diff --git a/CLAUDE.md b/CLAUDE.md index ddca4d81..5de22334 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,67 +1,170 @@ -- Keep track of what your current working directory is, and consider it when - running shell commands. Running a command in a directory you didn't expect can - potentially be catastrophic. Always use the correct relative paths to files - based on the current directory you are in. -- Some scripts may expect the current working directory of the process to be - a specific path. For example, most scripts in the `scripts` folder expect to - be run from the root of the repository, so file and directory paths are - relative to that. -- Always write new scripts in TypeScript. Use ES6 import and export, never - `require()` or `createRequire()`. -- If you think you need to use `require()` to get something working, try - changing how you are importing it instead (like importing the default export, - `import * as ...`, or other strategies). +## Introduction + +This project implements Tribes 2 map rendering using Three.js. Since we have +access to partial Tribes 2 source code and the open source Torque3D engine, as +well as the original game assets, the game's rendering pipeline can be reproduced +almost exactly. The primary concept demonstrated in this project is that a Torque +mission file (which defines an object tree similar to a scene graph) can be mapped +to a React component tree. + +## Technologies + +- Node.js +- npm +- TypeScript +- React +- Next.js +- Three.js +- react-three-fiber (r3f) +- TanStack Query +- Peggy (formerly PEG.js) +- Vitest + +## Project Structure + +- **app/** - Next.js application. +- **docs/** - Build output from Next.js static export. It's only called "docs" + because that's where GitHub Pages will look for it. NOT intended for actual + docs. Don't add or look for documentation here! +- **docs/base/** - Game files from Tribes 2, including extracted .vl2 contents. + Missions/scripts (.mis, .cs), models/shapes (.dif, .dts, and their .glb + conversions), textures (.png, .bmp, .ifl), and more. This folder is actually + very helpful to explore, especially when debugging specific maps. +- **src/** - Core implementation. +- **src/components/** - React components and hooks. +- **src/torqueScript/** - TorqueScript transpiler and runtime. +- **scripts/** - Helper scripts. TypeScript files can be run directly with `tsx`. + Python scripts are intended for use with Blender's headless background script + mode, and should not be executed with Python directly. +- **generated/** - Generated code, like the Peggy parser. +- **reference/** - Reference materials like docs, plans, screenshots, and more. +- **reference/TorqueEngineResources/** - A symlink to a "Torque Engine Resources" + folder, which may or may not exist for different developers. Developers can + use this to point to additional materials that provide context about Tribes 2, + Torque, and how it works (like the engine source code, books, user manuals, + game files, and conversion utilities). Use this to answer questions about the + engine. +- **public/** - Static files for the Next.js app. + +### Three.js + +- Keep colorspace conversions in mind so that we're never passing incorrect + color values or mixing colors incorrectly. Tribes 2 specifies all colors in + sRGB, and thus all color operations assume sRGB. Three.js, on the other hand, + expects linear color values in most circumstances. Pay attention to which + colorspace different shaders expect (which may differ depending on the type, + like standard vs. Lambert vs. custom). + +### React + +- Scenes should render progressively rather than requiring all resources to be + ready up-front. For example, we can render the terrain even if other objects + in the scene aren't ready. TanStack Query and Suspense boundaries are used to + show placeholders and prevent blocking or "waterfalling" where possible. + +### Tribes 2: Torque Engine / Torque3D / V12 + +- Tribes 2 uses an early version of the Torque3D engine known as V12. Thus, it + is common to refer to Tribes, Torque, and V12 interchangeably. When in doubt, + we're interested in Tribes 2's version of the engine specifically. + +- This is an old game. Some of its file formats are now obsolete and thus + difficult to find tooling for, especially 3D model formats like DIF (interiors) + and DTS (shapes). + +- The terms "map" and "mission" are used interchangeably. + +### TorqueScript + +- Do not make any assumptions about how TorqueScript works; it has some very + uncommon syntax and semantics (like case insensitivity, barewords strings, and + more). Refer to official documentation or the actual Torque3D SDK, which + contains the official grammar and source code. Check the `TorqueEngineResources` + folder for related materials. + +## Code Conventions + +### General Rules + +- Write new scripts in TypeScript unless instructed otherwise. +- Keep code well-formatted. This project uses Prettier, but it may not necessarily + handle all languages (like shaders/GLSL or TorqueScript). Run Prettier to format + code for you. - Despite preferring TypeScript, it's OK if some code generation tools output - .js, .cjs, or .mjs files. For example, Peggy (formerly PEG.js) generated - parsers are JavaScript. Likewise with .js files that were generated by the - TorqueScript transpiler. -- TypeScript can be executed using `tsx`. + JavaScript files. For example, Peggy generates JavaScript parsers. Likewise + with .js files generated by the TorqueScript transpiler. Don't attempt to + convert or format these unless requested. + +### Imports and Exports + +- Use ES6 import and export, never `require()` or `createRequire()`. +- If you think you need to use `require()` to get something working, try + changing how you're importing it instead (like importing the default export, + `import * as …`, or other strategies). +- Import Node's built-in modules using the `node:` prefix. +- Use Promise-based APIs when available. For example, prefer using `node:fs/promises` + over `node:fs`. +- For `node:fs` and `node:path`, prefer importing the whole module rather than + individual functions, since they contain many exports and short, generic names. + It looks nicer to reference them in code like `fs.readFile`, `path.join`, and + so on. +- Don't add new npm dependencies without explicit confirmation. + +### Comments and Documentation + +- Don't add excessive code comments. Prefer being concise when writing JSDoc style + comments. Don't over-explain; assume your code and comments will be read by a + competent programmer. +- Don't remove existing comments unless they're redundant, incorrect, or outdated. +- Exclude `@param` and `@returns` from JSDoc comments, instead preferring + self-descriptive TypeScript types and parameter names. Let the function names, + class names, argument/parameter names, and types do most of the talking. Prefer + only writing the description and occasional `@example` blocks in JSDoc comments. + Only include examples if the usage is complex. +- JSDoc comments may be beneficial for documenting the public API of a module, + not just for people reading the code. For example, some documentation generator + tools extract JSDoc comments, and IDEs often show JSDoc content in popups to + assist the developer. +- Only write inline/single line comments around code if it's tricky and non-obvious, + to clarify the motivation for doing something. +- When in doubt, use existing code to gauge the number of comments to write and + their level of detail. +- Don't add long Markdown files documenting your plans unless requested. It's + better to have documentation of a system in its final state rather than every + detail of your planning. + +## Shell Commands and Scripts + +- TypeScript can be executed directly using `tsx`. +- Keep track of your current working directory, and consider it when running + shell commands. Running a command in the wrong directory can be catastrophic. + Always use the correct relative paths to files based on the directory you're in. +- Some scripts may expect the current working directory to be a specific path. + For example, most scripts in the `scripts` folder expect to be run from the + repository root, so file and directory paths are relative to that. +- You are most likely running on a macOS system. Therefore, some command line + tools (like `awk`, `grep`, and others) may NOT be POSIX compliant. Before + running commands for the first time, determine what type of system you're on, + what versions it has, and what shell you're executing commands in (like bash + vs. zsh). This will prevent failures due to incorrect shell syntax, arguments, + or other assumptions. +- Don't run the `build` script to verify whether a change actually worked. + Building the project has the potential to be destructive, since it cleans out + existing build artifacts. Additionally, it's much slower than simply running + `typecheck`, and it interferes with the dev server. +- Don't run the dev server to verify changes. The dev server is probably already + running. +- The TorqueScript grammar written in Peggy can be rebuilt with the `build:parser` + npm script. +- Typechecking can be done with `typecheck` npm script or by running `tsc` + directly. +- The `scripts/screenshot.ts` tool lets you screenshot a specific camera's + viewpoint on a specific mission. It's very useful for verifying visual changes, + iterating, and debugging rendering. + +## Git + - Don't commit to git (or change any git history) unless requested. I will review your changes and decide when (and whether) to commit. -- Import Node built-in modules using the `node:` prefix. -- Use Promise-based APIs when available. For example, prefer using - `node:fs/promises` over `node:fs`. -- For `node:fs` and `node:path`, prefer importing the whole module rather than - individual functions, since they contain a lot of exports with short names. - It often looks nicer to refer to them in code like `fs.readFile`, `path.join`, - and so on. -- Format code according to my Prettier settings. If there is no Prettier config - defined, use Prettier's default settings. After any code additions or changes, - running Prettier on the code should not produce any changes. Instead of - memorizing how to format code correctly, you may run Prettier itself as a tool - to do formatting for you. -- The TorqueScript grammar written in Peggy (formerly PEG.js) can be rebuilt - by running `npm run build:parser`. -- Typechecking can be done with `npm run typecheck`. -- Game files and .vl2 contents (like .mis, .cs, shapes like .dif and .dts, - textures like .png and .ifl, and more) can all be found in the `docs/base` - folder relative to the repository root. -- You are most likely running on a macOS system, therefore some command line - tools (like `awk` and others) may NOT be POSIX compliant. Before executing any - commands for the first time, determine what type of system you are on and what - type of shell you are executing within. This will prevent failures due to - incorrect shell syntax, arguments, or other assumptions. -- Do not write excessive comments, and prefer being concise when writing JSDoc - style comments. Assume your code will be read by a competent programmer and - don't over-explain. Prefer excluding `@param` and `@returns` from JSDoc - comments, as TypeScript type annotations and parameter names are often - sufficient - let the function names, class names, argument/parameter names, - and types do much of the talking. Prefer only writing the description and - occasional `@example` blocks in JSDoc comments (and only include examples if - the usage is somewhat complex). -- JSDoc comments are more likely to be needed as documentation for the public - API of the codebase. This is useful for people reading docs (which may be - extracted from the JSDoc comments) or importing the code (if their IDE - shows the JSDoc description). You should therefore prioritize writing JSDoc - comments for exports (as opposed to internal helpers). -- When in doubt, use the already existing code to gauge the number of comments - to write and their level of detail. -- As for single-line and inline comments, only write them around code if it's - tricky and non-obvious, to clarify the motivation for doing something. -- Don't write long Markdown (.md) files documenting your plans unless requested. - It is much better to have documentation of the system in its final state - rather than every detail of your planning. -- Do not make any assumptions about how TorqueScript works, as it has some - uncommon syntax and semantics. Instead, reference documentation on the web, or - the code for the Torque3D SDK, which contains the official grammar and source - code. +- Unless requested, only use non-destructive git commands (e.g. `diff`, `show`, + `log`). Commands like `checkout` and `reset` could result in data loss! diff --git a/docs/404.html b/docs/404.html index 6fb44f78..efe5fa9a 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html index 6fb44f78..efe5fa9a 100644 --- a/docs/404/index.html +++ b/docs/404/index.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_next/static/chunks/16bd4fe75afcb969.js b/docs/_next/static/chunks/16bd4fe75afcb969.js deleted file mode 100644 index 6c395a3a..00000000 --- a/docs/_next/static/chunks/16bd4fe75afcb969.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(e,t,r)=>{t.exports=e.r(76562)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),a=RegExp(i,"g"),o=RegExp(i,"");function s(e){return n[e]}var l=function(e){return e.replace(a,s)};t.exports=l,t.exports.has=function(e){return!!e.match(o)},t.exports.remove=l},29402,(e,t,r)=>{var n,i,a="__lodash_hash_undefined__",o=1/0,s="[object Arguments]",l="[object Array]",u="[object Boolean]",c="[object Date]",d="[object Error]",f="[object Function]",h="[object Map]",m="[object Number]",p="[object Object]",A="[object Promise]",g="[object RegExp]",B="[object Set]",C="[object String]",y="[object Symbol]",b="[object WeakMap]",M="[object ArrayBuffer]",x="[object DataView]",E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,S=/^\./,T=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w=/\\(\\)?/g,R=/^\[object .+?Constructor\]$/,D=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[s]=I[l]=I[M]=I[u]=I[x]=I[c]=I[d]=I[f]=I[h]=I[m]=I[p]=I[g]=I[B]=I[C]=I[b]=!1;var G=e.g&&e.g.Object===Object&&e.g,L="object"==typeof self&&self&&self.Object===Object&&self,P=G||L||Function("return this")(),H=r&&!r.nodeType&&r,O=H&&t&&!t.nodeType&&t,k=O&&O.exports===H&&G.process,_=function(){try{return k&&k.binding("util")}catch(e){}}(),U=_&&_.isTypedArray;function j(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ey.prototype.set=function(e,t){var r=this.__data__,n=eE(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eb.prototype.clear=function(){this.__data__={hash:new eC,map:new(es||ey),string:new eC}},eb.prototype.delete=function(e){return eG(this,e).delete(e)},eb.prototype.get=function(e){return eG(this,e).get(e)},eb.prototype.has=function(e){return eG(this,e).has(e)},eb.prototype.set=function(e,t){return eG(this,e).set(e,t),this},eM.prototype.add=eM.prototype.push=function(e){return this.__data__.set(e,a),this},eM.prototype.has=function(e){return this.__data__.has(e)},ex.prototype.clear=function(){this.__data__=new ey},ex.prototype.delete=function(e){return this.__data__.delete(e)},ex.prototype.get=function(e){return this.__data__.get(e)},ex.prototype.has=function(e){return this.__data__.has(e)},ex.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ey){var n=r.__data__;if(!es||n.length<199)return n.push([e,t]),this;r=this.__data__=new eb(n)}return r.set(e,t),this};var eF=function(e,t){return function(r,n){if(null==r)return r;if(!eW(r))return e(r,n);for(var i=r.length,a=-1,o=Object(r);(t?a--:++as))return!1;var u=a.get(e);if(u&&a.get(t))return u==t;var c=-1,d=!0,f=1&i?new eM:void 0;for(a.set(e,t),a.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eq(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function ez(e){return"symbol"==typeof e||eY(e)&&$.call(e)==y}var eZ=U?J(U):function(e){return eY(e)&&eX(e.length)&&!!I[$.call(e)]};function e$(e){return eW(e)?function(e,t){var r=eQ(e)||eK(e)?function(e,t){for(var r=-1,n=Array(e);++rt||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;return l*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});l--;)s[l]=s[l].value;return s}(e,t,r))}},81405,(e,t,r)=>{e.e,t.exports=function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function r(e){for(var t=0;to+1e3&&(l.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:r}};return e.Panel=function(e,t,r){var n=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,l=48*o,u=3*o,c=2*o,d=3*o,f=15*o,h=74*o,m=30*o,p=document.createElement("canvas");p.width=s,p.height=l,p.style.cssText="width:80px;height:48px";var A=p.getContext("2d");return A.font="bold "+9*o+"px Helvetica,Arial,sans-serif",A.textBaseline="top",A.fillStyle=r,A.fillRect(0,0,s,l),A.fillStyle=t,A.fillText(e,u,c),A.fillRect(d,f,h,m),A.fillStyle=r,A.globalAlpha=.9,A.fillRect(d,f,h,m),{dom:p,update:function(l,g){n=Math.min(n,l),i=Math.max(i,l),A.fillStyle=r,A.globalAlpha=1,A.fillRect(0,0,s,f),A.fillStyle=t,A.fillText(a(l)+" "+e+" ("+a(n)+"-"+a(i)+")",u,c),A.drawImage(p,d+o,f,h-o,m,d,f,h-o,m),A.fillRect(d+h-o,f,o,m),A.fillStyle=r,A.globalAlpha=.9,A.fillRect(d+h-o,f,o,a((1-l/g)*m))}}},e}()},31713,e=>{"use strict";let t;e.s(["default",()=>l8],31713);var r,n,i,a,o,s,l,u,c,d,f,h,m,p,A,g,B,C,y,b,M,x,E,F,S,T,w,R,D,I,G,L,P,H,O,k,_,U,j,J,N,K,Q,W,V,X,q,Y,z,Z,$,ee,et,er,en,ei,ea,eo,es=e.i(43476),el=e.i(71645),eu=e.i(18566),ec=e.i(46712);e.s(["ACESFilmicToneMapping",()=>ef.ACESFilmicToneMapping,"AddEquation",()=>ef.AddEquation,"AddOperation",()=>ef.AddOperation,"AdditiveAnimationBlendMode",()=>ef.AdditiveAnimationBlendMode,"AdditiveBlending",()=>ef.AdditiveBlending,"AgXToneMapping",()=>ef.AgXToneMapping,"AlphaFormat",()=>ef.AlphaFormat,"AlwaysCompare",()=>ef.AlwaysCompare,"AlwaysDepth",()=>ef.AlwaysDepth,"AlwaysStencilFunc",()=>ef.AlwaysStencilFunc,"AmbientLight",()=>ef.AmbientLight,"AnimationAction",()=>ef.AnimationAction,"AnimationClip",()=>ef.AnimationClip,"AnimationLoader",()=>ef.AnimationLoader,"AnimationMixer",()=>ef.AnimationMixer,"AnimationObjectGroup",()=>ef.AnimationObjectGroup,"AnimationUtils",()=>ef.AnimationUtils,"ArcCurve",()=>ef.ArcCurve,"ArrayCamera",()=>ef.ArrayCamera,"ArrowHelper",()=>ef.ArrowHelper,"AttachedBindMode",()=>ef.AttachedBindMode,"Audio",()=>ef.Audio,"AudioAnalyser",()=>ef.AudioAnalyser,"AudioContext",()=>ef.AudioContext,"AudioListener",()=>ef.AudioListener,"AudioLoader",()=>ef.AudioLoader,"AxesHelper",()=>ef.AxesHelper,"BackSide",()=>ef.BackSide,"BasicDepthPacking",()=>ef.BasicDepthPacking,"BasicShadowMap",()=>ef.BasicShadowMap,"BatchedMesh",()=>ef.BatchedMesh,"Bone",()=>ef.Bone,"BooleanKeyframeTrack",()=>ef.BooleanKeyframeTrack,"Box2",()=>ef.Box2,"Box3",()=>ef.Box3,"Box3Helper",()=>ef.Box3Helper,"BoxGeometry",()=>ef.BoxGeometry,"BoxHelper",()=>ef.BoxHelper,"BufferAttribute",()=>ef.BufferAttribute,"BufferGeometry",()=>ef.BufferGeometry,"BufferGeometryLoader",()=>ef.BufferGeometryLoader,"ByteType",()=>ef.ByteType,"Cache",()=>ef.Cache,"Camera",()=>ef.Camera,"CameraHelper",()=>ef.CameraHelper,"CanvasTexture",()=>ef.CanvasTexture,"CapsuleGeometry",()=>ef.CapsuleGeometry,"CatmullRomCurve3",()=>ef.CatmullRomCurve3,"CineonToneMapping",()=>ef.CineonToneMapping,"CircleGeometry",()=>ef.CircleGeometry,"ClampToEdgeWrapping",()=>ef.ClampToEdgeWrapping,"Clock",()=>ef.Clock,"Color",()=>ef.Color,"ColorKeyframeTrack",()=>ef.ColorKeyframeTrack,"ColorManagement",()=>ef.ColorManagement,"CompressedArrayTexture",()=>ef.CompressedArrayTexture,"CompressedCubeTexture",()=>ef.CompressedCubeTexture,"CompressedTexture",()=>ef.CompressedTexture,"CompressedTextureLoader",()=>ef.CompressedTextureLoader,"ConeGeometry",()=>ef.ConeGeometry,"ConstantAlphaFactor",()=>ef.ConstantAlphaFactor,"ConstantColorFactor",()=>ef.ConstantColorFactor,"Controls",()=>ef.Controls,"CubeCamera",()=>ef.CubeCamera,"CubeReflectionMapping",()=>ef.CubeReflectionMapping,"CubeRefractionMapping",()=>ef.CubeRefractionMapping,"CubeTexture",()=>ef.CubeTexture,"CubeTextureLoader",()=>ef.CubeTextureLoader,"CubeUVReflectionMapping",()=>ef.CubeUVReflectionMapping,"CubicBezierCurve",()=>ef.CubicBezierCurve,"CubicBezierCurve3",()=>ef.CubicBezierCurve3,"CubicInterpolant",()=>ef.CubicInterpolant,"CullFaceBack",()=>ef.CullFaceBack,"CullFaceFront",()=>ef.CullFaceFront,"CullFaceFrontBack",()=>ef.CullFaceFrontBack,"CullFaceNone",()=>ef.CullFaceNone,"Curve",()=>ef.Curve,"CurvePath",()=>ef.CurvePath,"CustomBlending",()=>ef.CustomBlending,"CustomToneMapping",()=>ef.CustomToneMapping,"CylinderGeometry",()=>ef.CylinderGeometry,"Cylindrical",()=>ef.Cylindrical,"Data3DTexture",()=>ef.Data3DTexture,"DataArrayTexture",()=>ef.DataArrayTexture,"DataTexture",()=>ef.DataTexture,"DataTextureLoader",()=>ef.DataTextureLoader,"DataUtils",()=>ef.DataUtils,"DecrementStencilOp",()=>ef.DecrementStencilOp,"DecrementWrapStencilOp",()=>ef.DecrementWrapStencilOp,"DefaultLoadingManager",()=>ef.DefaultLoadingManager,"DepthFormat",()=>ef.DepthFormat,"DepthStencilFormat",()=>ef.DepthStencilFormat,"DepthTexture",()=>ef.DepthTexture,"DetachedBindMode",()=>ef.DetachedBindMode,"DirectionalLight",()=>ef.DirectionalLight,"DirectionalLightHelper",()=>ef.DirectionalLightHelper,"DiscreteInterpolant",()=>ef.DiscreteInterpolant,"DodecahedronGeometry",()=>ef.DodecahedronGeometry,"DoubleSide",()=>ef.DoubleSide,"DstAlphaFactor",()=>ef.DstAlphaFactor,"DstColorFactor",()=>ef.DstColorFactor,"DynamicCopyUsage",()=>ef.DynamicCopyUsage,"DynamicDrawUsage",()=>ef.DynamicDrawUsage,"DynamicReadUsage",()=>ef.DynamicReadUsage,"EdgesGeometry",()=>ef.EdgesGeometry,"EllipseCurve",()=>ef.EllipseCurve,"EqualCompare",()=>ef.EqualCompare,"EqualDepth",()=>ef.EqualDepth,"EqualStencilFunc",()=>ef.EqualStencilFunc,"EquirectangularReflectionMapping",()=>ef.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>ef.EquirectangularRefractionMapping,"Euler",()=>ef.Euler,"EventDispatcher",()=>ef.EventDispatcher,"ExternalTexture",()=>ef.ExternalTexture,"ExtrudeGeometry",()=>ef.ExtrudeGeometry,"FileLoader",()=>ef.FileLoader,"Float16BufferAttribute",()=>ef.Float16BufferAttribute,"Float32BufferAttribute",()=>ef.Float32BufferAttribute,"FloatType",()=>ef.FloatType,"Fog",()=>ef.Fog,"FogExp2",()=>ef.FogExp2,"FramebufferTexture",()=>ef.FramebufferTexture,"FrontSide",()=>ef.FrontSide,"Frustum",()=>ef.Frustum,"FrustumArray",()=>ef.FrustumArray,"GLBufferAttribute",()=>ef.GLBufferAttribute,"GLSL1",()=>ef.GLSL1,"GLSL3",()=>ef.GLSL3,"GreaterCompare",()=>ef.GreaterCompare,"GreaterDepth",()=>ef.GreaterDepth,"GreaterEqualCompare",()=>ef.GreaterEqualCompare,"GreaterEqualDepth",()=>ef.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>ef.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>ef.GreaterStencilFunc,"GridHelper",()=>ef.GridHelper,"Group",()=>ef.Group,"HalfFloatType",()=>ef.HalfFloatType,"HemisphereLight",()=>ef.HemisphereLight,"HemisphereLightHelper",()=>ef.HemisphereLightHelper,"IcosahedronGeometry",()=>ef.IcosahedronGeometry,"ImageBitmapLoader",()=>ef.ImageBitmapLoader,"ImageLoader",()=>ef.ImageLoader,"ImageUtils",()=>ef.ImageUtils,"IncrementStencilOp",()=>ef.IncrementStencilOp,"IncrementWrapStencilOp",()=>ef.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>ef.InstancedBufferAttribute,"InstancedBufferGeometry",()=>ef.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>ef.InstancedInterleavedBuffer,"InstancedMesh",()=>ef.InstancedMesh,"Int16BufferAttribute",()=>ef.Int16BufferAttribute,"Int32BufferAttribute",()=>ef.Int32BufferAttribute,"Int8BufferAttribute",()=>ef.Int8BufferAttribute,"IntType",()=>ef.IntType,"InterleavedBuffer",()=>ef.InterleavedBuffer,"InterleavedBufferAttribute",()=>ef.InterleavedBufferAttribute,"Interpolant",()=>ef.Interpolant,"InterpolateDiscrete",()=>ef.InterpolateDiscrete,"InterpolateLinear",()=>ef.InterpolateLinear,"InterpolateSmooth",()=>ef.InterpolateSmooth,"InterpolationSamplingMode",()=>ef.InterpolationSamplingMode,"InterpolationSamplingType",()=>ef.InterpolationSamplingType,"InvertStencilOp",()=>ef.InvertStencilOp,"KeepStencilOp",()=>ef.KeepStencilOp,"KeyframeTrack",()=>ef.KeyframeTrack,"LOD",()=>ef.LOD,"LatheGeometry",()=>ef.LatheGeometry,"Layers",()=>ef.Layers,"LessCompare",()=>ef.LessCompare,"LessDepth",()=>ef.LessDepth,"LessEqualCompare",()=>ef.LessEqualCompare,"LessEqualDepth",()=>ef.LessEqualDepth,"LessEqualStencilFunc",()=>ef.LessEqualStencilFunc,"LessStencilFunc",()=>ef.LessStencilFunc,"Light",()=>ef.Light,"LightProbe",()=>ef.LightProbe,"Line",()=>ef.Line,"Line3",()=>ef.Line3,"LineBasicMaterial",()=>ef.LineBasicMaterial,"LineCurve",()=>ef.LineCurve,"LineCurve3",()=>ef.LineCurve3,"LineDashedMaterial",()=>ef.LineDashedMaterial,"LineLoop",()=>ef.LineLoop,"LineSegments",()=>ef.LineSegments,"LinearFilter",()=>ef.LinearFilter,"LinearInterpolant",()=>ef.LinearInterpolant,"LinearMipMapLinearFilter",()=>ef.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>ef.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>ef.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>ef.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>ef.LinearSRGBColorSpace,"LinearToneMapping",()=>ef.LinearToneMapping,"LinearTransfer",()=>ef.LinearTransfer,"Loader",()=>ef.Loader,"LoaderUtils",()=>ef.LoaderUtils,"LoadingManager",()=>ef.LoadingManager,"LoopOnce",()=>ef.LoopOnce,"LoopPingPong",()=>ef.LoopPingPong,"LoopRepeat",()=>ef.LoopRepeat,"MOUSE",()=>ef.MOUSE,"Material",()=>ef.Material,"MaterialLoader",()=>ef.MaterialLoader,"MathUtils",()=>ef.MathUtils,"Matrix2",()=>ef.Matrix2,"Matrix3",()=>ef.Matrix3,"Matrix4",()=>ef.Matrix4,"MaxEquation",()=>ef.MaxEquation,"Mesh",()=>ef.Mesh,"MeshBasicMaterial",()=>ef.MeshBasicMaterial,"MeshDepthMaterial",()=>ef.MeshDepthMaterial,"MeshDistanceMaterial",()=>ef.MeshDistanceMaterial,"MeshLambertMaterial",()=>ef.MeshLambertMaterial,"MeshMatcapMaterial",()=>ef.MeshMatcapMaterial,"MeshNormalMaterial",()=>ef.MeshNormalMaterial,"MeshPhongMaterial",()=>ef.MeshPhongMaterial,"MeshPhysicalMaterial",()=>ef.MeshPhysicalMaterial,"MeshStandardMaterial",()=>ef.MeshStandardMaterial,"MeshToonMaterial",()=>ef.MeshToonMaterial,"MinEquation",()=>ef.MinEquation,"MirroredRepeatWrapping",()=>ef.MirroredRepeatWrapping,"MixOperation",()=>ef.MixOperation,"MultiplyBlending",()=>ef.MultiplyBlending,"MultiplyOperation",()=>ef.MultiplyOperation,"NearestFilter",()=>ef.NearestFilter,"NearestMipMapLinearFilter",()=>ef.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>ef.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>ef.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>ef.NearestMipmapNearestFilter,"NeutralToneMapping",()=>ef.NeutralToneMapping,"NeverCompare",()=>ef.NeverCompare,"NeverDepth",()=>ef.NeverDepth,"NeverStencilFunc",()=>ef.NeverStencilFunc,"NoBlending",()=>ef.NoBlending,"NoColorSpace",()=>ef.NoColorSpace,"NoToneMapping",()=>ef.NoToneMapping,"NormalAnimationBlendMode",()=>ef.NormalAnimationBlendMode,"NormalBlending",()=>ef.NormalBlending,"NotEqualCompare",()=>ef.NotEqualCompare,"NotEqualDepth",()=>ef.NotEqualDepth,"NotEqualStencilFunc",()=>ef.NotEqualStencilFunc,"NumberKeyframeTrack",()=>ef.NumberKeyframeTrack,"Object3D",()=>ef.Object3D,"ObjectLoader",()=>ef.ObjectLoader,"ObjectSpaceNormalMap",()=>ef.ObjectSpaceNormalMap,"OctahedronGeometry",()=>ef.OctahedronGeometry,"OneFactor",()=>ef.OneFactor,"OneMinusConstantAlphaFactor",()=>ef.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>ef.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>ef.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>ef.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>ef.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>ef.OneMinusSrcColorFactor,"OrthographicCamera",()=>ef.OrthographicCamera,"PCFShadowMap",()=>ef.PCFShadowMap,"PCFSoftShadowMap",()=>ef.PCFSoftShadowMap,"PMREMGenerator",()=>ed.PMREMGenerator,"Path",()=>ef.Path,"PerspectiveCamera",()=>ef.PerspectiveCamera,"Plane",()=>ef.Plane,"PlaneGeometry",()=>ef.PlaneGeometry,"PlaneHelper",()=>ef.PlaneHelper,"PointLight",()=>ef.PointLight,"PointLightHelper",()=>ef.PointLightHelper,"Points",()=>ef.Points,"PointsMaterial",()=>ef.PointsMaterial,"PolarGridHelper",()=>ef.PolarGridHelper,"PolyhedronGeometry",()=>ef.PolyhedronGeometry,"PositionalAudio",()=>ef.PositionalAudio,"PropertyBinding",()=>ef.PropertyBinding,"PropertyMixer",()=>ef.PropertyMixer,"QuadraticBezierCurve",()=>ef.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>ef.QuadraticBezierCurve3,"Quaternion",()=>ef.Quaternion,"QuaternionKeyframeTrack",()=>ef.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>ef.QuaternionLinearInterpolant,"RED_GREEN_RGTC2_Format",()=>ef.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>ef.RED_RGTC1_Format,"REVISION",()=>ef.REVISION,"RGBADepthPacking",()=>ef.RGBADepthPacking,"RGBAFormat",()=>ef.RGBAFormat,"RGBAIntegerFormat",()=>ef.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>ef.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>ef.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>ef.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>ef.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>ef.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>ef.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>ef.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>ef.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>ef.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>ef.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>ef.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>ef.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>ef.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>ef.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>ef.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>ef.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>ef.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>ef.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>ef.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>ef.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>ef.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>ef.RGBDepthPacking,"RGBFormat",()=>ef.RGBFormat,"RGBIntegerFormat",()=>ef.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>ef.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>ef.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>ef.RGB_ETC1_Format,"RGB_ETC2_Format",()=>ef.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>ef.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>ef.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>ef.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>ef.RGDepthPacking,"RGFormat",()=>ef.RGFormat,"RGIntegerFormat",()=>ef.RGIntegerFormat,"RawShaderMaterial",()=>ef.RawShaderMaterial,"Ray",()=>ef.Ray,"Raycaster",()=>ef.Raycaster,"RectAreaLight",()=>ef.RectAreaLight,"RedFormat",()=>ef.RedFormat,"RedIntegerFormat",()=>ef.RedIntegerFormat,"ReinhardToneMapping",()=>ef.ReinhardToneMapping,"RenderTarget",()=>ef.RenderTarget,"RenderTarget3D",()=>ef.RenderTarget3D,"RepeatWrapping",()=>ef.RepeatWrapping,"ReplaceStencilOp",()=>ef.ReplaceStencilOp,"ReverseSubtractEquation",()=>ef.ReverseSubtractEquation,"RingGeometry",()=>ef.RingGeometry,"SIGNED_RED_GREEN_RGTC2_Format",()=>ef.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>ef.SIGNED_RED_RGTC1_Format,"SRGBColorSpace",()=>ef.SRGBColorSpace,"SRGBTransfer",()=>ef.SRGBTransfer,"Scene",()=>ef.Scene,"ShaderChunk",()=>ed.ShaderChunk,"ShaderLib",()=>ed.ShaderLib,"ShaderMaterial",()=>ef.ShaderMaterial,"ShadowMaterial",()=>ef.ShadowMaterial,"Shape",()=>ef.Shape,"ShapeGeometry",()=>ef.ShapeGeometry,"ShapePath",()=>ef.ShapePath,"ShapeUtils",()=>ef.ShapeUtils,"ShortType",()=>ef.ShortType,"Skeleton",()=>ef.Skeleton,"SkeletonHelper",()=>ef.SkeletonHelper,"SkinnedMesh",()=>ef.SkinnedMesh,"Source",()=>ef.Source,"Sphere",()=>ef.Sphere,"SphereGeometry",()=>ef.SphereGeometry,"Spherical",()=>ef.Spherical,"SphericalHarmonics3",()=>ef.SphericalHarmonics3,"SplineCurve",()=>ef.SplineCurve,"SpotLight",()=>ef.SpotLight,"SpotLightHelper",()=>ef.SpotLightHelper,"Sprite",()=>ef.Sprite,"SpriteMaterial",()=>ef.SpriteMaterial,"SrcAlphaFactor",()=>ef.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>ef.SrcAlphaSaturateFactor,"SrcColorFactor",()=>ef.SrcColorFactor,"StaticCopyUsage",()=>ef.StaticCopyUsage,"StaticDrawUsage",()=>ef.StaticDrawUsage,"StaticReadUsage",()=>ef.StaticReadUsage,"StereoCamera",()=>ef.StereoCamera,"StreamCopyUsage",()=>ef.StreamCopyUsage,"StreamDrawUsage",()=>ef.StreamDrawUsage,"StreamReadUsage",()=>ef.StreamReadUsage,"StringKeyframeTrack",()=>ef.StringKeyframeTrack,"SubtractEquation",()=>ef.SubtractEquation,"SubtractiveBlending",()=>ef.SubtractiveBlending,"TOUCH",()=>ef.TOUCH,"TangentSpaceNormalMap",()=>ef.TangentSpaceNormalMap,"TetrahedronGeometry",()=>ef.TetrahedronGeometry,"Texture",()=>ef.Texture,"TextureLoader",()=>ef.TextureLoader,"TextureUtils",()=>ef.TextureUtils,"Timer",()=>ef.Timer,"TimestampQuery",()=>ef.TimestampQuery,"TorusGeometry",()=>ef.TorusGeometry,"TorusKnotGeometry",()=>ef.TorusKnotGeometry,"Triangle",()=>ef.Triangle,"TriangleFanDrawMode",()=>ef.TriangleFanDrawMode,"TriangleStripDrawMode",()=>ef.TriangleStripDrawMode,"TrianglesDrawMode",()=>ef.TrianglesDrawMode,"TubeGeometry",()=>ef.TubeGeometry,"UVMapping",()=>ef.UVMapping,"Uint16BufferAttribute",()=>ef.Uint16BufferAttribute,"Uint32BufferAttribute",()=>ef.Uint32BufferAttribute,"Uint8BufferAttribute",()=>ef.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>ef.Uint8ClampedBufferAttribute,"Uniform",()=>ef.Uniform,"UniformsGroup",()=>ef.UniformsGroup,"UniformsLib",()=>ed.UniformsLib,"UniformsUtils",()=>ef.UniformsUtils,"UnsignedByteType",()=>ef.UnsignedByteType,"UnsignedInt101111Type",()=>ef.UnsignedInt101111Type,"UnsignedInt248Type",()=>ef.UnsignedInt248Type,"UnsignedInt5999Type",()=>ef.UnsignedInt5999Type,"UnsignedIntType",()=>ef.UnsignedIntType,"UnsignedShort4444Type",()=>ef.UnsignedShort4444Type,"UnsignedShort5551Type",()=>ef.UnsignedShort5551Type,"UnsignedShortType",()=>ef.UnsignedShortType,"VSMShadowMap",()=>ef.VSMShadowMap,"Vector2",()=>ef.Vector2,"Vector3",()=>ef.Vector3,"Vector4",()=>ef.Vector4,"VectorKeyframeTrack",()=>ef.VectorKeyframeTrack,"VideoFrameTexture",()=>ef.VideoFrameTexture,"VideoTexture",()=>ef.VideoTexture,"WebGL3DRenderTarget",()=>ef.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>ef.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>ef.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>ef.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>ef.WebGLRenderTarget,"WebGLRenderer",()=>ed.WebGLRenderer,"WebGLUtils",()=>ed.WebGLUtils,"WebGPUCoordinateSystem",()=>ef.WebGPUCoordinateSystem,"WebXRController",()=>ef.WebXRController,"WireframeGeometry",()=>ef.WireframeGeometry,"WrapAroundEnding",()=>ef.WrapAroundEnding,"ZeroCurvatureEnding",()=>ef.ZeroCurvatureEnding,"ZeroFactor",()=>ef.ZeroFactor,"ZeroSlopeEnding",()=>ef.ZeroSlopeEnding,"ZeroStencilOp",()=>ef.ZeroStencilOp,"createCanvasElement",()=>ef.createCanvasElement],32009);var ed=e.i(8560),ef=e.i(90072),eh=e.i(32009);function em(e,t){let r;return function(){for(var n=arguments.length,i=Array(n),a=0;ae(...i),t)}}let ep=["x","y","top","bottom","left","right","width","height"];var eA=e.i(46791);function eg(e){let{ref:t,children:r,fallback:n,resize:i,style:a,gl:o,events:s=ec.f,eventSource:l,eventPrefix:u,shadows:c,linear:d,flat:f,legacy:h,orthographic:m,frameloop:p,dpr:A,performance:g,raycaster:B,camera:C,scene:y,onPointerMissed:b,onCreated:M,...x}=e;el.useMemo(()=>(0,ec.e)(eh),[]);let E=(0,ec.u)(),[F,S]=function(){var e,t,r;let{debounce:n,scroll:i,polyfill:a,offsetSize:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debounce:0,scroll:!1,offsetSize:!1},s=a||("undefined"==typeof window?class{}:window.ResizeObserver);if(!s)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[l,u]=(0,el.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,el.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:l,orientationHandler:null}),d=n?"number"==typeof n?n:n.scroll:null,f=n?"number"==typeof n?n:n.resize:null,h=(0,el.useRef)(!1);(0,el.useEffect)(()=>(h.current=!0,()=>void(h.current=!1)));let[m,p,A]=(0,el.useMemo)(()=>{let e=()=>{let e,t;if(!c.current.element)return;let{left:r,top:n,width:i,height:a,bottom:s,right:l,x:d,y:f}=c.current.element.getBoundingClientRect(),m={left:r,top:n,width:i,height:a,bottom:s,right:l,x:d,y:f};c.current.element instanceof HTMLElement&&o&&(m.height=c.current.element.offsetHeight,m.width=c.current.element.offsetWidth),Object.freeze(m),h.current&&(e=c.current.lastBounds,t=m,!ep.every(r=>e[r]===t[r]))&&u(c.current.lastBounds=m)};return[e,f?em(e,f):e,d?em(e,d):e]},[u,o,d,f]);function g(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",A,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null),c.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",c.current.orientationHandler))}function B(){c.current.element&&(c.current.resizeObserver=new s(A),c.current.resizeObserver.observe(c.current.element),i&&c.current.scrollContainers&&c.current.scrollContainers.forEach(e=>e.addEventListener("scroll",A,{capture:!0,passive:!0})),c.current.orientationHandler=()=>{A()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",c.current.orientationHandler))}return e=A,t=!!i,(0,el.useEffect)(()=>{if(t)return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",e,!0)},[e,t]),r=p,(0,el.useEffect)(()=>(window.addEventListener("resize",r),()=>void window.removeEventListener("resize",r)),[r]),(0,el.useEffect)(()=>{g(),B()},[i,A,p]),(0,el.useEffect)(()=>g,[]),[e=>{e&&e!==c.current.element&&(g(),c.current.element=e,c.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:a}=window.getComputedStyle(t);return[n,i,a].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),B())},l,m]}({scroll:!0,debounce:{scroll:50,resize:0},...i}),T=el.useRef(null),w=el.useRef(null);el.useImperativeHandle(t,()=>T.current);let R=(0,ec.a)(b),[D,I]=el.useState(!1),[G,L]=el.useState(!1);if(D)throw D;if(G)throw G;let P=el.useRef(null);(0,ec.b)(()=>{let e=T.current;S.width>0&&S.height>0&&e&&(P.current||(P.current=(0,ec.c)(e)),async function(){await P.current.configure({gl:o,scene:y,events:s,shadows:c,linear:d,flat:f,legacy:h,orthographic:m,frameloop:p,dpr:A,performance:g,raycaster:B,camera:C,size:S,onPointerMissed:function(){for(var e=arguments.length,t=Array(e),r=0;r{null==e.events.connect||e.events.connect(l?(0,ec.i)(l)?l.current:l:w.current),u&&e.setEvents({compute:(e,t)=>{let r=e[u+"X"],n=e[u+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==M||M(e)}}),P.current.render((0,es.jsx)(E,{children:(0,es.jsx)(ec.E,{set:L,children:(0,es.jsx)(el.Suspense,{fallback:(0,es.jsx)(ec.B,{set:I}),children:null!=r?r:null})})}))}())}),el.useEffect(()=>{let e=T.current;if(e)return()=>(0,ec.d)(e)},[]);let H=l?"none":"auto";return(0,es.jsx)("div",{ref:w,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:H,...a},...x,children:(0,es.jsx)("div",{ref:F,style:{width:"100%",height:"100%"},children:(0,es.jsx)("canvas",{ref:T,style:{display:"block"},children:n})})})}function ev(e){return(0,es.jsx)(eA.FiberProvider,{children:(0,es.jsx)(eg,{...e})})}function eB(e,t,r){if(!t.has(e))throw TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function eC(e,t){var r=eB(e,t,"get");return r.get?r.get.call(e):r.value}function ey(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function eb(e,t,r){ey(e,t),t.set(e,r)}function eM(e,t,r){var n=eB(e,t,"set");if(n.set)n.set.call(e,r);else{if(!n.writable)throw TypeError("attempted to set read only private field");n.value=r}return r}function ex(e,t,r){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return r}function eE(e,t){ey(e,t),t.add(e)}e.i(39695),e.i(98133),e.i(95087);var eF=class{subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}};e.i(47167);var eS={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},eT=new(r=new WeakMap,n=new WeakMap,class{setTimeoutProvider(e){eM(this,r,e)}setTimeout(e,t){return eC(this,r).setTimeout(e,t)}clearTimeout(e){eC(this,r).clearTimeout(e)}setInterval(e,t){return eC(this,r).setInterval(e,t)}clearInterval(e){eC(this,r).clearInterval(e)}constructor(){eb(this,r,{writable:!0,value:eS}),eb(this,n,{writable:!0,value:!1})}}),ew="undefined"==typeof window||"Deno"in globalThis;function eR(){}function eD(e){return"number"==typeof e&&e>=0&&e!==1/0}function eI(e,t){return Math.max(e+(t||0)-Date.now(),0)}function eG(e,t){return"function"==typeof e?e(t):e}function eL(e,t){return"function"==typeof e?e(t):e}function eP(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==eO(o,t.options))return!1}else if(!e_(t.queryKey,o))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&(!i||i===t.state.fetchStatus)&&(!a||!!a(t))}function eH(e,t){let{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(ek(t.options.mutationKey)!==ek(a))return!1}else if(!e_(t.options.mutationKey,a))return!1}return(!n||t.state.status===n)&&(!i||!!i(t))}function eO(e,t){return((null==t?void 0:t.queryKeyHashFn)||ek)(e)}function ek(e){return JSON.stringify(e,(e,t)=>eN(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function e_(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>e_(e[r],t[r]))}var eU=Object.prototype.hasOwnProperty;function ej(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function eJ(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function eN(e){if(!eK(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!eK(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function eK(e){return"[object Object]"===Object.prototype.toString.call(e)}function eQ(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let n=eJ(t)&&eJ(r);if(!n&&!(eN(t)&&eN(r)))return r;let i=(n?t:Object.keys(t)).length,a=n?r:Object.keys(r),o=a.length,s=n?Array(o):{},l=0;for(let u=0;u2&&void 0!==arguments[2]?arguments[2]:0,n=[...e,t];return r&&n.length>r?n.slice(1):n}function eV(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var eX=Symbol();function eq(e,t){return!e.queryFn&&(null==t?void 0:t.initialPromise)?()=>t.initialPromise:e.queryFn&&e.queryFn!==eX?e.queryFn:()=>Promise.reject(Error("Missing queryFn: '".concat(e.queryHash,"'")))}var eY=new(i=new WeakMap,a=new WeakMap,o=new WeakMap,class extends eF{onSubscribe(){eC(this,a)||this.setEventListener(eC(this,o))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=eC(this,a))||e.call(this),eM(this,a,void 0))}setEventListener(e){var t;eM(this,o,e),null==(t=eC(this,a))||t.call(this),eM(this,a,e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){eC(this,i)!==e&&(eM(this,i,e),this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return"boolean"==typeof eC(this,i)?eC(this,i):(null==(e=globalThis.document)?void 0:e.visibilityState)!=="hidden"}constructor(){super(),eb(this,i,{writable:!0,value:void 0}),eb(this,a,{writable:!0,value:void 0}),eb(this,o,{writable:!0,value:void 0}),eM(this,o,e=>{if(!ew&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}}),ez=function(e){setTimeout(e,0)},eZ=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=ez,a=n=>{t?e.push(n):i(()=>{r(n)})};return{batch:a=>{let o;t++;try{o=a()}finally{--t||(()=>{let t=e;e=[],t.length&&i(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return o},batchCalls:e=>function(){for(var t=arguments.length,r=Array(t),n=0;n{e(...r)})},schedule:a,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{i=e}}}(),e$=new(s=new WeakMap,l=new WeakMap,u=new WeakMap,class extends eF{onSubscribe(){eC(this,l)||this.setEventListener(eC(this,u))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=eC(this,l))||e.call(this),eM(this,l,void 0))}setEventListener(e){var t;eM(this,u,e),null==(t=eC(this,l))||t.call(this),eM(this,l,e(this.setOnline.bind(this)))}setOnline(e){eC(this,s)!==e&&(eM(this,s,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return eC(this,s)}constructor(){super(),eb(this,s,{writable:!0,value:!0}),eb(this,l,{writable:!0,value:void 0}),eb(this,u,{writable:!0,value:void 0}),eM(this,u,e=>{if(!ew&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}});function e0(){let e,t,r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function e1(e){return Math.min(1e3*2**e,3e4)}function e9(e){return(null!=e?e:"online")!=="online"||e$.isOnline()}var e2=class extends Error{constructor(e){super("CancelledError"),this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}};function e3(e){let t,r=!1,n=0,i=e0(),a=()=>eY.isFocused()&&("always"===e.networkMode||e$.isOnline())&&e.canRun(),o=()=>e9(e.networkMode)&&e.canRun(),s=e=>{"pending"===i.status&&(null==t||t(),i.resolve(e))},l=e=>{"pending"===i.status&&(null==t||t(),i.reject(e))},u=()=>new Promise(r=>{var n;t=e=>{("pending"!==i.status||a())&&r(e)},null==(n=e.onPause)||n.call(e)}).then(()=>{if(t=void 0,"pending"===i.status){var r;null==(r=e.onContinue)||r.call(e)}}),c=()=>{let t;if("pending"!==i.status)return;let o=0===n?e.initialPromise:void 0;try{t=null!=o?o:e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(s).catch(t=>{var o,s,d;if("pending"!==i.status)return;let f=null!=(s=e.retry)?s:3*!ew,h=null!=(d=e.retryDelay)?d:e1,m="function"==typeof h?h(n,t):h,p=!0===f||"number"==typeof f&&n{eT.setTimeout(e,m)}).then(()=>a()?void 0:u()).then(()=>{r?l(t):c()})})};return{promise:i,status:()=>i.status,cancel:t=>{if("pending"===i.status){var r;let n=new e2(t);l(n),null==(r=e.onCancel)||r.call(e,n)}},continue:()=>(null==t||t(),i),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:o,start:()=>(o()?c():u().then(c),i)}}var e8=(c=new WeakMap,class{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eD(this.gcTime)&&eM(this,c,eT.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,null!=e?e:ew?1/0:3e5)}clearGcTimeout(){eC(this,c)&&(eT.clearTimeout(eC(this,c)),eM(this,c,void 0))}constructor(){eb(this,c,{writable:!0,value:void 0})}}),e5=(d=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,p=new WeakMap,A=new WeakMap,g=new WeakMap,B=new WeakSet,class extends e8{get meta(){return this.options.meta}get promise(){var e;return null==(e=eC(this,p))?void 0:e.promise}setOptions(e){if(this.options={...eC(this,A),...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=e7(this.options);void 0!==e.data&&(this.setState(e4(e.data,e.dataUpdatedAt)),eM(this,d,e))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||eC(this,h).remove(this)}setData(e,t){let r=eQ(this.state.data,e,this.options);return ex(this,B,te).call(this,{data:r,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),r}setState(e,t){ex(this,B,te).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var t,r;let n=null==(t=eC(this,p))?void 0:t.promise;return null==(r=eC(this,p))||r.cancel(e),n?n.then(eR).catch(eR):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(eC(this,d))}isActive(){return this.observers.some(e=>!1!==eL(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===eX||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===eG(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!eI(this.state.dataUpdatedAt,e))}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());null==t||t.refetch({cancelRefetch:!1}),null==(e=eC(this,p))||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());null==t||t.refetch({cancelRefetch:!1}),null==(e=eC(this,p))||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),eC(this,h).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(eC(this,p)&&(eC(this,g)?eC(this,p).cancel({revert:!0}):eC(this,p).cancelRetry()),this.scheduleGc()),eC(this,h).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ex(this,B,te).call(this,{type:"invalidate"})}async fetch(e,t){var r,n,i,a,o,s,l,u,c,d,A,C;if("idle"!==this.state.fetchStatus&&(null==(r=eC(this,p))?void 0:r.status())!=="rejected"){if(void 0!==this.state.data&&(null==t?void 0:t.cancelRefetch))this.cancel({silent:!0});else if(eC(this,p))return eC(this,p).continueRetry(),eC(this,p).promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let y=new AbortController,b=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(eM(this,g,!0),y.signal)})},M=()=>{let e=eq(this.options,t),r=(()=>{let e={client:eC(this,m),queryKey:this.queryKey,meta:this.meta};return b(e),e})();return(eM(this,g,!1),this.options.persister)?this.options.persister(e,r,this):e(r)},x=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:eC(this,m),state:this.state,fetchFn:M};return b(e),e})();null==(n=this.options.behavior)||n.onFetch(x,this),eM(this,f,this.state),("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(i=x.fetchOptions)?void 0:i.meta))&&ex(this,B,te).call(this,{type:"fetch",meta:null==(a=x.fetchOptions)?void 0:a.meta}),eM(this,p,e3({initialPromise:null==t?void 0:t.initialPromise,fn:x.fetchFn,onCancel:e=>{e instanceof e2&&e.revert&&this.setState({...eC(this,f),fetchStatus:"idle"}),y.abort()},onFail:(e,t)=>{ex(this,B,te).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{ex(this,B,te).call(this,{type:"pause"})},onContinue:()=>{ex(this,B,te).call(this,{type:"continue"})},retry:x.options.retry,retryDelay:x.options.retryDelay,networkMode:x.options.networkMode,canRun:()=>!0}));try{let e=await eC(this,p).start();if(void 0===e)throw Error("".concat(this.queryHash," data is undefined"));return this.setData(e),null==(o=(s=eC(this,h).config).onSuccess)||o.call(s,e,this),null==(l=(u=eC(this,h).config).onSettled)||l.call(u,e,this.state.error,this),e}catch(e){if(e instanceof e2){if(e.silent)return eC(this,p).promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw ex(this,B,te).call(this,{type:"error",error:e}),null==(c=(d=eC(this,h).config).onError)||c.call(d,e,this),null==(A=(C=eC(this,h).config).onSettled)||A.call(C,this.state.data,e,this),e}finally{this.scheduleGc()}}constructor(e){var t;super(),eE(this,B),eb(this,d,{writable:!0,value:void 0}),eb(this,f,{writable:!0,value:void 0}),eb(this,h,{writable:!0,value:void 0}),eb(this,m,{writable:!0,value:void 0}),eb(this,p,{writable:!0,value:void 0}),eb(this,A,{writable:!0,value:void 0}),eb(this,g,{writable:!0,value:void 0}),eM(this,g,!1),eM(this,A,e.defaultOptions),this.setOptions(e.options),this.observers=[],eM(this,m,e.client),eM(this,h,eC(this,m).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,eM(this,d,e7(this.options)),this.state=null!=(t=e.state)?t:eC(this,d),this.scheduleGc()}});function e6(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:e9(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function e4(e,t){return{data:e,dataUpdatedAt:null!=t?t:Date.now(),error:null,isInvalidated:!1,status:"success"}}function e7(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}function te(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":var r;return{...t,...e6(t.data,this.options),fetchMeta:null!=(r=e.meta)?r:null};case"success":let n={...t,...e4(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return eM(this,f,e.manual?n:void 0),n;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),eZ.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),eC(this,h).notify({query:this,type:"updated",action:e})})}var tt=(C=new WeakMap,y=new WeakMap,b=new WeakMap,M=new WeakMap,x=new WeakMap,E=new WeakMap,F=new WeakMap,S=new WeakMap,T=new WeakMap,w=new WeakMap,R=new WeakMap,D=new WeakMap,I=new WeakMap,G=new WeakMap,L=new WeakMap,P=new WeakSet,H=new WeakSet,O=new WeakSet,k=new WeakSet,_=new WeakSet,U=new WeakSet,j=new WeakSet,J=new WeakSet,N=new WeakSet,class extends eF{bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(eC(this,y).addObserver(this),tr(eC(this,y),this.options)?ex(this,P,to).call(this):this.updateResult(),ex(this,_,tc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tn(eC(this,y),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tn(eC(this,y),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ex(this,U,td).call(this),ex(this,j,tf).call(this),eC(this,y).removeObserver(this)}setOptions(e){let t=this.options,r=eC(this,y);if(this.options=eC(this,C).defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof eL(this.options.enabled,eC(this,y)))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");ex(this,J,th).call(this),eC(this,y).setOptions(this.options),t._defaulted&&!ej(this.options,t)&&eC(this,C).getQueryCache().notify({type:"observerOptionsUpdated",query:eC(this,y),observer:this});let n=this.hasListeners();n&&ti(eC(this,y),r,this.options,t)&&ex(this,P,to).call(this),this.updateResult(),n&&(eC(this,y)!==r||eL(this.options.enabled,eC(this,y))!==eL(t.enabled,eC(this,y))||eG(this.options.staleTime,eC(this,y))!==eG(t.staleTime,eC(this,y)))&&ex(this,H,ts).call(this);let i=ex(this,O,tl).call(this);n&&(eC(this,y)!==r||eL(this.options.enabled,eC(this,y))!==eL(t.enabled,eC(this,y))||i!==eC(this,G))&&ex(this,k,tu).call(this,i)}getOptimisticResult(e){var t,r;let n=eC(this,C).getQueryCache().build(eC(this,C),e),i=this.createResult(n,e);return t=this,r=i,ej(t.getCurrentResult(),r)||(eM(this,M,i),eM(this,E,this.options),eM(this,x,eC(this,y).state)),i}getCurrentResult(){return eC(this,M)}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),null==t||t(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==eC(this,F).status||eC(this,F).reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){eC(this,L).add(e)}getCurrentQuery(){return eC(this,y)}refetch(){let{...e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.fetch({...e})}fetchOptimistic(e){let t=eC(this,C).defaultQueryOptions(e),r=eC(this,C).getQueryCache().build(eC(this,C),t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){var t;return ex(this,P,to).call(this,{...e,cancelRefetch:null==(t=e.cancelRefetch)||t}).then(()=>(this.updateResult(),eC(this,M)))}createResult(e,t){let r,n=eC(this,y),i=this.options,a=eC(this,M),o=eC(this,x),s=eC(this,E),l=e!==n?e.state:eC(this,b),{state:u}=e,c={...u},d=!1;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&tr(e,t),o=r&&ti(e,n,t,i);(a||o)&&(c={...c,...e6(u.data,e.options)}),"isRestoring"===t._optimisticResults&&(c.fetchStatus="idle")}let{error:f,errorUpdatedAt:h,status:m}=c;r=c.data;let p=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===m){let e;if((null==a?void 0:a.isPlaceholderData)&&t.placeholderData===(null==s?void 0:s.placeholderData))e=a.data,p=!0;else{var A;e="function"==typeof t.placeholderData?t.placeholderData(null==(A=eC(this,R))?void 0:A.state.data,eC(this,R)):t.placeholderData}void 0!==e&&(m="success",r=eQ(null==a?void 0:a.data,e,t),d=!0)}if(t.select&&void 0!==r&&!p)if(a&&r===(null==o?void 0:o.data)&&t.select===eC(this,T))r=eC(this,w);else try{eM(this,T,t.select),r=t.select(r),r=eQ(null==a?void 0:a.data,r,t),eM(this,w,r),eM(this,S,null)}catch(e){eM(this,S,e)}eC(this,S)&&(f=eC(this,S),r=eC(this,w),h=Date.now(),m="error");let g="fetching"===c.fetchStatus,B="pending"===m,C="error"===m,D=B&&g,I=void 0!==r,G={status:m,fetchStatus:c.fetchStatus,isPending:B,isSuccess:"success"===m,isError:C,isInitialLoading:D,isLoading:D,data:r,dataUpdatedAt:c.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:g,isRefetching:g&&!B,isLoadingError:C&&!I,isPaused:"paused"===c.fetchStatus,isPlaceholderData:d,isRefetchError:C&&I,isStale:ta(e,t),refetch:this.refetch,promise:eC(this,F),isEnabled:!1!==eL(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===G.status?e.reject(G.error):void 0!==G.data&&e.resolve(G.data)},r=()=>{t(eM(this,F,G.promise=e0()))},i=eC(this,F);switch(i.status){case"pending":e.queryHash===n.queryHash&&t(i);break;case"fulfilled":("error"===G.status||G.data!==i.value)&&r();break;case"rejected":("error"!==G.status||G.error!==i.reason)&&r()}}return G}updateResult(){let e=eC(this,M),t=this.createResult(eC(this,y),this.options);if(eM(this,x,eC(this,y).state),eM(this,E,this.options),void 0!==eC(this,x).data&&eM(this,R,eC(this,y)),ej(t,e))return;eM(this,M,t);let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!eC(this,L).size)return!0;let n=new Set(null!=r?r:eC(this,L));return this.options.throwOnError&&n.add("error"),Object.keys(eC(this,M)).some(t=>eC(this,M)[t]!==e[t]&&n.has(t))};ex(this,N,tm).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ex(this,_,tc).call(this)}constructor(e,t){super(),eE(this,P),eE(this,H),eE(this,O),eE(this,k),eE(this,_),eE(this,U),eE(this,j),eE(this,J),eE(this,N),eb(this,C,{writable:!0,value:void 0}),eb(this,y,{writable:!0,value:void 0}),eb(this,b,{writable:!0,value:void 0}),eb(this,M,{writable:!0,value:void 0}),eb(this,x,{writable:!0,value:void 0}),eb(this,E,{writable:!0,value:void 0}),eb(this,F,{writable:!0,value:void 0}),eb(this,S,{writable:!0,value:void 0}),eb(this,T,{writable:!0,value:void 0}),eb(this,w,{writable:!0,value:void 0}),eb(this,R,{writable:!0,value:void 0}),eb(this,D,{writable:!0,value:void 0}),eb(this,I,{writable:!0,value:void 0}),eb(this,G,{writable:!0,value:void 0}),eb(this,L,{writable:!0,value:new Set}),this.options=t,eM(this,C,e),eM(this,S,null),eM(this,F,e0()),this.bindMethods(),this.setOptions(t)}});function tr(e,t){return!1!==eL(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&tn(e,t,t.refetchOnMount)}function tn(e,t,r){if(!1!==eL(t.enabled,e)&&"static"!==eG(t.staleTime,e)){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&ta(e,t)}return!1}function ti(e,t,r,n){return(e!==t||!1===eL(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&ta(e,r)}function ta(e,t){return!1!==eL(t.enabled,e)&&e.isStaleByTime(eG(t.staleTime,e))}function to(e){ex(this,J,th).call(this);let t=eC(this,y).fetch(this.options,e);return(null==e?void 0:e.throwOnError)||(t=t.catch(eR)),t}function ts(){ex(this,U,td).call(this);let e=eG(this.options.staleTime,eC(this,y));if(ew||eC(this,M).isStale||!eD(e))return;let t=eI(eC(this,M).dataUpdatedAt,e);eM(this,D,eT.setTimeout(()=>{eC(this,M).isStale||this.updateResult()},t+1))}function tl(){var e;return null!=(e="function"==typeof this.options.refetchInterval?this.options.refetchInterval(eC(this,y)):this.options.refetchInterval)&&e}function tu(e){ex(this,j,tf).call(this),eM(this,G,e),!ew&&!1!==eL(this.options.enabled,eC(this,y))&&eD(eC(this,G))&&0!==eC(this,G)&&eM(this,I,eT.setInterval(()=>{(this.options.refetchIntervalInBackground||eY.isFocused())&&ex(this,P,to).call(this)},eC(this,G)))}function tc(){ex(this,H,ts).call(this),ex(this,k,tu).call(this,ex(this,O,tl).call(this))}function td(){eC(this,D)&&(eT.clearTimeout(eC(this,D)),eM(this,D,void 0))}function tf(){eC(this,I)&&(eT.clearInterval(eC(this,I)),eM(this,I,void 0))}function th(){let e=eC(this,C).getQueryCache().build(eC(this,C),this.options);if(e===eC(this,y))return;let t=eC(this,y);eM(this,y,e),eM(this,b,e.state),this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}function tm(e){eZ.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(eC(this,M))}),eC(this,C).getQueryCache().notify({query:eC(this,y),type:"observerResultsUpdated"})})}var tp=el.createContext(void 0),tA=e=>{let{client:t,children:r}=e;return el.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,es.jsx)(tp.Provider,{value:t,children:r})},tg=el.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),tv=el.createContext(!1);tv.Provider;var tB=(e,t)=>void 0===t.state.data,tC=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function ty(e,t,r){var n,i,a,o,s;let l=el.useContext(tv),u=el.useContext(tg),c=(e=>{let t=el.useContext(tp);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t})(r),d=c.defaultQueryOptions(e);if(null==(i=c.getDefaultOptions().queries)||null==(n=i._experimental_beforeQuery)||n.call(i,d),d._optimisticResults=l?"isRestoring":"optimistic",d.suspense){let e=e=>"static"===e?e:Math.max(null!=e?e:1e3,1e3),t=d.staleTime;d.staleTime="function"==typeof t?function(){for(var r=arguments.length,n=Array(r),i=0;i{u.clearReset()},[u]);let f=!c.getQueryCache().get(d.queryHash),[h]=el.useState(()=>new t(c,d)),m=h.getOptimisticResult(d),p=!l&&!1!==e.subscribed;if(el.useSyncExternalStore(el.useCallback(e=>{let t=p?h.subscribe(eZ.batchCalls(e)):eR;return h.updateResult(),t},[h,p]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),el.useEffect(()=>{h.setOptions(d)},[d,h]),(null==d?void 0:d.suspense)&&m.isPending)throw tC(d,h,u);if((e=>{var t,r;let{result:n,errorResetBoundary:i,throwOnError:a,query:o,suspense:s}=e;return n.isError&&!i.isReset()&&!n.isFetching&&o&&(s&&void 0===n.data||(t=a,r=[n.error,o],"function"==typeof t?t(...r):!!t))})({result:m,errorResetBoundary:u,throwOnError:d.throwOnError,query:c.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;if(null==(o=c.getDefaultOptions().queries)||null==(a=o._experimental_afterQuery)||a.call(o,d,m),d.experimental_prefetchInRender&&!ew&&m.isLoading&&m.isFetching&&!l){let e=f?tC(d,h,u):null==(s=c.getQueryCache().get(d.queryHash))?void 0:s.promise;null==e||e.catch(eR).finally(()=>{h.updateResult()})}return d.notifyOnChangeProps?m:h.trackResult(m)}var tb=e.i(54970),tM=e.i(12979),tx=e.i(5230),tE=e.i(16096),tF=e.i(62395),tS=e.i(75567),tT=e.i(47071),tw=e.i(79123),tR=e.i(47021),tD=e.i(48066);let tI={0:32,1:32,2:32,3:32,4:32,5:32};function tG(e){let{displacementMap:t,visibilityMask:r,textureNames:n,alphaTextures:i,detailTextureName:a,lightmap:o}=e,{debugMode:s}=(0,tw.useDebug)(),l=(0,tT.useTexture)(n.map(e=>(0,tM.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,tS.setupColor)(e))}),u=a?(0,tM.textureToUrl)(a):null,c=(0,tT.useTexture)(null!=u?u:tM.FALLBACK_TEXTURE_URL,e=>{(0,tS.setupColor)(e)}),d=(0,el.useCallback)(e=>{!function(e){let{shader:t,baseTextures:r,alphaTextures:n,visibilityMask:i,tiling:a,debugMode:o=!1,detailTexture:s=null,lightmap:l=null}=e,u=r.length;if(r.forEach((e,r)=>{t.uniforms["albedo".concat(r)]={value:e}}),n.forEach((e,r)=>{r>0&&(t.uniforms["mask".concat(r)]={value:e})}),i&&(t.uniforms.visibilityMask={value:i}),r.forEach((e,r)=>{var n;t.uniforms["tiling".concat(r)]={value:null!=(n=a[r])?n:32}}),t.uniforms.debugMode={value:+!!o},l&&(t.uniforms.terrainLightmap={value:l}),s&&(t.uniforms.detailTexture={value:s},t.uniforms.detailTiling={value:64},t.uniforms.detailFadeDistance={value:150},t.vertexShader=t.vertexShader.replace("#include ","#include \nvarying vec3 vTerrainWorldPos;"),t.vertexShader=t.vertexShader.replace("#include ","#include \nvTerrainWorldPos = (modelMatrix * vec4(transformed, 1.0)).xyz;")),t.fragmentShader="\nuniform sampler2D albedo0;\nuniform sampler2D albedo1;\nuniform sampler2D albedo2;\nuniform sampler2D albedo3;\nuniform sampler2D albedo4;\nuniform sampler2D albedo5;\nuniform sampler2D mask1;\nuniform sampler2D mask2;\nuniform sampler2D mask3;\nuniform sampler2D mask4;\nuniform sampler2D mask5;\nuniform float tiling0;\nuniform float tiling1;\nuniform float tiling2;\nuniform float tiling3;\nuniform float tiling4;\nuniform float tiling5;\nuniform float debugMode;\n".concat(i?"uniform sampler2D visibilityMask;":"","\n").concat(l?"uniform sampler2D terrainLightmap;":"","\n").concat(s?"uniform sampler2D detailTexture;\nuniform float detailTiling;\nuniform float detailFadeDistance;\nvarying vec3 vTerrainWorldPos;":"","\n\n").concat("\nvec3 terrainLinearToSRGB(vec3 linear) {\n vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055;\n vec3 lower = linear * 12.92;\n return mix(lower, higher, step(vec3(0.0031308), linear));\n}\n\nvec3 terrainSRGBToLinear(vec3 srgb) {\n vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4));\n vec3 lower = srgb / 12.92;\n return mix(lower, higher, step(vec3(0.04045), srgb));\n}\n\n// Debug grid overlay using screen-space derivatives for sharp, anti-aliased lines\n// Returns 1.0 on grid lines, 0.0 elsewhere\nfloat terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) {\n vec2 scaledUV = uv * gridSize;\n vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV);\n float line = min(grid.x, grid.y);\n return 1.0 - min(line / lineWidth, 1.0);\n}\n","\n\n// Global variable to store shadow factor from RE_Direct for use in output calculation\nfloat terrainShadowFactor = 1.0;\n")+t.fragmentShader,i){let e="#include ";t.fragmentShader=t.fragmentShader.replace(e,"".concat(e,"\n // Early discard for invisible areas (before fog/lighting)\n float visibility = texture2D(visibilityMask, vMapUv).r;\n if (visibility < 0.5) {\n discard;\n }\n "))}t.fragmentShader=t.fragmentShader.replace("#include ","\n // Sample base albedo layers (sRGB textures auto-decoded to linear by Three.js)\n vec2 baseUv = vMapUv;\n vec3 c0 = texture2D(albedo0, baseUv * vec2(tiling0)).rgb;\n ".concat(u>1?"vec3 c1 = texture2D(albedo1, baseUv * vec2(tiling1)).rgb;":"","\n ").concat(u>2?"vec3 c2 = texture2D(albedo2, baseUv * vec2(tiling2)).rgb;":"","\n ").concat(u>3?"vec3 c3 = texture2D(albedo3, baseUv * vec2(tiling3)).rgb;":"","\n ").concat(u>4?"vec3 c4 = texture2D(albedo4, baseUv * vec2(tiling4)).rgb;":"","\n ").concat(u>5?"vec3 c5 = texture2D(albedo5, baseUv * vec2(tiling5)).rgb;":"","\n\n // Sample linear masks (use R channel)\n // Add +0.5 texel offset: Torque samples alpha at grid corners (integer indices),\n // but GPU linear filtering samples at texel centers. This offset aligns them.\n vec2 alphaUv = baseUv + vec2(0.5 / ").concat(256,".0);\n float a1 = texture2D(mask1, alphaUv).r;\n ").concat(u>1?"float a2 = texture2D(mask2, alphaUv).r;":"","\n ").concat(u>2?"float a3 = texture2D(mask3, alphaUv).r;":"","\n ").concat(u>3?"float a4 = texture2D(mask4, alphaUv).r;":"","\n ").concat(u>4?"float a5 = texture2D(mask5, alphaUv).r;":"","\n\n // Bottom-up compositing: each mask tells how much the higher layer replaces lower\n ").concat(u>1?"vec3 blended = mix(c0, c1, clamp(a1, 0.0, 1.0));":"","\n ").concat(u>2?"blended = mix(blended, c2, clamp(a2, 0.0, 1.0));":"","\n ").concat(u>3?"blended = mix(blended, c3, clamp(a3, 0.0, 1.0));":"","\n ").concat(u>4?"blended = mix(blended, c4, clamp(a4, 0.0, 1.0));":"","\n ").concat(u>5?"blended = mix(blended, c5, clamp(a5, 0.0, 1.0));":"","\n\n // Assign to diffuseColor before lighting\n vec3 textureColor = ").concat(u>1?"blended":"c0",";\n\n ").concat(s?"// Detail texture blending (Torque-style multiplicative blend)\n // Sample detail texture at high frequency tiling\n vec3 detailColor = texture2D(detailTexture, baseUv * detailTiling).rgb;\n\n // Calculate distance-based fade factor using world positions\n // Torque: distFactor = (zeroDetailDistance - distance) / zeroDetailDistance\n float distToCamera = distance(vTerrainWorldPos, cameraPosition);\n float detailFade = clamp(1.0 - distToCamera / detailFadeDistance, 0.0, 1.0);\n\n // Torque blending: dst * lerp(1.0, detailTexel, fadeFactor)\n // Detail textures are authored with bright values (~0.8 mean), not 0.5 gray\n // Direct multiplication adds subtle darkening for surface detail\n textureColor *= mix(vec3(1.0), detailColor, detailFade);":"","\n\n // Store blended texture in diffuseColor (still in linear space here)\n // We'll convert to sRGB in the output calculation\n diffuseColor.rgb = textureColor;\n")),l&&(t.fragmentShader=t.fragmentShader.replace("#include ","#include \n\n// Override RE_Direct to extract shadow factor for Torque-style gamma-space lighting\n#undef RE_Direct\nvoid RE_Direct_TerrainShadow( 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 ) {\n // directLight.color = sunColor * shadowFactor (shadow already applied by Three.js)\n // Extract shadow factor by comparing to original sun color\n #if ( NUM_DIR_LIGHTS > 0 )\n vec3 originalSunColor = directionalLights[0].color;\n float sunMax = max(max(originalSunColor.r, originalSunColor.g), originalSunColor.b);\n float shadowedMax = max(max(directLight.color.r, directLight.color.g), directLight.color.b);\n terrainShadowFactor = clamp(shadowedMax / max(sunMax, 0.001), 0.0, 1.0);\n #endif\n // Don't add to reflectedLight - we'll compute lighting in gamma space at output\n}\n#define RE_Direct RE_Direct_TerrainShadow\n\n"),t.fragmentShader=t.fragmentShader.replace("#include ","#include \n// Clear indirect diffuse - we'll compute ambient in gamma space\n#if defined( RE_IndirectDiffuse )\n irradiance = vec3(0.0);\n#endif\n"),t.fragmentShader=t.fragmentShader.replace("#include ","#include \n // Clear Three.js lighting - we compute everything in gamma space\n reflectedLight.directDiffuse = vec3(0.0);\n reflectedLight.indirectDiffuse = vec3(0.0);\n")),t.fragmentShader=t.fragmentShader.replace("#include ","// Torque-style terrain lighting: output = clamp(lighting × texture, 0, 1) in sRGB space\n{\n // Get texture in sRGB space (undo Three.js linear decode)\n vec3 textureSRGB = terrainLinearToSRGB(diffuseColor.rgb);\n\n ".concat(l?"\n // Sample terrain lightmap for smooth NdotL\n vec2 lightmapUv = vMapUv + vec2(0.5 / ".concat(512,".0);\n float lightmapNdotL = texture2D(terrainLightmap, lightmapUv).r;\n\n // Get sun and ambient colors from Three.js lights (these ARE sRGB values from mission file)\n // Three.js interprets them as linear, but the numerical values are preserved\n #if ( NUM_DIR_LIGHTS > 0 )\n vec3 sunColorSRGB = directionalLights[0].color;\n #else\n vec3 sunColorSRGB = vec3(0.7);\n #endif\n vec3 ambientColorSRGB = ambientLightColor;\n\n // Torque formula (terrLighting.cc:471-483):\n // lighting = ambient + NdotL * shadowFactor * sunColor\n // Clamp lighting to [0,1] before multiplying by texture\n vec3 lightingSRGB = clamp(ambientColorSRGB + lightmapNdotL * terrainShadowFactor * sunColorSRGB, 0.0, 1.0);\n "):"\n // No lightmap - use simple ambient lighting\n vec3 lightingSRGB = ambientLightColor;\n ","\n\n // Torque formula: output = clamp(lighting × texture, 0, 1) in sRGB/gamma space\n vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0);\n\n // Convert back to linear for Three.js output pipeline\n outgoingLight = terrainSRGBToLinear(resultSRGB) + totalEmissiveRadiance;\n}\n#include ")),t.fragmentShader=t.fragmentShader.replace("#include ","// Debug mode: overlay green grid matching terrain grid squares (256x256)\nif (debugMode > 0.5) {\n float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5);\n vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green\n gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.05);\n}\n\n#include ")}({shader:e,baseTextures:l,alphaTextures:i,visibilityMask:r,tiling:tI,debugMode:s,detailTexture:u?c:null,lightmap:o}),(0,tR.injectCustomFog)(e,tD.globalFogUniforms)},[l,i,r,s,c,u,o]),f="".concat(s?"debug":"normal","-").concat(u?"detail":"nodetail","-").concat(o?"lightmap":"nolightmap");return(0,es.jsx)("meshLambertMaterial",{map:t,depthWrite:!0,side:ef.FrontSide,onBeforeCompile:d},f)}function tL(e){let{displacementMap:t,visibilityMask:r,textureNames:n,alphaTextures:i,detailTextureName:a,lightmap:o}=e;return(0,es.jsx)(el.Suspense,{fallback:(0,es.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),children:(0,es.jsx)(tG,{displacementMap:t,visibilityMask:r,textureNames:n,alphaTextures:i,detailTextureName:a,lightmap:o})})}let tP=(0,el.memo)(function(e){let{tileX:t,tileZ:r,blockSize:n,basePosition:i,textureNames:a,geometry:o,displacementMap:s,visibilityMask:l,alphaTextures:u,detailTextureName:c,lightmap:d,visible:f=!0}=e,h=(0,el.useMemo)(()=>[i.x+t*n+1024,0,i.z+r*n+1024],[t,r,n,i]);return(0,es.jsx)("mesh",{position:h,geometry:o,castShadow:!0,receiveShadow:!0,visible:f,children:(0,es.jsx)(tL,{displacementMap:s,visibilityMask:l,textureNames:a,alphaTextures:u,detailTextureName:c,lightmap:d})})});var tH=e.i(77482);function tO(e){return(0,tH.useRuntime)().getObjectByName(e)}function tk(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,n=r>>8&255,i=r>>16,a=256*n;for(let r=0;r0?r:null!=(e=(0,tF.getFloat)(t,"visibleDistance"))?e:600}(),l=(0,tE.useThree)(e=>e.camera),u=(0,el.useMemo)(()=>{let[e,,t]=(0,tF.getPosition)(r);return{x:e,z:t}},[r]),c=(0,el.useMemo)(()=>{let e=(0,tF.getProperty)(r,"emptySquares");return e?e.split(" ").map(e=>parseInt(e,10)):[]},[r]),{data:d}=ty({queryKey:["terrain",n],queryFn:()=>(0,tM.loadTerrain)(n)},tt,void 0),f=(0,el.useMemo)(()=>{if(!d)return null;let e=function(e,t){let r=new ef.BufferGeometry,n=66049,i=new Float32Array(3*n),a=new Float32Array(3*n),o=new Float32Array(2*n),s=new Uint32Array(t*t*6),l=0,u=e/t;for(let r=0;r<=t;r++)for(let n=0;n<=t;n++){let s=r*(t+1)+n;i[3*s]=n*u-e/2,i[3*s+1]=e/2-r*u,i[3*s+2]=0,a[3*s]=0,a[3*s+1]=0,a[3*s+2]=1,o[2*s]=n/t,o[2*s+1]=1-r/t}for(let e=0;e(e=Math.max(0,Math.min(255,e)),t[256*(r=Math.max(0,Math.min(255,r)))+e]/65535*2048),d=(e,r)=>{let n=Math.floor(e=Math.max(0,Math.min(255,e))),i=Math.floor(r=Math.max(0,Math.min(255,r))),a=Math.min(n+1,255),o=Math.min(i+1,255),s=e-n,l=r-i,u=t[256*i+n]/65535*2048,c=t[256*i+a]/65535*2048,d=t[256*o+n]/65535*2048;return(u*(1-s)+c*s)*(1-l)+(d*(1-s)+t[256*o+a]/65535*2048*s)*l};for(let e=0;e0?(p/=B,A/=B,g/=B):(p=0,A=1,g=0),l[3*e]=p,l[3*e+1]=A,l[3*e+2]=g}n.needsUpdate=!0,a.needsUpdate=!0}(e,d.heightMap,i),e},[i,d]),h=tO("Sun"),m=(0,el.useMemo)(()=>{var e;if(!h)return new ef.Vector3(.57735,-.57735,.57735);let[t,r,n]=(null!=(e=(0,tF.getProperty)(h,"direction"))?e:"0.57735 0.57735 -0.57735").split(" ").map(e=>parseFloat(e)),i=Math.sqrt(t*t+n*n+r*r);return new ef.Vector3(t/i,n/i,r/i)},[h]),p=(0,el.useMemo)(()=>d?function(e,t,r){let n=(t,r)=>{let n=Math.max(0,Math.min(255,t)),i=Math.max(0,Math.min(255,r)),a=Math.floor(n),o=Math.floor(i),s=Math.min(a+1,255),l=Math.min(o+1,255),u=n-a,c=i-o,d=e[256*o+a]/65535,f=e[256*o+s]/65535,h=e[256*l+a]/65535;return((d*(1-u)+f*u)*(1-c)+(h*(1-u)+e[256*l+s]/65535*u)*c)*2048},i=new ef.Vector3(-t.x,-t.y,-t.z).normalize(),a=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let o=t/2+.25,s=e/2+.25,l=n(o,s),u=n(o-.5,s),c=n(o+.5,s),d=n(o,s-.5),f=n(o,s+.5),h=-((f-d)/1),m=-((c-u)/1),p=Math.sqrt(h*h+r*r+m*m),A=Math.max(0,h/p*i.x+r/p*i.y+m/p*i.z),g=1;A>0&&(g=function(e,t,r,n,i,a){let o=n.z/i,s=n.x/i,l=n.y,u=Math.sqrt(o*o+s*s);if(u<1e-4)return 1;let c=.5/u,d=o*c,f=s*c,h=l*c,m=e,p=t,A=r+.1;for(let e=0;e<768&&(m+=d,p+=f,A+=h,!(m<0)&&!(m>=256)&&!(p<0)&&!(p>=256)&&!(A>2048));e++)if(A{if(!d)return null;let e=function(e){let t=new Float32Array(e.length);for(let r=0;rtk(c),[c]),B=(0,el.useMemo)(()=>tk([]),[]),C=(0,el.useMemo)(()=>d?d.alphaMaps.map(e=>(0,tS.setupMask)(e)):null,[d]),y=(0,el.useMemo)(()=>{let e=2*Math.ceil(s/o)+1;return e*e-1},[s,o]),b=(0,el.useMemo)(()=>Array.from({length:y},(e,t)=>t),[y]),[M,x]=(0,el.useState)(()=>Array(y).fill(null)),E=(0,el.useRef)({xStart:0,xEnd:0,zStart:0,zEnd:0});return((0,tx.useFrame)(()=>{let e=l.position.x-u.x,t=l.position.z-u.z,r=Math.floor((e-s)/o),n=Math.ceil((e+s)/o),i=Math.floor((t-s)/o),a=Math.ceil((t+s)/o),c=E.current;if(r===c.xStart&&n===c.xEnd&&i===c.zStart&&a===c.zEnd)return;c.xStart=r,c.xEnd=n,c.zStart=i,c.zEnd=a;let d=[];for(let e=r;e{var t,r;let n=M[e];return(0,es.jsx)(tP,{tileX:null!=(t=null==n?void 0:n.tileX)?t:0,tileZ:null!=(r=null==n?void 0:n.tileZ)?r:0,blockSize:o,basePosition:u,textureNames:d.textureNames,geometry:f,displacementMap:A,visibilityMask:B,alphaTextures:C,detailTextureName:a,lightmap:p,visible:null!==n},e)})]}):null}),tU=(0,el.createContext)(null);function tj(){return(0,el.useContext)(tU)}var tJ=el;let tN=(0,tJ.createContext)(null),tK={didCatch:!1,error:null};class tQ extends tJ.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,n=arguments.length,i=Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,n)){var i,a;null==(i=(a=this.props).onReset)||i.call(a,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(tK)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:n}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)o=t(e);else if(r)o=(0,tJ.createElement)(r,e);else if(void 0!==n)o=n;else throw a}return(0,tJ.createElement)(tN.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=tK}}var tW=e.i(31067),tV=ef;function tX(e,t){if(t===ef.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==ef.TriangleFanDrawMode&&t!==ef.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e=2.0 are supported."));return}let s=new rG(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});s.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}s.setExtensions(a),s.setPlugins(o),s.parse(r,n)}parseAsync(e,t){let r=this;return new Promise(function(n,i){r.parse(e,t,n,i)})}constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new t8(e)}),this.register(function(e){return new t5(e)}),this.register(function(e){return new ra(e)}),this.register(function(e){return new ro(e)}),this.register(function(e){return new rs(e)}),this.register(function(e){return new t4(e)}),this.register(function(e){return new t7(e)}),this.register(function(e){return new re(e)}),this.register(function(e){return new rt(e)}),this.register(function(e){return new t3(e)}),this.register(function(e){return new rr(e)}),this.register(function(e){return new t6(e)}),this.register(function(e){return new ri(e)}),this.register(function(e){return new rn(e)}),this.register(function(e){return new t9(e)}),this.register(function(e){return new rl(e)}),this.register(function(e){return new ru(e)})}}function t0(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let t1={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class t9{_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,i.source,a)}constructor(e){this.parser=e,this.name=t1.KHR_TEXTURE_BASISU}}class ro{loadTexture(e){let t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=n.images[a.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return r.loadTextureImage(e,a.source,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}constructor(e){this.parser=e,this.name=t1.EXT_TEXTURE_WEBP,this.isSupported=null}}class rs{loadTexture(e){let t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=n.images[a.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return r.loadTextureImage(e,a.source,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}constructor(e){this.parser=e,this.name=t1.EXT_TEXTURE_AVIF,this.isSupported=null}}class rl{loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return n.then(function(t){let r=e.byteOffset||0,n=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}}constructor(e){this.name=t1.EXT_MESHOPT_COMPRESSION,this.parser=e}}class ru{createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==rB.TRIANGLES&&e.mode!==rB.TRIANGLE_STRIP&&e.mode!==rB.TRIANGLE_FAN&&void 0!==e.mode)return null;let n=r.extensions[this.name].attributes,i=[],a={};for(let e in n)i.push(this.parser.getDependency("accessor",n[e]).then(t=>(a[e]=t,a[e])));return i.length<1?null:(i.push(this.parser.createNodeMesh(e)),Promise.all(i).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],n=e[0].count,i=[];for(let e of r){let t=new tV.Matrix4,r=new tV.Vector3,o=new tV.Quaternion,s=new tV.Vector3(1,1,1),l=new tV.InstancedMesh(e.geometry,e.material,n);for(let e=0;e=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},rE={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},rF={CUBICSPLINE:void 0,LINEAR:tV.InterpolateLinear,STEP:tV.InterpolateDiscrete},rS={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function rT(e,t,r){for(let n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function rw(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function rR(e){let t="",r=Object.keys(e).sort();for(let n=0,i=r.length;n{let r=this.associations.get(e);for(let[n,a]of(null!=r&&this.associations.set(t,r),e.children.entries()))i(a,t.children[n])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&a.setY(t,d[e*s+1]),s>=3&&a.setZ(t,d[e*s+2]),s>=4&&a.setW(t,d[e*s+3]),s>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})}loadTexture(e){let t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n],a=this.textureLoader;if(i.uri){let e=r.manager.getHandler(i.uri);null!==e&&(a=e)}return this.loadTextureImage(e,n,a)}loadTextureImage(e,t,r){let n=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[s])return this.textureCache[s];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let r=(i.samplers||{})[a.sampler]||{};return t.magFilter=ry[r.magFilter]||tV.LinearFilter,t.minFilter=ry[r.minFilter]||tV.LinearMipmapLinearFilter,t.wrapS=rb[r.wrapS]||tV.RepeatWrapping,t.wrapT=rb[r.wrapT]||tV.RepeatWrapping,n.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=l,l}loadImageSource(e,t){let r=this.json,n=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let i=r.images[e],a=self.URL||self.webkitURL,o=i.uri||"",s=!1;if(void 0!==i.bufferView)o=this.getDependency("bufferView",i.bufferView).then(function(e){s=!0;let t=new Blob([e],{type:i.mimeType});return o=a.createObjectURL(t)});else if(void 0===i.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(o).then(function(e){return new Promise(function(r,i){let a=r;!0===t.isImageBitmapLoader&&(a=function(e){let t=new tV.Texture(e);t.needsUpdate=!0,r(t)}),t.load(tV.LoaderUtils.resolveURL(e,n.path),a,void 0,i)})}).then(function(e){var t;return!0===s&&a.revokeObjectURL(o),rw(e,i),e.userData.mimeType=i.mimeType||((t=i.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,n){let i=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((a=a.clone()).channel=r.texCoord),i.extensions[t1.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[t1.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=i.associations.get(a);a=i.extensions[t1.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return void 0!==n&&("number"==typeof n&&(n=3001===n?tz:tZ),"colorSpace"in a?a.colorSpace=n:a.encoding=n===tz?3001:3e3),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,r=e.material,n=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new tV.PointsMaterial,tV.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new tV.LineBasicMaterial,tV.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(n||i||a){let e="ClonedMaterial:"+r.uuid+":";n&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),n&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return tV.MeshStandardMaterial}loadMaterial(e){let t,r=this,n=this.json,i=this.extensions,a=n.materials[e],o={},s=a.extensions||{},l=[];if(s[t1.KHR_MATERIALS_UNLIT]){let e=i[t1.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(o,a,r))}else{let n=a.pbrMetallicRoughness||{};if(o.color=new tV.Color(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],tZ),o.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(r.assignTexture(o,"map",n.baseColorTexture,tz)),o.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,o.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(r.assignTexture(o,"metalnessMap",n.metallicRoughnessTexture)),l.push(r.assignTexture(o,"roughnessMap",n.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}!0===a.doubleSided&&(o.side=tV.DoubleSide);let u=a.alphaMode||rS.OPAQUE;if(u===rS.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,u===rS.MASK&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==tV.MeshBasicMaterial&&(l.push(r.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new tV.Vector2(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==tV.MeshBasicMaterial&&(l.push(r.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==tV.MeshBasicMaterial){let e=a.emissiveFactor;o.emissive=new tV.Color().setRGB(e[0],e[1],e[2],tZ)}return void 0!==a.emissiveTexture&&t!==tV.MeshBasicMaterial&&l.push(r.assignTexture(o,"emissiveMap",a.emissiveTexture,tz)),Promise.all(l).then(function(){let n=new t(o);return a.name&&(n.name=a.name),rw(n,a),r.associations.set(n,{materials:e}),a.extensions&&rT(i,n,a),n})}createUniqueName(e){let t=tV.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,n=this.primitiveCache,i=[];for(let a=0,o=e.length;a0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,n=t.weights.length;r1?new tV.Group:1===t.length?t[0]:new tV.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of n.associations)(e instanceof tV.Material||e instanceof tV.Texture)&&t.set(e,r);return e.traverse(e=>{let r=n.associations.get(e);null!=r&&t.set(e,r)}),t})(i),i})}_createAnimationTracks(e,t,r,n,i){let a,o=[],s=e.name?e.name:e.uuid,l=[];switch(rE[i.path]===rE.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(s),rE[i.path]){case rE.weights:a=tV.NumberKeyframeTrack;break;case rE.rotation:a=tV.QuaternionKeyframeTrack;break;case rE.position:case rE.scale:a=tV.VectorKeyframeTrack;break;default:a=1===r.itemSize?tV.NumberKeyframeTrack:tV.VectorKeyframeTrack}let u=void 0!==n.interpolation?rF[n.interpolation]:tV.InterpolateLinear,c=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&i<98?this.textureLoader=new tV.TextureLoader(this.options.manager):this.textureLoader=new tV.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new tV.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}}function rL(e,t,r){let n=t.attributes,i=[];for(let t in n){let a=rx[t]||t.toLowerCase();a in e.attributes||i.push(function(t,n){return r.getDependency("accessor",t).then(function(t){e.setAttribute(n,t)})}(n[t],a))}if(void 0!==t.indices&&!e.index){let n=r.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});i.push(n)}return rw(e,t),!function(e,t,r){let n=t.attributes,i=new tV.Box3;if(void 0===n.POSITION)return;{let e=r.json.accessors[n.POSITION],t=e.min,a=e.max;if(void 0===t||void 0===a)return console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new tV.Vector3(t[0],t[1],t[2]),new tV.Vector3(a[0],a[1],a[2])),e.normalized){let t=rD(rC[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}let a=t.targets;if(void 0!==a){let e=new tV.Vector3,t=new tV.Vector3;for(let n=0,i=a.length;n{let r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(n)},r,n)}decodeDracoFile(e,t,r,n){let i={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){let r;for(let e in t.attributeTypes){let r=t.attributeTypes[e];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=r.name)}let n=JSON.stringify(t);if(rH.has(e)){let t=rH.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(n=>(r=n,new Promise((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),rH.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new rP.BufferGeometry;e.index&&t.setIndex(new rP.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let n=rk.toString(),i=["/* draco decoder */",r,"\n/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let t=e.draco,r=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(i),i.byteLength);try{let e=function(e,t,r,n){let i,a,o=n.attributeIDs,s=n.attributeTypes,l=t.GetEncodedGeometryType(r);if(l===e.TRIANGULAR_MESH)i=new e.Mesh,a=t.DecodeBufferToMesh(r,i);else if(l===e.POINT_CLOUD)i=new e.PointCloud,a=t.DecodeBufferToPointCloud(r,i);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!a.ok()||0===i.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+a.error_msg());let u={index:null,attributes:[]};for(let r in o){let a,l,c=self[s[r]];if(n.useUniqueIDs)l=o[r],a=t.GetAttributeByUniqueId(i,l);else{if(-1===(l=t.GetAttributeId(i,e[o[r]])))continue;a=t.GetAttribute(i,l)}u.attributes.push(function(e,t,r,n,i,a){let o=a.num_components(),s=r.num_points()*o,l=s*i.BYTES_PER_ELEMENT,u=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,a,u,l,c);let d=new i(e.HEAPF32.buffer,c,s).slice();return e._free(c),{name:n,array:d,itemSize:o}}(e,t,i,r,c,a))}return l===e.TRIANGULAR_MESH&&(u.index=function(e,t,r){let n=3*r.num_faces(),i=4*n,a=e._malloc(i);t.GetTrianglesUInt32Array(r,i,a);let o=new Uint32Array(e.HEAPF32.buffer,a,n).slice();return e._free(a),{array:o,itemSize:1}}(e,t,i)),e.destroy(i),u}(t,r,o,a),i=e.attributes.map(e=>e.array.buffer);e.index&&i.push(e.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:e},i)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(o),t.destroy(r)}})}}}var r_=e.i(80520);let rU={clone:function(e){let t=new Map,r=new Map,n=e.clone();return function e(t,r,n){n(t,r);for(let i=0;i{let{isChild:r=!1,object:n,children:i,deep:a,castShadow:o,receiveShadow:s,inject:l,keys:u,...c}=e,d={keys:u,deep:a,inject:l,castShadow:o,receiveShadow:s};if(Array.isArray(n=el.useMemo(()=>{if(!1===r&&!Array.isArray(n)){let e=!1;if(n.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return rU.clone(n)}return n},[n,r])))return el.createElement("group",(0,tW.default)({},c,{ref:t}),n.map(e=>el.createElement(rj,(0,tW.default)({key:e.uuid,object:e},d))),i);let{children:f,...h}=function(e,t){let{keys:r=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData","bindMode","bindMatrix","bindMatrixInverse","skeleton"],deep:n,inject:i,castShadow:a,receiveShadow:o}=t,s={};for(let t of r)s[t]=e[t];return n&&(s.geometry&&"materialsOnly"!==n&&(s.geometry=s.geometry.clone()),s.material&&"geometriesOnly"!==n&&(s.material=s.material.clone())),i&&(s="function"==typeof i?{...s,children:i(e)}:el.isValidElement(i)?{...s,children:i}:{...s,...i}),e instanceof ef.Mesh&&(a&&(s.castShadow=!0),o&&(s.receiveShadow=!0)),s}(n,d),m=n.type[0].toLowerCase()+n.type.slice(1);return el.createElement(m,(0,tW.default)({},h,c,{ref:t}),n.children.map(e=>"Bone"===e.type?el.createElement("primitive",(0,tW.default)({key:e.uuid,object:e},d)):el.createElement(rj,(0,tW.default)({key:e.uuid,object:e},d,{isChild:!0}))),i,f)}),rJ=null,rN="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function rK(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=arguments.length>2?arguments[2]:void 0;return i=>{n&&n(i),e&&(rJ||(rJ=new rO),rJ.setDecoderPath("string"==typeof e?e:rN),i.setDRACOLoader(rJ)),r&&i.setMeshoptDecoder((()=>{let e;if(t)return t;let r=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let i="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(r)&&(i="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");let a=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let r=0;for(let i=0;i{(e=t.instance).exports.__wasm_call_ctors()});function o(t,r,n,i,a,o){let s=e.exports.sbrk,l=n+3&-4,u=s(l*i),c=s(a.length),d=new Uint8Array(e.exports.memory.buffer);d.set(a,c);let f=t(u,n,i,c,a.length);if(0===f&&o&&o(u,l,i),r.set(d.subarray(u,u+n*i)),s(u-s(0)),0!==f)throw Error("Malformed buffer data: ".concat(f))}let s={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:a,supported:!0,decodeVertexBuffer(t,r,n,i,a){o(e.exports.meshopt_decodeVertexBuffer,t,r,n,i,e.exports[s[a]])},decodeIndexBuffer(t,r,n,i){o(e.exports.meshopt_decodeIndexBuffer,t,r,n,i)},decodeIndexSequence(t,r,n,i){o(e.exports.meshopt_decodeIndexSequence,t,r,n,i)},decodeGltfBuffer(t,r,n,i,a,u){o(e.exports[l[a]],t,r,n,i,e.exports[s[u]])}}})())}}let rQ=(e,t,r,n)=>(0,r_.useLoader)(t$,e,rK(t,r,n));rQ.preload=(e,t,r,n)=>r_.useLoader.preload(t$,e,rK(t,r,n)),rQ.clear=e=>r_.useLoader.clear(t$,e),rQ.setDecoderPath=e=>{rN=e};var rW=e.i(89887);function rV(e){var t,r,n,i,a;let{materialName:o,material:s,lightMap:l}=e,u=(0,tw.useDebug)(),c=null!=(n=null==u?void 0:u.debugMode)&&n,d=(0,tM.textureToUrl)(o),f=(0,tT.useTexture)(d,e=>(0,tS.setupColor)(e)),h=new Set(null!=(i=null==s||null==(t=s.userData)?void 0:t.flag_names)?i:[]).has("SelfIlluminating"),m=new Set(null!=(a=null==s||null==(r=s.userData)?void 0:r.surface_flag_names)?a:[]).has("SurfaceOutsideVisible"),p=(0,el.useCallback)(e=>{(0,tR.injectCustomFog)(e,tD.globalFogUniforms),function(e,t){var r,n;let i=null!=(r=null==t?void 0:t.surfaceOutsideVisible)&&r,a=null!=(n=null==t?void 0:t.debugMode)&&n;e.uniforms.useSceneLighting={value:i},e.uniforms.interiorDebugMode={value:a},e.uniforms.interiorDebugColor={value:i?new ef.Vector3(0,.4,1):new ef.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ","#include \n".concat("\nvec3 interiorLinearToSRGB(vec3 linear) {\n vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055;\n vec3 lower = linear * 12.92;\n return mix(lower, higher, step(vec3(0.0031308), linear));\n}\n\nvec3 interiorSRGBToLinear(vec3 srgb) {\n vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4));\n vec3 lower = srgb / 12.92;\n return mix(lower, higher, step(vec3(0.04045), srgb));\n}\n\n// Debug grid overlay function using screen-space derivatives for sharp, anti-aliased lines\n// Returns 1.0 on grid lines, 0.0 elsewhere\nfloat debugGrid(vec2 uv, float gridSize, float lineWidth) {\n vec2 scaledUV = uv * gridSize;\n vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV);\n float line = min(grid.x, grid.y);\n return 1.0 - min(line / lineWidth, 1.0);\n}\n","\nuniform bool useSceneLighting;\nuniform bool interiorDebugMode;\nuniform vec3 interiorDebugColor;\n")),e.fragmentShader=e.fragmentShader.replace("#include ","// Lightmap handled in custom output calculation\n#ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n#endif"),e.fragmentShader=e.fragmentShader.replace("#include ","// Torque-style lighting: output = clamp(lighting × texture, 0, 1) in sRGB space\n// Get texture in sRGB space (undo Three.js linear decode)\nvec3 textureSRGB = interiorLinearToSRGB(diffuseColor.rgb);\n\n// Compute lighting in sRGB space\nvec3 lightingSRGB = vec3(0.0);\n\nif (useSceneLighting) {\n // Three.js computed: reflectedLight = lighting × texture_linear / PI\n // Extract pure lighting: lighting = reflectedLight × PI / texture_linear\n vec3 totalLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 safeTexLinear = max(diffuseColor.rgb, vec3(0.001));\n vec3 extractedLighting = totalLight * PI / safeTexLinear;\n // NOTE: extractedLighting is ALREADY sRGB values because mission sun/ambient colors\n // are sRGB values (Torque used them directly in gamma space). Three.js treats them\n // as linear but the numerical values are the same. DO NOT convert to sRGB here!\n // IMPORTANT: Torque clamps scene lighting to [0,1] BEFORE adding to lightmap\n // (sceneLighting.cc line 1785: tmp.clamp())\n lightingSRGB = clamp(extractedLighting, 0.0, 1.0);\n}\n\n// Add lightmap contribution (for BOTH outside and inside surfaces)\n// In Torque, scene lighting is ADDED to lightmaps for outside surfaces at mission load\n// (stored in .ml files). Inside surfaces only have base lightmap. Both need lightmap here.\n#ifdef USE_LIGHTMAP\n // Lightmap is stored as linear in Three.js (decoded from sRGB texture), convert back\n lightingSRGB += interiorLinearToSRGB(lightMapTexel.rgb);\n#endif\n// Torque clamps the sum to [0,1] per channel (sceneLighting.cc lines 1817-1827)\nlightingSRGB = clamp(lightingSRGB, 0.0, 1.0);\n\n// Torque formula: output = clamp(lighting × texture, 0, 1) in sRGB/gamma space\nvec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0);\n\n// Convert back to linear for Three.js output pipeline\nvec3 resultLinear = interiorSRGBToLinear(resultSRGB);\n\n// Reassign outgoingLight before opaque_fragment consumes it\noutgoingLight = resultLinear + totalEmissiveRadiance;\n\n#include "),e.fragmentShader=e.fragmentShader.replace("#include ","// Debug mode: overlay colored grid on top of normal rendering\n// Blue grid = SurfaceOutsideVisible (receives scene ambient light)\n// Red grid = inside surface (no scene ambient light)\n#ifdef USE_MAP\nif (interiorDebugMode) {\n // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide\n float gridIntensity = debugGrid(vMapUv, 4.0, 1.5);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1);\n}\n#endif\n\n#include ")}(e,{surfaceOutsideVisible:m,debugMode:c})},[m,c]),A="".concat(m,"-").concat(c);return h?(0,es.jsx)("meshBasicMaterial",{map:f,toneMapped:!1,onBeforeCompile:p},A):(0,es.jsx)("meshLambertMaterial",{map:f,lightMap:null!=l?l:void 0,toneMapped:!1,onBeforeCompile:p},A)}function rX(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=ef.SRGBColorSpace),null!=t?t:null}function rq(e){let{node:t}=e,r=(0,el.useMemo)(()=>t.material?Array.isArray(t.material)?t.material.map(e=>rX(e)):[rX(t.material)]:[],[t.material]);return(0,es.jsx)("mesh",{geometry:t.geometry,castShadow:!0,receiveShadow:!0,children:t.material?(0,es.jsx)(el.Suspense,{fallback:(0,es.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(t.material)?t.material.map((e,t)=>(0,es.jsx)(rV,{materialName:e.userData.resource_path,material:e,lightMap:r[t]},t)):(0,es.jsx)(rV,{materialName:t.material.userData.resource_path,material:t.material,lightMap:r[0]})}):null})}let rY=(0,el.memo)(e=>{var t;let{interiorFile:r}=e,{nodes:n}=rQ((0,tM.interiorToUrl)(r)),i=(0,tw.useDebug)(),a=null!=(t=null==i?void 0:i.debugMode)&&t;return(0,es.jsxs)("group",{rotation:[0,-Math.PI/2,0],children:[Object.entries(n).filter(e=>{let[,t]=e;return t.isMesh}).map(e=>{let[t,r]=e;return(0,es.jsx)(rq,{node:r},t)}),a?(0,es.jsx)(rW.FloatingLabel,{children:r}):null]})});function rz(e){let{color:t,label:r}=e;return(0,es.jsxs)("mesh",{children:[(0,es.jsx)("boxGeometry",{args:[10,10,10]}),(0,es.jsx)("meshStandardMaterial",{color:t,wireframe:!0}),r?(0,es.jsx)(rW.FloatingLabel,{color:t,children:r}):null]})}function rZ(e){var t;let{label:r}=e,n=(0,tw.useDebug)();return null!=(t=null==n?void 0:n.debugMode)&&t?(0,es.jsx)(rz,{color:"red",label:r}):null}let r$=(0,el.memo)(function(e){let{object:t}=e,r=(0,tF.getProperty)(t,"interiorFile"),n=(0,el.useMemo)(()=>(0,tF.getPosition)(t),[t]),i=(0,el.useMemo)(()=>(0,tF.getScale)(t),[t]),a=(0,el.useMemo)(()=>(0,tF.getRotation)(t),[t]);return(0,es.jsx)("group",{position:n,quaternion:a,scale:i,children:(0,es.jsx)(tQ,{fallback:(0,es.jsx)(rZ,{label:r}),children:(0,es.jsx)(el.Suspense,{fallback:(0,es.jsx)(rz,{color:"orange"}),children:(0,es.jsx)(rY,{interiorFile:r})})})})});function r0(e,t){let{path:r}=t,[n]=(0,r_.useLoader)(ef.CubeTextureLoader,[e],e=>e.setPath(r));return n}r0.preload=(e,t)=>{let{path:r}=t;return r_.useLoader.preload(ef.CubeTextureLoader,[e],e=>e.setPath(r))};function r1(e){return e.wrapS=ef.RepeatWrapping,e.wrapT=ef.RepeatWrapping,e.minFilter=ef.LinearFilter,e.magFilter=ef.LinearFilter,e.colorSpace=ef.NoColorSpace,e.needsUpdate=!0,e}function r9(e){let{textureUrl:t,radius:r,heightPercent:n,speed:i,windDirection:a,layerIndex:o,debugMode:s,animationEnabled:l}=e,u=(0,el.useRef)(null),c=(0,el.useRef)(new ef.Vector2(0,0)),d=(0,tT.useTexture)(t,r1),f=(0,el.useMemo)(()=>{let e=n-.05;return function(e,t,r,n){let i=new ef.BufferGeometry,a=new Float32Array(75),o=new Float32Array(50),s=[.05,.05,.05,.05,.05,.05,r,r,r,.05,.05,r,t,r,.05,.05,r,r,r,.05,.05,.05,.05,.05,.05],l=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let n=5*t+r,i=-e+r*l,u=e-t*l,c=e*s[n];a[3*n]=i,a[3*n+1]=c,a[3*n+2]=u,o[2*n]=r,o[2*n+1]=t}!function(e){let t=t=>({x:e[3*t],y:e[3*t+1],z:e[3*t+2]}),r=(t,r,n,i)=>{e[3*t]=r,e[3*t+1]=n,e[3*t+2]=i},n=t(1),i=t(3),a=t(5),o=t(6),s=t(8),l=t(9),u=t(15),c=t(16),d=t(18),f=t(19),h=t(21),m=t(23),p=a.x+(n.x-a.x)*.5,A=a.y+(n.y-a.y)*.5,g=a.z+(n.z-a.z)*.5;r(0,o.x+(p-o.x)*2,o.y+(A-o.y)*2,o.z+(g-o.z)*2),p=l.x+(i.x-l.x)*.5,A=l.y+(i.y-l.y)*.5,g=l.z+(i.z-l.z)*.5,r(4,s.x+(p-s.x)*2,s.y+(A-s.y)*2,s.z+(g-s.z)*2),p=h.x+(u.x-h.x)*.5,A=h.y+(u.y-h.y)*.5,g=h.z+(u.z-h.z)*.5,r(20,c.x+(p-c.x)*2,c.y+(A-c.y)*2,c.z+(g-c.z)*2),p=m.x+(f.x-m.x)*.5,A=m.y+(f.y-m.y)*.5,g=m.z+(f.z-m.z)*.5,r(24,d.x+(p-d.x)*2,d.y+(A-d.y)*2,d.z+(g-d.z)*2)}(a);let u=function(e,t){let r=new Float32Array(25);for(let n=0;n<25;n++){let i=e[3*n],a=e[3*n+2],o=1.3-Math.sqrt(i*i+a*a)/t;o<.4?o=0:o>.8&&(o=1),r[n]=o}return r}(a,e),c=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,n=r+1,i=r+5,a=i+1;c.push(r,i,a),c.push(r,a,n)}return i.setIndex(c),i.setAttribute("position",new ef.Float32BufferAttribute(a,3)),i.setAttribute("uv",new ef.Float32BufferAttribute(o,2)),i.setAttribute("alpha",new ef.Float32BufferAttribute(u,1)),i.computeBoundingSphere(),i}(r,n,e,0)},[r,n]),h=(0,el.useMemo)(()=>new ef.ShaderMaterial({uniforms:{cloudTexture:{value:d},uvOffset:{value:new ef.Vector2(0,0)},debugMode:{value:+!!s},layerIndex:{value:o}},vertexShader:"\n attribute float alpha;\n\n uniform vec2 uvOffset;\n\n varying vec2 vUv;\n varying float vAlpha;\n\n void main() {\n // Apply UV offset for scrolling\n vUv = uv + uvOffset;\n vAlpha = alpha;\n\n vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n // Set depth to far plane so clouds are always visible and behind other geometry\n gl_Position = pos.xyww;\n }\n",fragmentShader:"\n uniform sampler2D cloudTexture;\n uniform float debugMode;\n uniform int layerIndex;\n\n varying vec2 vUv;\n varying float vAlpha;\n\n // Debug grid using screen-space derivatives for sharp, anti-aliased lines\n float debugGrid(vec2 uv, float gridSize, float lineWidth) {\n vec2 scaledUV = uv * gridSize;\n vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV);\n float line = min(grid.x, grid.y);\n return 1.0 - min(line / lineWidth, 1.0);\n }\n\n void main() {\n vec4 texColor = texture2D(cloudTexture, vUv);\n\n // Tribes 2 uses GL_MODULATE: final = texture × vertex color\n // Vertex color is white with varying alpha, so:\n // Final RGB = Texture RGB × 1.0 = Texture RGB\n // Final Alpha = Texture Alpha × Vertex Alpha\n float finalAlpha = texColor.a * vAlpha;\n vec3 color = texColor.rgb;\n\n // Debug mode: overlay R/G/B grid for layers 0/1/2\n if (debugMode > 0.5) {\n float gridIntensity = debugGrid(vUv, 4.0, 1.5);\n vec3 gridColor;\n if (layerIndex == 0) {\n gridColor = vec3(1.0, 0.0, 0.0); // Red\n } else if (layerIndex == 1) {\n gridColor = vec3(0.0, 1.0, 0.0); // Green\n } else {\n gridColor = vec3(0.0, 0.0, 1.0); // Blue\n }\n color = mix(color, gridColor, gridIntensity * 0.5);\n }\n\n // Output clouds with texture color and combined alpha\n gl_FragColor = vec4(color, finalAlpha);\n }\n",transparent:!0,depthWrite:!1,side:ef.DoubleSide}),[d,s,o]);return(0,tx.useFrame)((e,t)=>{if(!u.current||!l)return;let r=1e3*t/32;c.current.x+=a.x*i*r,c.current.y+=a.y*i*r,c.current.x=c.current.x-Math.floor(c.current.x),c.current.y=c.current.y-Math.floor(c.current.y),u.current.uniforms.uvOffset.value.copy(c.current)}),(0,el.useEffect)(()=>()=>{f.dispose(),h.dispose()},[f,h]),(0,es.jsx)("mesh",{geometry:f,frustumCulled:!1,renderOrder:10,children:(0,es.jsx)("primitive",{ref:u,object:h,attach:"material"})})}function r2(e){var t,r;let{object:n}=e,{debugMode:i}=(0,tw.useDebug)(),{animationEnabled:a}=(0,tw.useSettings)(),{data:o}=ty({queryKey:["detailMapList",r=(0,tF.getProperty)(n,"materialList")],queryFn:()=>(0,tM.loadDetailMapList)(r),enabled:!!r},tt,void 0),s=.95*(null!=(t=(0,tF.getFloat)(n,"visibleDistance"))?t:500),l=(0,el.useMemo)(()=>{var e,t,r;return[null!=(e=(0,tF.getFloat)(n,"cloudSpeed1"))?e:1e-4,null!=(t=(0,tF.getFloat)(n,"cloudSpeed2"))?t:2e-4,null!=(r=(0,tF.getFloat)(n,"cloudSpeed3"))?r:3e-4]},[n]),u=(0,el.useMemo)(()=>{let e=[.35,.25,.2],t=[];for(let i=0;i<3;i++){var r;let a=null!=(r=(0,tF.getFloat)(n,"cloudHeightPer".concat(i)))?r:e[i];t.push(a)}return t},[n]),c=(0,el.useMemo)(()=>{let e=(0,tF.getProperty)(n,"windVelocity");if(e){let[t,r]=e.split(" ").map(e=>parseFloat(e));if(0!==t||0!==r)return new ef.Vector2(r,-t).normalize()}return new ef.Vector2(1,0)},[n]),d=(0,el.useMemo)(()=>{if(!o)return[];let e=[];for(let n=7;n{let{camera:t}=e;f.current&&f.current.position.copy(t.position)}),d&&0!==d.length)?(0,es.jsx)("group",{ref:f,children:d.map((e,t)=>{let r=(0,tM.textureToUrl)(e.texture);return(0,es.jsx)(el.Suspense,{fallback:null,children:(0,es.jsx)(r9,{textureUrl:r,radius:s,heightPercent:e.height,speed:e.speed,windDirection:c,layerIndex:t,debugMode:i,animationEnabled:a})},t)})}):null}tM.BASE_URL;let r3=!1;function r8(e){if(!e)return;let[t,r,n]=e.split(" ").map(e=>parseFloat(e));return[new ef.Color().setRGB(t,r,n),new ef.Color().setRGB(t,r,n).convertSRGBToLinear()]}function r5(e){let{skyBoxFiles:t,fogColor:r,fogState:n}=e,{camera:i}=(0,tE.useThree)(),a=r0(t,{path:""}),o=(0,el.useMemo)(()=>i.projectionMatrixInverse,[i]),s=(0,el.useMemo)(()=>n?(0,tD.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),l=(0,el.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]);return(0,es.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,es.jsxs)("bufferGeometry",{children:[(0,es.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,es.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,es.jsx)("shaderMaterial",{uniforms:{skybox:{value:a},fogColor:{value:null!=r?r:new ef.Color(0,0,0)},enableFog:{value:!!r},inverseProjectionMatrix:{value:o},cameraMatrixWorld:{value:i.matrixWorld},cameraHeight:tD.globalFogUniforms.cameraHeight,fogVolumeData:{value:s},horizonFogHeight:{value:l}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = vec4(position.xy, 0.9999, 1.0);\n }\n ",fragmentShader:'\n uniform samplerCube skybox;\n uniform vec3 fogColor;\n uniform bool enableFog;\n uniform mat4 inverseProjectionMatrix;\n uniform mat4 cameraMatrixWorld;\n uniform float cameraHeight;\n uniform float fogVolumeData[12];\n uniform float horizonFogHeight;\n\n varying vec2 vUv;\n\n // Convert linear to sRGB for display\n // shaderMaterial does NOT get automatic linear->sRGB output conversion\n // Use proper sRGB transfer function (not simplified gamma 2.2) to match Three.js\n vec3 linearToSRGB(vec3 linear) {\n vec3 low = linear * 12.92;\n vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055;\n return mix(low, high, step(vec3(0.0031308), linear));\n }\n\n void main() {\n vec2 ndc = vUv * 2.0 - 1.0;\n vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0);\n viewPos.xyz /= viewPos.w;\n vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz);\n direction = vec3(direction.z, direction.y, -direction.x);\n // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear\n vec4 skyColor = textureCube(skybox, direction);\n vec3 finalColor;\n\n if (enableFog) {\n vec3 effectiveFogColor = fogColor;\n\n // Calculate how much fog volume the ray passes through\n // For skybox at "infinite" distance, the relevant height is how much\n // of the volume is above/below camera depending on view direction\n float volumeFogInfluence = 0.0;\n\n for (int i = 0; i < 3; i++) {\n int offset = i * 4;\n float volVisDist = fogVolumeData[offset + 0];\n float volMinH = fogVolumeData[offset + 1];\n float volMaxH = fogVolumeData[offset + 2];\n float volPct = fogVolumeData[offset + 3];\n\n if (volVisDist <= 0.0) continue;\n\n // Check if camera is inside this volume\n if (cameraHeight >= volMinH && cameraHeight <= volMaxH) {\n // Camera is inside the fog volume\n // Looking horizontally or up at shallow angles means ray travels\n // through more fog before exiting the volume\n float heightAboveCamera = volMaxH - cameraHeight;\n float heightBelowCamera = cameraHeight - volMinH;\n float volumeHeight = volMaxH - volMinH;\n\n // For horizontal rays (direction.y ≈ 0), maximum fog influence\n // For rays going up steeply, less fog (exits volume quickly)\n // For rays going down, more fog (travels through volume below)\n float rayInfluence;\n if (direction.y >= 0.0) {\n // Looking up: influence based on how steep we\'re looking\n // Shallow angles = long path through fog = high influence\n rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y);\n } else {\n // Looking down: always high fog (into the volume)\n rayInfluence = 1.0;\n }\n\n // Scale by percentage and volume depth factor\n volumeFogInfluence += rayInfluence * volPct;\n }\n }\n\n // Base fog factor from view direction (for haze at horizon)\n // In Torque, the fog "bans" (bands) are rendered as geometry from\n // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox.\n // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3).\n //\n // horizonFogHeight is the direction.y value where the fog band ends:\n // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2)\n //\n // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18\n //\n // Torque renders the fog bands as geometry with linear vertex alpha\n // interpolation. We use a squared curve (t^2) to create a gentler\n // falloff at the top of the gradient, matching Tribes 2\'s appearance.\n float baseFogFactor;\n if (direction.y <= 0.0) {\n // Looking at or below horizon: full fog\n baseFogFactor = 1.0;\n } else if (direction.y >= horizonFogHeight) {\n // Above fog band: no fog\n baseFogFactor = 0.0;\n } else {\n // Within fog band: squared curve for gentler falloff at top\n float t = direction.y / horizonFogHeight;\n baseFogFactor = (1.0 - t) * (1.0 - t);\n }\n\n // Combine base fog with volume fog influence\n // When inside a volume, increase fog intensity\n float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5);\n\n finalColor = mix(skyColor.rgb, effectiveFogColor, finalFogFactor);\n } else {\n finalColor = skyColor.rgb;\n }\n // Convert linear result to sRGB for display\n gl_FragColor = vec4(linearToSRGB(finalColor), 1.0);\n }\n ',depthWrite:!1,depthTest:!1})]})}function r6(e){let{materialList:t,fogColor:r,fogState:n}=e,{data:i}=ty({queryKey:["detailMapList",t],queryFn:()=>(0,tM.loadDetailMapList)(t)},tt,void 0),a=(0,el.useMemo)(()=>i?[(0,tM.textureToUrl)(i[1]),(0,tM.textureToUrl)(i[3]),(0,tM.textureToUrl)(i[4]),(0,tM.textureToUrl)(i[5]),(0,tM.textureToUrl)(i[0]),(0,tM.textureToUrl)(i[2])]:null,[i]);return a?(0,es.jsx)(r5,{skyBoxFiles:a,fogColor:r,fogState:n}):null}function r4(e){let{skyColor:t,fogColor:r,fogState:n}=e,{camera:i}=(0,tE.useThree)(),a=(0,el.useMemo)(()=>i.projectionMatrixInverse,[i]),o=(0,el.useMemo)(()=>n?(0,tD.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),s=(0,el.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]);return(0,es.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,es.jsxs)("bufferGeometry",{children:[(0,es.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,es.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,es.jsx)("shaderMaterial",{uniforms:{skyColor:{value:t},fogColor:{value:null!=r?r:new ef.Color(0,0,0)},enableFog:{value:!!r},inverseProjectionMatrix:{value:a},cameraMatrixWorld:{value:i.matrixWorld},cameraHeight:tD.globalFogUniforms.cameraHeight,fogVolumeData:{value:o},horizonFogHeight:{value:s}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = vec4(position.xy, 0.9999, 1.0);\n }\n ",fragmentShader:"\n uniform vec3 skyColor;\n uniform vec3 fogColor;\n uniform bool enableFog;\n uniform mat4 inverseProjectionMatrix;\n uniform mat4 cameraMatrixWorld;\n uniform float cameraHeight;\n uniform float fogVolumeData[12];\n uniform float horizonFogHeight;\n\n varying vec2 vUv;\n\n // Convert linear to sRGB for display\n vec3 linearToSRGB(vec3 linear) {\n vec3 low = linear * 12.92;\n vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055;\n return mix(low, high, step(vec3(0.0031308), linear));\n }\n\n void main() {\n vec2 ndc = vUv * 2.0 - 1.0;\n vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0);\n viewPos.xyz /= viewPos.w;\n vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz);\n direction = vec3(direction.z, direction.y, -direction.x);\n\n vec3 finalColor;\n\n if (enableFog) {\n // Calculate volume fog influence (same logic as SkyBoxTexture)\n float volumeFogInfluence = 0.0;\n\n for (int i = 0; i < 3; i++) {\n int offset = i * 4;\n float volVisDist = fogVolumeData[offset + 0];\n float volMinH = fogVolumeData[offset + 1];\n float volMaxH = fogVolumeData[offset + 2];\n float volPct = fogVolumeData[offset + 3];\n\n if (volVisDist <= 0.0) continue;\n\n if (cameraHeight >= volMinH && cameraHeight <= volMaxH) {\n float rayInfluence;\n if (direction.y >= 0.0) {\n rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y);\n } else {\n rayInfluence = 1.0;\n }\n volumeFogInfluence += rayInfluence * volPct;\n }\n }\n\n // Base fog factor from view direction\n float baseFogFactor;\n if (direction.y <= 0.0) {\n baseFogFactor = 1.0;\n } else if (direction.y >= horizonFogHeight) {\n baseFogFactor = 0.0;\n } else {\n float t = direction.y / horizonFogHeight;\n baseFogFactor = (1.0 - t) * (1.0 - t);\n }\n\n // Combine base fog with volume fog influence\n float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5);\n\n finalColor = mix(skyColor, fogColor, finalFogFactor);\n } else {\n finalColor = skyColor;\n }\n\n gl_FragColor = vec4(linearToSRGB(finalColor), 1.0);\n }\n ",depthWrite:!1,depthTest:!1})]})}function r7(e,t){let{fogDistance:r,visibleDistance:n}=e;return[r,n]}function ne(e){let{fogState:t}=e,{scene:r,camera:n}=(0,tE.useThree)(),i=(0,el.useRef)(null),a=(0,el.useMemo)(()=>(0,tD.packFogVolumeData)(t.fogVolumes),[t.fogVolumes]);return(0,el.useEffect)(()=>{r3||((0,tR.installCustomFogShader)(),r3=!0)},[]),(0,el.useEffect)(()=>{(0,tD.resetGlobalFogUniforms)();let[e,o]=r7(t,n.position.y),s=new ef.Fog(t.fogColor,e,o);return r.fog=s,i.current=s,(0,tD.updateGlobalFogUniforms)(n.position.y,a),()=>{r.fog=null,i.current=null,(0,tD.resetGlobalFogUniforms)()}},[r,n,t,a]),(0,tx.useFrame)(()=>{let e=i.current;if(!e)return;let r=n.position.y,[o,s]=r7(t,r);e.near=o,e.far=s,e.color.copy(t.fogColor),(0,tD.updateGlobalFogUniforms)(r,a)}),null}let nt=/borg|xorg|porg|dorg|plant|tree|bush|fern|vine|grass|leaf|flower|frond|palm|foliage/i;function nr(e){return nt.test(e)}let nn=(0,el.createContext)(null);function ni(e){let{children:t,shapeName:r,type:n}=e,i=(0,el.useMemo)(()=>nr(r),[r]),a=(0,el.useMemo)(()=>({shapeName:r,type:n,isOrganic:i}),[r,n,i]);return(0,es.jsx)(nn.Provider,{value:a,children:t})}var na=e.i(51475);let no=new Map,ns={directional:1,ambient:1.5};function nl(e){e.onBeforeCompile=t=>{(0,tR.injectCustomFog)(t,tD.globalFogUniforms),e instanceof ef.MeshLambertMaterial&&(t.uniforms.shapeDirectionalFactor={value:ns.directional},t.uniforms.shapeAmbientFactor={value:ns.ambient},t.fragmentShader=t.fragmentShader.replace("#include ","#include \nuniform float shapeDirectionalFactor;\nuniform float shapeAmbientFactor;\n"),t.fragmentShader=t.fragmentShader.replace("#include ","#include \n // Apply shape-specific lighting multipliers\n reflectedLight.directDiffuse *= shapeDirectionalFactor;\n reflectedLight.indirectDiffuse *= shapeAmbientFactor;\n"))}}function nu(e,t,r,n){let i=r.has("Translucent"),a=r.has("Additive"),o=r.has("SelfIlluminating");if(r.has("NeverEnvMap"),o){let e=new ef.MeshBasicMaterial({map:t,side:2,transparent:a,alphaTest:.5*!a,blending:a?ef.AdditiveBlending:void 0,fog:!0});return nl(e),e}if(n||i){let e={map:t,transparent:!1,alphaTest:.5,reflectivity:0},r=new ef.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),n=new ef.MeshLambertMaterial({...e,side:0});return nl(r),nl(n),[r,n]}let s=new ef.MeshLambertMaterial({map:t,side:2,reflectivity:0});return nl(s),s}let nc=(0,el.memo)(function(e){var t;let{material:r,shapeName:n,geometry:i,backGeometry:a,castShadow:o=!1,receiveShadow:s=!1}=e,l=r.userData.resource_path,u=new Set(null!=(t=r.userData.flag_names)?t:[]),c=function(e){let{animationEnabled:t}=(0,tw.useSettings)(),{data:r}=ty({queryKey:["ifl",e],queryFn:()=>(0,tM.loadImageFrameList)(e),enabled:!0,suspense:!0,throwOnError:tB,placeholderData:void 0},tt,void 0),n=(0,el.useMemo)(()=>r.map(t=>(0,tM.iflTextureToUrl)(t.name,e)),[r,e]),i=(0,tT.useTexture)(n),a=(0,el.useMemo)(()=>{var t;let n,a=no.get(e);return a||(a=function(e){let t=e[0].image.width,r=e[0].image.height,n=e.length,i=Math.ceil(Math.sqrt(n)),a=Math.ceil(n/i),o=document.createElement("canvas");o.width=t*i,o.height=r*a;let s=o.getContext("2d");e.forEach((e,n)=>{let a=Math.floor(n/i);s.drawImage(e.image,n%i*t,a*r)});let l=new ef.CanvasTexture(o);return l.colorSpace=ef.SRGBColorSpace,l.generateMipmaps=!1,l.minFilter=ef.NearestFilter,l.magFilter=ef.NearestFilter,l.wrapS=ef.ClampToEdgeWrapping,l.wrapT=ef.ClampToEdgeWrapping,l.repeat.set(1/i,1/a),{texture:l,columns:i,rows:a,frameCount:n,frameStartTicks:[],totalTicks:0,lastFrame:-1}}(i),no.set(e,a)),n=0,(t=a).frameStartTicks=r.map(e=>{let t=n;return n+=e.frameCount,t}),t.totalTicks=n,a},[e,i,r]);return(0,na.useTick)(e=>{let r=t?function(e,t){if(0===e.totalTicks)return 0;let r=t%e.totalTicks,{frameStartTicks:n}=e;for(let e=n.length-1;e>=0;e--)if(r>=n[e])return e;return 0}(a,e):0;!function(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,n=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,n/e.rows)}(a,r)}),a.texture}("textures/".concat(l,".ifl")),d=n&&nr(n),f=(0,el.useMemo)(()=>nu(r,c,u,d),[r,c,u,d]);return Array.isArray(f)?(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)("mesh",{geometry:a||i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:f[0],attach:"material"})}),(0,es.jsx)("mesh",{geometry:i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:f[1],attach:"material"})})]}):(0,es.jsx)("mesh",{geometry:i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:f,attach:"material"})})}),nd=(0,el.memo)(function(e){var t;let{material:r,shapeName:n,geometry:i,backGeometry:a,castShadow:o=!1,receiveShadow:s=!1}=e,l=r.userData.resource_path,u=new Set(null!=(t=r.userData.flag_names)?t:[]),c=(0,el.useMemo)(()=>(l||console.warn('No resource_path was found on "'.concat(n,'" - rendering fallback.')),l?(0,tM.textureToUrl)(l):tM.FALLBACK_TEXTURE_URL),[l,n]),d=n&&nr(n),f=u.has("Translucent"),h=(0,tT.useTexture)(c,e=>d||f?(0,tS.setupAlphaTestedTexture)(e):(0,tS.setupColor)(e)),m=(0,el.useMemo)(()=>nu(r,h,u,d),[r,h,u,d]);return Array.isArray(m)?(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)("mesh",{geometry:a||i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:m[0],attach:"material"})}),(0,es.jsx)("mesh",{geometry:i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:m[1],attach:"material"})})]}):(0,es.jsx)("mesh",{geometry:i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:m,attach:"material"})})}),nf=(0,el.memo)(function(e){var t;let{material:r,shapeName:n,geometry:i,backGeometry:a,castShadow:o=!1,receiveShadow:s=!1}=e,l=new Set(null!=(t=r.userData.flag_names)?t:[]).has("IflMaterial"),u=r.userData.resource_path;return l&&u?(0,es.jsx)(nc,{material:r,shapeName:n,geometry:i,backGeometry:a,castShadow:o,receiveShadow:s}):r.name?(0,es.jsx)(nd,{material:r,shapeName:n,geometry:i,backGeometry:a,castShadow:o,receiveShadow:s}):null});function nh(e){let{color:t,label:r}=e;return(0,es.jsxs)("mesh",{children:[(0,es.jsx)("boxGeometry",{args:[10,10,10]}),(0,es.jsx)("meshStandardMaterial",{color:t,wireframe:!0}),r?(0,es.jsx)(rW.FloatingLabel,{color:t,children:r}):null]})}function nm(e){let{color:t,label:r}=e,{debugMode:n}=(0,tw.useDebug)();return n?(0,es.jsx)(nh,{color:t,label:r}):null}function np(e){let{shapeName:t,loadingColor:r="yellow",children:n}=e;return t?(0,es.jsx)(tQ,{fallback:(0,es.jsx)(nm,{color:"red",label:t}),children:(0,es.jsxs)(el.Suspense,{fallback:(0,es.jsx)(nh,{color:r}),children:[(0,es.jsx)(nA,{}),n]})}):(0,es.jsx)(nm,{color:"orange"})}let nA=(0,el.memo)(function(){let{shapeName:e,isOrganic:t}=(0,el.useContext)(nn),{debugMode:r}=(0,tw.useDebug)(),{nodes:n}=rQ((0,tM.shapeToUrl)(e)),i=(0,el.useMemo)(()=>{let e=Object.values(n).filter(e=>e.skeleton);if(e.length>0){var t=e[0].skeleton;let r=new Set;return t.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&r.add(t)}),r}return new Set},[n]),a=(0,el.useMemo)(()=>Object.entries(n).filter(e=>{let[t,r]=e;return r.material&&"Unassigned"!==r.material.name&&!r.name.match(/^Hulk/i)}).map(e=>{let[r,n]=e,a=function(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,n=e.attributes.skinWeight,i=e.index,a=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(o)){a[e]=!0;break}}if(i){let t=[],r=i.array;for(let e=0;e1){let t=0,r=0,n=0;for(let a of e)t+=i[3*a],r+=i[3*a+1],n+=i[3*a+2];let a=Math.sqrt(t*t+r*r+n*n);for(let o of(a>0&&(t/=a,r/=a,n/=a),e))i[3*o]=t,i[3*o+1]=r,i[3*o+2]=n}if(r.needsUpdate=!0,t){let e=(o=a.clone()).attributes.normal,t=e.array;for(let e=0;e{let{node:r,geometry:n,backGeometry:i}=t;return(0,es.jsx)(el.Suspense,{fallback:(0,es.jsx)("mesh",{geometry:n,children:(0,es.jsx)("meshStandardMaterial",{color:"gray",wireframe:!0})}),children:r.material?Array.isArray(r.material)?r.material.map((t,r)=>(0,es.jsx)(nf,{material:t,shapeName:e,geometry:n,backGeometry:i,castShadow:o,receiveShadow:o},r)):(0,es.jsx)(nf,{material:r.material,shapeName:e,geometry:n,backGeometry:i,castShadow:o,receiveShadow:o}):null},r.id)}),r?(0,es.jsx)(rW.FloatingLabel,{children:e}):null]})});var ng=e.i(6112);let nv={1:"Storm",2:"Inferno"},nB=(0,el.createContext)(null);function nC(){let e=(0,el.useContext)(nB);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function ny(e){let{children:t}=e,{camera:r}=(0,tE.useThree)(),[n,i]=(0,el.useState)(0),[a,o]=(0,el.useState)({}),s=(0,el.useCallback)(e=>{o(t=>({...t,[e.id]:e}))},[]),l=(0,el.useCallback)(e=>{o(t=>{let{[e.id]:r,...n}=t;return n})},[]),u=Object.keys(a).length,c=(0,el.useCallback)(()=>{i(e=>0===u?0:(e+1)%u)},[u]),d=(0,el.useCallback)(e=>{e>=0&&e{if(n({registerCamera:s,unregisterCamera:l,nextCamera:c,setCameraIndex:d,cameraCount:u}),[s,l,c,d,u]);return(0,es.jsx)(nB.Provider,{value:f,children:t})}let nb=(0,el.lazy)(()=>e.A(61921).then(e=>({default:e.AudioEmitter}))),nM={AudioEmitter:function(e){let{audioEnabled:t}=(0,tw.useSettings)();return t?(0,es.jsx)(nb,{...e}):null},Camera:function(e){let{object:t}=e,{registerCamera:r,unregisterCamera:n}=nC(),i=(0,el.useId)(),a=(0,tF.getProperty)(t,"dataBlock"),o=(0,el.useMemo)(()=>(0,tF.getPosition)(t),[t]),s=(0,el.useMemo)(()=>(0,tF.getRotation)(t),[t]);return(0,el.useEffect)(()=>{if("Observer"===a){let e={id:i,position:new ef.Vector3(...o),rotation:s};return r(e),()=>{n(e)}}},[i,a,r,n,o,s]),null},ForceFieldBare:(0,el.lazy)(()=>e.A(25147).then(e=>({default:e.ForceFieldBare}))),InteriorInstance:r$,Item:function(e){var t,r;let{object:n}=e,i=tj(),a=null!=(t=(0,tF.getProperty)(n,"dataBlock"))?t:"",o=(0,ng.useDatablock)(a),s=(0,el.useMemo)(()=>(0,tF.getPosition)(n),[n]),l=(0,el.useMemo)(()=>(0,tF.getScale)(n),[n]),u=(0,el.useMemo)(()=>(0,tF.getRotation)(n),[n]),c=(0,tF.getProperty)(o,"shapeFile");c||console.error(" missing shape for datablock: ".concat(a));let d=(null==a?void 0:a.toLowerCase())==="flag",f=null!=(r=null==i?void 0:i.team)?r:null,h=f&&f>0?nv[f]:null,m=d&&h?"".concat(h," Flag"):null;return(0,es.jsx)(ni,{shapeName:c,type:"Item",children:(0,es.jsx)("group",{position:s,quaternion:u,scale:l,children:(0,es.jsx)(np,{shapeName:c,loadingColor:"pink",children:m?(0,es.jsx)(rW.FloatingLabel,{opacity:.6,children:m}):null})})})},SimGroup:function(e){var t;let{object:r}=e,n=tj(),i=(0,el.useMemo)(()=>{let e=null,t=!1;if(n&&n.hasTeams){if(t=!0,null!=n.team)e=n.team;else if(r._name){let t=r._name.match(/^team(\d+)$/i);t&&(e=parseInt(t[1],10))}}else r._name&&(t="teams"===r._name.toLowerCase());return{object:r,parent:n,hasTeams:t,team:e}},[r,n]);return(0,es.jsx)(tU.Provider,{value:i,children:(null!=(t=r._children)?t:[]).map((e,t)=>nx(e,t))})},Sky:function(e){var t;let{object:r}=e,{fogEnabled:n,highQualityFog:i}=(0,tw.useSettings)(),a=(0,tF.getProperty)(r,"materialList"),o=(0,el.useMemo)(()=>r8((0,tF.getProperty)(r,"SkySolidColor")),[r]),s=null!=(t=(0,tF.getInt)(r,"useSkyTextures"))?t:1,l=(0,el.useMemo)(()=>(function(e){var t,r;let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=null!=(t=(0,tF.getFloat)(e,"fogDistance"))?t:0,a=null!=(r=(0,tF.getFloat)(e,"visibleDistance"))?r:1e3,o=(0,tF.getFloat)(e,"high_fogDistance"),s=(0,tF.getFloat)(e,"high_visibleDistance"),l=n&&null!=o&&o>0?o:i,u=n&&null!=s&&s>0?s:a,c=function(e){if(!e)return new ef.Color(.5,.5,.5);let[t,r,n]=e.split(" ").map(e=>parseFloat(e));return new ef.Color().setRGB(t,r,n).convertSRGBToLinear()}((0,tF.getProperty)(e,"fogColor")),d=[];for(let t=1;t<=3;t++){let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return null;let r=e.split(" ").map(e=>parseFloat(e));if(r.length<3)return null;let[n,i,a]=r;return n<=0||a<=i?null:{visibleDistance:n,minHeight:i,maxHeight:a,percentage:Math.max(0,Math.min(1,t))}}((0,tF.getProperty)(e,"fogVolume".concat(t)),1);r&&d.push(r)}let f=d.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:l,visibleDistance:u,fogColor:c,fogVolumes:d,fogLine:f,enabled:u>l}})(r,i),[r,i]),u=(0,el.useMemo)(()=>r8((0,tF.getProperty)(r,"fogColor")),[r]),c=o||u,d=l.enabled&&n,f=l.fogColor,{scene:h,gl:m}=(0,tE.useThree)();(0,el.useEffect)(()=>{if(d){let e=f.clone();h.background=e,m.setClearColor(e)}else if(c){let e=c[0].clone();h.background=e,m.setClearColor(e)}else h.background=null;return()=>{h.background=null}},[h,m,d,f,c]);let p=null==o?void 0:o[1];return(0,es.jsxs)(es.Fragment,{children:[a&&s?(0,es.jsx)(el.Suspense,{fallback:null,children:(0,es.jsx)(r6,{materialList:a,fogColor:d?f:void 0,fogState:d?l:void 0},a)}):p?(0,es.jsx)(r4,{skyColor:p,fogColor:d?f:void 0,fogState:d?l:void 0}):null,(0,es.jsx)(el.Suspense,{children:(0,es.jsx)(r2,{object:r})}),d?(0,es.jsx)(ne,{fogState:l}):null]})},StaticShape:function(e){var t;let{object:r}=e,n=null!=(t=(0,tF.getProperty)(r,"dataBlock"))?t:"",i=(0,ng.useDatablock)(n),a=(0,el.useMemo)(()=>(0,tF.getPosition)(r),[r]),o=(0,el.useMemo)(()=>(0,tF.getRotation)(r),[r]),s=(0,el.useMemo)(()=>(0,tF.getScale)(r),[r]),l=(0,tF.getProperty)(i,"shapeFile");return l||console.error(" missing shape for datablock: ".concat(n)),(0,es.jsx)(ni,{shapeName:l,type:"StaticShape",children:(0,es.jsx)("group",{position:a,quaternion:o,scale:s,children:(0,es.jsx)(np,{shapeName:l})})})},Sun:function(e){let{object:t}=e,r=(0,el.useMemo)(()=>{var e;let[r,n,i]=(null!=(e=(0,tF.getProperty)(t,"direction"))?e:"0.57735 0.57735 -0.57735").split(" ").map(e=>parseFloat(e)),a=Math.sqrt(r*r+i*i+n*n);return new ef.Vector3(r/a,i/a,n/a)},[t]),n=(0,el.useMemo)(()=>new ef.Vector3(-(5e3*r.x),-(5e3*r.y),-(5e3*r.z)),[r]),i=(0,el.useMemo)(()=>{var e;let[r,n,i]=(null!=(e=(0,tF.getProperty)(t,"color"))?e:"0.7 0.7 0.7 1").split(" ").map(e=>parseFloat(e));return new ef.Color(r,n,i)},[t]),a=(0,el.useMemo)(()=>{var e;let[r,n,i]=(null!=(e=(0,tF.getProperty)(t,"ambient"))?e:"0.5 0.5 0.5 1").split(" ").map(e=>parseFloat(e));return new ef.Color(r,n,i)},[t]);return(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)("directionalLight",{position:n,color:i,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4}),(0,es.jsx)("ambientLight",{color:a,intensity:1})]})},TerrainBlock:t_,TSStatic:function(e){let{object:t}=e,r=(0,tF.getProperty)(t,"shapeName"),n=(0,el.useMemo)(()=>(0,tF.getPosition)(t),[t]),i=(0,el.useMemo)(()=>(0,tF.getRotation)(t),[t]),a=(0,el.useMemo)(()=>(0,tF.getScale)(t),[t]);return r||console.error(" missing shapeName for object",t),(0,es.jsx)(ni,{shapeName:r,type:"TSStatic",children:(0,es.jsx)("group",{position:n,quaternion:i,scale:a,children:(0,es.jsx)(np,{shapeName:r})})})},Turret:function(e){var t;let{object:r}=e,n=null!=(t=(0,tF.getProperty)(r,"dataBlock"))?t:"",i=(0,tF.getProperty)(r,"initialBarrel"),a=(0,ng.useDatablock)(n),o=(0,ng.useDatablock)(i),s=(0,el.useMemo)(()=>(0,tF.getPosition)(r),[r]),l=(0,el.useMemo)(()=>(0,tF.getRotation)(r),[r]),u=(0,el.useMemo)(()=>(0,tF.getScale)(r),[r]),c=(0,tF.getProperty)(a,"shapeFile"),d=(0,tF.getProperty)(o,"shapeFile");return c||console.error(" missing shape for datablock: ".concat(n)),i&&!d&&console.error(" missing shape for barrel datablock: ".concat(i)),(0,es.jsx)(ni,{shapeName:c,type:"Turret",children:(0,es.jsxs)("group",{position:s,quaternion:l,scale:u,children:[(0,es.jsx)(np,{shapeName:c}),d?(0,es.jsx)(ni,{shapeName:d,type:"Turret",children:(0,es.jsx)("group",{position:[0,1.5,0],children:(0,es.jsx)(np,{shapeName:d})})}):null]})})},WaterBlock:(0,el.lazy)(()=>e.A(18599).then(e=>({default:e.WaterBlock}))),WayPoint:function(e){let{object:t}=e;tj();let r=(0,el.useMemo)(()=>(0,tF.getPosition)(t),[t]),n=(0,tF.getProperty)(t,"name");return n?(0,es.jsx)(rW.FloatingLabel,{position:r,opacity:.6,children:n}):null}};function nx(e,t){let r=nM[e._className];return r?(0,es.jsx)(el.Suspense,{children:(0,es.jsx)(r,{object:e})},t):null}var nE=e.i(86608),nF=e.i(38433),nS=e.i(33870),nT=e.i(91996);let nw=async e=>{let t;try{t=(0,tM.getUrlForPath)(e)}catch(t){return console.warn("Script not in manifest: ".concat(e," (").concat(t,")")),null}try{let r=await fetch(t);if(!r.ok)return console.error("Script fetch failed: ".concat(e," (").concat(r.status,")")),null;return await r.text()}catch(t){return console.error("Script fetch error: ".concat(e)),console.error(t),null}},nR=(0,nS.createScriptCache)(),nD={findFiles:e=>{let t=(0,tb.default)(e,{nocase:!0});return(0,nT.getResourceList)().filter(e=>t(e)).map(e=>{let[t,r]=(0,nT.getSourceAndPath)(e);return r})},isFile:e=>null!=(0,nT.getResourceMap)()[(0,nT.getResourceKey)(e)]},nI=(0,el.memo)(function(e){let{name:t,onLoadingChange:r}=e,{data:n}=ty({queryKey:["parsedMission",t],queryFn:()=>(0,tM.loadMission)(t)},tt,void 0),{missionGroup:i,runtime:a,progress:o}=function(e,t){let[r,n]=(0,el.useState)({missionGroup:void 0,runtime:void 0,progress:0});return(0,el.useEffect)(()=>{if(!t)return;let r=new AbortController,i=t.missionTypes[0],a=(0,nF.createProgressTracker)(),o=()=>{n(e=>({...e,progress:a.progress}))};a.on("update",o);let{runtime:s}=(0,nE.runServer)({missionName:e,missionType:i,runtimeOptions:{loadScript:nw,fileSystem:nD,cache:nR,signal:r.signal,progress:a,ignoreScripts:["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]},onMissionLoadDone:()=>{n({missionGroup:s.getObjectByName("MissionGroup"),runtime:s,progress:1})}});return()=>{a.off("update",o),r.abort(),s.destroy()}},[e,t]),r}(t,n),s=!i||!a;return((0,el.useEffect)(()=>{null==r||r(s,o)},[s,o,r]),s)?null:(0,es.jsx)(tH.RuntimeProvider,{runtime:a,children:nx(i)})});function nG(e,t){var r=eB(e,t,"update");if(r.set){if(!r.get)throw TypeError("attempted to read set only private field");return"__destrWrapper"in r||(r.__destrWrapper={set value(v){r.set.call(e,v)},get value(){return r.get.call(e)}}),r.__destrWrapper}if(!r.writable)throw TypeError("attempted to set read only private field");return r}var nL=(K=new WeakMap,class extends eF{build(e,t,r){var n;let i=t.queryKey,a=null!=(n=t.queryHash)?n:eO(i,t),o=this.get(a);return o||(o=new e5({client:e,queryKey:i,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){eC(this,K).has(e.queryHash)||(eC(this,K).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=eC(this,K).get(e.queryHash);t&&(e.destroy(),t===e&&eC(this,K).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){eZ.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return eC(this,K).get(e)}getAll(){return[...eC(this,K).values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>eP(t,e))}findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.getAll();return Object.keys(e).length>0?t.filter(t=>eP(e,t)):t}notify(e){eZ.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){eZ.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){eZ.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}constructor(e={}){super(),eb(this,K,{writable:!0,value:void 0}),this.config=e,eM(this,K,new Map)}}),nP=(Q=new WeakMap,W=new WeakMap,V=new WeakMap,X=new WeakMap,q=new WeakSet,class extends e8{setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){eC(this,W).includes(e)||(eC(this,W).push(e),this.clearGcTimeout(),eC(this,V).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){eM(this,W,eC(this,W).filter(t=>t!==e)),this.scheduleGc(),eC(this,V).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){eC(this,W).length||("pending"===this.state.status?this.scheduleGc():eC(this,V).remove(this))}continue(){var e,t;return null!=(t=null==(e=eC(this,X))?void 0:e.continue())?t:this.execute(this.state.variables)}async execute(e){var t,r,n,i,a,o,s,l,u,c,d,f,h,m,p,A,g,B,C,y,b;let M=()=>{ex(this,q,nH).call(this,{type:"continue"})},x={client:eC(this,Q),meta:this.options.meta,mutationKey:this.options.mutationKey};eM(this,X,e3({fn:()=>this.options.mutationFn?this.options.mutationFn(e,x):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{ex(this,q,nH).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{ex(this,q,nH).call(this,{type:"pause"})},onContinue:M,retry:null!=(t=this.options.retry)?t:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>eC(this,V).canRun(this)}));let E="pending"===this.state.status,F=!eC(this,X).canStart();try{if(E)M();else{ex(this,q,nH).call(this,{type:"pending",variables:e,isPaused:F}),await (null==(c=(d=eC(this,V).config).onMutate)?void 0:c.call(d,e,this,x));let t=await (null==(f=(h=this.options).onMutate)?void 0:f.call(h,e,x));t!==this.state.context&&ex(this,q,nH).call(this,{type:"pending",context:t,variables:e,isPaused:F})}let t=await eC(this,X).start();return await (null==(r=(n=eC(this,V).config).onSuccess)?void 0:r.call(n,t,e,this.state.context,this,x)),await (null==(i=(a=this.options).onSuccess)?void 0:i.call(a,t,e,this.state.context,x)),await (null==(o=(s=eC(this,V).config).onSettled)?void 0:o.call(s,t,null,this.state.variables,this.state.context,this,x)),await (null==(l=(u=this.options).onSettled)?void 0:l.call(u,t,null,e,this.state.context,x)),ex(this,q,nH).call(this,{type:"success",data:t}),t}catch(t){try{throw await (null==(m=(p=eC(this,V).config).onError)?void 0:m.call(p,t,e,this.state.context,this,x)),await (null==(A=(g=this.options).onError)?void 0:A.call(g,t,e,this.state.context,x)),await (null==(B=(C=eC(this,V).config).onSettled)?void 0:B.call(C,void 0,t,this.state.variables,this.state.context,this,x)),await (null==(y=(b=this.options).onSettled)?void 0:y.call(b,void 0,t,e,this.state.context,x)),t}finally{ex(this,q,nH).call(this,{type:"error",error:t})}}finally{eC(this,V).runNext(this)}}constructor(e){super(),eE(this,q),eb(this,Q,{writable:!0,value:void 0}),eb(this,W,{writable:!0,value:void 0}),eb(this,V,{writable:!0,value:void 0}),eb(this,X,{writable:!0,value:void 0}),eM(this,Q,e.client),this.mutationId=e.mutationId,eM(this,V,e.mutationCache),eM(this,W,[]),this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}});function nH(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),eZ.batch(()=>{eC(this,W).forEach(t=>{t.onMutationUpdate(e)}),eC(this,V).notify({mutation:this,type:"updated",action:e})})}var nO=(Y=new WeakMap,z=new WeakMap,Z=new WeakMap,class extends eF{build(e,t,r){let n=new nP({client:e,mutationCache:this,mutationId:++nG(this,Z).value,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){eC(this,Y).add(e);let t=nk(e);if("string"==typeof t){let r=eC(this,z).get(t);r?r.push(e):eC(this,z).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(eC(this,Y).delete(e)){let t=nk(e);if("string"==typeof t){let r=eC(this,z).get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&eC(this,z).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=nk(e);if("string"!=typeof t)return!0;{let r=eC(this,z).get(t),n=null==r?void 0:r.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=nk(e);if("string"!=typeof t)return Promise.resolve();{var r,n;let i=null==(r=eC(this,z).get(t))?void 0:r.find(t=>t!==e&&t.state.isPaused);return null!=(n=null==i?void 0:i.continue())?n:Promise.resolve()}}clear(){eZ.batch(()=>{eC(this,Y).forEach(e=>{this.notify({type:"removed",mutation:e})}),eC(this,Y).clear(),eC(this,z).clear()})}getAll(){return Array.from(eC(this,Y))}find(e){let t={exact:!0,...e};return this.getAll().find(e=>eH(t,e))}findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().filter(t=>eH(e,t))}notify(e){eZ.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return eZ.batch(()=>Promise.all(e.map(e=>e.continue().catch(eR))))}constructor(e={}){super(),eb(this,Y,{writable:!0,value:void 0}),eb(this,z,{writable:!0,value:void 0}),eb(this,Z,{writable:!0,value:void 0}),this.config=e,eM(this,Y,new Set),eM(this,z,new Map),eM(this,Z,0)}});function nk(e){var t;return null==(t=e.options.scope)?void 0:t.id}function n_(e){return{onFetch:(t,r)=>{var n,i,a,o,s;let l=t.options,u=null==(a=t.fetchOptions)||null==(i=a.meta)||null==(n=i.fetchMore)?void 0:n.direction,c=(null==(o=t.state.data)?void 0:o.pages)||[],d=(null==(s=t.state.data)?void 0:s.pageParams)||[],f={pages:[],pageParams:[]},h=0,m=async()=>{let r=!1,n=eq(t.options,t.fetchOptions),i=async(e,i,a)=>{if(r)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let o=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:a?"backward":"forward",meta:t.options.meta};return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)}),e})(),s=await n(o),{maxPages:l}=t.options,u=a?eV:eW;return{pages:u(e.pages,s,l),pageParams:u(e.pageParams,i,l)}};if(u&&c.length){let e="backward"===u,t={pages:c,pageParams:d},r=(e?function(e,t){var r;let{pages:n,pageParams:i}=t;return n.length>0?null==(r=e.getPreviousPageParam)?void 0:r.call(e,n[0],n,i[0],i):void 0}:nU)(l,t);f=await i(t,r,e)}else{let t=null!=e?e:c.length;do{var a;let e=0===h?null!=(a=d[0])?a:l.initialPageParam:nU(l,f);if(h>0&&null==e)break;f=await i(f,e),h++}while(h{var e,n;return null==(e=(n=t.options).persister)?void 0:e.call(n,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=m}}}function nU(e,t){let{pages:r,pageParams:n}=t,i=r.length-1;return r.length>0?e.getNextPageParam(r[i],r,n[i],n):void 0}var nj=($=new WeakMap,ee=new WeakMap,et=new WeakMap,er=new WeakMap,en=new WeakMap,ei=new WeakMap,ea=new WeakMap,eo=new WeakMap,class{mount(){nG(this,ei).value++,1===eC(this,ei)&&(eM(this,ea,eY.subscribe(async e=>{e&&(await this.resumePausedMutations(),eC(this,$).onFocus())})),eM(this,eo,e$.subscribe(async e=>{e&&(await this.resumePausedMutations(),eC(this,$).onOnline())})))}unmount(){var e,t;nG(this,ei).value--,0===eC(this,ei)&&(null==(e=eC(this,ea))||e.call(this),eM(this,ea,void 0),null==(t=eC(this,eo))||t.call(this),eM(this,eo,void 0))}isFetching(e){return eC(this,$).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return eC(this,ee).findAll({...e,status:"pending"}).length}getQueryData(e){var t;let r=this.defaultQueryOptions({queryKey:e});return null==(t=eC(this,$).get(r.queryHash))?void 0:t.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=eC(this,$).build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(eG(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return eC(this,$).findAll(e).map(e=>{let{queryKey:t,state:r}=e;return[t,r.data]})}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),i=eC(this,$).get(n.queryHash),a=null==i?void 0:i.state.data,o="function"==typeof t?t(a):t;if(void 0!==o)return eC(this,$).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return eZ.batch(()=>eC(this,$).findAll(e).map(e=>{let{queryKey:n}=e;return[n,this.setQueryData(n,t,r)]}))}getQueryState(e){var t;let r=this.defaultQueryOptions({queryKey:e});return null==(t=eC(this,$).get(r.queryHash))?void 0:t.state}removeQueries(e){let t=eC(this,$);eZ.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=eC(this,$);return eZ.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={revert:!0,...t};return Promise.all(eZ.batch(()=>eC(this,$).findAll(e).map(e=>e.cancel(r)))).then(eR).catch(eR)}invalidateQueries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return eZ.batch(()=>{var r,n;return(eC(this,$).findAll(e).forEach(e=>{e.invalidate()}),(null==e?void 0:e.refetchType)==="none")?Promise.resolve():this.refetchQueries({...e,type:null!=(n=null!=(r=null==e?void 0:e.refetchType)?r:null==e?void 0:e.type)?n:"active"},t)})}refetchQueries(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={...r,cancelRefetch:null==(t=r.cancelRefetch)||t};return Promise.all(eZ.batch(()=>eC(this,$).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(eR)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(eR)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=eC(this,$).build(this,t);return r.isStaleByTime(eG(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(eR).catch(eR)}fetchInfiniteQuery(e){return e.behavior=n_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(eR).catch(eR)}ensureInfiniteQueryData(e){return e.behavior=n_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return e$.isOnline()?eC(this,ee).resumePausedMutations():Promise.resolve()}getQueryCache(){return eC(this,$)}getMutationCache(){return eC(this,ee)}getDefaultOptions(){return eC(this,et)}setDefaultOptions(e){eM(this,et,e)}setQueryDefaults(e,t){eC(this,er).set(ek(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...eC(this,er).values()],r={};return t.forEach(t=>{e_(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){eC(this,en).set(ek(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...eC(this,en).values()],r={};return t.forEach(t=>{e_(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...eC(this,et).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=eO(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===eX&&(t.enabled=!1),t}defaultMutationOptions(e){return(null==e?void 0:e._defaulted)?e:{...eC(this,et).mutations,...(null==e?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){eC(this,$).clear(),eC(this,ee).clear()}constructor(e={}){eb(this,$,{writable:!0,value:void 0}),eb(this,ee,{writable:!0,value:void 0}),eb(this,et,{writable:!0,value:void 0}),eb(this,er,{writable:!0,value:void 0}),eb(this,en,{writable:!0,value:void 0}),eb(this,ei,{writable:!0,value:void 0}),eb(this,ea,{writable:!0,value:void 0}),eb(this,eo,{writable:!0,value:void 0}),eM(this,$,e.queryCache||new nL),eM(this,ee,e.mutationCache||new nO),eM(this,et,e.defaultOptions||{}),eM(this,er,new Map),eM(this,en,new Map),eM(this,ei,0)}}),nJ=e.i(8155);let nN=e=>e,nK=e=>{let t=(0,nJ.createStore)(e),r=e=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nN,r=el.default.useSyncExternalStore(e.subscribe,el.default.useCallback(()=>t(e.getState()),[e,t]),el.default.useCallback(()=>t(e.getInitialState()),[e,t]));return el.default.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},nQ=el.createContext(null);function nW(e){let{map:t,children:r,onChange:n,domElement:i}=e,a=t.map(e=>e.name+e.keys).join("-"),o=el.useMemo(()=>{let e,r;return e=()=>t.reduce((e,t)=>({...e,[t.name]:!1}),{}),(r=(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let a=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,o=e(n.getState());a=r=>{let n=e(r);if(!i(o,n)){let e=o;t(o=n,e)}},(null==r?void 0:r.fireImmediately)&&t(o,o)}return i(a)},e(t,r,n)})?nK(r):nK},[a]),s=el.useMemo(()=>[o.subscribe,o.getState,o],[a]),l=o.setState;return el.useEffect(()=>{let e=t.map(e=>{let{name:t,keys:r,up:i}=e;return{keys:r,up:i,fn:e=>{l({[t]:e}),n&&n(t,e,s[1]())}}}).reduce((e,t)=>{let{keys:r,fn:n,up:i=!0}=t;return r.forEach(t=>e[t]={fn:n,pressed:!1,up:i}),e},{}),r=t=>{let{key:r,code:n}=t,i=e[r]||e[n];if(!i)return;let{fn:a,pressed:o,up:s}=i;i.pressed=!0,(s||!o)&&a(!0)},a=t=>{let{key:r,code:n}=t,i=e[r]||e[n];if(!i)return;let{fn:a,up:o}=i;i.pressed=!1,o&&a(!1)},o=i||window;return o.addEventListener("keydown",r,{passive:!0}),o.addEventListener("keyup",a,{passive:!0}),()=>{o.removeEventListener("keydown",r),o.removeEventListener("keyup",a)}},[i,a]),el.createElement(nQ.Provider,{value:s,children:r})}var nV=Object.defineProperty;class nX{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let r=this._listeners[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let r=t.slice(0);for(let t=0,n=r.length;t((e,t,r)=>t in e?nV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r))(this,"_listeners")}}var nq=Object.defineProperty,nY=(e,t,r)=>(((e,t,r)=>t in e?nq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),r);let nz=new ef.Euler(0,0,0,"YXZ"),nZ=new ef.Vector3,n$={type:"change"},n0={type:"lock"},n1={type:"unlock"},n9=Math.PI/2;class n2 extends nX{constructor(e,t){super(),nY(this,"camera"),nY(this,"domElement"),nY(this,"isLocked"),nY(this,"minPolarAngle"),nY(this,"maxPolarAngle"),nY(this,"pointerSpeed"),nY(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(nz.setFromQuaternion(this.camera.quaternion),nz.y-=.002*e.movementX*this.pointerSpeed,nz.x-=.002*e.movementY*this.pointerSpeed,nz.x=Math.max(n9-this.maxPolarAngle,Math.min(n9-this.minPolarAngle,nz.x)),this.camera.quaternion.setFromEuler(nz),this.dispatchEvent(n$))}),nY(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(n0),this.isLocked=!0):(this.dispatchEvent(n1),this.isLocked=!1))}),nY(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),nY(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),nY(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),nY(this,"dispose",()=>{this.disconnect()}),nY(this,"getObject",()=>this.camera),nY(this,"direction",new ef.Vector3(0,0,-1)),nY(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),nY(this,"moveForward",e=>{nZ.setFromMatrixColumn(this.camera.matrix,0),nZ.crossVectors(this.camera.up,nZ),this.camera.position.addScaledVector(nZ,e)}),nY(this,"moveRight",e=>{nZ.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(nZ,e)}),nY(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),nY(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}var n3=function(e){return e.forward="forward",e.backward="backward",e.left="left",e.right="right",e.up="up",e.down="down",e.camera1="camera1",e.camera2="camera2",e.camera3="camera3",e.camera4="camera4",e.camera5="camera5",e.camera6="camera6",e.camera7="camera7",e.camera8="camera8",e.camera9="camera9",e}(n3||{});function n8(){let{speedMultiplier:e,setSpeedMultiplier:t}=(0,tw.useControls)(),[r,n]=function(e){let[t,r,n]=el.useContext(nQ);return[t,r]}(),{camera:i,gl:a}=(0,tE.useThree)(),{nextCamera:o,setCameraIndex:s,cameraCount:l}=nC(),u=(0,el.useRef)(null),c=(0,el.useRef)(new ef.Vector3),d=(0,el.useRef)(new ef.Vector3),f=(0,el.useRef)(new ef.Vector3);return(0,el.useEffect)(()=>{let e=new n2(i,a.domElement);u.current=e;let t=t=>{e.isLocked?o():t.target===a.domElement&&e.lock()};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t),e.dispose()}},[i,a,o]),(0,el.useEffect)(()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return r(t=>{for(let r=0;r{let e=e=>{e.preventDefault();let r=e.deltaY>0?-1:1,n=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*r;t(e=>Math.max(.1,Math.min(5,Math.round((e+n)*20)/20)))},r=a.domElement;return r.addEventListener("wheel",e,{passive:!1}),()=>{r.removeEventListener("wheel",e)}},[a]),(0,tx.useFrame)((t,r)=>{let{forward:a,backward:o,left:s,right:l,up:u,down:h}=n();(a||o||s||l||u||h)&&(i.getWorldDirection(c.current),c.current.normalize(),d.current.crossVectors(i.up,c.current).normalize(),f.current.set(0,0,0),a&&f.current.add(c.current),o&&f.current.sub(c.current),s&&f.current.add(d.current),l&&f.current.sub(d.current),u&&(f.current.y+=1),h&&(f.current.y-=1),f.current.lengthSq()>0&&(f.current.normalize().multiplyScalar(80*e*r),i.position.add(f.current)))}),null}let n5=[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"camera1",keys:["Digit1"]},{name:"camera2",keys:["Digit2"]},{name:"camera3",keys:["Digit3"]},{name:"camera4",keys:["Digit4"]},{name:"camera5",keys:["Digit5"]},{name:"camera6",keys:["Digit6"]},{name:"camera7",keys:["Digit7"]},{name:"camera8",keys:["Digit8"]},{name:"camera9",keys:["Digit9"]}];function n6(){return(0,el.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",e,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",e,{capture:!0})}},[]),(0,es.jsx)(nW,{map:n5,children:(0,es.jsx)(n8,{})})}var n4=function(){var e;return"undefined"!=typeof window&&!!(null==(e=window.document)?void 0:e.createElement)}();function n7(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function ie(e){return e?"self"in e?e.self:n7(e).defaultView||window:self}function it(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{activeElement:r}=n7(e);if(!(null==r?void 0:r.nodeName))return null;if(ii(r)&&r.contentDocument)return it(r.contentDocument.body,t);if(t){let e=r.getAttribute("aria-activedescendant");if(e){let t=n7(r).getElementById(e);if(t)return t}}return r}function ir(e,t){return e===t||e.contains(t)}function ii(e){return"IFRAME"===e.tagName}function ia(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==io.indexOf(e.type)}var io=["button","color","file","image","reset","submit"];function is(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function il(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function iu(e){return e.isContentEditable||il(e)}function ic(e){let t=0,r=0;if(il(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let n=n7(e).getSelection();if((null==n?void 0:n.rangeCount)&&n.anchorNode&&ir(e,n.anchorNode)&&n.focusNode&&ir(e,n.focusNode)){let i=n.getRangeAt(0),a=i.cloneRange();a.selectNodeContents(e),a.setEnd(i.startContainer,i.startOffset),t=a.toString().length,a.setEnd(i.endContainer,i.endOffset),r=a.toString().length}}return{start:t,end:r}}function id(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function ih(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return ih(e.parentElement)||document.scrollingElement||document.body}function im(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,a,!0),r()}),a=()=>{i(),r()};return e.addEventListener(t,a,{once:!0,capture:!0}),i}function iO(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,i=[];try{for(let a of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(iO(e,t,r,a))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var ik={...el},i_=ik.useId;ik.useDeferredValue;var iU=ik.useInsertionEffect,ij=n4?el.useLayoutEffect:el.useEffect;function iJ(e){let t=(0,el.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return iU?iU(()=>{t.current=e}):t.current=e,(0,el.useCallback)(function(){for(var e,r=arguments.length,n=Array(r),i=0;i{if(t.some(Boolean))return e=>{for(let r of t)iS(r,e)}},t)}function iK(e){if(i_){let t=i_();return e||t}let[t,r]=(0,el.useState)(e);return ij(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r("id-".concat(n))},[e,t]),e||t}function iQ(e,t){let r=(0,el.useRef)(!1);(0,el.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,el.useEffect)(()=>()=>{r.current=!1},[])}function iW(){return(0,el.useReducer)(()=>[],[])}function iV(e){return iJ("function"==typeof e?e:()=>e)}function iX(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=(0,el.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function iq(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,[r,n]=(0,el.useState)(null);return{portalRef:iN(n,t),portalNode:r,domReady:!e||r}}var iY=!1,iz=!1,iZ=0,i$=0;function i0(e){(function(e){let t=e.movementX||e.screenX-iZ,r=e.movementY||e.screenY-i$;return iZ=e.screenX,i$=e.screenY,t||r||!1})(e)&&(iz=!0)}function i1(){iz=!1}function i9(e){let t=el.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function i2(e,t){return el.memo(e,t)}function i3(e,t){let r,{wrapElement:n,render:i,...a}=t,o=iN(t.ref,i&&(0,el.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(el.isValidElement(i)){let e={...i.props,ref:o};r=el.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!iB(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?"".concat(e[n]," ").concat(t[n]):t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=function(){for(var e=arguments.length,r=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return e(t)};return t.displayName=e.name,t}function i5(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=el.createContext(void 0),n=el.createContext(void 0),i=()=>el.useContext(r),a=t=>e.reduceRight((e,r)=>(0,es.jsx)(r,{...t,children:e}),(0,es.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=el.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=el.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:a,ScopedContextProvider:e=>(0,es.jsx)(a,{...e,children:t.reduceRight((t,r)=>(0,es.jsx)(r,{...e,children:t}),(0,es.jsx)(n.Provider,{...e}))})}}var i6=i5(),i4=i6.useContext;i6.useScopedContext,i6.useProviderContext;var i7=i5([i6.ContextProvider],[i6.ScopedContextProvider]),ae=i7.useContext;i7.useScopedContext;var at=i7.useProviderContext,ar=i7.ContextProvider,an=i7.ScopedContextProvider,ai=(0,el.createContext)(void 0),aa=(0,el.createContext)(void 0),ao=(0,el.createContext)(!0),as="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function al(e){return!(!e.matches(as)||!is(e)||e.closest("[inert]"))}function au(e){if(!al(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=it(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function ac(e,t){let r=Array.from(e.querySelectorAll(as));t&&r.unshift(e);let n=r.filter(al);return n.forEach((e,t)=>{if(ii(e)&&e.contentDocument){let r=e.contentDocument.body;n.splice(t,1,...ac(r))}}),n}function ad(e,t,r){let n=Array.from(e.querySelectorAll(as)),i=n.filter(au);return(t&&au(e)&&i.unshift(e),i.forEach((e,t)=>{if(ii(e)&&e.contentDocument){let n=ad(e.contentDocument.body,!1,r);i.splice(t,1,...n)}}),!i.length&&r)?n:i}function af(e,t){return function(e,t,r,n){let i=it(e),a=ac(e,t),o=a.indexOf(i),s=a.slice(o+1);return s.find(au)||(r?a.find(au):null)||(n?s[0]:null)||null}(document.body,!1,e,t)}function ah(e,t){return function(e,t,r,n){let i=it(e),a=ac(e,t).reverse(),o=a.indexOf(i),s=a.slice(o+1);return s.find(au)||(r?a.find(au):null)||(n?s[0]:null)||null}(document.body,!1,e,t)}function am(e){let t=it(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function ap(e){let t=it(e);if(!t)return!1;if(ir(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector("#".concat(CSS.escape(r))))}function aA(e){!ap(e)&&al(e)&&e.focus()}var ag=iR(),av=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],aB=Symbol("safariFocusAncestor");function aC(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function ay(e,t){return iJ(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var ab=!1,aM=!0;function ax(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(aM=!1)}function aE(e){e.metaKey||e.ctrlKey||e.altKey||(aM=!0)}var aF=i8(function(e){var t,r,n,i,a;let{focusable:o=!0,accessibleWhenDisabled:s,autoFocus:l,onFocusVisible:u,...c}=e,d=(0,el.useRef)(null);(0,el.useEffect)(()=>{o&&(ab||(iO("mousedown",ax,!0),iO("keydown",aE,!0),ab=!0))},[o]),ag&&(0,el.useEffect)(()=>{if(!o)return;let e=d.current;if(!e||!aC(e))return;let t="labels"in e?e.labels:null;if(!t)return;let r=()=>queueMicrotask(()=>e.focus());for(let e of t)e.addEventListener("mouseup",r);return()=>{for(let e of t)e.removeEventListener("mouseup",r)}},[o]);let f=o&&ix(c),h=!!f&&!s,[m,p]=(0,el.useState)(!1);(0,el.useEffect)(()=>{o&&h&&m&&p(!1)},[o,h,m]),(0,el.useEffect)(()=>{if(!o||!m)return;let e=d.current;if(!e||"undefined"==typeof IntersectionObserver)return;let t=new IntersectionObserver(()=>{al(e)||p(!1)});return t.observe(e),()=>t.disconnect()},[o,m]);let A=ay(c.onKeyPressCapture,f),g=ay(c.onMouseDownCapture,f),B=ay(c.onClickCapture,f),C=c.onMouseDown,y=iJ(e=>{if(null==C||C(e),e.defaultPrevented||!o)return;let t=e.currentTarget;if(!ag||iD(e)||!ia(t)&&!aC(t))return;let r=!1,n=()=>{r=!0};t.addEventListener("focusin",n,{capture:!0,once:!0});let i=function(e){for(;e&&!al(e);)e=e.closest(as);return e||null}(t.parentElement);i&&(i[aB]=!0),iH(t,"mouseup",()=>{t.removeEventListener("focusin",n,!0),i&&(i[aB]=!1),r||aA(t)})}),b=(e,t)=>{if(t&&(e.currentTarget=t),!o)return;let r=e.currentTarget;r&&am(r)&&(null==u||u(e),e.defaultPrevented||(r.dataset.focusVisible="true",p(!0)))},M=c.onKeyDownCapture,x=iJ(e=>{if(null==M||M(e),e.defaultPrevented||!o||m||e.metaKey||e.altKey||e.ctrlKey||!iI(e))return;let t=e.currentTarget;iH(t,"focusout",()=>b(e,t))}),E=c.onFocusCapture,F=iJ(e=>{if(null==E||E(e),e.defaultPrevented||!o)return;if(!iI(e))return void p(!1);let t=e.currentTarget;aM||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:av.includes(n))}(e.target)?iH(e.target,"focusout",()=>b(e,t)):p(!1)}),S=c.onBlur,T=iJ(e=>{null==S||S(e),o&&iP(e)&&(e.currentTarget.removeAttribute("data-focus-visible"),p(!1))}),w=(0,el.useContext)(ao),R=iJ(e=>{o&&l&&e&&w&&queueMicrotask(()=>{!am(e)&&al(e)&&e.focus()})}),D=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,el.useState)(()=>r(void 0));return ij(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,t]),n}(d),I=o&&(!D||"button"===D||"summary"===D||"input"===D||"select"===D||"textarea"===D||"a"===D),G=o&&(!D||"button"===D||"input"===D||"select"===D||"textarea"===D),L=c.style,P=(0,el.useMemo)(()=>h?{pointerEvents:"none",...L}:L,[h,L]);return c={"data-focus-visible":o&&m||void 0,"data-autofocus":l||void 0,"aria-disabled":f||void 0,...c,ref:iN(d,R,c.ref),style:P,tabIndex:(t=o,r=h,n=I,i=G,a=c.tabIndex,t?r?n&&!i?-1:void 0:n?a:a||0:a),disabled:!!G&&!!h||void 0,contentEditable:f?void 0:c.contentEditable,onKeyPressCapture:A,onClickCapture:B,onMouseDownCapture:g,onMouseDown:y,onKeyDownCapture:x,onFocusCapture:F,onBlur:T},iE(c)});function aS(e){let t=[];for(let r of e)t.push(...r);return t}function aT(e){return e.slice().reverse()}function aw(e,t,r){return iJ(n=>{var i;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!iI(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||function(e){let t=e.target;return(!t||!!il(t))&&1===e.key.length&&!e.ctrlKey&&!e.metaKey}(n))return;let a=e.getState(),o=null==(i=ip(e,a.activeId))?void 0:i.element;if(!o)return;let{view:s,...l}=n;o!==(null==r?void 0:r.current)&&o.focus(),!function(e,t,r){let n=new KeyboardEvent(t,r);return e.dispatchEvent(n)}(o,n.type,l)&&n.preventDefault(),n.currentTarget.contains(o)&&n.stopPropagation()})}i9(function(e){return i3("div",aF(e))});var aR=i8(function(e){let{store:t,composite:r=!0,focusOnMove:n=r,moveOnKeyPress:i=!0,...a}=e,o=at();ib(t=t||o,!1);let s=(0,el.useRef)(null),l=(0,el.useRef)(null),u=function(e){let[t,r]=(0,el.useState)(!1),n=(0,el.useCallback)(()=>r(!0),[]),i=e.useState(t=>ip(e,t.activeId));return(0,el.useEffect)(()=>{let e=null==i?void 0:i.element;t&&e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(t),c=t.useState("moves"),[,d]=function(e){let[t,r]=(0,el.useState)(null);return ij(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(r?t.setBaseElement:null);(0,el.useEffect)(()=>{var e;if(!t||!c||!r||!n)return;let{activeId:i}=t.getState(),a=null==(e=ip(t,i))?void 0:e.element;a&&("scrollIntoView"in a?(a.focus({preventScroll:!0}),a.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):a.focus())},[t,c,r,n]),ij(()=>{if(!t||!c||!r)return;let{baseElement:e,activeId:n}=t.getState();if(null!==n||!e)return;let i=l.current;l.current=null,i&&iG(i,{relatedTarget:e}),am(e)||e.focus()},[t,c,r]);let f=t.useState("activeId"),h=t.useState("virtualFocus");ij(()=>{var e;if(!t||!r||!h)return;let n=l.current;if(l.current=null,!n)return;let i=(null==(e=ip(t,f))?void 0:e.element)||it(n);i!==n&&iG(n,{relatedTarget:i})},[t,f,h,r]);let m=aw(t,a.onKeyDownCapture,l),p=aw(t,a.onKeyUpCapture,l),A=a.onFocusCapture,g=iJ(e=>{if(null==A||A(e),e.defaultPrevented||!t)return;let{virtualFocus:r}=t.getState();if(!r)return;let n=e.relatedTarget,i=function(e){let t=e[iA];return delete e[iA],t}(e.currentTarget);iI(e)&&i&&(e.stopPropagation(),l.current=n)}),B=a.onFocus,C=iJ(e=>{if(null==B||B(e),e.defaultPrevented||!r||!t)return;let{relatedTarget:n}=e,{virtualFocus:i}=t.getState();i?iI(e)&&!ig(t,n)&&queueMicrotask(u):iI(e)&&t.setActiveId(null)}),y=a.onBlurCapture,b=iJ(e=>{var r;if(null==y||y(e),e.defaultPrevented||!t)return;let{virtualFocus:n,activeId:i}=t.getState();if(!n)return;let a=null==(r=ip(t,i))?void 0:r.element,o=e.relatedTarget,s=ig(t,o),u=l.current;l.current=null,iI(e)&&s?(o===a?u&&u!==o&&iG(u,e):a?iG(a,e):u&&iG(u,e),e.stopPropagation()):!ig(t,e.target)&&a&&iG(a,e)}),M=a.onKeyDown,x=iV(i),E=iJ(e=>{var r;if(null==M||M(e),e.nativeEvent.isComposing||e.defaultPrevented||!t||!iI(e))return;let{orientation:n,renderedItems:i,activeId:a}=t.getState(),o=ip(t,a);if(null==(r=null==o?void 0:o.element)?void 0:r.isConnected)return;let s="horizontal"!==n,l="vertical"!==n,u=i.some(e=>!!e.rowId);if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&il(e.currentTarget))return;let c={ArrowUp:(u||s)&&(()=>{if(u){let e=aS(aT(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==t?void 0:t.last()}),ArrowRight:(u||l)&&t.first,ArrowDown:(u||s)&&t.first,ArrowLeft:(u||l)&&t.last,Home:t.first,End:t.last,PageUp:t.first,PageDown:t.last}[e.key];if(c){let r=c();if(void 0!==r){if(!x(e))return;e.preventDefault(),t.move(r)}}});return a=iX(a,e=>(0,es.jsx)(ar,{value:t,children:e}),[t]),a={"aria-activedescendant":t.useState(e=>{var n;if(t&&r&&e.virtualFocus)return null==(n=ip(t,e.activeId))?void 0:n.id}),...a,ref:iN(s,d,a.ref),onKeyDownCapture:m,onKeyUpCapture:p,onFocusCapture:g,onFocus:C,onBlurCapture:b,onKeyDown:E},a=aF({focusable:t.useState(e=>r&&(e.virtualFocus||null===e.activeId)),...a})});i9(function(e){return i3("div",aR(e))});var aD=i5();aD.useContext,aD.useScopedContext;var aI=aD.useProviderContext,aG=i5([aD.ContextProvider],[aD.ScopedContextProvider]);aG.useContext,aG.useScopedContext;var aL=aG.useProviderContext,aP=aG.ContextProvider,aH=aG.ScopedContextProvider,aO=(0,el.createContext)(void 0),ak=(0,el.createContext)(void 0),a_=i5([aP],[aH]);a_.useContext,a_.useScopedContext;var aU=a_.useProviderContext,aj=a_.ContextProvider,aJ=a_.ScopedContextProvider,aN=i8(function(e){let{store:t,...r}=e,n=aU();return t=t||n,r={...r,ref:iN(null==t?void 0:t.setAnchorElement,r.ref)}});i9(function(e){return i3("div",aN(e))});var aK=(0,el.createContext)(void 0),aQ=i5([aj,ar],[aJ,an]),aW=aQ.useContext,aV=aQ.useScopedContext,aX=aQ.useProviderContext,aq=aQ.ContextProvider,aY=aQ.ScopedContextProvider,az=(0,el.createContext)(void 0),aZ=(0,el.createContext)(!1);function a$(e,t){let r=e.__unstableInternals;return ib(r,"Invalid store"),r[t]}function a0(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n2&&void 0!==arguments[2]?arguments[2]:d;return r.add(t),m.set(t,e),()=>{var e;null==(e=h.get(t))||e(),h.delete(t),m.delete(t),r.delete(t)}},A=function(e,t){var n,s;let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!iB(i,e))return;let c=(s=i[e],"function"==typeof t?t("function"==typeof s?s():s):t);if(c===i[e])return;if(!l)for(let t of r)null==(n=null==t?void 0:t.setState)||n.call(t,e,c);let p=i;i={...i,[e]:c};let A=Symbol();o=A,u.add(e);let g=(t,r,n)=>{var a;let o=m.get(t);(!o||o.some(t=>n?n.has(t):t===e))&&(null==(a=h.get(t))||a(),h.set(t,t(i,r)))};for(let e of d)g(e,p);queueMicrotask(()=>{if(o!==A)return;let e=i;for(let e of f)g(e,a,u);a=e,u.clear()})},g={getState:()=>i,setState:A,__unstableInternals:{setup:e=>(c.add(e),()=>c.delete(e)),init:()=>{let e=l.size,t=Symbol();l.add(t);let n=()=>{l.delete(t),l.size||s()};if(e)return n;let a=Object.keys(i).map(e=>iC(...r.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&iB(n,e))return a3(t,[e],t=>{A(e,t[e],!0)})}))),o=[];for(let e of c)o.push(e());return s=iC(...a,...o,...r.map(a9)),n},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(h.set(t,t(i,i)),p(e,t)),batch:(e,t)=>(h.set(t,t(i,a)),p(e,t,f)),pick:e=>a0(function(e,t){let r={};for(let n of t)iB(e,n)&&(r[n]=e[n]);return r}(i,e),g),omit:e=>a0(function(e,t){let r={...e};for(let e of t)iB(r,e)&&delete r[e];return r}(i,e),g)}};return g}function a1(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function oe(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var ot=i8(function(e){let{store:t,focusable:r=!0,autoSelect:n=!1,getAutoSelectId:i,setValueOnChange:a,showMinLength:o=0,showOnChange:s,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:c,showOnKeyPress:d=c,blurActiveItemOnClick:f,setValueOnClick:h=!0,moveOnKeyPress:m=!0,autoComplete:p="list",...A}=e,g=aX();ib(t=t||g,!1);let B=(0,el.useRef)(null),[C,y]=iW(),b=(0,el.useRef)(!1),M=(0,el.useRef)(!1),x=t.useState(e=>e.virtualFocus&&n),E="inline"===p||"both"===p,[F,S]=(0,el.useState)(E);!function(e,t){let r=(0,el.useRef)(!1);ij(()=>{if(r.current)return e();r.current=!0},t),ij(()=>()=>{r.current=!1},[])}(()=>{E&&S(!0)},[E]);let T=t.useState("value"),w=(0,el.useRef)();(0,el.useEffect)(()=>a3(t,["selectedValue","activeId"],(e,t)=>{w.current=t.selectedValue}),[]);let R=t.useState(e=>{var t;if(E&&F){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=w.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),D=t.useState("renderedItems"),I=t.useState("open"),G=t.useState("contentElement"),L=(0,el.useMemo)(()=>{if(!E||!F)return T;if(a7(D,R,x)){if(oe(T,R)){let e=(null==R?void 0:R.slice(T.length))||"";return T+e}return T}return R||T},[E,F,D,R,x,T]);(0,el.useEffect)(()=>{let e=B.current;if(!e)return;let t=()=>S(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,el.useEffect)(()=>{if(!E||!F||!R||!a7(D,R,x)||!oe(T,R))return;let e=iv;return queueMicrotask(()=>{let t=B.current;if(!t)return;let{start:r,end:n}=ic(t),i=T.length,a=R.length;im(t,i,a),e=()=>{if(!am(t))return;let{start:e,end:o}=ic(t);e===i&&o===a&&im(t,r,n)}}),()=>e()},[C,E,F,R,D,x,T]);let P=(0,el.useRef)(null),H=iJ(i),O=(0,el.useRef)(null);(0,el.useEffect)(()=>{if(!I||!G)return;let e=ih(G);if(!e)return;P.current=e;let r=()=>{b.current=!1},n=()=>{if(!t||!b.current)return;let{activeId:e}=t.getState();null!==e&&e!==O.current&&(b.current=!1)},i={passive:!0,capture:!0};return e.addEventListener("wheel",r,i),e.addEventListener("touchmove",r,i),e.addEventListener("scroll",n,i),()=>{e.removeEventListener("wheel",r,!0),e.removeEventListener("touchmove",r,!0),e.removeEventListener("scroll",n,!0)}},[I,G,t]),ij(()=>{T&&(M.current||(b.current=!0))},[T]),ij(()=>{"always"!==x&&I||(b.current=I)},[x,I]);let k=t.useState("resetValueOnSelect");iQ(()=>{var e,r;let n=b.current;if(!t||!I||!n&&!k)return;let{baseElement:i,contentElement:a,activeId:o}=t.getState();if(!i||am(i)){if(null==a?void 0:a.hasAttribute("data-placing")){let e=new MutationObserver(y);return e.observe(a,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(x&&n){let r=H(D),n=void 0!==r?r:null!=(e=function(e){let t=e.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"});return null==t?void 0:t.id}(D))?e:t.first();O.current=n,t.move(null!=n?n:null)}else{let e=null==(r=t.item(o||t.first()))?void 0:r.element;e&&"scrollIntoView"in e&&e.scrollIntoView({block:"nearest",inline:"nearest"})}}},[t,I,C,T,x,k,H,D]),(0,el.useEffect)(()=>{if(!E)return;let e=B.current;if(!e)return;let r=[e,G].filter(e=>!!e),n=e=>{r.every(t=>iP(e,t))&&(null==t||t.setValue(L))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[E,G,t,L]);let _=e=>e.currentTarget.value.length>=o,U=A.onChange,j=iV(null!=s?s:_),J=iV(null!=a?a:!t.tag),N=iJ(e=>{if(null==U||U(e),e.defaultPrevented||!t)return;let r=e.currentTarget,{value:n,selectionStart:i,selectionEnd:a}=r,o=e.nativeEvent;if(b.current=!0,"input"===o.type&&(o.isComposing&&(b.current=!1,M.current=!0),E)){let e="insertText"===o.inputType||"insertCompositionText"===o.inputType,t=i===n.length;S(e&&t)}if(J(e)){let e=n===t.getState().value;t.setValue(n),queueMicrotask(()=>{im(r,i,a)}),E&&x&&e&&y()}j(e)&&t.show(),x&&b.current||t.setActiveId(null)}),K=A.onCompositionEnd,Q=iJ(e=>{b.current=!0,M.current=!1,null==K||K(e),!e.defaultPrevented&&x&&y()}),W=A.onMouseDown,V=iV(null!=f?f:()=>!!(null==t?void 0:t.getState().includesBaseElement)),X=iV(h),q=iV(null!=u?u:_),Y=iJ(e=>{null==W||W(e),e.defaultPrevented||e.button||e.ctrlKey||t&&(V(e)&&t.setActiveId(null),X(e)&&t.setValue(L),q(e)&&iH(e.currentTarget,"mouseup",t.show))}),z=A.onKeyDown,Z=iV(null!=d?d:_),$=iJ(e=>{if(null==z||z(e),e.repeat||(b.current=!1),e.defaultPrevented||e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||!t)return;let{open:r}=t.getState();!r&&("ArrowUp"===e.key||"ArrowDown"===e.key)&&Z(e)&&(e.preventDefault(),t.show())}),ee=A.onBlur,et=iJ(e=>{if(b.current=!1,null==ee||ee(e),e.defaultPrevented)return}),er=iK(A.id),en=t.useState(e=>null===e.activeId);return A={id:er,role:"combobox","aria-autocomplete":"inline"===p||"list"===p||"both"===p||"none"===p?p:void 0,"aria-haspopup":id(G,"listbox"),"aria-expanded":I,"aria-controls":null==G?void 0:G.id,"data-active-item":en||void 0,value:L,...A,ref:iN(B,A.ref),onChange:N,onCompositionEnd:Q,onMouseDown:Y,onKeyDown:$,onBlur:et},A=aR({store:t,focusable:r,...A,moveOnKeyPress:e=>!iM(m,e)&&(E&&S(!0),!0)}),{autoComplete:"off",...A=aN({store:t,...A})}}),or=i9(function(e){return i3("input",ot(e))});function on(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var oi=Symbol("composite-hover"),oa=i8(function(e){let{store:t,focusOnHover:r=!0,blurOnHoverEnd:n=!!r,...i}=e,a=ae();ib(t=t||a,!1);let o=((0,el.useEffect)(()=>{iY||(iO("mousemove",i0,!0),iO("mousedown",i1,!0),iO("mouseup",i1,!0),iO("keydown",i1,!0),iO("scroll",i1,!0),iY=!0)},[]),iJ(()=>iz)),s=i.onMouseMove,l=iV(r),u=iJ(e=>{if((null==s||s(e),!e.defaultPrevented&&o())&&l(e)){if(!ap(e.currentTarget)){let e=null==t?void 0:t.getState().baseElement;e&&!am(e)&&e.focus()}null==t||t.setActiveId(e.currentTarget.id)}}),c=i.onMouseLeave,d=iV(n),f=iJ(e=>{var r;null==c||c(e),!(e.defaultPrevented||!o()||function(e){let t=on(e);return!!t&&ir(e.currentTarget,t)}(e)||function(e){let t=on(e);if(!t)return!1;do{if(iB(t,oi)&&t[oi])return!0;t=t.parentElement}while(t)return!1}(e))&&l(e)&&d(e)&&(null==t||t.setActiveId(null),null==(r=null==t?void 0:t.getState().baseElement)||r.focus())}),h=(0,el.useCallback)(e=>{e&&(e[oi]=!0)},[]);return iE(i={...i,ref:iN(h,i.ref),onMouseMove:u,onMouseLeave:f})});i2(i9(function(e){return i3("div",oa(e))}));var oo=i8(function(e){let{store:t,shouldRegisterItem:r=!0,getItem:n=iy,element:i,...a}=e,o=i4();t=t||o;let s=iK(a.id),l=(0,el.useRef)(i);return(0,el.useEffect)(()=>{let e=l.current;if(!s||!e||!r)return;let i=n({id:s,element:e});return null==t?void 0:t.renderItem(i)},[s,r,n,t]),iE(a={...a,ref:iN(l,a.ref)})});function os(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?ia(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(ia(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}i9(function(e){return i3("div",oo(e))});var ol=Symbol("command"),ou=i8(function(e){let{clickOnEnter:t=!0,clickOnSpace:r=!0,...n}=e,i=(0,el.useRef)(null),[a,o]=(0,el.useState)(!1);(0,el.useEffect)(()=>{i.current&&o(ia(i.current))},[]);let[s,l]=(0,el.useState)(!1),u=(0,el.useRef)(!1),c=ix(n),[d,f]=function(e,t,r){let n=e.onLoadedMetadataCapture,i=(0,el.useMemo)(()=>Object.assign(()=>{},{...n,[t]:r}),[n,t,r]);return[null==n?void 0:n[t],{onLoadedMetadataCapture:i}]}(n,ol,!0),h=n.onKeyDown,m=iJ(e=>{null==h||h(e);let n=e.currentTarget;if(e.defaultPrevented||d||c||!iI(e)||il(n)||n.isContentEditable)return;let i=t&&"Enter"===e.key,a=r&&" "===e.key,o="Enter"===e.key&&!t,s=" "===e.key&&!r;if(o||s)return void e.preventDefault();if(i||a){let t=os(e);if(i){if(!t){e.preventDefault();let{view:t,...r}=e,i=()=>iL(n,r);n4&&/firefox\//i.test(navigator.userAgent)?iH(n,"keyup",i):queueMicrotask(i)}}else a&&(u.current=!0,t||(e.preventDefault(),l(!0)))}}),p=n.onKeyUp,A=iJ(e=>{if(null==p||p(e),e.defaultPrevented||d||c||e.metaKey)return;let t=r&&" "===e.key;if(u.current&&t&&(u.current=!1,!os(e))){e.preventDefault(),l(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>iL(t,n))}});return aF(n={"data-active":s||void 0,type:a?"button":void 0,...f,...n,ref:iN(i,n.ref),onKeyDown:m,onKeyUp:A})});i9(function(e){return i3("button",ou(e))});var{useSyncExternalStore:oc}=e.i(2239).default,od=()=>()=>{};function of(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:iy,r=el.useCallback(t=>e?a2(e,null,t):od(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&iB(i,r)?i[r]:void 0};return oc(r,n,n)}function oh(e,t){let r=el.useRef({}),n=el.useCallback(t=>e?a2(e,null,t):od(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,a=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==a[e]&&(a[e]=t,i=!0)}if("string"==typeof r){if(!n||!iB(n,r))continue;let t=n[r];t!==a[e]&&(a[e]=t,i=!0)}}return i&&(r.current={...a}),r.current};return oc(n,i,i)}function om(e,t,r,n){let i=iB(t,r)?t[r]:void 0,a=function(e){let t=(0,el.useRef)(e);return ij(()=>{t.current=e}),t}({value:i,setValue:n?t[n]:void 0});ij(()=>a3(e,[r],(e,t)=>{let{value:n,setValue:i}=a.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),ij(()=>{if(void 0!==i)return e.setState(r,i),a8(e,[r],()=>{void 0!==i&&e.setState(r,i)})})}function op(e,t){let[r,n]=el.useState(()=>e(t));ij(()=>a9(r),[r]);let i=el.useCallback(e=>of(r,e),[r]);return[el.useMemo(()=>({...r,useState:i}),[r,i]),iJ(()=>{n(r=>e({...t,...r.getState()}))})]}function oA(e,t,r){var n;let i,a,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!t||!r)return;let{renderedItems:s}=t.getState(),l=ih(e);if(!l)return;let u=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),a=t?r-i+n:i+n;return"HTML"===e.tagName?a+e.scrollTop:a}(l,o);for(let e=0;e1&&void 0!==arguments[1]&&arguments[1],{top:r}=e.getBoundingClientRect();return t?r+e.clientHeight:r}(l,o)-u,d=Math.abs(c);if(o&&c<=0||!o&&c>=0){void 0!==a&&ar||(e&&(null==h?void 0:h.baseElement)&&h.baseElement===e.baseElement?h.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===d,ariaSetSize:e=>null!=s?s:e&&(null==h?void 0:h.ariaSetSize)&&h.baseElement===e.baseElement?h.ariaSetSize:void 0,ariaPosInSet(e){if(null!=l)return l;if(!e||!(null==h?void 0:h.ariaPosInSet)||h.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===p);return h.ariaPosInSet+t.findIndex(e=>e.id===d)},isTabbable(e){if(!(null==e?void 0:e.renderedItems.length))return!0;if(e.virtualFocus)return!1;if(a)return!0;if(null===e.activeId)return!1;let r=null==t?void 0:t.item(e.activeId);return null!=r&&!!r.disabled||null==r||!r.element||e.activeId===d}}),b=(0,el.useCallback)(e=>{var t;let r={...e,id:d||e.id,rowId:p,disabled:!!m,children:null==(t=e.element)?void 0:t.textContent};return o?o(r):r},[d,p,m,o]),M=u.onFocus,x=(0,el.useRef)(!1),E=iJ(e=>{var r,n;if(null==M||M(e),e.defaultPrevented||iD(e)||!d||!t||(r=t,!iI(e)&&ig(r,e.target)))return;let{virtualFocus:i,baseElement:a}=t.getState();if(t.setActiveId(d),iu(e.currentTarget)&&function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(il(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=n7(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(e.currentTarget),i&&iI(e))!iu(n=e.currentTarget)&&("INPUT"!==n.tagName||ia(n))&&(null==a?void 0:a.isConnected)&&((iR()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),x.current=!0,e.relatedTarget===a||ig(t,e.relatedTarget))?(a[iA]=!0,a.focus({preventScroll:!0})):a.focus())}),F=u.onBlurCapture,S=iJ(e=>{if(null==F||F(e),e.defaultPrevented)return;let r=null==t?void 0:t.getState();(null==r?void 0:r.virtualFocus)&&x.current&&(x.current=!1,e.preventDefault(),e.stopPropagation())}),T=u.onKeyDown,w=iV(n),R=iV(i),D=iJ(e=>{if(null==T||T(e),e.defaultPrevented||!iI(e)||!t)return;let{currentTarget:r}=e,n=t.getState(),i=t.item(d),a=!!(null==i?void 0:i.rowId),o="horizontal"!==n.orientation,s="vertical"!==n.orientation,l=()=>!(!a&&!s&&n.baseElement&&il(n.baseElement)),u={ArrowUp:(a||o)&&t.up,ArrowRight:(a||s)&&t.next,ArrowDown:(a||o)&&t.down,ArrowLeft:(a||s)&&t.previous,Home:()=>{if(l())return!a||e.ctrlKey?null==t?void 0:t.first():null==t?void 0:t.previous(-1)},End:()=>{if(l())return!a||e.ctrlKey?null==t?void 0:t.last():null==t?void 0:t.next(-1)},PageUp:()=>oA(r,t,null==t?void 0:t.up,!0),PageDown:()=>oA(r,t,null==t?void 0:t.down)}[e.key];if(u){if(iu(r)){let t=ic(r),n=s&&"ArrowLeft"===e.key,i=s&&"ArrowRight"===e.key,a=o&&"ArrowUp"===e.key,l=o&&"ArrowDown"===e.key;if(i||l){let{length:e}=function(e){if(il(e))return e.value;if(e.isContentEditable){let t=n7(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(t.end!==e)return}else if((n||a)&&0!==t.start)return}let n=u();if(w(e)||void 0!==n){if(!R(e))return;e.preventDefault(),t.move(n)}}}),I=(0,el.useMemo)(()=>({id:d,baseElement:A}),[d,A]);return u={id:d,"data-active-item":g||void 0,...u=iX(u,e=>(0,es.jsx)(ai.Provider,{value:I,children:e}),[I]),ref:iN(f,u.ref),tabIndex:y?u.tabIndex:-1,onFocus:E,onBlurCapture:S,onKeyDown:D},u=ou(u),iE({...u=oo({store:t,...u,getItem:b,shouldRegisterItem:!!d&&u.shouldRegisterItem}),"aria-setsize":B,"aria-posinset":C})});i2(i9(function(e){return i3("button",og(e))}));var ov=i8(function(e){var t,r;let{store:n,value:i,hideOnClick:a,setValueOnClick:o,selectValueOnClick:s=!0,resetValueOnSelect:l,focusOnHover:u=!1,moveOnKeyPress:c=!0,getItem:d,...f}=e,h=aV();ib(n=n||h,!1);let{resetValueOnSelectState:m,multiSelectable:p,selected:A}=oh(n,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,i)}),g=(0,el.useCallback)(e=>{let t={...e,value:i};return d?d(t):t},[i,d]);o=null!=o?o:!p,a=null!=a?a:null!=i&&!p;let B=f.onClick,C=iV(o),y=iV(s),b=iV(null!=(t=null!=l?l:m)?t:p),M=iV(a),x=iJ(e=>{null==B||B(e),!(e.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(e))&&!function(e){let t=e.currentTarget;if(!t)return!1;let r=iw();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(e)&&(null!=i&&(y(e)&&(b(e)&&(null==n||n.resetValue()),null==n||n.setSelectedValue(e=>Array.isArray(e)?e.includes(i)?e.filter(e=>e!==i):[...e,i]:i)),C(e)&&(null==n||n.setValue(i))),M(e)&&(null==n||n.hide()))}),E=f.onKeyDown,F=iJ(e=>{if(null==E||E(e),e.defaultPrevented)return;let t=null==n?void 0:n.getState().baseElement;!(!t||am(t))&&(1===e.key.length||"Backspace"===e.key||"Delete"===e.key)&&(queueMicrotask(()=>t.focus()),il(t)&&(null==n||n.setValue(t.value)))});p&&null!=A&&(f={"aria-selected":A,...f}),f=iX(f,e=>(0,es.jsx)(az.Provider,{value:i,children:(0,es.jsx)(aZ.Provider,{value:null!=A&&A,children:e})}),[i,A]),f={role:null!=(r=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,el.useContext)(aK)])?r:"option",children:i,...f,onClick:x,onKeyDown:F};let S=iV(c);return f=og({store:n,...f,getItem:g,moveOnKeyPress:e=>{if(!S(e))return!1;let t=new Event("combobox-item-move"),r=null==n?void 0:n.getState().baseElement;return null==r||r.dispatchEvent(t),!0}}),f=oa({store:n,focusOnHover:u,...f})}),oB=i2(i9(function(e){return i3("div",ov(e))})),oC=e.i(74080);function oy(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function ob(){for(var e=arguments.length,t=Array(e),r=0;r{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function oM(e,t,r){return!r&&!1!==t&&(!e||!!t)}var ox=i8(function(e){let{store:t,alwaysVisible:r,...n}=e,i=aI();ib(t=t||i,!1);let a=(0,el.useRef)(null),o=iK(n.id),[s,l]=(0,el.useState)(null),u=t.useState("open"),c=t.useState("mounted"),d=t.useState("animated"),f=t.useState("contentElement"),h=of(t.disclosure,"contentElement");ij(()=>{a.current&&(null==t||t.setContentElement(a.current))},[t]),ij(()=>{let e;return null==t||t.setState("animated",t=>(e=t,!0)),()=>{void 0!==e&&(null==t||t.setState("animated",e))}},[t]),ij(()=>{if(d){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":c?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[d,f,u,c]),ij(()=>{if(!t||!d||!s||!f)return;let e=()=>null==t?void 0:t.setState("animating",!1),r=()=>(0,oC.flushSync)(e);if("leave"===s&&u||"enter"===s&&!u)return;if("number"==typeof d)return oy(d,r);let{transitionDuration:n,animationDuration:i,transitionDelay:a,animationDelay:o}=getComputedStyle(f),{transitionDuration:l="0",animationDuration:c="0",transitionDelay:m="0",animationDelay:p="0"}=h?getComputedStyle(h):{},A=ob(a,o,m,p)+ob(n,i,l,c);if(!A){"enter"===s&&t.setState("animated",!1),e();return}return oy(Math.max(A-1e3/60,0),r)},[t,d,f,h,u,s]);let m=oM(c,(n=iX(n,e=>(0,es.jsx)(aH,{value:t,children:e}),[t])).hidden,r),p=n.style,A=(0,el.useMemo)(()=>m?{...p,display:"none"}:p,[m,p]);return iE(n={id:o,"data-open":u||void 0,"data-enter":"enter"===s||void 0,"data-leave":"leave"===s||void 0,hidden:m,...n,ref:iN(o?t.setContentElement:null,a,n.ref),style:A})}),oE=i9(function(e){return i3("div",ox(e))});i9(function(e){let{unmountOnHide:t,...r}=e,n=aI();return!1===of(r.store||n,e=>!t||(null==e?void 0:e.mounted))?null:(0,es.jsx)(oE,{...r})});var oF=i8(function(e){let{store:t,alwaysVisible:r,...n}=e,i=aV(!0),a=aW(),o=!!(t=t||a)&&t===i;ib(t,!1);let s=(0,el.useRef)(null),l=iK(n.id),u=t.useState("mounted"),c=oM(u,n.hidden,r),d=c?{...n.style,display:"none"}:n.style,f=t.useState(e=>Array.isArray(e.selectedValue)),h=function(e,t,r){let n=function(e){let[t]=(0,el.useState)(e);return t}(r),[i,a]=(0,el.useState)(n);return(0,el.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);a(null==e?n:e)},o=new MutationObserver(i);return o.observe(r,{attributeFilter:[t]}),i(),()=>o.disconnect()},[e,t,n]),i}(s,"role",n.role),m="listbox"===h||"tree"===h||"grid"===h,[p,A]=(0,el.useState)(!1),g=t.useState("contentElement");ij(()=>{if(!u)return;let e=s.current;if(!e||g!==e)return;let t=()=>{A(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,g]),p||(n={role:"listbox","aria-multiselectable":m&&f||void 0,...n}),n=iX(n,e=>(0,es.jsx)(aY,{value:t,children:(0,es.jsx)(aK.Provider,{value:h,children:e})}),[t,h]);let B=!l||i&&o?null:t.setContentElement;return iE(n={id:l,hidden:c,...n,ref:iN(B,s,n.ref),style:d})}),oS=i9(function(e){return i3("div",oF(e))}),oT=(0,el.createContext)(null),ow=i8(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});i9(function(e){return i3("span",ow(e))});var oR=i8(function(e){return ow(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),oD=i9(function(e){return i3("span",oR(e))});function oI(e){queueMicrotask(()=>{null==e||e.focus()})}var oG=i8(function(e){let{preserveTabOrder:t,preserveTabOrderAnchor:r,portalElement:n,portalRef:i,portal:a=!0,...o}=e,s=(0,el.useRef)(null),l=iN(s,o.ref),u=(0,el.useContext)(oT),[c,d]=(0,el.useState)(null),[f,h]=(0,el.useState)(null),m=(0,el.useRef)(null),p=(0,el.useRef)(null),A=(0,el.useRef)(null),g=(0,el.useRef)(null);return ij(()=>{let e=s.current;if(!e||!a)return void d(null);let t=n?"function"==typeof n?n(e):n:n7(e).createElement("div");if(!t)return void d(null);let r=t.isConnected;if(r||(u||n7(e).body).appendChild(t),t.id||(t.id=e.id?"portal/".concat(e.id):function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return"".concat(e?"".concat(e,"-"):"").concat(Math.random().toString(36).slice(2,8))}()),d(t),iS(i,t),!r)return()=>{t.remove(),iS(i,null)}},[a,n,u,i]),ij(()=>{if(!a||!t||!r)return;let e=n7(r).createElement("span");return e.style.position="fixed",r.insertAdjacentElement("afterend",e),h(e),()=>{e.remove(),h(null)}},[a,t,r]),(0,el.useEffect)(()=>{if(!c||!t)return;let e=0,r=t=>{if(!iP(t))return;let r="focusin"===t.type;if(cancelAnimationFrame(e),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}e=requestAnimationFrame(()=>{for(let e of ad(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(e),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,t]),o={...o=iX(o,e=>{if(e=(0,es.jsx)(oT.Provider,{value:c||u,children:e}),!a)return e;if(!c)return(0,es.jsx)("span",{ref:l,id:o.id,style:{position:"fixed"},hidden:!0});e=(0,es.jsxs)(es.Fragment,{children:[t&&c&&(0,es.jsx)(oD,{ref:p,"data-focus-trap":o.id,className:"__focus-trap-inner-before",onFocus:e=>{iP(e,c)?oI(af()):oI(m.current)}}),e,t&&c&&(0,es.jsx)(oD,{ref:A,"data-focus-trap":o.id,className:"__focus-trap-inner-after",onFocus:e=>{iP(e,c)?oI(ah()):oI(g.current)}})]}),c&&(e=(0,oC.createPortal)(e,c));let r=(0,es.jsxs)(es.Fragment,{children:[t&&c&&(0,es.jsx)(oD,{ref:m,"data-focus-trap":o.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&iP(e,c)?oI(p.current):oI(ah())}}),t&&(0,es.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),t&&c&&(0,es.jsx)(oD,{ref:g,"data-focus-trap":o.id,className:"__focus-trap-outer-after",onFocus:e=>{if(iP(e,c))oI(A.current);else{let e=af();if(e===p.current)return void requestAnimationFrame(()=>{var e;return null==(e=af())?void 0:e.focus()});oI(e)}}})]});return f&&t&&(r=(0,oC.createPortal)(r,f)),(0,es.jsxs)(es.Fragment,{children:[r,e]})},[c,u,a,o.id,t,f]),ref:l}});i9(function(e){return i3("div",oG(e))});var oL=(0,el.createContext)(0);function oP(e){let{level:t,children:r}=e,n=(0,el.useContext)(oL),i=Math.max(Math.min(t||n+1,6),1);return(0,es.jsx)(oL.Provider,{value:i,children:r})}var oH=i8(function(e){let{autoFocusOnShow:t=!0,...r}=e;return iX(r,e=>(0,es.jsx)(ao.Provider,{value:t,children:e}),[t])});i9(function(e){return i3("div",oH(e))});var oO=new WeakMap;function ok(e,t,r){oO.has(e)||oO.set(e,new Map);let n=oO.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let a=r(),o=()=>{a(),i(),n.delete(t)};return n.set(t,o),()=>{n.get(t)===o&&(a(),n.set(t,i))}}function o_(e,t,r){return ok(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function oU(e,t,r){return ok(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function oj(e,t){return e?ok(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var oJ=["SCRIPT","STYLE"];function oN(e){return"__ariakit-dialog-snapshot-".concat(e)}function oK(e,t,r,n){for(let i of t){if(!(null==i?void 0:i.isConnected))continue;let a=t.some(e=>!!e&&e!==i&&e.contains(i)),o=n7(i),s=i;for(;i.parentElement&&i!==o.body;){if(null==n||n(i.parentElement,s),!a)for(let n of i.parentElement.children)(function(e,t,r){return!oJ.includes(t.tagName)&&!!function(e,t){let r=n7(t),n=oN(e);if(!r.body[n])return!0;for(;;){if(t===r.body)return!1;if(t[n])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&ir(t,e))})(e,n,t)&&r(n,s);i=i.parentElement}}}function oQ(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;ni===e))}function oW(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"__ariakit-dialog-".concat(t?"ancestor":"outside").concat(e?"-".concat(e):"")}function oV(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return iC(oU(e,oW("",!0),!0),oU(e,oW(t,!0),!0))}function oX(e,t){if(e[oW(t,!0)])return!0;let r=oW(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function oq(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return oK(e,t,t=>{oQ(t,...n)||r.unshift(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return iC(oU(e,oW(),!0),oU(e,oW(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(oV(t,e))}),()=>{for(let e of r)e()}}function oY(e){let{store:t,type:r,listener:n,capture:i,domReady:a}=e,o=iJ(n),s=of(t,"open"),l=(0,el.useRef)(!1);ij(()=>{if(!s||!a)return;let{contentElement:e}=t.getState();if(!e)return;let r=()=>{l.current=!0};return e.addEventListener("focusin",r,!0),()=>e.removeEventListener("focusin",r,!0)},[t,s,a]),(0,el.useEffect)(()=>{if(s)return iO(r,e=>{let{contentElement:r,disclosureElement:n}=t.getState(),i=e.target;if(r&&i)!(!("HTML"===i.tagName||ir(n7(i).body,i))||ir(r,i)||function(e,t){if(!e)return!1;if(ir(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=n7(e).getElementById(r);if(t)return ir(e,t)}return!1}(n,i)||i.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(e,r))&&(!l.current||oX(i,r.id))&&(i&&i[aB]||o(e))},i)},[s,i])}function oz(e,t){return"function"==typeof e?e(t):!!e}var oZ=(0,el.createContext)({});function o$(){return"inert"in HTMLElement.prototype}function o0(e,t){if(!("style"in e))return iv;if(o$())return oU(e,"inert",!0);let r=ad(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&ir(t,e)))return iv;let r=ok(e,"focus",()=>(e.focus=iv,()=>{delete e.focus}));return iC(o_(e,"tabindex","-1"),r)});return iC(...r,o_(e,"aria-hidden","true"),oj(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function o1(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=a6(e.store,a5(e.disclosure,["contentElement","disclosureElement"]));a4(e,t);let r=null==t?void 0:t.getState(),n=iF(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=iF(e.animated,null==r?void 0:r.animated,!1),a=a0({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:iF(null==r?void 0:r.contentElement,null),disclosureElement:iF(null==r?void 0:r.disclosureElement,null)},t);return a1(a,()=>a3(a,["animated","animating"],e=>{e.animated||a.setState("animating",!1)})),a1(a,()=>a2(a,["open"],()=>{a.getState().animated&&a.setState("animating",!0)})),a1(a,()=>a3(a,["open","animating"],e=>{a.setState("mounted",e.open||e.animating)})),{...a,disclosure:e.disclosure,setOpen:e=>a.setState("open",e),show:()=>a.setState("open",!0),hide:()=>a.setState("open",!1),toggle:()=>a.setState("open",e=>!e),stopAnimation:()=>a.setState("animating",!1),setContentElement:e=>a.setState("contentElement",e),setDisclosureElement:e=>a.setState("disclosureElement",e)}}function o9(e,t,r){return iQ(t,[r.store,r.disclosure]),om(e,r,"open","setOpen"),om(e,r,"mounted","setMounted"),om(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}i8(function(e){return e});var o2=i9(function(e){return i3("div",e)});function o3(e){let{store:t,backdrop:r,alwaysVisible:n,hidden:i}=e,a=(0,el.useRef)(null),o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,r]=op(o1,e);return o9(t,r,e)}({disclosure:t}),s=of(t,"contentElement");(0,el.useEffect)(()=>{let e=a.current;e&&s&&(e.style.zIndex=getComputedStyle(s).zIndex)},[s]),ij(()=>{let e=null==s?void 0:s.id;if(!e)return;let t=a.current;if(t)return oV(t,e)},[s]);let l=ox({ref:a,store:o,role:"presentation","data-backdrop":(null==s?void 0:s.id)||"",alwaysVisible:n,hidden:null!=i?i:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!r)return null;if((0,el.isValidElement)(r))return(0,es.jsx)(o2,{...l,render:r});let u="boolean"!=typeof r?r:"div";return(0,es.jsx)(o2,{...l,render:(0,es.jsx)(u,{})})}function o8(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o1(e)}Object.assign(o2,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=i9(function(e){return i3(t,e)}),e),{}));var o5=iR();function o6(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;let r="current"in e?e.current:e;return r?t?al(r)?r:null:r:null}var o4=i8(function(e){let{store:t,open:r,onClose:n,focusable:i=!0,modal:a=!0,portal:o=!!a,backdrop:s=!!a,hideOnEscape:l=!0,hideOnInteractOutside:u=!0,getPersistentElements:c,preventBodyScroll:d=!!a,autoFocusOnShow:f=!0,autoFocusOnHide:h=!0,initialFocus:m,finalFocus:p,unmountOnHide:A,unstable_treeSnapshotKey:g,...B}=e,C=aL(),y=(0,el.useRef)(null),b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,r]=op(o8,e);return o9(t,r,e)}({store:t||C,open:r,setOpen(e){if(e)return;let t=y.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});n&&t.addEventListener("close",n,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&b.setOpen(!0)}}),{portalRef:M,domReady:x}=iq(o,B.portalRef),E=B.preserveTabOrder,F=of(b,e=>E&&!a&&e.mounted),S=iK(B.id),T=of(b,"open"),w=of(b,"mounted"),R=of(b,"contentElement"),D=oM(w,B.hidden,B.alwaysVisible),I=function(e){let{attribute:t,contentId:r,contentElement:n,enabled:i}=e,[a,o]=iW(),s=(0,el.useCallback)(()=>{if(!i||!n)return!1;let{body:e}=n7(n),a=e.getAttribute(t);return!a||a===r},[a,i,n,t,r]);return(0,el.useEffect)(()=>{if(!i||!r||!n)return;let{body:e}=n7(n);if(s())return e.setAttribute(t,r),()=>e.removeAttribute(t);let a=new MutationObserver(()=>(0,oC.flushSync)(o));return a.observe(e,{attributeFilter:[t]}),()=>a.disconnect()},[a,i,r,n,s,t]),s}({attribute:"data-dialog-prevent-body-scroll",contentElement:R,contentId:S,enabled:d&&!D});(0,el.useEffect)(()=>{var e,t;if(!I()||!R)return;let r=n7(R),n=ie(R),{documentElement:i,body:a}=r,o=i.style.getPropertyValue("--scrollbar-width"),s=o?Number.parseInt(o,10):n.innerWidth-i.clientWidth,l=Math.round(i.getBoundingClientRect().left)+i.scrollLeft?"paddingLeft":"paddingRight",u=iw()&&!(n4&&navigator.platform.startsWith("Mac")&&!iT());return iC((e="--scrollbar-width",t="".concat(s,"px"),i?ok(i,e,()=>{let r=i.style.getPropertyValue(e);return i.style.setProperty(e,t),()=>{r?i.style.setProperty(e,r):i.style.removeProperty(e)}}):()=>{}),u?(()=>{var e,t;let{scrollX:r,scrollY:i,visualViewport:o}=n,u=null!=(e=null==o?void 0:o.offsetLeft)?e:0,c=null!=(t=null==o?void 0:o.offsetTop)?t:0,d=oj(a,{position:"fixed",overflow:"hidden",top:"".concat(-(i-Math.floor(c)),"px"),left:"".concat(-(r-Math.floor(u)),"px"),right:"0",[l]:"".concat(s,"px")});return()=>{d(),n.scrollTo({left:r,top:i,behavior:"instant"})}})():oj(a,{overflow:"hidden",[l]:"".concat(s,"px")}))},[I,R]);let G=function(e){let t=(0,el.useRef)();return(0,el.useEffect)(()=>{if(!e){t.current=null;return}return iO("mousedown",e=>{t.current=e.target},!0)},[e]),t}(of(b,"open")),L={store:b,domReady:x,capture:!0};oY({...L,type:"click",listener:e=>{let{contentElement:t}=b.getState(),r=G.current;r&&is(r)&&oX(r,null==t?void 0:t.id)&&oz(u,e)&&b.hide()}}),oY({...L,type:"focusin",listener:e=>{let{contentElement:t}=b.getState();t&&e.target!==n7(t)&&oz(u,e)&&b.hide()}}),oY({...L,type:"contextmenu",listener:e=>{oz(u,e)&&b.hide()}});let{wrapElement:P,nestedDialogs:H}=function(e){let t=(0,el.useContext)(oZ),[r,n]=(0,el.useState)([]),i=(0,el.useCallback)(e=>{var r;return n(t=>[...t,e]),iC(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);ij(()=>a3(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let a=(0,el.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,el.useCallback)(e=>(0,es.jsx)(oZ.Provider,{value:a,children:e}),[a]),nestedDialogs:r}}(b);B=iX(B,P,[P]),ij(()=>{if(!T)return;let e=y.current,t=it(e,!0);t&&"BODY"!==t.tagName&&(e&&ir(e,t)||b.setDisclosureElement(t))},[b,T]),o5&&(0,el.useEffect)(()=>{if(!w)return;let{disclosureElement:e}=b.getState();if(!e||!ia(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),iH(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||aA(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[b,w]),(0,el.useEffect)(()=>{if(!w||!x)return;let e=y.current;if(!e)return;let t=ie(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height","".concat(i,"px"))};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[w,x]),(0,el.useEffect)(()=>{if(!a||!w||!x)return;let e=y.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t=b.hide;let r=n7(e).createElement("button");return r.type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[b,a,w,x]),ij(()=>{if(!o$()||T||!w||!x)return;let e=y.current;if(e)return o0(e)},[T,w,x]);let O=T&&x;ij(()=>{if(!S||!O)return;var e=[y.current];let{body:t}=n7(e[0]),r=[];return oK(S,e,e=>{r.push(oU(e,oN(S),!0))}),iC(oU(t,oN(S),!0),()=>{for(let e of r)e()})},[S,O,g]);let k=iJ(c);ij(()=>{if(!S||!O)return;let{disclosureElement:e}=b.getState(),t=[y.current,...k()||[],...H.map(e=>e.getState().contentElement)];return a?iC(oq(S,t),function(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return oK(e,t,e=>{oQ(e,...n)||!function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;ni===e))}(e,...n)&&r.unshift(o0(e,t))},e=>{e.hasAttribute("role")&&(t.some(t=>t&&ir(t,e))||r.unshift(o_(e,"role","none")))}),()=>{for(let e of r)e()}}(S,t)):oq(S,[e,...t])},[S,b,O,k,H,a,g]);let _=!!f,U=iV(f),[j,J]=(0,el.useState)(!1);(0,el.useEffect)(()=>{if(!T||!_||!x||!(null==R?void 0:R.isConnected))return;let e=o6(m,!0)||R.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=ad(e,t,r);return n||null}(R,!0,o&&F)||R,t=al(e);U(t?e:null)&&(J(!0),queueMicrotask(()=>{e.focus(),o5&&t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[T,_,x,R,m,o,F,U]);let N=!!h,K=iV(h),[Q,W]=(0,el.useState)(!1);(0,el.useEffect)(()=>{if(T)return W(!0),()=>W(!1)},[T]);let V=(0,el.useCallback)(function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{disclosureElement:r}=b.getState();if(function(e){let t=it();return!(!t||e&&ir(e,t))&&!!al(t)}(e))return;let n=o6(p)||r;if(null==n?void 0:n.id){let e=n7(n),t='[aria-activedescendant="'.concat(n.id,'"]'),r=e.querySelector(t);r&&(n=r)}if(n&&!al(n)){let e=n.closest("[data-dialog]");if(null==e?void 0:e.id){let t=n7(e),r='[aria-controls~="'.concat(e.id,'"]'),i=t.querySelector(r);i&&(n=i)}}let i=n&&al(n);if(!i&&t)return void requestAnimationFrame(()=>V(e,!1));K(i?n:null)&&i&&(null==n||n.focus({preventScroll:!0}))},[b,p,K]),X=(0,el.useRef)(!1);ij(()=>{if(T||!Q||!N)return;let e=y.current;X.current=!0,V(e)},[T,Q,x,N,V]),(0,el.useEffect)(()=>{if(!Q||!N)return;let e=y.current;return()=>{if(X.current){X.current=!1;return}V(e)}},[Q,N,V]);let q=iV(l);(0,el.useEffect)(()=>{if(x&&w)return iO("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=y.current;if(!t||oX(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=b.getState();("BODY"===r.tagName||ir(t,r)||!n||ir(n,r))&&q(e)&&b.hide()},!0)},[b,x,w,q]);let Y=(B=iX(B,e=>(0,es.jsx)(oP,{level:a?1:void 0,children:e}),[a])).hidden,z=B.alwaysVisible;B=iX(B,e=>s?(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)(o3,{store:b,backdrop:s,hidden:Y,alwaysVisible:z}),e]}):e,[b,s,Y,z]);let[Z,$]=(0,el.useState)(),[ee,et]=(0,el.useState)();return B=oH({...B={id:S,"data-dialog":"",role:"dialog",tabIndex:i?-1:void 0,"aria-labelledby":Z,"aria-describedby":ee,...B=iX(B,e=>(0,es.jsx)(aH,{value:b,children:(0,es.jsx)(aO.Provider,{value:$,children:(0,es.jsx)(ak.Provider,{value:et,children:e})})}),[b]),ref:iN(y,B.ref)},autoFocusOnShow:j}),B=oG({portal:o,...B=aF({...B=ox({store:b,...B}),focusable:i}),portalRef:M,preserveTabOrder:F})});function o7(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:aL;return i9(function(r){let n=t();return of(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,es.jsx)(e,{...r}):null})}o7(i9(function(e){return i3("div",o4(e))}),aL);let se=Math.min,st=Math.max,sr=Math.round,sn=Math.floor,si=e=>({x:e,y:e}),sa={left:"right",right:"left",bottom:"top",top:"bottom"},so={start:"end",end:"start"};function ss(e,t){return"function"==typeof e?e(t):e}function sl(e){return e.split("-")[0]}function su(e){return e.split("-")[1]}function sc(e){return"x"===e?"y":"x"}function sd(e){return"y"===e?"height":"width"}let sf=new Set(["top","bottom"]);function sh(e){return sf.has(sl(e))?"y":"x"}function sm(e){return e.replace(/start|end/g,e=>so[e])}let sp=["left","right"],sA=["right","left"],sg=["top","bottom"],sv=["bottom","top"];function sB(e){return e.replace(/left|right|bottom|top/g,e=>sa[e])}function sC(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function sy(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function sb(e,t,r){let n,{reference:i,floating:a}=e,o=sh(t),s=sc(sh(t)),l=sd(s),u=sl(t),c="y"===o,d=i.x+i.width/2-a.width/2,f=i.y+i.height/2-a.height/2,h=i[l]/2-a[l]/2;switch(u){case"top":n={x:d,y:i.y-a.height};break;case"bottom":n={x:d,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:f};break;case"left":n={x:i.x-a.width,y:f};break;default:n={x:i.x,y:i.y}}switch(su(t)){case"start":n[s]-=h*(r&&c?-1:1);break;case"end":n[s]+=h*(r&&c?-1:1)}return n}let sM=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,s=a.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=sb(u,n,l),f=n,h={},m=0;for(let r=0;r{try{return e.matches(t)}catch(e){return!1}})}let sU=["transform","translate","scale","rotate","perspective"],sj=["transform","translate","scale","rotate","perspective","filter"],sJ=["paint","layout","strict","content"];function sN(e){let t=sK(),r=sI(e)?sV(e):e;return sU.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||sj.some(e=>(r.willChange||"").includes(e))||sJ.some(e=>(r.contain||"").includes(e))}function sK(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let sQ=new Set(["html","body","#document"]);function sW(e){return sQ.has(sT(e))}function sV(e){return sw(e).getComputedStyle(e)}function sX(e){return sI(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sq(e){if("html"===sT(e))return e;let t=e.assignedSlot||e.parentNode||sL(e)&&e.host||sR(e);return sL(t)?t.host:t}function sY(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let i=function e(t){let r=sq(t);return sW(r)?t.ownerDocument?t.ownerDocument.body:t.body:sG(r)&&sH(r)?r:e(r)}(e),a=i===(null==(n=e.ownerDocument)?void 0:n.body),o=sw(i);if(a){let e=sz(o);return t.concat(o,o.visualViewport||[],sH(i)?i:[],e&&r?sY(e):[])}return t.concat(i,sY(i,[],r))}function sz(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sZ(e){let t=sV(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=sG(e),a=i?e.offsetWidth:r,o=i?e.offsetHeight:n,s=sr(r)!==a||sr(n)!==o;return s&&(r=a,n=o),{width:r,height:n,$:s}}function s$(e){return sI(e)?e:e.contextElement}function s0(e){let t=s$(e);if(!sG(t))return si(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:a}=sZ(t),o=(a?sr(r.width):r.width)/n,s=(a?sr(r.height):r.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}let s1=si(0);function s9(e){let t=sw(e);return sK()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:s1}function s2(e,t,r,n){var i;void 0===t&&(t=!1),void 0===r&&(r=!1);let a=e.getBoundingClientRect(),o=s$(e),s=si(1);t&&(n?sI(n)&&(s=s0(n)):s=s0(e));let l=(void 0===(i=r)&&(i=!1),n&&(!i||n===sw(o))&&i)?s9(o):si(0),u=(a.left+l.x)/s.x,c=(a.top+l.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(o){let e=sw(o),t=n&&sI(n)?sw(n):n,r=e,i=sz(r);for(;i&&n&&t!==r;){let e=s0(i),t=i.getBoundingClientRect(),n=sV(i),a=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=a,c+=o,i=sz(r=sw(i))}}return sy({width:d,height:f,x:u,y:c})}function s3(e,t){let r=sX(e).scrollLeft;return t?t.left+r:s2(sR(e)).left+r}function s8(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-s3(e,r),y:r.top+t.scrollTop}}let s5=new Set(["absolute","fixed"]);function s6(e,t,r){let n;if("viewport"===t)n=function(e,t){let r=sw(e),n=sR(e),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;let e=sK();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}let u=s3(n);if(u<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(n.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else u<=25&&(a+=u);return{width:a,height:o,x:s,y:l}}(e,r);else if("document"===t)n=function(e){let t=sR(e),r=sX(e),n=e.ownerDocument.body,i=st(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=st(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),o=-r.scrollLeft+s3(e),s=-r.scrollTop;return"rtl"===sV(n).direction&&(o+=st(t.clientWidth,n.clientWidth)-i),{width:i,height:a,x:o,y:s}}(sR(e));else if(sI(t))n=function(e,t){let r=s2(e,!0,"fixed"===t),n=r.top+e.clientTop,i=r.left+e.clientLeft,a=sG(e)?s0(e):si(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y;return{width:o,height:s,x:i*a.x,y:n*a.y}}(t,r);else{let r=s9(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return sy(n)}function s4(e){return"static"===sV(e).position}function s7(e,t){if(!sG(e)||"fixed"===sV(e).position)return null;if(t)return t(e);let r=e.offsetParent;return sR(e)===r&&(r=r.ownerDocument.body),r}function le(e,t){var r;let n=sw(e);if(s_(e))return n;if(!sG(e)){let t=sq(e);for(;t&&!sW(t);){if(sI(t)&&!s4(t))return t;t=sq(t)}return n}let i=s7(e,t);for(;i&&(r=i,sO.has(sT(r)))&&s4(i);)i=s7(i,t);return i&&sW(i)&&s4(i)&&!sN(i)?n:i||function(e){let t=sq(e);for(;sG(t)&&!sW(t);){if(sN(t))return t;if(s_(t))break;t=sq(t)}return null}(e)||n}let lt=async function(e){let t=this.getOffsetParent||le,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=sG(t),i=sR(t),a="fixed"===r,o=s2(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=si(0);if(n||!n&&!a)if(("body"!==sT(t)||sH(i))&&(s=sX(t)),n){let e=s2(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=s3(i));a&&!n&&i&&(l.x=s3(i));let u=!i||n||a?si(0):s8(i,s);return{x:o.left+s.scrollLeft-l.x-u.x,y:o.top+s.scrollTop-l.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},lr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,a="fixed"===i,o=sR(n),s=!!t&&s_(t.floating);if(n===o||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=si(1),c=si(0),d=sG(n);if((d||!d&&!a)&&(("body"!==sT(n)||sH(o))&&(l=sX(n)),sG(n))){let e=s2(n);u=s0(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}let f=!o||d||a?si(0):s8(o,l);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}},getDocumentElement:sR,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,a=[..."clippingAncestors"===r?s_(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=sY(e,[],!1).filter(e=>sI(e)&&"body"!==sT(e)),i=null,a="fixed"===sV(e).position,o=a?sq(e):e;for(;sI(o)&&!sW(o);){let t=sV(o),r=sN(o);r||"fixed"!==t.position||(i=null),(a?!r&&!i:!r&&"static"===t.position&&!!i&&s5.has(i.position)||sH(o)&&!r&&function e(t,r){let n=sq(t);return!(n===r||!sI(n)||sW(n))&&("fixed"===sV(n).position||e(n,r))}(e,o))?n=n.filter(e=>e!==o):i=t,o=sq(o)}return t.set(e,n),n}(t,this._c):[].concat(r),n],o=a[0],s=a.reduce((e,r)=>{let n=s6(t,r,i);return e.top=st(n.top,e.top),e.right=se(n.right,e.right),e.bottom=se(n.bottom,e.bottom),e.left=st(n.left,e.left),e},s6(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:le,getElementRects:lt,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=sZ(e);return{width:t,height:r}},getScale:s0,isElement:sI,isRTL:function(e){return"rtl"===sV(e).direction}};function ln(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function li(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function la(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function lo(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var ls=i8(function(e){let{store:t,modal:r=!1,portal:n=!!r,preserveTabOrder:i=!0,autoFocusOnShow:a=!0,wrapperProps:o,fixed:s=!1,flip:l=!0,shift:u=0,slide:c=!0,overlap:d=!1,sameWidth:f=!1,fitViewport:h=!1,gutter:m,arrowPadding:p=4,overflowPadding:A=8,getAnchorRect:g,updatePosition:B,...C}=e,y=aU();ib(t=t||y,!1);let b=t.useState("arrowElement"),M=t.useState("anchorElement"),x=t.useState("disclosureElement"),E=t.useState("popoverElement"),F=t.useState("contentElement"),S=t.useState("placement"),T=t.useState("mounted"),w=t.useState("rendered"),R=(0,el.useRef)(null),[D,I]=(0,el.useState)(!1),{portalRef:G,domReady:L}=iq(n,C.portalRef),P=iJ(g),H=iJ(B),O=!!B;ij(()=>{if(!(null==E?void 0:E.isConnected))return;E.style.setProperty("--popover-overflow-padding","".concat(A,"px"));let e={contextElement:M||void 0,getBoundingClientRect:()=>{let e=null==P?void 0:P(M);if(e||!M){if(!e)return li();let{x:t,y:r,width:n,height:i}=e;return li(t,r,n,i)}return M.getBoundingClientRect()}},r=async()=>{var r,n,i,a;if(!T)return;b||(R.current=R.current||document.createElement("div"));let o=b||R.current,g=[(r={gutter:m,shift:u},void 0===(n=e=>{var t;let{placement:n}=e,i=((null==o?void 0:o.clientHeight)||0)/2,a="number"==typeof r.gutter?r.gutter+i:null!=(t=r.gutter)?t:i;return{crossAxis:n.split("-")[1]?void 0:r.shift,mainAxis:a,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:a,placement:o,middlewareData:s}=e,l=await sF(e,n);return o===(null==(t=s.offset)?void 0:t.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return ib(!r||r.every(la),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,a,o;let{placement:s,middlewareData:l,rects:u,initialPlacement:c,platform:d,elements:f}=e,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:A="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:B=!0,...C}=ss(t,e);if(null!=(r=l.arrow)&&r.alignmentOffset)return{};let y=sl(s),b=sh(c),M=sl(c)===c,x=await (null==d.isRTL?void 0:d.isRTL(f.floating)),E=p||(M||!B?[sB(c)]:function(e){let t=sB(e);return[sm(e),t,sm(t)]}(c)),F="none"!==g;!p&&F&&E.push(...function(e,t,r,n){let i=su(e),a=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?sA:sp;return t?sp:sA;case"left":case"right":return t?sg:sv;default:return[]}}(sl(e),"start"===r,n);return i&&(a=a.map(e=>e+"-"+i),t&&(a=a.concat(a.map(sm)))),a}(c,B,g,x));let S=[c,...E],T=await sx(e,C),w=[],R=(null==(n=l.flip)?void 0:n.overflows)||[];if(h&&w.push(T[y]),m){let e=function(e,t,r){void 0===r&&(r=!1);let n=su(e),i=sc(sh(e)),a=sd(i),o="x"===i?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=sB(o)),[o,sB(o)]}(s,u,x);w.push(T[e[0]],T[e[1]])}if(R=[...R,{placement:s,overflows:w}],!w.every(e=>e<=0)){let e=((null==(i=l.flip)?void 0:i.index)||0)+1,t=S[e];if(t&&("alignment"!==m||b===sh(t)||R.every(e=>sh(e.placement)!==b||e.overflows[0]>0)))return{data:{index:e,overflows:R},reset:{placement:t}};let r=null==(a=R.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:a.placement;if(!r)switch(A){case"bestFit":{let e=null==(o=R.filter(e=>{if(F){let t=sh(e.placement);return t===b||"y"===t}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])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=c}if(s!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:A}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:a,middlewareData:o}=e,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=ss(t,e),c={x:r,y:n},d=sh(i),f=sc(d),h=c[f],m=c[d],p=ss(s,e),A="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){let e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+A.mainAxis,r=a.reference[f]+a.reference[e]-A.mainAxis;hr&&(h=r)}if(u){var g,B;let e="y"===f?"width":"height",t=sE.has(sl(i)),r=a.reference[d]-a.floating[e]+(t&&(null==(g=o.offset)?void 0:g[d])||0)+(t?0:A.crossAxis),n=a.reference[d]+a.reference[e]+(t?0:(null==(B=o.offset)?void 0:B[d])||0)-(t?A.crossAxis:0);mn&&(m=n)}return{[f]:h,[d]:m}}})},async fn(e){let{x:t,y:n,placement:i}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=ss(r,e),u={x:t,y:n},c=await sx(e,l),d=sh(sl(i)),f=sc(d),h=u[f],m=u[d];if(a){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=h+c[e],n=h-c[t];h=st(r,se(h,n))}if(o){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=m+c[e],n=m-c[t];m=st(r,se(m,n))}let p=s.fn({...e,[f]:h,[d]:m});return{...p,data:{x:p.x-t,y:p.y-n,enabled:{[f]:a,[d]:o}}}}}}}({slide:c,shift:u,overlap:d,overflowPadding:A}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=ss(r,e)||{};if(null==u)return{};let d=sC(c),f={x:t,y:n},h=sc(sh(i)),m=sd(h),p=await o.getDimensions(u),A="y"===h,g=A?"clientHeight":"clientWidth",B=a.reference[m]+a.reference[h]-f[h]-a.floating[m],C=f[h]-a.reference[h],y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u)),b=y?y[g]:0;b&&await (null==o.isElement?void 0:o.isElement(y))||(b=s.floating[g]||a.floating[m]);let M=b/2-p[m]/2-1,x=se(d[A?"top":"left"],M),E=se(d[A?"bottom":"right"],M),F=b-p[m]-E,S=b/2-p[m]/2+(B/2-C/2),T=st(x,se(S,F)),w=!l.arrow&&null!=su(i)&&S!==T&&a.reference[m]/2-(S{},...d}=ss(a,e),f=await sx(e,d),h=sl(o),m=su(o),p="y"===sh(o),{width:A,height:g}=s.floating;"top"===h||"bottom"===h?(n=h,i=m===(await (null==l.isRTL?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(i=h,n="end"===m?"top":"bottom");let B=g-f.top-f.bottom,C=A-f.left-f.right,y=se(g-f[n],B),b=se(A-f[i],C),M=!e.middlewareData.shift,x=y,E=b;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=C),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(x=B),M&&!m){let e=st(f.left,0),t=st(f.right,0),r=st(f.top,0),n=st(f.bottom,0);p?E=A-2*(0!==e||0!==t?e+t:st(f.left,f.right)):x=g-2*(0!==r||0!==n?r+n:st(f.top,f.bottom))}await c({...e,availableWidth:E,availableHeight:x});let F=await l.getDimensions(u.floating);return A!==F.width||g!==F.height?{reset:{rects:!0}}:{}}}],B=await ((e,t,r)=>{let n=new Map,i={platform:lr,...r},a={...i.platform,_c:n};return sM(e,t,{...i,platform:a})})(e,E,{placement:S,strategy:s?"fixed":"absolute",middleware:g});null==t||t.setState("currentPlacement",B.placement),I(!0);let C=lo(B.x),y=lo(B.y);if(Object.assign(E.style,{top:"0",left:"0",transform:"translate3d(".concat(C,"px,").concat(y,"px,0)")}),o&&B.middlewareData.arrow){let{x:e,y:t}=B.middlewareData.arrow,r=B.placement.split("-")[0],n=o.clientWidth/2,i=o.clientHeight/2,a=null!=e?e+n:-n,s=null!=t?t+i:-i;E.style.setProperty("--popover-transform-origin",{top:"".concat(a,"px calc(100% + ").concat(i,"px)"),bottom:"".concat(a,"px ").concat(-i,"px"),left:"calc(100% + ".concat(n,"px) ").concat(s,"px"),right:"".concat(-n,"px ").concat(s,"px")}[r]),Object.assign(o.style,{left:null!=e?"".concat(e,"px"):"",top:null!=t?"".concat(t,"px"):"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,c=s$(e),d=a||o?[...c?sY(c):[],...sY(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});let f=c&&l?function(e,t){let r,n=null,i=sR(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(s||t(),!f||!h)return;let m=sn(d),p=sn(i.clientWidth-(c+f)),A={rootMargin:-m+"px "+-p+"px "+-sn(i.clientHeight-(d+h))+"px "+-sn(c)+"px",threshold:st(0,se(1,l))||1},g=!0;function B(t){let n=t[0].intersectionRatio;if(n!==l){if(!g)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==n||ln(u,e.getBoundingClientRect())||o(),g=!1}try{n=new IntersectionObserver(B,{...A,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(B,A)}n.observe(e)}(!0),a}(c,r):null,h=-1,m=null;s&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!u&&m.observe(c),m.observe(t));let p=u?s2(e):null;return u&&function t(){let n=s2(e);p&&!ln(p,n)&&r(),p=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,u&&cancelAnimationFrame(i)}}(e,E,async()=>{O?(await H({updatePosition:r}),I(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{I(!1),n()}},[t,w,E,b,M,E,S,T,L,s,l,u,c,d,f,h,m,p,A,P,O,H]),ij(()=>{if(!T||!L||!(null==E?void 0:E.isConnected)||!(null==F?void 0:F.isConnected))return;let e=()=>{E.style.zIndex=getComputedStyle(F).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,L,E,F]);let k=s?"fixed":"absolute";return C=iX(C,e=>(0,es.jsx)("div",{...o,style:{position:k,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==t?void 0:t.setPopoverElement,children:e}),[t,k,o]),C={"data-placing":!D||void 0,...C=iX(C,e=>(0,es.jsx)(aJ,{value:t,children:e}),[t]),style:{position:"relative",...C.style}},C=o4({store:t,modal:r,portal:n,preserveTabOrder:i,preserveTabOrderAnchor:x||M,autoFocusOnShow:D&&a,...C,portalRef:G})});o7(i9(function(e){return i3("div",ls(e))}),aU);var ll=i8(function(e){let{store:t,modal:r,tabIndex:n,alwaysVisible:i,autoFocusOnHide:a=!0,hideOnInteractOutside:o=!0,...s}=e,l=aX();ib(t=t||l,!1);let u=t.useState("baseElement"),c=(0,el.useRef)(!1),d=of(t.tag,e=>null==e?void 0:e.renderedItems.length);return s=oF({store:t,alwaysVisible:i,...s}),s=ls({store:t,modal:r,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:u,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:d,...s,getPersistentElements(){var e;let n=(null==(e=s.getPersistentElements)?void 0:e.call(s))||[];if(!r||!t)return n;let{contentElement:i,baseElement:a}=t.getState();if(!a)return n;let o=n7(a),l=[];if((null==i?void 0:i.id)&&l.push('[aria-controls~="'.concat(i.id,'"]')),(null==a?void 0:a.id)&&l.push('[aria-controls~="'.concat(a.id,'"]')),!l.length)return[...n,a];let u=l.join(",");return[...n,...o.querySelectorAll(u)]},autoFocusOnHide:e=>!iM(a,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(e){var r,n;let i=null==t?void 0:t.getState(),a=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,s=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n'[aria-controls~="'.concat(e,'"]')).join(", ");return!!t&&e.matches(t)}return!1}(e.target,a,s))return!1;let l="function"==typeof o?o(e):o;return l&&(c.current="click"===e.type),l}})}),lu=o7(i9(function(e){return i3("div",ll(e))}),aX);(0,el.createContext)(null),(0,el.createContext)(null);var lc=i5([ar],[an]),ld=lc.useContext;lc.useScopedContext,lc.useProviderContext,lc.ContextProvider,lc.ScopedContextProvider;var lf={id:null};function lh(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function lm(e,t){return e.filter(e=>e.rowId===t)}function lp(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function lA(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var lg=iR()&&iT();function lv(){let{tag:e,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=a6(t.store,function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:{},r=null==(e=t.store)?void 0:e.getState(),n=function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a4(r,r.store);let n=null==(e=r.store)?void 0:e.getState(),i=iF(r.items,null==n?void 0:n.items,r.defaultItems,[]),a=new Map(i.map(e=>[e.id,e])),o={items:i,renderedItems:iF(null==n?void 0:n.renderedItems,[])},s=null==(t=r.store)?void 0:t.__unstablePrivateStore,l=a0({items:i,renderedItems:o.renderedItems},s),u=a0(o,r.store),c=e=>{let t=function(e,t){let r=e.map((e,t)=>[t,e]),n=!1;return(r.sort((e,r)=>{var i;let[a,o]=e,[s,l]=r,u=t(o),c=t(l);return u!==c&&u&&c?(i=u,c.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_PRECEDING)?(a>s&&(n=!0),-1):(a{let[t,r]=e;return r}):e}(e,e=>e.element);l.setState("renderedItems",t),u.setState("renderedItems",t)};a1(u,()=>a9(l)),a1(l,()=>a8(l,["items"],e=>{u.setState("items",e.items)})),a1(l,()=>a8(l,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=u.getState();e.renderedItems!==t&&c(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let n=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>c(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),n=[...e].reverse().find(e=>!!e.element),i=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;i&&(null==n?void 0:n.element);){let e=i;if(n&&e.contains(n.element))return i;i=i.parentElement}return n7(i).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&n.observe(t.element);return()=>{cancelAnimationFrame(r),n.disconnect()}}));let d=function(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t(t=>{let n=t.findIndex(t=>{let{id:r}=t;return r===e.id}),i=t.slice();if(-1!==n){let o={...r=t[n],...e};i[n]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!r)return n&&a.delete(e.id),t.filter(t=>{let{id:r}=t;return r!==e.id});let i=t.findIndex(t=>{let{id:r}=t;return r===e.id});if(-1===i)return t;let o=t.slice();return o[i]=r,a.set(e.id,r),o})}},f=e=>d(e,e=>l.setState("items",e),!0);return{...u,registerItem:f,renderItem:e=>iC(f(e),d(e,e=>l.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=l.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:l}}(t),i=iF(t.activeId,null==r?void 0:r.activeId,t.defaultActiveId),a=a0({...n.getState(),id:iF(t.id,null==r?void 0:r.id,"id-".concat(Math.random().toString(36).slice(2,8))),activeId:i,baseElement:iF(null==r?void 0:r.baseElement,null),includesBaseElement:iF(t.includesBaseElement,null==r?void 0:r.includesBaseElement,null===i),moves:iF(null==r?void 0:r.moves,0),orientation:iF(t.orientation,null==r?void 0:r.orientation,"both"),rtl:iF(t.rtl,null==r?void 0:r.rtl,!1),virtualFocus:iF(t.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:iF(t.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:iF(t.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:iF(t.focusShift,null==r?void 0:r.focusShift,!1)},n,t.store);a1(a,()=>a3(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=lh(e.renderedItems))?void 0:r.id})}));let o=function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"next",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=a.getState(),{skip:o=0,activeId:s=i.activeId,focusShift:l=i.focusShift,focusLoop:u=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:d=i.includesBaseElement,renderedItems:f=i.renderedItems,rtl:h=i.rtl}=n,m="up"===r||"down"===r,p="next"===r||"down"===r,A=m?aS(function(e,t,r){let n=lA(e);for(let i of e)for(let e=0;ee.id===s);if(!g)return null==(t=lh(A))?void 0:t.id;let B=A.some(e=>e.rowId),C=A.indexOf(g),y=A.slice(C+1),b=lm(y,g.rowId);if(o){let e=b.filter(e=>s?!e.disabled&&e.id!==s:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let M=u&&(m?"horizontal"!==u:"vertical"!==u),x=B&&c&&(m?"horizontal"!==c:"vertical"!==c),E=p?(!B||m)&&M&&d:!!m&&d;if(M){let e=lh(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[lf]:[],...e.slice(0,n)]}(x&&!E?A:lm(A,g.rowId),s,E),s);return null==e?void 0:e.id}if(x){let e=lh(E?b:y,s);return E?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let F=lh(b,s);return!F&&E?null:null==F?void 0:F.id};return{...n,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=lh(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=lh(aT(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("up",e))}}({...t,activeId:a,includesBaseElement:iF(t.includesBaseElement,null==i?void 0:i.includesBaseElement,!0),orientation:iF(t.orientation,null==i?void 0:i.orientation,"vertical"),focusLoop:iF(t.focusLoop,null==i?void 0:i.focusLoop,!0),focusWrap:iF(t.focusWrap,null==i?void 0:i.focusWrap,!0),virtualFocus:iF(t.virtualFocus,null==i?void 0:i.virtualFocus,!0)}),s=function(){let{popover:e,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=a6(t.store,a5(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));a4(t,r);let n=null==r?void 0:r.getState(),i=o8({...t,store:r}),a=iF(t.placement,null==n?void 0:n.placement,"bottom"),o=a0({...i.getState(),placement:a,currentPlacement:a,anchorElement:iF(null==n?void 0:n.anchorElement,null),popoverElement:iF(null==n?void 0:n.popoverElement,null),arrowElement:iF(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...o,setAnchorElement:e=>o.setState("anchorElement",e),setPopoverElement:e=>o.setState("popoverElement",e),setArrowElement:e=>o.setState("arrowElement",e),render:()=>o.setState("rendered",Symbol("rendered"))}}({...t,placement:iF(t.placement,null==i?void 0:i.placement,"bottom-start")}),l=iF(t.value,null==i?void 0:i.value,t.defaultValue,""),u=iF(t.selectedValue,null==i?void 0:i.selectedValue,null==n?void 0:n.values,t.defaultSelectedValue,""),c=Array.isArray(u),d={...o.getState(),...s.getState(),value:l,selectedValue:u,resetValueOnSelect:iF(t.resetValueOnSelect,null==i?void 0:i.resetValueOnSelect,c),resetValueOnHide:iF(t.resetValueOnHide,null==i?void 0:i.resetValueOnHide,c&&!e),activeValue:null==i?void 0:i.activeValue},f=a0(d,o,s,r);return lg&&a1(f,()=>a3(f,["virtualFocus"],()=>{f.setState("virtualFocus",!1)})),a1(f,()=>{if(e)return iC(a3(f,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),a3(e,["values"],e=>{f.setState("selectedValue",e.values)}))}),a1(f,()=>a3(f,["resetValueOnHide","mounted"],e=>{e.resetValueOnHide&&(e.mounted||f.setState("value",l))})),a1(f,()=>a3(f,["open"],e=>{e.open||(f.setState("activeId",a),f.setState("moves",0))})),a1(f,()=>a3(f,["moves","activeId"],(e,t)=>{e.moves===t.moves&&f.setState("activeValue",void 0)})),a1(f,()=>a8(f,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=f.getState(),n=o.item(r);f.setState("activeValue",null==n?void 0:n.value)})),{...s,...o,...f,tag:e,setValue:e=>f.setState("value",e),resetValue:()=>f.setState("value",d.value),setSelectedValue:e=>f.setState("selectedValue",e)}}function lB(){var e,t,r,n,i,a;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[s,l]=op(lv,o=function(e){var t;let r=ld();return{id:iK((t=e={...e,tag:void 0!==e.tag?e.tag:r}).id),...t}}(o));return iQ(l,[(e=o).tag]),om(s,e,"value","setValue"),om(s,e,"selectedValue","setSelectedValue"),om(s,e,"resetValueOnHide"),om(s,e,"resetValueOnSelect"),Object.assign((n=s,iQ(i=l,[(a=e).popover]),om(n,a,"placement"),t=o9(n,i,a),r=t,iQ(l,[e.store]),om(r,e,"items","setItems"),om(t=r,e,"activeId","setActiveId"),om(t,e,"includesBaseElement"),om(t,e,"virtualFocus"),om(t,e,"orientation"),om(t,e,"rtl"),om(t,e,"focusLoop"),om(t,e,"focusWrap"),om(t,e,"focusShift"),t),{tag:e.tag})}function lC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=lB(e);return(0,es.jsx)(aq,{value:t,children:e.children})}var ly=(0,el.createContext)(void 0),lb=i8(function(e){let[t,r]=(0,el.useState)();return iE(e={role:"group","aria-labelledby":t,...e=iX(e,e=>(0,es.jsx)(ly.Provider,{value:r,children:e}),[])})});i9(function(e){return i3("div",lb(e))});var lM=i8(function(e){let{store:t,...r}=e;return lb(r)});i9(function(e){return i3("div",lM(e))});var lx=i8(function(e){let{store:t,...r}=e,n=aV();return ib(t=t||n,!1),"grid"===id(t.useState("contentElement"))&&(r={role:"rowgroup",...r}),r=lM({store:t,...r})}),lE=i9(function(e){return i3("div",lx(e))}),lF=i8(function(e){let t=(0,el.useContext)(ly),r=iK(e.id);return ij(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),iE(e={id:r,"aria-hidden":!0,...e})});i9(function(e){return i3("div",lF(e))});var lS=i8(function(e){let{store:t,...r}=e;return lF(r)});i9(function(e){return i3("div",lS(e))});var lT=i8(function(e){return lS(e)}),lw=i9(function(e){return i3("div",lT(e))}),lR=e.i(38360);let lD={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},lI=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function lG(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{keys:n,threshold:i=lD.MATCHES,baseSort:a=lI,sorter:o=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:a,keyIndex:o}=t;return n!==a?n>a?-1:1:i===o?r(e,t):i{let{rank:n,rankedValue:i,keyIndex:a,keyThreshold:o}=e,{itemValue:s,attributes:l}=t,d=lL(s,u,c),f=i,{minRanking:h,maxRanking:m,threshold:p}=l;return d=lD.MATCHES?d=h:d>m&&(d=m),d>n&&(n=d,a=r,o=p,f=s),{rankedValue:f,rank:n,keyIndex:a,keyThreshold:o}},{rankedValue:s,rank:lD.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:s,rank:lL(s,u,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:f,keyThreshold:h=i}=d;return f>=h&&e.push({...d,item:a,index:o}),e},[])).map(e=>{let{item:t}=e;return t})}function lL(e,t,r){if(e=lP(e,r),(t=lP(t,r)).length>e.length)return lD.NO_MATCH;if(e===t)return lD.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),a=i.value;if(e.length===t.length&&0===a)return lD.EQUAL;if(0===a)return lD.STARTS_WITH;let o=i;for(;!o.done;){if(o.value>0&&" "===e[o.value-1])return lD.WORD_STARTS_WITH;o=n.next()}return a>0?lD.CONTAINS:1===t.length?lD.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return lD.NO_MATCH;var o=n-a;let s=r/t.length;return lD.MATCHES+1/o*s}(e,t)}function lP(e,t){let{keepDiacritics:r}=t;return e="".concat(e),r||(e=(0,lR.default)(e)),e}lG.rankings=lD;let lH={maxRanking:1/0,minRanking:-1/0};var lO=e.i(29402);let lk=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),l_={"missions.vl2":"Official","TR2final105-client.vl2":"Team Rabbit 2","z_mappacks/CTF/Classic_maps_v1.vl2":"Classic","z_mappacks/CTF/DynamixFinalPack.vl2":"Official","z_mappacks/CTF/KryMapPack_b3EDIT.vl2":"KryMapPack","z_mappacks/CTF/S5maps.vl2":"S5","z_mappacks/CTF/S8maps.vl2":"S8","z_mappacks/CTF/TWL-MapPack.vl2":"TWL","z_mappacks/CTF/TWL-MapPackEDIT.vl2":"TWL","z_mappacks/CTF/TWL2-MapPack.vl2":"TWL2","z_mappacks/CTF/TWL2-MapPackEDIT.vl2":"TWL2","z_mappacks/TWL_T2arenaOfficialMaps.vl2":"Arena","z_mappacks/z_DMP2-V0.6.vl2":"DMP2 (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX.vl2":"DMP (Discord Map Pack)"},lU={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},lj=(0,nT.getMissionList)().filter(e=>!lk.has(e)).map(e=>{var t,r;let n=(0,nT.getMissionInfo)(e),[i]=(0,nT.getSourceAndPath)(n.resourcePath),a=(e=>{let t=e.match(/^(.*)(\/[^/]+)$/);return t?t[1]:""})(i),o=null!=(r=null!=(t=l_[i])?t:lU[a])?r:null;return{resourcePath:n.resourcePath,missionName:e,displayName:n.displayName,sourcePath:i,groupName:o,missionTypes:n.missionTypes}}),lJ=new Map(lj.map(e=>[e.missionName,e])),lN=function(e){let t=new Map;for(let n of e){var r;let e=null!=(r=t.get(n.groupName))?r:[];e.push(n),t.set(n.groupName,e)}return t.forEach((e,r)=>{t.set(r,(0,lO.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,lO.default)(Array.from(t.entries()),[e=>{let[t]=e;return"Official"===t?0:null==t?2:1},e=>{let[t]=e;return t?t.toLowerCase():""}],["asc","asc"])}(lj),lK="undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function lQ(e){let{mission:t}=e;return(0,es.jsxs)(es.Fragment,{children:[(0,es.jsxs)("span",{className:"MissionSelect-itemHeader",children:[(0,es.jsx)("span",{className:"MissionSelect-itemName",children:t.displayName||t.missionName}),t.missionTypes.length>0&&(0,es.jsx)("span",{className:"MissionSelect-itemTypes",children:t.missionTypes.map(e=>(0,es.jsx)("span",{className:"MissionSelect-itemType",children:e},e))})]}),(0,es.jsx)("span",{className:"MissionSelect-itemMissionName",children:t.missionName})]})}function lW(e){let{value:t,onChange:r}=e,[n,i]=(0,el.useState)(""),a=(0,el.useRef)(null),o=lB({resetValueOnHide:!0,selectedValue:t,setSelectedValue:e=>{e&&r(e)},setValue:e=>{(0,el.startTransition)(()=>i(e))}});(0,el.useEffect)(()=>{let e=e=>{if("k"===e.key&&(e.metaKey||e.ctrlKey)){var t;e.preventDefault(),null==(t=a.current)||t.focus(),o.show()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]);let s=lJ.get(t),l=(0,el.useMemo)(()=>n?{type:"flat",missions:lG(lj,n,{keys:["displayName","missionName"]})}:{type:"grouped",groups:lN},[n]),u=s?s.displayName||s.missionName:t,c="flat"===l.type?0===l.missions.length:0===l.groups.length;return(0,es.jsxs)(lC,{store:o,children:[(0,es.jsxs)("div",{className:"MissionSelect-inputWrapper",children:[(0,es.jsx)(or,{ref:a,autoSelect:!0,placeholder:u,className:"MissionSelect-input",onFocus:()=>{document.exitPointerLock(),o.show()}}),(0,es.jsx)("kbd",{className:"MissionSelect-shortcut",children:lK?"⌘K":"^K"})]}),(0,es.jsx)(lu,{gutter:4,fitViewport:!0,className:"MissionSelect-popover",children:(0,es.jsxs)(oS,{className:"MissionSelect-list",children:["flat"===l.type?l.missions.map(e=>(0,es.jsx)(oB,{value:e.missionName,className:"MissionSelect-item",focusOnHover:!0,children:(0,es.jsx)(lQ,{mission:e})},e.missionName)):l.groups.map(e=>{let[t,r]=e;return t?(0,es.jsxs)(lE,{className:"MissionSelect-group",children:[(0,es.jsx)(lw,{className:"MissionSelect-groupLabel",children:t}),r.map(e=>(0,es.jsx)(oB,{value:e.missionName,className:"MissionSelect-item",focusOnHover:!0,children:(0,es.jsx)(lQ,{mission:e})},e.missionName))]},t):(0,es.jsx)(el.Fragment,{children:r.map(e=>(0,es.jsx)(oB,{value:e.missionName,className:"MissionSelect-item",focusOnHover:!0,children:(0,es.jsx)(lQ,{mission:e})},e.missionName))},"ungrouped")}),c&&(0,es.jsx)("div",{className:"MissionSelect-noResults",children:"No missions found"})]})})]})}function lV(e){let{missionName:t,onChangeMission:r}=e,{fogEnabled:n,setFogEnabled:i,fov:a,setFov:o,audioEnabled:s,setAudioEnabled:l,animationEnabled:u,setAnimationEnabled:c}=(0,tw.useSettings)(),{speedMultiplier:d,setSpeedMultiplier:f}=(0,tw.useControls)(),{debugMode:h,setDebugMode:m}=(0,tw.useDebug)();return(0,es.jsxs)("div",{id:"controls",onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,es.jsx)(lW,{value:t,onChange:r}),(0,es.jsxs)("div",{className:"CheckboxField",children:[(0,es.jsx)("input",{id:"fogInput",type:"checkbox",checked:n,onChange:e=>{i(e.target.checked)}}),(0,es.jsx)("label",{htmlFor:"fogInput",children:"Fog?"})]}),(0,es.jsxs)("div",{className:"CheckboxField",children:[(0,es.jsx)("input",{id:"audioInput",type:"checkbox",checked:s,onChange:e=>{l(e.target.checked)}}),(0,es.jsx)("label",{htmlFor:"audioInput",children:"Audio?"})]}),(0,es.jsxs)("div",{className:"CheckboxField",children:[(0,es.jsx)("input",{id:"animationInput",type:"checkbox",checked:u,onChange:e=>{c(e.target.checked)}}),(0,es.jsx)("label",{htmlFor:"animationInput",children:"Animation?"})]}),(0,es.jsxs)("div",{className:"CheckboxField",children:[(0,es.jsx)("input",{id:"debugInput",type:"checkbox",checked:h,onChange:e=>{m(e.target.checked)}}),(0,es.jsx)("label",{htmlFor:"debugInput",children:"Debug?"})]}),(0,es.jsxs)("div",{className:"Field",children:[(0,es.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),(0,es.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:a,onChange:e=>o(parseInt(e.target.value))}),(0,es.jsx)("output",{htmlFor:"speedInput",children:a})]}),(0,es.jsxs)("div",{className:"Field",children:[(0,es.jsx)("label",{htmlFor:"speedInput",children:"Speed"}),(0,es.jsx)("input",{id:"speedInput",type:"range",min:.1,max:5,step:.05,value:d,onChange:e=>f(parseFloat(e.target.value))})]})]})}let lX=el.forwardRef((e,t)=>{let{envMap:r,resolution:n=256,frames:i=1/0,makeDefault:a,children:o,...s}=e,l=(0,tE.useThree)(e=>{let{set:t}=e;return t}),u=(0,tE.useThree)(e=>{let{camera:t}=e;return t}),c=(0,tE.useThree)(e=>{let{size:t}=e;return t}),d=el.useRef(null);el.useImperativeHandle(t,()=>d.current,[]);let f=el.useRef(null),h=function(e,t,r){let n=(0,tE.useThree)(e=>e.size),i=(0,tE.useThree)(e=>e.viewport),a="number"==typeof e?e:n.width*i.dpr,o=n.height*i.dpr,s=("number"==typeof e?void 0:e)||{},{samples:l=0,depth:u,...c}=s,d=null!=u?u:s.depthBuffer,f=el.useMemo(()=>{let e=new ef.WebGLRenderTarget(a,o,{minFilter:ef.LinearFilter,magFilter:ef.LinearFilter,type:ef.HalfFloatType,...c});return d&&(e.depthTexture=new ef.DepthTexture(a,o,ef.FloatType)),e.samples=l,e},[]);return el.useLayoutEffect(()=>{f.setSize(a,o),l&&(f.samples=l)},[l,f,a,o]),el.useEffect(()=>()=>f.dispose(),[]),f}(n);el.useLayoutEffect(()=>{s.manual||(d.current.aspect=c.width/c.height)},[c,s]),el.useLayoutEffect(()=>{d.current.updateProjectionMatrix()});let m=0,p=null,A="function"==typeof o;return(0,tx.useFrame)(e=>{A&&(i===1/0||m{if(a)return l(()=>({camera:d.current})),()=>l(()=>({camera:u}))},[d,a,l]),el.createElement(el.Fragment,null,el.createElement("perspectiveCamera",(0,tW.default)({ref:d},s),!A&&o),el.createElement("group",{ref:f},A&&o(h.texture)))});function lq(){let{fov:e}=(0,tw.useSettings)();return(0,es.jsx)(lX,{makeDefault:!0,position:[0,256,0],fov:e})}var lY=e.i(51434),lz=e.i(81405);function lZ(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function l$(e){let{showPanel:t=0,className:r,parent:n}=e,i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,[n,i]=el.useState();return el.useLayoutEffect(()=>{let t=e();return i(t),lZ(r,t),()=>lZ(r,null)},t),n}(()=>new lz.default,[]);return el.useEffect(()=>{if(i){let e=n&&n.current||document.body;i.showPanel(t),null==e||e.appendChild(i.dom);let a=(null!=r?r:"").split(" ").filter(e=>e);a.length&&i.dom.classList.add(...a);let o=(0,ec.j)(()=>i.begin()),s=(0,ec.k)(()=>i.end());return()=>{a.length&&i.dom.classList.remove(...a),null==e||e.removeChild(i.dom),o(),s()}}},[n,i,r,t]),null}var l0=e.i(60099);function l1(){let{debugMode:e}=(0,tw.useDebug)(),t=(0,el.useRef)(null);return(0,el.useEffect)(()=>{let e=t.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")}),e?(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)(l$,{className:"StatsPanel"}),(0,es.jsx)("axesHelper",{ref:t,args:[70],renderOrder:999,children:(0,es.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),(0,es.jsx)(l0.Html,{position:[80,0,0],center:!0,children:(0,es.jsx)("span",{className:"AxisLabel","data-axis":"y",children:"Y"})}),(0,es.jsx)(l0.Html,{position:[0,80,0],center:!0,children:(0,es.jsx)("span",{className:"AxisLabel","data-axis":"z",children:"Z"})}),(0,es.jsx)(l0.Html,{position:[0,0,80],center:!0,children:(0,es.jsx)("span",{className:"AxisLabel","data-axis":"x",children:"X"})})]}):null}let l9=new nj,l2={toneMapping:ef.NoToneMapping,outputColorSpace:ef.SRGBColorSpace};function l3(){let e=(0,eu.useSearchParams)(),t=(0,eu.useRouter)(),[r,n]=(0,el.useState)(e.get("mission")||"TWL2_WoodyMyrk"),[i,a]=(0,el.useState)(0),[o,s]=(0,el.useState)(!0),l=i<1;(0,el.useEffect)(()=>{if(l)s(!0);else{let e=setTimeout(()=>s(!1),500);return()=>clearTimeout(e)}},[l]),(0,el.useEffect)(()=>(window.setMissionName=n,window.getMissionList=nT.getMissionList,window.getMissionInfo=nT.getMissionInfo,()=>{delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo}),[]),(0,el.useEffect)(()=>{let e=new URLSearchParams;e.set("mission",r),t.replace("?".concat(e.toString()),{scroll:!1})},[r,t]);let u=(0,el.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;a(t)},[]);return(0,es.jsx)(tA,{client:l9,children:(0,es.jsx)("main",{children:(0,es.jsxs)(tw.SettingsProvider,{children:[(0,es.jsxs)("div",{id:"canvasContainer",children:[o&&(0,es.jsxs)("div",{id:"loadingIndicator","data-complete":!l,children:[(0,es.jsx)("div",{className:"LoadingSpinner"}),(0,es.jsx)("div",{className:"LoadingProgress",children:(0,es.jsx)("div",{className:"LoadingProgress-bar",style:{width:"".concat(100*i,"%")}})}),(0,es.jsxs)("div",{className:"LoadingProgress-text",children:[Math.round(100*i),"%"]})]}),(0,es.jsx)(ev,{frameloop:"always",gl:l2,shadows:"soft",children:(0,es.jsx)(ny,{children:(0,es.jsxs)(lY.AudioProvider,{children:[(0,es.jsx)(nI,{name:r,onLoadingChange:u},r),(0,es.jsx)(lq,{}),(0,es.jsx)(l1,{}),(0,es.jsx)(n6,{})]})})})]}),(0,es.jsx)(lV,{missionName:r,onChangeMission:n})]})})})}function l8(){return(0,es.jsx)(el.Suspense,{children:(0,es.jsx)(l3,{})})}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/440c894c0d872ba4.js b/docs/_next/static/chunks/440c894c0d872ba4.js new file mode 100644 index 00000000..4ce3ebe3 --- /dev/null +++ b/docs/_next/static/chunks/440c894c0d872ba4.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42585,e=>{"use strict";e.s(["WaterBlock",()=>x,"WaterMaterial",()=>h],42585);var n,t=e.i(43476),a=e.i(71645),o=e.i(31067),r=e.i(90072);let i=(n=0,a.forwardRef((e,n)=>{let{args:t,children:r,...i}=e,l=a.useRef(null);return a.useImperativeHandle(n,()=>l.current),a.useLayoutEffect(()=>void 0),a.createElement("mesh",(0,o.default)({ref:l},i),a.createElement("boxGeometry",{attach:"geometry",args:t}),r)}));var l=e.i(47071),s=e.i(5230),u=e.i(16096),c=e.i(12979),f=e.i(62395),v=e.i(75567),d=e.i(48066),m=e.i(47021);let p="\n #include \n\n // Enable volumetric fog (must be defined before fog uniforms)\n #ifdef USE_FOG\n #define USE_VOLUMETRIC_FOG\n #define USE_FOG_WORLD_POSITION\n #endif\n\n uniform float uTime;\n uniform float uOpacity;\n uniform float uEnvMapIntensity;\n uniform sampler2D uBaseTexture;\n uniform sampler2D uEnvMapTexture;\n\n // Volumetric fog uniforms\n #ifdef USE_FOG\n uniform float fogVolumeData[12];\n uniform float cameraHeight;\n uniform bool fogEnabled;\n varying vec3 vFogWorldPosition;\n #endif\n\n varying vec3 vWorldPosition;\n varying vec3 vViewVector;\n varying float vDistance;\n\n #define TWO_PI 6.283185307179586\n\n // Constants from Tribes 2 engine\n #define BASE_DRIFT_CYCLE_TIME 8.0\n #define BASE_DRIFT_RATE 0.02\n #define BASE_DRIFT_SCALAR 0.03\n #define TEXTURE_SCALE (1.0 / 48.0)\n\n // Environment map UV wobble constants\n #define Q1 150.0\n #define Q2 2.0\n #define Q3 0.01\n\n // Rotate UV coordinates\n vec2 rotateUV(vec2 uv, float angle) {\n float c = cos(angle);\n float s = sin(angle);\n return vec2(\n uv.x * c - uv.y * s,\n uv.x * s + uv.y * c\n );\n }\n\n void main() {\n // Calculate base texture UVs using world position (1/48 tiling)\n vec2 baseUV = vWorldPosition.xz * TEXTURE_SCALE;\n\n // Phase (time in radians for drift cycle)\n float phase = mod(uTime * (TWO_PI / BASE_DRIFT_CYCLE_TIME), TWO_PI);\n\n // Base texture drift\n float baseDriftX = uTime * BASE_DRIFT_RATE;\n float baseDriftY = cos(phase) * BASE_DRIFT_SCALAR;\n\n // === Phase 1a: First base texture pass (rotated 30 degrees) ===\n vec2 uv1a = rotateUV(baseUV, radians(30.0));\n\n // === Phase 1b: Second base texture pass (rotated 60 degrees total, with drift) ===\n vec2 uv1b = rotateUV(baseUV + vec2(baseDriftX, baseDriftY), radians(60.0));\n\n // Calculate cross-fade swing value\n float A1 = cos(((vWorldPosition.x / Q1) + (uTime / Q2)) * 6.0);\n float A2 = sin(((vWorldPosition.z / Q1) + (uTime / Q2)) * TWO_PI);\n float swing = (A1 + A2) * 0.15 + 0.5;\n\n // Cross-fade alpha calculation from engine\n float alpha1a = ((1.0 - swing) * uOpacity) / max(1.0 - (swing * uOpacity), 0.001);\n float alpha1b = swing * uOpacity;\n\n // Sample base texture for both passes\n vec4 texColor1a = texture2D(uBaseTexture, uv1a);\n vec4 texColor1b = texture2D(uBaseTexture, uv1b);\n\n // Combined alpha and color\n float combinedAlpha = 1.0 - (1.0 - alpha1a) * (1.0 - alpha1b);\n vec3 baseColor = (texColor1a.rgb * alpha1a * (1.0 - alpha1b) + texColor1b.rgb * alpha1b) / max(combinedAlpha, 0.001);\n\n // === Phase 3: Environment map / specular ===\n vec3 reflectVec = -vViewVector;\n reflectVec.y = abs(reflectVec.y);\n if (reflectVec.y < 0.001) reflectVec.y = 0.001;\n\n vec2 envUV;\n if (vDistance < 0.001) {\n envUV = vec2(0.0);\n } else {\n float value = (vDistance - reflectVec.y) / (vDistance * vDistance);\n envUV.x = reflectVec.x * value;\n envUV.y = reflectVec.z * value;\n }\n\n envUV = envUV * 0.5 + 0.5;\n envUV.x += A1 * Q3;\n envUV.y += A2 * Q3;\n\n vec4 envColor = texture2D(uEnvMapTexture, envUV);\n vec3 finalColor = baseColor + envColor.rgb * envColor.a * uEnvMapIntensity;\n\n // Note: Tribes 2 water does NOT use lighting - Phase 2 (lightmap) is disabled\n // in the original engine. Water colors come directly from textures.\n\n gl_FragColor = vec4(finalColor, combinedAlpha);\n\n // Apply volumetric fog using shared Torque-style fog shader\n ".concat(m.fogFragmentShader,"\n }\n");var g=e.i(79123);function h(e){let{surfaceTexture:n,attach:a}=e,o=(0,c.textureToUrl)(n),i=(0,l.useTexture)(o,e=>(0,v.setupColor)(e));return(0,t.jsx)("meshStandardMaterial",{attach:a,map:i,transparent:!0,opacity:.8,side:r.DoubleSide})}let x=(0,a.memo)(function(e){var n,o,l,c;let{object:v}=e,{debugMode:d}=(0,g.useDebug)(),m=(0,a.useMemo)(()=>(0,f.getRotation)(v),[v]),p=(0,a.useMemo)(()=>(0,f.getPosition)(v),[v]),h=(0,a.useMemo)(()=>(0,f.getScale)(v),[v]),[x,b,y]=h,M=(0,u.useThree)(e=>e.camera),w=function(){let e=(0,a.useRef)(null);return(0,a.useCallback)(n=>{if(!e.current)return e.current=n.clone(),!0;let t=e.current.x===n.x&&e.current.y===n.y&&e.current.z===n.z;return t||e.current.copy(n),t},[])}();p[1];let E=null!=(n=(0,f.getFloat)(v,"waveMagnitude"))?n:1,P=(0,a.useMemo)(()=>{let[e,n,t]=p,a=Math.round((e+1024)/8),o=Math.round((t+1024)/8);return[8*(a=Math.max(0,Math.min(2040,a))),n,8*(o=Math.max(0,Math.min(2040,o)))]},[p]),S=(e,n)=>{let t=e+1024,a=n+1024,o=Math.trunc(t/2048),r=Math.trunc(a/2048);t<0&&o--,a<0&&r--;let i=[];for(let e=r-1;e<=r+1;e++)for(let n=o-1;n<=o+1;n++)i.push([n,e]);return i},[V,_]=(0,a.useState)(()=>S(M.position.x,M.position.z));(0,s.useFrame)(()=>{if(!w(M.position))return;let e=S(M.position.x,M.position.z);_(n=>JSON.stringify(n)===JSON.stringify(e)?n:e)});let U=null!=(o=(0,f.getProperty)(v,"surfaceTexture"))?o:"liquidTiles/BlueWater",C=(0,f.getProperty)(v,"envMapTexture"),F=null!=(l=(0,f.getFloat)(v,"surfaceOpacity"))?l:.75,D=null!=(c=(0,f.getFloat)(v,"envMapIntensity"))?c:1,A=(0,a.useMemo)(()=>{let[e,n]=function(e,n){let t=e<=1024&&n<=1024?8:16;return[Math.max(4,Math.ceil(e/t)),Math.max(4,Math.ceil(n/t))]}(x,y),t=new r.PlaneGeometry(x,y,e,n);return t.rotateX(-Math.PI/2),t.translate(x/2,b,y/2),t},[x,b,y]);return(0,a.useEffect)(()=>()=>{A.dispose()},[A]),(0,t.jsxs)("group",{quaternion:m,children:[d&&(0,t.jsx)(i,{args:h,position:[p[0]+x/2,p[1]+b/2,p[2]+y/2],children:(0,t.jsx)("meshBasicMaterial",{color:"#00fbff",wireframe:!0})}),(0,t.jsx)(a.Suspense,{fallback:V.map(e=>{let[n,a]=e,o=P[0]+2048*n-1024,i=P[2]+2048*a-1024;return(0,t.jsx)("mesh",{geometry:A,position:[o,P[1],i],children:(0,t.jsx)("meshStandardMaterial",{color:"#00fbff",transparent:!0,opacity:.4,wireframe:!0,side:r.DoubleSide})},"".concat(n,",").concat(a))}),children:(0,t.jsx)(T,{reps:V,basePosition:P,surfaceGeometry:A,surfaceTexture:U,envMapTexture:C,opacity:F,waveMagnitude:E,envMapIntensity:D})})]})}),T=(0,a.memo)(function(e){let{reps:n,basePosition:o,surfaceGeometry:i,surfaceTexture:u,envMapTexture:f,opacity:m,waveMagnitude:h,envMapIntensity:x}=e,T=(0,c.textureToUrl)(u),b=(0,c.textureToUrl)(null!=f?f:"special/lush_env"),[y,M]=(0,l.useTexture)([T,b],e=>{(Array.isArray(e)?e:[e]).forEach(e=>{(0,v.setupColor)(e),e.colorSpace=r.NoColorSpace,e.wrapS=r.RepeatWrapping,e.wrapT=r.RepeatWrapping})}),{animationEnabled:w}=(0,g.useSettings)(),E=(0,a.useMemo)(()=>{var e,n,t,a,o,i;return e={opacity:m,waveMagnitude:h,envMapIntensity:x,baseTexture:y,envMapTexture:M},new r.ShaderMaterial({uniforms:{uTime:{value:0},uOpacity:{value:null!=(n=null==e?void 0:e.opacity)?n:.75},uWaveMagnitude:{value:null!=(t=null==e?void 0:e.waveMagnitude)?t:1},uEnvMapIntensity:{value:null!=(a=null==e?void 0:e.envMapIntensity)?a:1},uBaseTexture:{value:null!=(o=null==e?void 0:e.baseTexture)?o:null},uEnvMapTexture:{value:null!=(i=null==e?void 0:e.envMapTexture)?i:null},fogColor:{value:new r.Color},fogNear:{value:1},fogFar:{value:2e3},fogVolumeData:d.globalFogUniforms.fogVolumeData,cameraHeight:d.globalFogUniforms.cameraHeight,fogEnabled:d.globalFogUniforms.fogEnabled},vertexShader:"\n #include \n\n #ifdef USE_FOG\n #define USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n #endif\n\n uniform float uTime;\n uniform float uWaveMagnitude;\n\n varying vec3 vWorldPosition;\n varying vec3 vViewVector;\n varying float vDistance;\n\n // Wave function matching Tribes 2 engine\n // Z = surfaceZ + (sin(X*0.05 + time) + sin(Y*0.05 + time)) * waveFactor\n // waveFactor = waveAmplitude * 0.25\n // Note: Using xz for Three.js Y-up (Torque uses XY with Z-up)\n float getWaveHeight(vec3 worldPos) {\n float waveFactor = uWaveMagnitude * 0.25;\n return (sin(worldPos.x * 0.05 + uTime) + sin(worldPos.z * 0.05 + uTime)) * waveFactor;\n }\n\n void main() {\n // Get world position for wave calculation\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n vWorldPosition = worldPos.xyz;\n\n // Apply wave displacement to Y (vertical axis in Three.js)\n vec3 displaced = position;\n displaced.y += getWaveHeight(worldPos.xyz);\n\n // Calculate final world position after displacement for fog\n #ifdef USE_FOG\n vec4 displacedWorldPos = modelMatrix * vec4(displaced, 1.0);\n vFogWorldPosition = displacedWorldPos.xyz;\n #endif\n\n // Calculate view vector for environment mapping\n vViewVector = cameraPosition - worldPos.xyz;\n vDistance = length(vViewVector);\n\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(displaced, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n // Set fog depth (distance from camera) - normally done by fog_vertex include\n // but we can't use that include because it references 'transformed' which we don't have\n #ifdef USE_FOG\n vFogDepth = length(mvPosition.xyz);\n #endif\n }\n",fragmentShader:p,transparent:!0,side:r.DoubleSide,depthWrite:!0,fog:!0})},[m,h,x,y,M]),P=(0,a.useRef)(0);return(0,s.useFrame)((e,n)=>{w?(P.current+=n,E.uniforms.uTime.value=P.current):(P.current=0,E.uniforms.uTime.value=0)}),(0,a.useEffect)(()=>()=>{E.dispose()},[E]),(0,t.jsx)(t.Fragment,{children:n.map(e=>{let[n,a]=e,r=o[0]+2048*n-1024,l=o[2]+2048*a-1024;return(0,t.jsx)("mesh",{geometry:i,material:E,position:[r,o[1],l]},"".concat(n,",").concat(a))})})})}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/7251a2126000b924.js b/docs/_next/static/chunks/7251a2126000b924.js new file mode 100644 index 00000000..f2a2e679 --- /dev/null +++ b/docs/_next/static/chunks/7251a2126000b924.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(e,t,r)=>{t.exports=e.r(76562)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),a=RegExp(i,"g"),o=RegExp(i,"");function s(e){return n[e]}var l=function(e){return e.replace(a,s)};t.exports=l,t.exports.has=function(e){return!!e.match(o)},t.exports.remove=l},29402,(e,t,r)=>{var n,i,a="__lodash_hash_undefined__",o=1/0,s="[object Arguments]",l="[object Array]",u="[object Boolean]",c="[object Date]",d="[object Error]",f="[object Function]",h="[object Map]",m="[object Number]",p="[object Object]",A="[object Promise]",g="[object RegExp]",B="[object Set]",C="[object String]",y="[object Symbol]",b="[object WeakMap]",M="[object ArrayBuffer]",x="[object DataView]",E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,S=/^\./,T=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w=/\\(\\)?/g,R=/^\[object .+?Constructor\]$/,D=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[s]=I[l]=I[M]=I[u]=I[x]=I[c]=I[d]=I[f]=I[h]=I[m]=I[p]=I[g]=I[B]=I[C]=I[b]=!1;var G=e.g&&e.g.Object===Object&&e.g,L="object"==typeof self&&self&&self.Object===Object&&self,P=G||L||Function("return this")(),H=r&&!r.nodeType&&r,O=H&&t&&!t.nodeType&&t,_=O&&O.exports===H&&G.process,k=function(){try{return _&&_.binding("util")}catch(e){}}(),U=k&&k.isTypedArray;function j(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ey.prototype.set=function(e,t){var r=this.__data__,n=eE(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eb.prototype.clear=function(){this.__data__={hash:new eC,map:new(es||ey),string:new eC}},eb.prototype.delete=function(e){return eG(this,e).delete(e)},eb.prototype.get=function(e){return eG(this,e).get(e)},eb.prototype.has=function(e){return eG(this,e).has(e)},eb.prototype.set=function(e,t){return eG(this,e).set(e,t),this},eM.prototype.add=eM.prototype.push=function(e){return this.__data__.set(e,a),this},eM.prototype.has=function(e){return this.__data__.has(e)},ex.prototype.clear=function(){this.__data__=new ey},ex.prototype.delete=function(e){return this.__data__.delete(e)},ex.prototype.get=function(e){return this.__data__.get(e)},ex.prototype.has=function(e){return this.__data__.has(e)},ex.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ey){var n=r.__data__;if(!es||n.length<199)return n.push([e,t]),this;r=this.__data__=new eb(n)}return r.set(e,t),this};var eF=function(e,t){return function(r,n){if(null==r)return r;if(!eW(r))return e(r,n);for(var i=r.length,a=-1,o=Object(r);(t?a--:++as))return!1;var u=a.get(e);if(u&&a.get(t))return u==t;var c=-1,d=!0,f=1&i?new eM:void 0;for(a.set(e,t),a.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eq(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function ez(e){return"symbol"==typeof e||eY(e)&&$.call(e)==y}var eZ=U?J(U):function(e){return eY(e)&&eX(e.length)&&!!I[$.call(e)]};function e$(e){return eW(e)?function(e,t){var r=eQ(e)||eK(e)?function(e,t){for(var r=-1,n=Array(e);++rt||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;return l*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});l--;)s[l]=s[l].value;return s}(e,t,r))}},81405,(e,t,r)=>{e.e,t.exports=function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function r(e){for(var t=0;to+1e3&&(l.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:r}};return e.Panel=function(e,t,r){var n=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,l=48*o,u=3*o,c=2*o,d=3*o,f=15*o,h=74*o,m=30*o,p=document.createElement("canvas");p.width=s,p.height=l,p.style.cssText="width:80px;height:48px";var A=p.getContext("2d");return A.font="bold "+9*o+"px Helvetica,Arial,sans-serif",A.textBaseline="top",A.fillStyle=r,A.fillRect(0,0,s,l),A.fillStyle=t,A.fillText(e,u,c),A.fillRect(d,f,h,m),A.fillStyle=r,A.globalAlpha=.9,A.fillRect(d,f,h,m),{dom:p,update:function(l,g){n=Math.min(n,l),i=Math.max(i,l),A.fillStyle=r,A.globalAlpha=1,A.fillRect(0,0,s,f),A.fillStyle=t,A.fillText(a(l)+" "+e+" ("+a(n)+"-"+a(i)+")",u,c),A.drawImage(p,d+o,f,h-o,m,d,f,h-o,m),A.fillRect(d+h-o,f,o,m),A.fillStyle=r,A.globalAlpha=.9,A.fillRect(d+h-o,f,o,a((1-l/g)*m))}}},e}()},31713,e=>{"use strict";let t;e.s(["default",()=>l5],31713);var r,n,i,a,o,s,l,u,c,d,f,h,m,p,A,g,B,C,y,b,M,x,E,F,S,T,w,R,D,I,G,L,P,H,O,_,k,U,j,J,N,K,Q,W,V,X,q,Y,z,Z,$,ee,et,er,en,ei,ea,eo,es=e.i(43476),el=e.i(71645),eu=e.i(18566),ec=e.i(46712);e.s(["ACESFilmicToneMapping",()=>ef.ACESFilmicToneMapping,"AddEquation",()=>ef.AddEquation,"AddOperation",()=>ef.AddOperation,"AdditiveAnimationBlendMode",()=>ef.AdditiveAnimationBlendMode,"AdditiveBlending",()=>ef.AdditiveBlending,"AgXToneMapping",()=>ef.AgXToneMapping,"AlphaFormat",()=>ef.AlphaFormat,"AlwaysCompare",()=>ef.AlwaysCompare,"AlwaysDepth",()=>ef.AlwaysDepth,"AlwaysStencilFunc",()=>ef.AlwaysStencilFunc,"AmbientLight",()=>ef.AmbientLight,"AnimationAction",()=>ef.AnimationAction,"AnimationClip",()=>ef.AnimationClip,"AnimationLoader",()=>ef.AnimationLoader,"AnimationMixer",()=>ef.AnimationMixer,"AnimationObjectGroup",()=>ef.AnimationObjectGroup,"AnimationUtils",()=>ef.AnimationUtils,"ArcCurve",()=>ef.ArcCurve,"ArrayCamera",()=>ef.ArrayCamera,"ArrowHelper",()=>ef.ArrowHelper,"AttachedBindMode",()=>ef.AttachedBindMode,"Audio",()=>ef.Audio,"AudioAnalyser",()=>ef.AudioAnalyser,"AudioContext",()=>ef.AudioContext,"AudioListener",()=>ef.AudioListener,"AudioLoader",()=>ef.AudioLoader,"AxesHelper",()=>ef.AxesHelper,"BackSide",()=>ef.BackSide,"BasicDepthPacking",()=>ef.BasicDepthPacking,"BasicShadowMap",()=>ef.BasicShadowMap,"BatchedMesh",()=>ef.BatchedMesh,"Bone",()=>ef.Bone,"BooleanKeyframeTrack",()=>ef.BooleanKeyframeTrack,"Box2",()=>ef.Box2,"Box3",()=>ef.Box3,"Box3Helper",()=>ef.Box3Helper,"BoxGeometry",()=>ef.BoxGeometry,"BoxHelper",()=>ef.BoxHelper,"BufferAttribute",()=>ef.BufferAttribute,"BufferGeometry",()=>ef.BufferGeometry,"BufferGeometryLoader",()=>ef.BufferGeometryLoader,"ByteType",()=>ef.ByteType,"Cache",()=>ef.Cache,"Camera",()=>ef.Camera,"CameraHelper",()=>ef.CameraHelper,"CanvasTexture",()=>ef.CanvasTexture,"CapsuleGeometry",()=>ef.CapsuleGeometry,"CatmullRomCurve3",()=>ef.CatmullRomCurve3,"CineonToneMapping",()=>ef.CineonToneMapping,"CircleGeometry",()=>ef.CircleGeometry,"ClampToEdgeWrapping",()=>ef.ClampToEdgeWrapping,"Clock",()=>ef.Clock,"Color",()=>ef.Color,"ColorKeyframeTrack",()=>ef.ColorKeyframeTrack,"ColorManagement",()=>ef.ColorManagement,"CompressedArrayTexture",()=>ef.CompressedArrayTexture,"CompressedCubeTexture",()=>ef.CompressedCubeTexture,"CompressedTexture",()=>ef.CompressedTexture,"CompressedTextureLoader",()=>ef.CompressedTextureLoader,"ConeGeometry",()=>ef.ConeGeometry,"ConstantAlphaFactor",()=>ef.ConstantAlphaFactor,"ConstantColorFactor",()=>ef.ConstantColorFactor,"Controls",()=>ef.Controls,"CubeCamera",()=>ef.CubeCamera,"CubeReflectionMapping",()=>ef.CubeReflectionMapping,"CubeRefractionMapping",()=>ef.CubeRefractionMapping,"CubeTexture",()=>ef.CubeTexture,"CubeTextureLoader",()=>ef.CubeTextureLoader,"CubeUVReflectionMapping",()=>ef.CubeUVReflectionMapping,"CubicBezierCurve",()=>ef.CubicBezierCurve,"CubicBezierCurve3",()=>ef.CubicBezierCurve3,"CubicInterpolant",()=>ef.CubicInterpolant,"CullFaceBack",()=>ef.CullFaceBack,"CullFaceFront",()=>ef.CullFaceFront,"CullFaceFrontBack",()=>ef.CullFaceFrontBack,"CullFaceNone",()=>ef.CullFaceNone,"Curve",()=>ef.Curve,"CurvePath",()=>ef.CurvePath,"CustomBlending",()=>ef.CustomBlending,"CustomToneMapping",()=>ef.CustomToneMapping,"CylinderGeometry",()=>ef.CylinderGeometry,"Cylindrical",()=>ef.Cylindrical,"Data3DTexture",()=>ef.Data3DTexture,"DataArrayTexture",()=>ef.DataArrayTexture,"DataTexture",()=>ef.DataTexture,"DataTextureLoader",()=>ef.DataTextureLoader,"DataUtils",()=>ef.DataUtils,"DecrementStencilOp",()=>ef.DecrementStencilOp,"DecrementWrapStencilOp",()=>ef.DecrementWrapStencilOp,"DefaultLoadingManager",()=>ef.DefaultLoadingManager,"DepthFormat",()=>ef.DepthFormat,"DepthStencilFormat",()=>ef.DepthStencilFormat,"DepthTexture",()=>ef.DepthTexture,"DetachedBindMode",()=>ef.DetachedBindMode,"DirectionalLight",()=>ef.DirectionalLight,"DirectionalLightHelper",()=>ef.DirectionalLightHelper,"DiscreteInterpolant",()=>ef.DiscreteInterpolant,"DodecahedronGeometry",()=>ef.DodecahedronGeometry,"DoubleSide",()=>ef.DoubleSide,"DstAlphaFactor",()=>ef.DstAlphaFactor,"DstColorFactor",()=>ef.DstColorFactor,"DynamicCopyUsage",()=>ef.DynamicCopyUsage,"DynamicDrawUsage",()=>ef.DynamicDrawUsage,"DynamicReadUsage",()=>ef.DynamicReadUsage,"EdgesGeometry",()=>ef.EdgesGeometry,"EllipseCurve",()=>ef.EllipseCurve,"EqualCompare",()=>ef.EqualCompare,"EqualDepth",()=>ef.EqualDepth,"EqualStencilFunc",()=>ef.EqualStencilFunc,"EquirectangularReflectionMapping",()=>ef.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>ef.EquirectangularRefractionMapping,"Euler",()=>ef.Euler,"EventDispatcher",()=>ef.EventDispatcher,"ExternalTexture",()=>ef.ExternalTexture,"ExtrudeGeometry",()=>ef.ExtrudeGeometry,"FileLoader",()=>ef.FileLoader,"Float16BufferAttribute",()=>ef.Float16BufferAttribute,"Float32BufferAttribute",()=>ef.Float32BufferAttribute,"FloatType",()=>ef.FloatType,"Fog",()=>ef.Fog,"FogExp2",()=>ef.FogExp2,"FramebufferTexture",()=>ef.FramebufferTexture,"FrontSide",()=>ef.FrontSide,"Frustum",()=>ef.Frustum,"FrustumArray",()=>ef.FrustumArray,"GLBufferAttribute",()=>ef.GLBufferAttribute,"GLSL1",()=>ef.GLSL1,"GLSL3",()=>ef.GLSL3,"GreaterCompare",()=>ef.GreaterCompare,"GreaterDepth",()=>ef.GreaterDepth,"GreaterEqualCompare",()=>ef.GreaterEqualCompare,"GreaterEqualDepth",()=>ef.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>ef.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>ef.GreaterStencilFunc,"GridHelper",()=>ef.GridHelper,"Group",()=>ef.Group,"HalfFloatType",()=>ef.HalfFloatType,"HemisphereLight",()=>ef.HemisphereLight,"HemisphereLightHelper",()=>ef.HemisphereLightHelper,"IcosahedronGeometry",()=>ef.IcosahedronGeometry,"ImageBitmapLoader",()=>ef.ImageBitmapLoader,"ImageLoader",()=>ef.ImageLoader,"ImageUtils",()=>ef.ImageUtils,"IncrementStencilOp",()=>ef.IncrementStencilOp,"IncrementWrapStencilOp",()=>ef.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>ef.InstancedBufferAttribute,"InstancedBufferGeometry",()=>ef.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>ef.InstancedInterleavedBuffer,"InstancedMesh",()=>ef.InstancedMesh,"Int16BufferAttribute",()=>ef.Int16BufferAttribute,"Int32BufferAttribute",()=>ef.Int32BufferAttribute,"Int8BufferAttribute",()=>ef.Int8BufferAttribute,"IntType",()=>ef.IntType,"InterleavedBuffer",()=>ef.InterleavedBuffer,"InterleavedBufferAttribute",()=>ef.InterleavedBufferAttribute,"Interpolant",()=>ef.Interpolant,"InterpolateDiscrete",()=>ef.InterpolateDiscrete,"InterpolateLinear",()=>ef.InterpolateLinear,"InterpolateSmooth",()=>ef.InterpolateSmooth,"InterpolationSamplingMode",()=>ef.InterpolationSamplingMode,"InterpolationSamplingType",()=>ef.InterpolationSamplingType,"InvertStencilOp",()=>ef.InvertStencilOp,"KeepStencilOp",()=>ef.KeepStencilOp,"KeyframeTrack",()=>ef.KeyframeTrack,"LOD",()=>ef.LOD,"LatheGeometry",()=>ef.LatheGeometry,"Layers",()=>ef.Layers,"LessCompare",()=>ef.LessCompare,"LessDepth",()=>ef.LessDepth,"LessEqualCompare",()=>ef.LessEqualCompare,"LessEqualDepth",()=>ef.LessEqualDepth,"LessEqualStencilFunc",()=>ef.LessEqualStencilFunc,"LessStencilFunc",()=>ef.LessStencilFunc,"Light",()=>ef.Light,"LightProbe",()=>ef.LightProbe,"Line",()=>ef.Line,"Line3",()=>ef.Line3,"LineBasicMaterial",()=>ef.LineBasicMaterial,"LineCurve",()=>ef.LineCurve,"LineCurve3",()=>ef.LineCurve3,"LineDashedMaterial",()=>ef.LineDashedMaterial,"LineLoop",()=>ef.LineLoop,"LineSegments",()=>ef.LineSegments,"LinearFilter",()=>ef.LinearFilter,"LinearInterpolant",()=>ef.LinearInterpolant,"LinearMipMapLinearFilter",()=>ef.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>ef.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>ef.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>ef.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>ef.LinearSRGBColorSpace,"LinearToneMapping",()=>ef.LinearToneMapping,"LinearTransfer",()=>ef.LinearTransfer,"Loader",()=>ef.Loader,"LoaderUtils",()=>ef.LoaderUtils,"LoadingManager",()=>ef.LoadingManager,"LoopOnce",()=>ef.LoopOnce,"LoopPingPong",()=>ef.LoopPingPong,"LoopRepeat",()=>ef.LoopRepeat,"MOUSE",()=>ef.MOUSE,"Material",()=>ef.Material,"MaterialLoader",()=>ef.MaterialLoader,"MathUtils",()=>ef.MathUtils,"Matrix2",()=>ef.Matrix2,"Matrix3",()=>ef.Matrix3,"Matrix4",()=>ef.Matrix4,"MaxEquation",()=>ef.MaxEquation,"Mesh",()=>ef.Mesh,"MeshBasicMaterial",()=>ef.MeshBasicMaterial,"MeshDepthMaterial",()=>ef.MeshDepthMaterial,"MeshDistanceMaterial",()=>ef.MeshDistanceMaterial,"MeshLambertMaterial",()=>ef.MeshLambertMaterial,"MeshMatcapMaterial",()=>ef.MeshMatcapMaterial,"MeshNormalMaterial",()=>ef.MeshNormalMaterial,"MeshPhongMaterial",()=>ef.MeshPhongMaterial,"MeshPhysicalMaterial",()=>ef.MeshPhysicalMaterial,"MeshStandardMaterial",()=>ef.MeshStandardMaterial,"MeshToonMaterial",()=>ef.MeshToonMaterial,"MinEquation",()=>ef.MinEquation,"MirroredRepeatWrapping",()=>ef.MirroredRepeatWrapping,"MixOperation",()=>ef.MixOperation,"MultiplyBlending",()=>ef.MultiplyBlending,"MultiplyOperation",()=>ef.MultiplyOperation,"NearestFilter",()=>ef.NearestFilter,"NearestMipMapLinearFilter",()=>ef.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>ef.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>ef.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>ef.NearestMipmapNearestFilter,"NeutralToneMapping",()=>ef.NeutralToneMapping,"NeverCompare",()=>ef.NeverCompare,"NeverDepth",()=>ef.NeverDepth,"NeverStencilFunc",()=>ef.NeverStencilFunc,"NoBlending",()=>ef.NoBlending,"NoColorSpace",()=>ef.NoColorSpace,"NoToneMapping",()=>ef.NoToneMapping,"NormalAnimationBlendMode",()=>ef.NormalAnimationBlendMode,"NormalBlending",()=>ef.NormalBlending,"NotEqualCompare",()=>ef.NotEqualCompare,"NotEqualDepth",()=>ef.NotEqualDepth,"NotEqualStencilFunc",()=>ef.NotEqualStencilFunc,"NumberKeyframeTrack",()=>ef.NumberKeyframeTrack,"Object3D",()=>ef.Object3D,"ObjectLoader",()=>ef.ObjectLoader,"ObjectSpaceNormalMap",()=>ef.ObjectSpaceNormalMap,"OctahedronGeometry",()=>ef.OctahedronGeometry,"OneFactor",()=>ef.OneFactor,"OneMinusConstantAlphaFactor",()=>ef.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>ef.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>ef.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>ef.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>ef.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>ef.OneMinusSrcColorFactor,"OrthographicCamera",()=>ef.OrthographicCamera,"PCFShadowMap",()=>ef.PCFShadowMap,"PCFSoftShadowMap",()=>ef.PCFSoftShadowMap,"PMREMGenerator",()=>ed.PMREMGenerator,"Path",()=>ef.Path,"PerspectiveCamera",()=>ef.PerspectiveCamera,"Plane",()=>ef.Plane,"PlaneGeometry",()=>ef.PlaneGeometry,"PlaneHelper",()=>ef.PlaneHelper,"PointLight",()=>ef.PointLight,"PointLightHelper",()=>ef.PointLightHelper,"Points",()=>ef.Points,"PointsMaterial",()=>ef.PointsMaterial,"PolarGridHelper",()=>ef.PolarGridHelper,"PolyhedronGeometry",()=>ef.PolyhedronGeometry,"PositionalAudio",()=>ef.PositionalAudio,"PropertyBinding",()=>ef.PropertyBinding,"PropertyMixer",()=>ef.PropertyMixer,"QuadraticBezierCurve",()=>ef.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>ef.QuadraticBezierCurve3,"Quaternion",()=>ef.Quaternion,"QuaternionKeyframeTrack",()=>ef.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>ef.QuaternionLinearInterpolant,"RED_GREEN_RGTC2_Format",()=>ef.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>ef.RED_RGTC1_Format,"REVISION",()=>ef.REVISION,"RGBADepthPacking",()=>ef.RGBADepthPacking,"RGBAFormat",()=>ef.RGBAFormat,"RGBAIntegerFormat",()=>ef.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>ef.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>ef.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>ef.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>ef.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>ef.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>ef.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>ef.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>ef.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>ef.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>ef.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>ef.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>ef.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>ef.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>ef.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>ef.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>ef.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>ef.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>ef.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>ef.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>ef.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>ef.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>ef.RGBDepthPacking,"RGBFormat",()=>ef.RGBFormat,"RGBIntegerFormat",()=>ef.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>ef.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>ef.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>ef.RGB_ETC1_Format,"RGB_ETC2_Format",()=>ef.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>ef.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>ef.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>ef.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>ef.RGDepthPacking,"RGFormat",()=>ef.RGFormat,"RGIntegerFormat",()=>ef.RGIntegerFormat,"RawShaderMaterial",()=>ef.RawShaderMaterial,"Ray",()=>ef.Ray,"Raycaster",()=>ef.Raycaster,"RectAreaLight",()=>ef.RectAreaLight,"RedFormat",()=>ef.RedFormat,"RedIntegerFormat",()=>ef.RedIntegerFormat,"ReinhardToneMapping",()=>ef.ReinhardToneMapping,"RenderTarget",()=>ef.RenderTarget,"RenderTarget3D",()=>ef.RenderTarget3D,"RepeatWrapping",()=>ef.RepeatWrapping,"ReplaceStencilOp",()=>ef.ReplaceStencilOp,"ReverseSubtractEquation",()=>ef.ReverseSubtractEquation,"RingGeometry",()=>ef.RingGeometry,"SIGNED_RED_GREEN_RGTC2_Format",()=>ef.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>ef.SIGNED_RED_RGTC1_Format,"SRGBColorSpace",()=>ef.SRGBColorSpace,"SRGBTransfer",()=>ef.SRGBTransfer,"Scene",()=>ef.Scene,"ShaderChunk",()=>ed.ShaderChunk,"ShaderLib",()=>ed.ShaderLib,"ShaderMaterial",()=>ef.ShaderMaterial,"ShadowMaterial",()=>ef.ShadowMaterial,"Shape",()=>ef.Shape,"ShapeGeometry",()=>ef.ShapeGeometry,"ShapePath",()=>ef.ShapePath,"ShapeUtils",()=>ef.ShapeUtils,"ShortType",()=>ef.ShortType,"Skeleton",()=>ef.Skeleton,"SkeletonHelper",()=>ef.SkeletonHelper,"SkinnedMesh",()=>ef.SkinnedMesh,"Source",()=>ef.Source,"Sphere",()=>ef.Sphere,"SphereGeometry",()=>ef.SphereGeometry,"Spherical",()=>ef.Spherical,"SphericalHarmonics3",()=>ef.SphericalHarmonics3,"SplineCurve",()=>ef.SplineCurve,"SpotLight",()=>ef.SpotLight,"SpotLightHelper",()=>ef.SpotLightHelper,"Sprite",()=>ef.Sprite,"SpriteMaterial",()=>ef.SpriteMaterial,"SrcAlphaFactor",()=>ef.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>ef.SrcAlphaSaturateFactor,"SrcColorFactor",()=>ef.SrcColorFactor,"StaticCopyUsage",()=>ef.StaticCopyUsage,"StaticDrawUsage",()=>ef.StaticDrawUsage,"StaticReadUsage",()=>ef.StaticReadUsage,"StereoCamera",()=>ef.StereoCamera,"StreamCopyUsage",()=>ef.StreamCopyUsage,"StreamDrawUsage",()=>ef.StreamDrawUsage,"StreamReadUsage",()=>ef.StreamReadUsage,"StringKeyframeTrack",()=>ef.StringKeyframeTrack,"SubtractEquation",()=>ef.SubtractEquation,"SubtractiveBlending",()=>ef.SubtractiveBlending,"TOUCH",()=>ef.TOUCH,"TangentSpaceNormalMap",()=>ef.TangentSpaceNormalMap,"TetrahedronGeometry",()=>ef.TetrahedronGeometry,"Texture",()=>ef.Texture,"TextureLoader",()=>ef.TextureLoader,"TextureUtils",()=>ef.TextureUtils,"Timer",()=>ef.Timer,"TimestampQuery",()=>ef.TimestampQuery,"TorusGeometry",()=>ef.TorusGeometry,"TorusKnotGeometry",()=>ef.TorusKnotGeometry,"Triangle",()=>ef.Triangle,"TriangleFanDrawMode",()=>ef.TriangleFanDrawMode,"TriangleStripDrawMode",()=>ef.TriangleStripDrawMode,"TrianglesDrawMode",()=>ef.TrianglesDrawMode,"TubeGeometry",()=>ef.TubeGeometry,"UVMapping",()=>ef.UVMapping,"Uint16BufferAttribute",()=>ef.Uint16BufferAttribute,"Uint32BufferAttribute",()=>ef.Uint32BufferAttribute,"Uint8BufferAttribute",()=>ef.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>ef.Uint8ClampedBufferAttribute,"Uniform",()=>ef.Uniform,"UniformsGroup",()=>ef.UniformsGroup,"UniformsLib",()=>ed.UniformsLib,"UniformsUtils",()=>ef.UniformsUtils,"UnsignedByteType",()=>ef.UnsignedByteType,"UnsignedInt101111Type",()=>ef.UnsignedInt101111Type,"UnsignedInt248Type",()=>ef.UnsignedInt248Type,"UnsignedInt5999Type",()=>ef.UnsignedInt5999Type,"UnsignedIntType",()=>ef.UnsignedIntType,"UnsignedShort4444Type",()=>ef.UnsignedShort4444Type,"UnsignedShort5551Type",()=>ef.UnsignedShort5551Type,"UnsignedShortType",()=>ef.UnsignedShortType,"VSMShadowMap",()=>ef.VSMShadowMap,"Vector2",()=>ef.Vector2,"Vector3",()=>ef.Vector3,"Vector4",()=>ef.Vector4,"VectorKeyframeTrack",()=>ef.VectorKeyframeTrack,"VideoFrameTexture",()=>ef.VideoFrameTexture,"VideoTexture",()=>ef.VideoTexture,"WebGL3DRenderTarget",()=>ef.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>ef.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>ef.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>ef.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>ef.WebGLRenderTarget,"WebGLRenderer",()=>ed.WebGLRenderer,"WebGLUtils",()=>ed.WebGLUtils,"WebGPUCoordinateSystem",()=>ef.WebGPUCoordinateSystem,"WebXRController",()=>ef.WebXRController,"WireframeGeometry",()=>ef.WireframeGeometry,"WrapAroundEnding",()=>ef.WrapAroundEnding,"ZeroCurvatureEnding",()=>ef.ZeroCurvatureEnding,"ZeroFactor",()=>ef.ZeroFactor,"ZeroSlopeEnding",()=>ef.ZeroSlopeEnding,"ZeroStencilOp",()=>ef.ZeroStencilOp,"createCanvasElement",()=>ef.createCanvasElement],32009);var ed=e.i(8560),ef=e.i(90072),eh=e.i(32009);function em(e,t){let r;return function(){for(var n=arguments.length,i=Array(n),a=0;ae(...i),t)}}let ep=["x","y","top","bottom","left","right","width","height"];var eA=e.i(46791);function eg(e){let{ref:t,children:r,fallback:n,resize:i,style:a,gl:o,events:s=ec.f,eventSource:l,eventPrefix:u,shadows:c,linear:d,flat:f,legacy:h,orthographic:m,frameloop:p,dpr:A,performance:g,raycaster:B,camera:C,scene:y,onPointerMissed:b,onCreated:M,...x}=e;el.useMemo(()=>(0,ec.e)(eh),[]);let E=(0,ec.u)(),[F,S]=function(){var e,t,r;let{debounce:n,scroll:i,polyfill:a,offsetSize:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debounce:0,scroll:!1,offsetSize:!1},s=a||("undefined"==typeof window?class{}:window.ResizeObserver);if(!s)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[l,u]=(0,el.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,el.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:l,orientationHandler:null}),d=n?"number"==typeof n?n:n.scroll:null,f=n?"number"==typeof n?n:n.resize:null,h=(0,el.useRef)(!1);(0,el.useEffect)(()=>(h.current=!0,()=>void(h.current=!1)));let[m,p,A]=(0,el.useMemo)(()=>{let e=()=>{let e,t;if(!c.current.element)return;let{left:r,top:n,width:i,height:a,bottom:s,right:l,x:d,y:f}=c.current.element.getBoundingClientRect(),m={left:r,top:n,width:i,height:a,bottom:s,right:l,x:d,y:f};c.current.element instanceof HTMLElement&&o&&(m.height=c.current.element.offsetHeight,m.width=c.current.element.offsetWidth),Object.freeze(m),h.current&&(e=c.current.lastBounds,t=m,!ep.every(r=>e[r]===t[r]))&&u(c.current.lastBounds=m)};return[e,f?em(e,f):e,d?em(e,d):e]},[u,o,d,f]);function g(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",A,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null),c.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",c.current.orientationHandler))}function B(){c.current.element&&(c.current.resizeObserver=new s(A),c.current.resizeObserver.observe(c.current.element),i&&c.current.scrollContainers&&c.current.scrollContainers.forEach(e=>e.addEventListener("scroll",A,{capture:!0,passive:!0})),c.current.orientationHandler=()=>{A()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",c.current.orientationHandler))}return e=A,t=!!i,(0,el.useEffect)(()=>{if(t)return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",e,!0)},[e,t]),r=p,(0,el.useEffect)(()=>(window.addEventListener("resize",r),()=>void window.removeEventListener("resize",r)),[r]),(0,el.useEffect)(()=>{g(),B()},[i,A,p]),(0,el.useEffect)(()=>g,[]),[e=>{e&&e!==c.current.element&&(g(),c.current.element=e,c.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:a}=window.getComputedStyle(t);return[n,i,a].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),B())},l,m]}({scroll:!0,debounce:{scroll:50,resize:0},...i}),T=el.useRef(null),w=el.useRef(null);el.useImperativeHandle(t,()=>T.current);let R=(0,ec.a)(b),[D,I]=el.useState(!1),[G,L]=el.useState(!1);if(D)throw D;if(G)throw G;let P=el.useRef(null);(0,ec.b)(()=>{let e=T.current;S.width>0&&S.height>0&&e&&(P.current||(P.current=(0,ec.c)(e)),async function(){await P.current.configure({gl:o,scene:y,events:s,shadows:c,linear:d,flat:f,legacy:h,orthographic:m,frameloop:p,dpr:A,performance:g,raycaster:B,camera:C,size:S,onPointerMissed:function(){for(var e=arguments.length,t=Array(e),r=0;r{null==e.events.connect||e.events.connect(l?(0,ec.i)(l)?l.current:l:w.current),u&&e.setEvents({compute:(e,t)=>{let r=e[u+"X"],n=e[u+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==M||M(e)}}),P.current.render((0,es.jsx)(E,{children:(0,es.jsx)(ec.E,{set:L,children:(0,es.jsx)(el.Suspense,{fallback:(0,es.jsx)(ec.B,{set:I}),children:null!=r?r:null})})}))}())}),el.useEffect(()=>{let e=T.current;if(e)return()=>(0,ec.d)(e)},[]);let H=l?"none":"auto";return(0,es.jsx)("div",{ref:w,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:H,...a},...x,children:(0,es.jsx)("div",{ref:F,style:{width:"100%",height:"100%"},children:(0,es.jsx)("canvas",{ref:T,style:{display:"block"},children:n})})})}function ev(e){return(0,es.jsx)(eA.FiberProvider,{children:(0,es.jsx)(eg,{...e})})}function eB(e,t,r){if(!t.has(e))throw TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function eC(e,t){var r=eB(e,t,"get");return r.get?r.get.call(e):r.value}function ey(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function eb(e,t,r){ey(e,t),t.set(e,r)}function eM(e,t,r){var n=eB(e,t,"set");if(n.set)n.set.call(e,r);else{if(!n.writable)throw TypeError("attempted to set read only private field");n.value=r}return r}function ex(e,t,r){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return r}function eE(e,t){ey(e,t),t.add(e)}e.i(39695),e.i(98133),e.i(95087);var eF=class{subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}};e.i(47167);var eS={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},eT=new(r=new WeakMap,n=new WeakMap,class{setTimeoutProvider(e){eM(this,r,e)}setTimeout(e,t){return eC(this,r).setTimeout(e,t)}clearTimeout(e){eC(this,r).clearTimeout(e)}setInterval(e,t){return eC(this,r).setInterval(e,t)}clearInterval(e){eC(this,r).clearInterval(e)}constructor(){eb(this,r,{writable:!0,value:eS}),eb(this,n,{writable:!0,value:!1})}}),ew="undefined"==typeof window||"Deno"in globalThis;function eR(){}function eD(e){return"number"==typeof e&&e>=0&&e!==1/0}function eI(e,t){return Math.max(e+(t||0)-Date.now(),0)}function eG(e,t){return"function"==typeof e?e(t):e}function eL(e,t){return"function"==typeof e?e(t):e}function eP(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==eO(o,t.options))return!1}else if(!ek(t.queryKey,o))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&(!i||i===t.state.fetchStatus)&&(!a||!!a(t))}function eH(e,t){let{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(e_(t.options.mutationKey)!==e_(a))return!1}else if(!ek(t.options.mutationKey,a))return!1}return(!n||t.state.status===n)&&(!i||!!i(t))}function eO(e,t){return((null==t?void 0:t.queryKeyHashFn)||e_)(e)}function e_(e){return JSON.stringify(e,(e,t)=>eN(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function ek(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>ek(e[r],t[r]))}var eU=Object.prototype.hasOwnProperty;function ej(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function eJ(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function eN(e){if(!eK(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!eK(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function eK(e){return"[object Object]"===Object.prototype.toString.call(e)}function eQ(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let n=eJ(t)&&eJ(r);if(!n&&!(eN(t)&&eN(r)))return r;let i=(n?t:Object.keys(t)).length,a=n?r:Object.keys(r),o=a.length,s=n?Array(o):{},l=0;for(let u=0;u2&&void 0!==arguments[2]?arguments[2]:0,n=[...e,t];return r&&n.length>r?n.slice(1):n}function eV(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var eX=Symbol();function eq(e,t){return!e.queryFn&&(null==t?void 0:t.initialPromise)?()=>t.initialPromise:e.queryFn&&e.queryFn!==eX?e.queryFn:()=>Promise.reject(Error("Missing queryFn: '".concat(e.queryHash,"'")))}var eY=new(i=new WeakMap,a=new WeakMap,o=new WeakMap,class extends eF{onSubscribe(){eC(this,a)||this.setEventListener(eC(this,o))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=eC(this,a))||e.call(this),eM(this,a,void 0))}setEventListener(e){var t;eM(this,o,e),null==(t=eC(this,a))||t.call(this),eM(this,a,e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){eC(this,i)!==e&&(eM(this,i,e),this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return"boolean"==typeof eC(this,i)?eC(this,i):(null==(e=globalThis.document)?void 0:e.visibilityState)!=="hidden"}constructor(){super(),eb(this,i,{writable:!0,value:void 0}),eb(this,a,{writable:!0,value:void 0}),eb(this,o,{writable:!0,value:void 0}),eM(this,o,e=>{if(!ew&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}}),ez=function(e){setTimeout(e,0)},eZ=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=ez,a=n=>{t?e.push(n):i(()=>{r(n)})};return{batch:a=>{let o;t++;try{o=a()}finally{--t||(()=>{let t=e;e=[],t.length&&i(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return o},batchCalls:e=>function(){for(var t=arguments.length,r=Array(t),n=0;n{e(...r)})},schedule:a,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{i=e}}}(),e$=new(s=new WeakMap,l=new WeakMap,u=new WeakMap,class extends eF{onSubscribe(){eC(this,l)||this.setEventListener(eC(this,u))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=eC(this,l))||e.call(this),eM(this,l,void 0))}setEventListener(e){var t;eM(this,u,e),null==(t=eC(this,l))||t.call(this),eM(this,l,e(this.setOnline.bind(this)))}setOnline(e){eC(this,s)!==e&&(eM(this,s,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return eC(this,s)}constructor(){super(),eb(this,s,{writable:!0,value:!0}),eb(this,l,{writable:!0,value:void 0}),eb(this,u,{writable:!0,value:void 0}),eM(this,u,e=>{if(!ew&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}});function e0(){let e,t,r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function e1(e){return Math.min(1e3*2**e,3e4)}function e9(e){return(null!=e?e:"online")!=="online"||e$.isOnline()}var e2=class extends Error{constructor(e){super("CancelledError"),this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}};function e3(e){let t,r=!1,n=0,i=e0(),a=()=>eY.isFocused()&&("always"===e.networkMode||e$.isOnline())&&e.canRun(),o=()=>e9(e.networkMode)&&e.canRun(),s=e=>{"pending"===i.status&&(null==t||t(),i.resolve(e))},l=e=>{"pending"===i.status&&(null==t||t(),i.reject(e))},u=()=>new Promise(r=>{var n;t=e=>{("pending"!==i.status||a())&&r(e)},null==(n=e.onPause)||n.call(e)}).then(()=>{if(t=void 0,"pending"===i.status){var r;null==(r=e.onContinue)||r.call(e)}}),c=()=>{let t;if("pending"!==i.status)return;let o=0===n?e.initialPromise:void 0;try{t=null!=o?o:e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(s).catch(t=>{var o,s,d;if("pending"!==i.status)return;let f=null!=(s=e.retry)?s:3*!ew,h=null!=(d=e.retryDelay)?d:e1,m="function"==typeof h?h(n,t):h,p=!0===f||"number"==typeof f&&n{eT.setTimeout(e,m)}).then(()=>a()?void 0:u()).then(()=>{r?l(t):c()})})};return{promise:i,status:()=>i.status,cancel:t=>{if("pending"===i.status){var r;let n=new e2(t);l(n),null==(r=e.onCancel)||r.call(e,n)}},continue:()=>(null==t||t(),i),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:o,start:()=>(o()?c():u().then(c),i)}}var e8=(c=new WeakMap,class{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eD(this.gcTime)&&eM(this,c,eT.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,null!=e?e:ew?1/0:3e5)}clearGcTimeout(){eC(this,c)&&(eT.clearTimeout(eC(this,c)),eM(this,c,void 0))}constructor(){eb(this,c,{writable:!0,value:void 0})}}),e5=(d=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,p=new WeakMap,A=new WeakMap,g=new WeakMap,B=new WeakSet,class extends e8{get meta(){return this.options.meta}get promise(){var e;return null==(e=eC(this,p))?void 0:e.promise}setOptions(e){if(this.options={...eC(this,A),...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=e7(this.options);void 0!==e.data&&(this.setState(e4(e.data,e.dataUpdatedAt)),eM(this,d,e))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||eC(this,h).remove(this)}setData(e,t){let r=eQ(this.state.data,e,this.options);return ex(this,B,te).call(this,{data:r,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),r}setState(e,t){ex(this,B,te).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var t,r;let n=null==(t=eC(this,p))?void 0:t.promise;return null==(r=eC(this,p))||r.cancel(e),n?n.then(eR).catch(eR):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(eC(this,d))}isActive(){return this.observers.some(e=>!1!==eL(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===eX||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===eG(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!eI(this.state.dataUpdatedAt,e))}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());null==t||t.refetch({cancelRefetch:!1}),null==(e=eC(this,p))||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());null==t||t.refetch({cancelRefetch:!1}),null==(e=eC(this,p))||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),eC(this,h).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(eC(this,p)&&(eC(this,g)?eC(this,p).cancel({revert:!0}):eC(this,p).cancelRetry()),this.scheduleGc()),eC(this,h).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ex(this,B,te).call(this,{type:"invalidate"})}async fetch(e,t){var r,n,i,a,o,s,l,u,c,d,A,C;if("idle"!==this.state.fetchStatus&&(null==(r=eC(this,p))?void 0:r.status())!=="rejected"){if(void 0!==this.state.data&&(null==t?void 0:t.cancelRefetch))this.cancel({silent:!0});else if(eC(this,p))return eC(this,p).continueRetry(),eC(this,p).promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let y=new AbortController,b=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(eM(this,g,!0),y.signal)})},M=()=>{let e=eq(this.options,t),r=(()=>{let e={client:eC(this,m),queryKey:this.queryKey,meta:this.meta};return b(e),e})();return(eM(this,g,!1),this.options.persister)?this.options.persister(e,r,this):e(r)},x=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:eC(this,m),state:this.state,fetchFn:M};return b(e),e})();null==(n=this.options.behavior)||n.onFetch(x,this),eM(this,f,this.state),("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(i=x.fetchOptions)?void 0:i.meta))&&ex(this,B,te).call(this,{type:"fetch",meta:null==(a=x.fetchOptions)?void 0:a.meta}),eM(this,p,e3({initialPromise:null==t?void 0:t.initialPromise,fn:x.fetchFn,onCancel:e=>{e instanceof e2&&e.revert&&this.setState({...eC(this,f),fetchStatus:"idle"}),y.abort()},onFail:(e,t)=>{ex(this,B,te).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{ex(this,B,te).call(this,{type:"pause"})},onContinue:()=>{ex(this,B,te).call(this,{type:"continue"})},retry:x.options.retry,retryDelay:x.options.retryDelay,networkMode:x.options.networkMode,canRun:()=>!0}));try{let e=await eC(this,p).start();if(void 0===e)throw Error("".concat(this.queryHash," data is undefined"));return this.setData(e),null==(o=(s=eC(this,h).config).onSuccess)||o.call(s,e,this),null==(l=(u=eC(this,h).config).onSettled)||l.call(u,e,this.state.error,this),e}catch(e){if(e instanceof e2){if(e.silent)return eC(this,p).promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw ex(this,B,te).call(this,{type:"error",error:e}),null==(c=(d=eC(this,h).config).onError)||c.call(d,e,this),null==(A=(C=eC(this,h).config).onSettled)||A.call(C,this.state.data,e,this),e}finally{this.scheduleGc()}}constructor(e){var t;super(),eE(this,B),eb(this,d,{writable:!0,value:void 0}),eb(this,f,{writable:!0,value:void 0}),eb(this,h,{writable:!0,value:void 0}),eb(this,m,{writable:!0,value:void 0}),eb(this,p,{writable:!0,value:void 0}),eb(this,A,{writable:!0,value:void 0}),eb(this,g,{writable:!0,value:void 0}),eM(this,g,!1),eM(this,A,e.defaultOptions),this.setOptions(e.options),this.observers=[],eM(this,m,e.client),eM(this,h,eC(this,m).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,eM(this,d,e7(this.options)),this.state=null!=(t=e.state)?t:eC(this,d),this.scheduleGc()}});function e6(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:e9(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function e4(e,t){return{data:e,dataUpdatedAt:null!=t?t:Date.now(),error:null,isInvalidated:!1,status:"success"}}function e7(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}function te(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":var r;return{...t,...e6(t.data,this.options),fetchMeta:null!=(r=e.meta)?r:null};case"success":let n={...t,...e4(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return eM(this,f,e.manual?n:void 0),n;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),eZ.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),eC(this,h).notify({query:this,type:"updated",action:e})})}var tt=(C=new WeakMap,y=new WeakMap,b=new WeakMap,M=new WeakMap,x=new WeakMap,E=new WeakMap,F=new WeakMap,S=new WeakMap,T=new WeakMap,w=new WeakMap,R=new WeakMap,D=new WeakMap,I=new WeakMap,G=new WeakMap,L=new WeakMap,P=new WeakSet,H=new WeakSet,O=new WeakSet,_=new WeakSet,k=new WeakSet,U=new WeakSet,j=new WeakSet,J=new WeakSet,N=new WeakSet,class extends eF{bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(eC(this,y).addObserver(this),tr(eC(this,y),this.options)?ex(this,P,to).call(this):this.updateResult(),ex(this,k,tc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tn(eC(this,y),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tn(eC(this,y),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ex(this,U,td).call(this),ex(this,j,tf).call(this),eC(this,y).removeObserver(this)}setOptions(e){let t=this.options,r=eC(this,y);if(this.options=eC(this,C).defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof eL(this.options.enabled,eC(this,y)))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");ex(this,J,th).call(this),eC(this,y).setOptions(this.options),t._defaulted&&!ej(this.options,t)&&eC(this,C).getQueryCache().notify({type:"observerOptionsUpdated",query:eC(this,y),observer:this});let n=this.hasListeners();n&&ti(eC(this,y),r,this.options,t)&&ex(this,P,to).call(this),this.updateResult(),n&&(eC(this,y)!==r||eL(this.options.enabled,eC(this,y))!==eL(t.enabled,eC(this,y))||eG(this.options.staleTime,eC(this,y))!==eG(t.staleTime,eC(this,y)))&&ex(this,H,ts).call(this);let i=ex(this,O,tl).call(this);n&&(eC(this,y)!==r||eL(this.options.enabled,eC(this,y))!==eL(t.enabled,eC(this,y))||i!==eC(this,G))&&ex(this,_,tu).call(this,i)}getOptimisticResult(e){var t,r;let n=eC(this,C).getQueryCache().build(eC(this,C),e),i=this.createResult(n,e);return t=this,r=i,ej(t.getCurrentResult(),r)||(eM(this,M,i),eM(this,E,this.options),eM(this,x,eC(this,y).state)),i}getCurrentResult(){return eC(this,M)}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),null==t||t(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==eC(this,F).status||eC(this,F).reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){eC(this,L).add(e)}getCurrentQuery(){return eC(this,y)}refetch(){let{...e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.fetch({...e})}fetchOptimistic(e){let t=eC(this,C).defaultQueryOptions(e),r=eC(this,C).getQueryCache().build(eC(this,C),t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){var t;return ex(this,P,to).call(this,{...e,cancelRefetch:null==(t=e.cancelRefetch)||t}).then(()=>(this.updateResult(),eC(this,M)))}createResult(e,t){let r,n=eC(this,y),i=this.options,a=eC(this,M),o=eC(this,x),s=eC(this,E),l=e!==n?e.state:eC(this,b),{state:u}=e,c={...u},d=!1;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&tr(e,t),o=r&&ti(e,n,t,i);(a||o)&&(c={...c,...e6(u.data,e.options)}),"isRestoring"===t._optimisticResults&&(c.fetchStatus="idle")}let{error:f,errorUpdatedAt:h,status:m}=c;r=c.data;let p=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===m){let e;if((null==a?void 0:a.isPlaceholderData)&&t.placeholderData===(null==s?void 0:s.placeholderData))e=a.data,p=!0;else{var A;e="function"==typeof t.placeholderData?t.placeholderData(null==(A=eC(this,R))?void 0:A.state.data,eC(this,R)):t.placeholderData}void 0!==e&&(m="success",r=eQ(null==a?void 0:a.data,e,t),d=!0)}if(t.select&&void 0!==r&&!p)if(a&&r===(null==o?void 0:o.data)&&t.select===eC(this,T))r=eC(this,w);else try{eM(this,T,t.select),r=t.select(r),r=eQ(null==a?void 0:a.data,r,t),eM(this,w,r),eM(this,S,null)}catch(e){eM(this,S,e)}eC(this,S)&&(f=eC(this,S),r=eC(this,w),h=Date.now(),m="error");let g="fetching"===c.fetchStatus,B="pending"===m,C="error"===m,D=B&&g,I=void 0!==r,G={status:m,fetchStatus:c.fetchStatus,isPending:B,isSuccess:"success"===m,isError:C,isInitialLoading:D,isLoading:D,data:r,dataUpdatedAt:c.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:g,isRefetching:g&&!B,isLoadingError:C&&!I,isPaused:"paused"===c.fetchStatus,isPlaceholderData:d,isRefetchError:C&&I,isStale:ta(e,t),refetch:this.refetch,promise:eC(this,F),isEnabled:!1!==eL(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===G.status?e.reject(G.error):void 0!==G.data&&e.resolve(G.data)},r=()=>{t(eM(this,F,G.promise=e0()))},i=eC(this,F);switch(i.status){case"pending":e.queryHash===n.queryHash&&t(i);break;case"fulfilled":("error"===G.status||G.data!==i.value)&&r();break;case"rejected":("error"!==G.status||G.error!==i.reason)&&r()}}return G}updateResult(){let e=eC(this,M),t=this.createResult(eC(this,y),this.options);if(eM(this,x,eC(this,y).state),eM(this,E,this.options),void 0!==eC(this,x).data&&eM(this,R,eC(this,y)),ej(t,e))return;eM(this,M,t);let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!eC(this,L).size)return!0;let n=new Set(null!=r?r:eC(this,L));return this.options.throwOnError&&n.add("error"),Object.keys(eC(this,M)).some(t=>eC(this,M)[t]!==e[t]&&n.has(t))};ex(this,N,tm).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ex(this,k,tc).call(this)}constructor(e,t){super(),eE(this,P),eE(this,H),eE(this,O),eE(this,_),eE(this,k),eE(this,U),eE(this,j),eE(this,J),eE(this,N),eb(this,C,{writable:!0,value:void 0}),eb(this,y,{writable:!0,value:void 0}),eb(this,b,{writable:!0,value:void 0}),eb(this,M,{writable:!0,value:void 0}),eb(this,x,{writable:!0,value:void 0}),eb(this,E,{writable:!0,value:void 0}),eb(this,F,{writable:!0,value:void 0}),eb(this,S,{writable:!0,value:void 0}),eb(this,T,{writable:!0,value:void 0}),eb(this,w,{writable:!0,value:void 0}),eb(this,R,{writable:!0,value:void 0}),eb(this,D,{writable:!0,value:void 0}),eb(this,I,{writable:!0,value:void 0}),eb(this,G,{writable:!0,value:void 0}),eb(this,L,{writable:!0,value:new Set}),this.options=t,eM(this,C,e),eM(this,S,null),eM(this,F,e0()),this.bindMethods(),this.setOptions(t)}});function tr(e,t){return!1!==eL(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&tn(e,t,t.refetchOnMount)}function tn(e,t,r){if(!1!==eL(t.enabled,e)&&"static"!==eG(t.staleTime,e)){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&ta(e,t)}return!1}function ti(e,t,r,n){return(e!==t||!1===eL(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&ta(e,r)}function ta(e,t){return!1!==eL(t.enabled,e)&&e.isStaleByTime(eG(t.staleTime,e))}function to(e){ex(this,J,th).call(this);let t=eC(this,y).fetch(this.options,e);return(null==e?void 0:e.throwOnError)||(t=t.catch(eR)),t}function ts(){ex(this,U,td).call(this);let e=eG(this.options.staleTime,eC(this,y));if(ew||eC(this,M).isStale||!eD(e))return;let t=eI(eC(this,M).dataUpdatedAt,e);eM(this,D,eT.setTimeout(()=>{eC(this,M).isStale||this.updateResult()},t+1))}function tl(){var e;return null!=(e="function"==typeof this.options.refetchInterval?this.options.refetchInterval(eC(this,y)):this.options.refetchInterval)&&e}function tu(e){ex(this,j,tf).call(this),eM(this,G,e),!ew&&!1!==eL(this.options.enabled,eC(this,y))&&eD(eC(this,G))&&0!==eC(this,G)&&eM(this,I,eT.setInterval(()=>{(this.options.refetchIntervalInBackground||eY.isFocused())&&ex(this,P,to).call(this)},eC(this,G)))}function tc(){ex(this,H,ts).call(this),ex(this,_,tu).call(this,ex(this,O,tl).call(this))}function td(){eC(this,D)&&(eT.clearTimeout(eC(this,D)),eM(this,D,void 0))}function tf(){eC(this,I)&&(eT.clearInterval(eC(this,I)),eM(this,I,void 0))}function th(){let e=eC(this,C).getQueryCache().build(eC(this,C),this.options);if(e===eC(this,y))return;let t=eC(this,y);eM(this,y,e),eM(this,b,e.state),this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}function tm(e){eZ.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(eC(this,M))}),eC(this,C).getQueryCache().notify({query:eC(this,y),type:"observerResultsUpdated"})})}var tp=el.createContext(void 0),tA=e=>{let{client:t,children:r}=e;return el.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,es.jsx)(tp.Provider,{value:t,children:r})},tg=el.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),tv=el.createContext(!1);tv.Provider;var tB=(e,t)=>void 0===t.state.data,tC=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function ty(e,t,r){var n,i,a,o,s;let l=el.useContext(tv),u=el.useContext(tg),c=(e=>{let t=el.useContext(tp);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t})(r),d=c.defaultQueryOptions(e);if(null==(i=c.getDefaultOptions().queries)||null==(n=i._experimental_beforeQuery)||n.call(i,d),d._optimisticResults=l?"isRestoring":"optimistic",d.suspense){let e=e=>"static"===e?e:Math.max(null!=e?e:1e3,1e3),t=d.staleTime;d.staleTime="function"==typeof t?function(){for(var r=arguments.length,n=Array(r),i=0;i{u.clearReset()},[u]);let f=!c.getQueryCache().get(d.queryHash),[h]=el.useState(()=>new t(c,d)),m=h.getOptimisticResult(d),p=!l&&!1!==e.subscribed;if(el.useSyncExternalStore(el.useCallback(e=>{let t=p?h.subscribe(eZ.batchCalls(e)):eR;return h.updateResult(),t},[h,p]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),el.useEffect(()=>{h.setOptions(d)},[d,h]),(null==d?void 0:d.suspense)&&m.isPending)throw tC(d,h,u);if((e=>{var t,r;let{result:n,errorResetBoundary:i,throwOnError:a,query:o,suspense:s}=e;return n.isError&&!i.isReset()&&!n.isFetching&&o&&(s&&void 0===n.data||(t=a,r=[n.error,o],"function"==typeof t?t(...r):!!t))})({result:m,errorResetBoundary:u,throwOnError:d.throwOnError,query:c.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;if(null==(o=c.getDefaultOptions().queries)||null==(a=o._experimental_afterQuery)||a.call(o,d,m),d.experimental_prefetchInRender&&!ew&&m.isLoading&&m.isFetching&&!l){let e=f?tC(d,h,u):null==(s=c.getQueryCache().get(d.queryHash))?void 0:s.promise;null==e||e.catch(eR).finally(()=>{h.updateResult()})}return d.notifyOnChangeProps?m:h.trackResult(m)}var tb=e.i(54970),tM=e.i(12979),tx=e.i(5230),tE=e.i(16096),tF=e.i(62395),tS=e.i(75567),tT=e.i(47071),tw=e.i(79123),tR=e.i(47021),tD=e.i(48066);let tI={0:32,1:32,2:32,3:32,4:32,5:32};function tG(e){let{displacementMap:t,visibilityMask:r,textureNames:n,alphaTextures:i,detailTextureName:a,lightmap:o}=e,{debugMode:s}=(0,tw.useDebug)(),l=(0,tT.useTexture)(n.map(e=>(0,tM.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,tS.setupColor)(e))}),u=a?(0,tM.textureToUrl)(a):null,c=(0,tT.useTexture)(null!=u?u:tM.FALLBACK_TEXTURE_URL,e=>{(0,tS.setupColor)(e)}),d=(0,el.useCallback)(e=>{!function(e){let{shader:t,baseTextures:r,alphaTextures:n,visibilityMask:i,tiling:a,detailTexture:o=null,lightmap:s=null}=e,l=r.length;if(r.forEach((e,r)=>{t.uniforms["albedo".concat(r)]={value:e}}),n.forEach((e,r)=>{r>0&&(t.uniforms["mask".concat(r)]={value:e})}),i&&(t.uniforms.visibilityMask={value:i}),r.forEach((e,r)=>{var n;t.uniforms["tiling".concat(r)]={value:null!=(n=a[r])?n:32}}),s&&(t.uniforms.terrainLightmap={value:s}),o&&(t.uniforms.detailTexture={value:o},t.uniforms.detailTiling={value:64},t.uniforms.detailFadeDistance={value:150},t.vertexShader=t.vertexShader.replace("#include ","#include \nvarying vec3 vTerrainWorldPos;"),t.vertexShader=t.vertexShader.replace("#include ","#include \nvTerrainWorldPos = (modelMatrix * vec4(transformed, 1.0)).xyz;")),t.fragmentShader="\nuniform sampler2D albedo0;\nuniform sampler2D albedo1;\nuniform sampler2D albedo2;\nuniform sampler2D albedo3;\nuniform sampler2D albedo4;\nuniform sampler2D albedo5;\nuniform sampler2D mask1;\nuniform sampler2D mask2;\nuniform sampler2D mask3;\nuniform sampler2D mask4;\nuniform sampler2D mask5;\nuniform float tiling0;\nuniform float tiling1;\nuniform float tiling2;\nuniform float tiling3;\nuniform float tiling4;\nuniform float tiling5;\n".concat(i?"uniform sampler2D visibilityMask;":"","\n").concat(s?"uniform sampler2D terrainLightmap;":"","\n").concat(o?"uniform sampler2D detailTexture;\nuniform float detailTiling;\nuniform float detailFadeDistance;\nvarying vec3 vTerrainWorldPos;":"","\n\n").concat("\nvec3 terrainLinearToSRGB(vec3 linear) {\n vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055;\n vec3 lower = linear * 12.92;\n return mix(lower, higher, step(vec3(0.0031308), linear));\n}\n\nvec3 terrainSRGBToLinear(vec3 srgb) {\n vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4));\n vec3 lower = srgb / 12.92;\n return mix(lower, higher, step(vec3(0.04045), srgb));\n}\n\n// Debug grid overlay using screen-space derivatives for sharp, anti-aliased lines\n// Returns 1.0 on grid lines, 0.0 elsewhere\nfloat terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) {\n vec2 scaledUV = uv * gridSize;\n vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV);\n float line = min(grid.x, grid.y);\n return 1.0 - min(line / lineWidth, 1.0);\n}\n","\n\n// Global variable to store shadow factor from RE_Direct for use in output calculation\nfloat terrainShadowFactor = 1.0;\n")+t.fragmentShader,i){let e="#include ";t.fragmentShader=t.fragmentShader.replace(e,"".concat(e,"\n // Early discard for invisible areas (before fog/lighting)\n float visibility = texture2D(visibilityMask, vMapUv).r;\n if (visibility < 0.5) {\n discard;\n }\n "))}t.fragmentShader=t.fragmentShader.replace("#include ","\n // Sample base albedo layers (sRGB textures auto-decoded to linear by Three.js)\n vec2 baseUv = vMapUv;\n vec3 c0 = texture2D(albedo0, baseUv * vec2(tiling0)).rgb;\n ".concat(l>1?"vec3 c1 = texture2D(albedo1, baseUv * vec2(tiling1)).rgb;":"","\n ").concat(l>2?"vec3 c2 = texture2D(albedo2, baseUv * vec2(tiling2)).rgb;":"","\n ").concat(l>3?"vec3 c3 = texture2D(albedo3, baseUv * vec2(tiling3)).rgb;":"","\n ").concat(l>4?"vec3 c4 = texture2D(albedo4, baseUv * vec2(tiling4)).rgb;":"","\n ").concat(l>5?"vec3 c5 = texture2D(albedo5, baseUv * vec2(tiling5)).rgb;":"","\n\n // Sample linear masks (use R channel)\n // Add +0.5 texel offset: Torque samples alpha at grid corners (integer indices),\n // but GPU linear filtering samples at texel centers. This offset aligns them.\n vec2 alphaUv = baseUv + vec2(0.5 / ").concat(256,".0);\n float a1 = texture2D(mask1, alphaUv).r;\n ").concat(l>1?"float a2 = texture2D(mask2, alphaUv).r;":"","\n ").concat(l>2?"float a3 = texture2D(mask3, alphaUv).r;":"","\n ").concat(l>3?"float a4 = texture2D(mask4, alphaUv).r;":"","\n ").concat(l>4?"float a5 = texture2D(mask5, alphaUv).r;":"","\n\n // Bottom-up compositing: each mask tells how much the higher layer replaces lower\n ").concat(l>1?"vec3 blended = mix(c0, c1, clamp(a1, 0.0, 1.0));":"","\n ").concat(l>2?"blended = mix(blended, c2, clamp(a2, 0.0, 1.0));":"","\n ").concat(l>3?"blended = mix(blended, c3, clamp(a3, 0.0, 1.0));":"","\n ").concat(l>4?"blended = mix(blended, c4, clamp(a4, 0.0, 1.0));":"","\n ").concat(l>5?"blended = mix(blended, c5, clamp(a5, 0.0, 1.0));":"","\n\n // Assign to diffuseColor before lighting\n vec3 textureColor = ").concat(l>1?"blended":"c0",";\n\n ").concat(o?"// Detail texture blending (Torque-style multiplicative blend)\n // Sample detail texture at high frequency tiling\n vec3 detailColor = texture2D(detailTexture, baseUv * detailTiling).rgb;\n\n // Calculate distance-based fade factor using world positions\n // Torque: distFactor = (zeroDetailDistance - distance) / zeroDetailDistance\n float distToCamera = distance(vTerrainWorldPos, cameraPosition);\n float detailFade = clamp(1.0 - distToCamera / detailFadeDistance, 0.0, 1.0);\n\n // Torque blending: dst * lerp(1.0, detailTexel, fadeFactor)\n // Detail textures are authored with bright values (~0.8 mean), not 0.5 gray\n // Direct multiplication adds subtle darkening for surface detail\n textureColor *= mix(vec3(1.0), detailColor, detailFade);":"","\n\n // Store blended texture in diffuseColor (still in linear space here)\n // We'll convert to sRGB in the output calculation\n diffuseColor.rgb = textureColor;\n")),s&&(t.fragmentShader=t.fragmentShader.replace("#include ","#include \n\n// Override RE_Direct to extract shadow factor for Torque-style gamma-space lighting\n#undef RE_Direct\nvoid RE_Direct_TerrainShadow( 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 ) {\n // directLight.color = sunColor * shadowFactor (shadow already applied by Three.js)\n // Extract shadow factor by comparing to original sun color\n #if ( NUM_DIR_LIGHTS > 0 )\n vec3 originalSunColor = directionalLights[0].color;\n float sunMax = max(max(originalSunColor.r, originalSunColor.g), originalSunColor.b);\n float shadowedMax = max(max(directLight.color.r, directLight.color.g), directLight.color.b);\n terrainShadowFactor = clamp(shadowedMax / max(sunMax, 0.001), 0.0, 1.0);\n #endif\n // Don't add to reflectedLight - we'll compute lighting in gamma space at output\n}\n#define RE_Direct RE_Direct_TerrainShadow\n\n"),t.fragmentShader=t.fragmentShader.replace("#include ","#include \n// Clear indirect diffuse - we'll compute ambient in gamma space\n#if defined( RE_IndirectDiffuse )\n irradiance = vec3(0.0);\n#endif\n"),t.fragmentShader=t.fragmentShader.replace("#include ","#include \n // Clear Three.js lighting - we compute everything in gamma space\n reflectedLight.directDiffuse = vec3(0.0);\n reflectedLight.indirectDiffuse = vec3(0.0);\n")),t.fragmentShader=t.fragmentShader.replace("#include ","// Torque-style terrain lighting: output = clamp(lighting × texture, 0, 1) in sRGB space\n{\n // Get texture in sRGB space (undo Three.js linear decode)\n vec3 textureSRGB = terrainLinearToSRGB(diffuseColor.rgb);\n\n ".concat(s?"\n // Sample terrain lightmap for smooth NdotL\n vec2 lightmapUv = vMapUv + vec2(0.5 / ".concat(512,".0);\n float lightmapNdotL = texture2D(terrainLightmap, lightmapUv).r;\n\n // Get sun and ambient colors from Three.js lights (these ARE sRGB values from mission file)\n // Three.js interprets them as linear, but the numerical values are preserved\n #if ( NUM_DIR_LIGHTS > 0 )\n vec3 sunColorSRGB = directionalLights[0].color;\n #else\n vec3 sunColorSRGB = vec3(0.7);\n #endif\n vec3 ambientColorSRGB = ambientLightColor;\n\n // Torque formula (terrLighting.cc:471-483):\n // lighting = ambient + NdotL * shadowFactor * sunColor\n // Clamp lighting to [0,1] before multiplying by texture\n vec3 lightingSRGB = clamp(ambientColorSRGB + lightmapNdotL * terrainShadowFactor * sunColorSRGB, 0.0, 1.0);\n "):"\n // No lightmap - use simple ambient lighting\n vec3 lightingSRGB = ambientLightColor;\n ","\n\n // Torque formula: output = clamp(lighting × texture, 0, 1) in sRGB/gamma space\n vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0);\n\n // Convert back to linear for Three.js output pipeline\n outgoingLight = terrainSRGBToLinear(resultSRGB) + totalEmissiveRadiance;\n}\n#include ")),t.fragmentShader=t.fragmentShader.replace("#include ","#if DEBUG_MODE\n // Debug mode: overlay green grid matching terrain grid squares (256x256)\n float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5);\n vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green\n gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.05);\n#endif\n\n#include ")}({shader:e,baseTextures:l,alphaTextures:i,visibilityMask:r,tiling:tI,detailTexture:u?c:null,lightmap:o}),(0,tR.injectCustomFog)(e,tD.globalFogUniforms)},[l,i,r,c,u,o]),f=(0,el.useRef)(null);(0,el.useEffect)(()=>{let e=f.current;e&&(null!=e.defines||(e.defines={}),e.defines.DEBUG_MODE=+!!s,e.needsUpdate=!0)},[s]);let h="".concat(u?"detail":"nodetail","-").concat(o?"lightmap":"nolightmap");return(0,es.jsx)("meshLambertMaterial",{ref:f,map:t,depthWrite:!0,side:ef.FrontSide,defines:{DEBUG_MODE:+!!s},onBeforeCompile:d},h)}function tL(e){let{displacementMap:t,visibilityMask:r,textureNames:n,alphaTextures:i,detailTextureName:a,lightmap:o}=e;return(0,es.jsx)(el.Suspense,{fallback:(0,es.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),children:(0,es.jsx)(tG,{displacementMap:t,visibilityMask:r,textureNames:n,alphaTextures:i,detailTextureName:a,lightmap:o})})}let tP=(0,el.memo)(function(e){let{tileX:t,tileZ:r,blockSize:n,basePosition:i,textureNames:a,geometry:o,displacementMap:s,visibilityMask:l,alphaTextures:u,detailTextureName:c,lightmap:d,visible:f=!0}=e,h=(0,el.useMemo)(()=>[i.x+t*n+1024,0,i.z+r*n+1024],[t,r,n,i]);return(0,es.jsx)("mesh",{position:h,geometry:o,castShadow:!0,receiveShadow:!0,visible:f,children:(0,es.jsx)(tL,{displacementMap:s,visibilityMask:l,textureNames:a,alphaTextures:u,detailTextureName:c,lightmap:d})})});var tH=e.i(77482);function tO(e){return(0,tH.useRuntime)().getObjectByName(e)}function t_(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,n=r>>8&255,i=r>>16,a=256*n;for(let r=0;r0?r:null!=(e=(0,tF.getFloat)(t,"visibleDistance"))?e:600}(),l=(0,tE.useThree)(e=>e.camera),u=(0,el.useMemo)(()=>{let[e,,t]=(0,tF.getPosition)(r);return{x:e,z:t}},[r]),c=(0,el.useMemo)(()=>{let e=(0,tF.getProperty)(r,"emptySquares");return e?e.split(" ").map(e=>parseInt(e,10)):[]},[r]),{data:d}=ty({queryKey:["terrain",n],queryFn:()=>(0,tM.loadTerrain)(n)},tt,void 0),f=(0,el.useMemo)(()=>{if(!d)return null;let e=function(e,t){let r=new ef.BufferGeometry,n=66049,i=new Float32Array(3*n),a=new Float32Array(3*n),o=new Float32Array(2*n),s=new Uint32Array(t*t*6),l=0,u=e/t;for(let r=0;r<=t;r++)for(let n=0;n<=t;n++){let s=r*(t+1)+n;i[3*s]=n*u-e/2,i[3*s+1]=e/2-r*u,i[3*s+2]=0,a[3*s]=0,a[3*s+1]=0,a[3*s+2]=1,o[2*s]=n/t,o[2*s+1]=1-r/t}for(let e=0;e(e=Math.max(0,Math.min(255,e)),t[256*(r=Math.max(0,Math.min(255,r)))+e]/65535*2048),d=(e,r)=>{let n=Math.floor(e=Math.max(0,Math.min(255,e))),i=Math.floor(r=Math.max(0,Math.min(255,r))),a=Math.min(n+1,255),o=Math.min(i+1,255),s=e-n,l=r-i,u=t[256*i+n]/65535*2048,c=t[256*i+a]/65535*2048,d=t[256*o+n]/65535*2048;return(u*(1-s)+c*s)*(1-l)+(d*(1-s)+t[256*o+a]/65535*2048*s)*l};for(let e=0;e0?(p/=B,A/=B,g/=B):(p=0,A=1,g=0),l[3*e]=p,l[3*e+1]=A,l[3*e+2]=g}n.needsUpdate=!0,a.needsUpdate=!0}(e,d.heightMap,i),e},[i,d]),h=tO("Sun"),m=(0,el.useMemo)(()=>{var e;if(!h)return new ef.Vector3(.57735,-.57735,.57735);let[t,r,n]=(null!=(e=(0,tF.getProperty)(h,"direction"))?e:"0.57735 0.57735 -0.57735").split(" ").map(e=>parseFloat(e)),i=Math.sqrt(t*t+n*n+r*r);return new ef.Vector3(t/i,n/i,r/i)},[h]),p=(0,el.useMemo)(()=>d?function(e,t,r){let n=(t,r)=>{let n=Math.max(0,Math.min(255,t)),i=Math.max(0,Math.min(255,r)),a=Math.floor(n),o=Math.floor(i),s=Math.min(a+1,255),l=Math.min(o+1,255),u=n-a,c=i-o,d=e[256*o+a]/65535,f=e[256*o+s]/65535,h=e[256*l+a]/65535;return((d*(1-u)+f*u)*(1-c)+(h*(1-u)+e[256*l+s]/65535*u)*c)*2048},i=new ef.Vector3(-t.x,-t.y,-t.z).normalize(),a=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let o=t/2+.25,s=e/2+.25,l=n(o,s),u=n(o-.5,s),c=n(o+.5,s),d=n(o,s-.5),f=n(o,s+.5),h=-((f-d)/1),m=-((c-u)/1),p=Math.sqrt(h*h+r*r+m*m),A=Math.max(0,h/p*i.x+r/p*i.y+m/p*i.z),g=1;A>0&&(g=function(e,t,r,n,i,a){let o=n.z/i,s=n.x/i,l=n.y,u=Math.sqrt(o*o+s*s);if(u<1e-4)return 1;let c=.5/u,d=o*c,f=s*c,h=l*c,m=e,p=t,A=r+.1;for(let e=0;e<768&&(m+=d,p+=f,A+=h,!(m<0)&&!(m>=256)&&!(p<0)&&!(p>=256)&&!(A>2048));e++)if(A{if(!d)return null;let e=function(e){let t=new Float32Array(e.length);for(let r=0;rt_(c),[c]),B=(0,el.useMemo)(()=>t_([]),[]),C=(0,el.useMemo)(()=>d?d.alphaMaps.map(e=>(0,tS.setupMask)(e)):null,[d]),y=(0,el.useMemo)(()=>{let e=2*Math.ceil(s/o)+1;return e*e-1},[s,o]),b=(0,el.useMemo)(()=>Array.from({length:y},(e,t)=>t),[y]),[M,x]=(0,el.useState)(()=>Array(y).fill(null)),E=(0,el.useRef)({xStart:0,xEnd:0,zStart:0,zEnd:0});return((0,tx.useFrame)(()=>{let e=l.position.x-u.x,t=l.position.z-u.z,r=Math.floor((e-s)/o),n=Math.ceil((e+s)/o),i=Math.floor((t-s)/o),a=Math.ceil((t+s)/o),c=E.current;if(r===c.xStart&&n===c.xEnd&&i===c.zStart&&a===c.zEnd)return;c.xStart=r,c.xEnd=n,c.zStart=i,c.zEnd=a;let d=[];for(let e=r;e{var t,r;let n=M[e];return(0,es.jsx)(tP,{tileX:null!=(t=null==n?void 0:n.tileX)?t:0,tileZ:null!=(r=null==n?void 0:n.tileZ)?r:0,blockSize:o,basePosition:u,textureNames:d.textureNames,geometry:f,displacementMap:A,visibilityMask:B,alphaTextures:C,detailTextureName:a,lightmap:p,visible:null!==n},e)})]}):null}),tU=(0,el.createContext)(null);function tj(){return(0,el.useContext)(tU)}var tJ=el;let tN=(0,tJ.createContext)(null),tK={didCatch:!1,error:null};class tQ extends tJ.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,n=arguments.length,i=Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,n)){var i,a;null==(i=(a=this.props).onReset)||i.call(a,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(tK)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:n}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)o=t(e);else if(r)o=(0,tJ.createElement)(r,e);else if(void 0!==n)o=n;else throw a}return(0,tJ.createElement)(tN.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=tK}}var tW=e.i(31067),tV=ef;function tX(e,t){if(t===ef.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==ef.TriangleFanDrawMode&&t!==ef.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e=2.0 are supported."));return}let s=new rG(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});s.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}s.setExtensions(a),s.setPlugins(o),s.parse(r,n)}parseAsync(e,t){let r=this;return new Promise(function(n,i){r.parse(e,t,n,i)})}constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new t8(e)}),this.register(function(e){return new t5(e)}),this.register(function(e){return new ra(e)}),this.register(function(e){return new ro(e)}),this.register(function(e){return new rs(e)}),this.register(function(e){return new t4(e)}),this.register(function(e){return new t7(e)}),this.register(function(e){return new re(e)}),this.register(function(e){return new rt(e)}),this.register(function(e){return new t3(e)}),this.register(function(e){return new rr(e)}),this.register(function(e){return new t6(e)}),this.register(function(e){return new ri(e)}),this.register(function(e){return new rn(e)}),this.register(function(e){return new t9(e)}),this.register(function(e){return new rl(e)}),this.register(function(e){return new ru(e)})}}function t0(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let t1={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class t9{_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,i.source,a)}constructor(e){this.parser=e,this.name=t1.KHR_TEXTURE_BASISU}}class ro{loadTexture(e){let t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=n.images[a.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return r.loadTextureImage(e,a.source,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}constructor(e){this.parser=e,this.name=t1.EXT_TEXTURE_WEBP,this.isSupported=null}}class rs{loadTexture(e){let t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=n.images[a.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return r.loadTextureImage(e,a.source,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}constructor(e){this.parser=e,this.name=t1.EXT_TEXTURE_AVIF,this.isSupported=null}}class rl{loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return n.then(function(t){let r=e.byteOffset||0,n=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}}constructor(e){this.name=t1.EXT_MESHOPT_COMPRESSION,this.parser=e}}class ru{createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==rB.TRIANGLES&&e.mode!==rB.TRIANGLE_STRIP&&e.mode!==rB.TRIANGLE_FAN&&void 0!==e.mode)return null;let n=r.extensions[this.name].attributes,i=[],a={};for(let e in n)i.push(this.parser.getDependency("accessor",n[e]).then(t=>(a[e]=t,a[e])));return i.length<1?null:(i.push(this.parser.createNodeMesh(e)),Promise.all(i).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],n=e[0].count,i=[];for(let e of r){let t=new tV.Matrix4,r=new tV.Vector3,o=new tV.Quaternion,s=new tV.Vector3(1,1,1),l=new tV.InstancedMesh(e.geometry,e.material,n);for(let e=0;e=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},rE={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},rF={CUBICSPLINE:void 0,LINEAR:tV.InterpolateLinear,STEP:tV.InterpolateDiscrete},rS={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function rT(e,t,r){for(let n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function rw(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function rR(e){let t="",r=Object.keys(e).sort();for(let n=0,i=r.length;n{let r=this.associations.get(e);for(let[n,a]of(null!=r&&this.associations.set(t,r),e.children.entries()))i(a,t.children[n])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&a.setY(t,d[e*s+1]),s>=3&&a.setZ(t,d[e*s+2]),s>=4&&a.setW(t,d[e*s+3]),s>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})}loadTexture(e){let t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n],a=this.textureLoader;if(i.uri){let e=r.manager.getHandler(i.uri);null!==e&&(a=e)}return this.loadTextureImage(e,n,a)}loadTextureImage(e,t,r){let n=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[s])return this.textureCache[s];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let r=(i.samplers||{})[a.sampler]||{};return t.magFilter=ry[r.magFilter]||tV.LinearFilter,t.minFilter=ry[r.minFilter]||tV.LinearMipmapLinearFilter,t.wrapS=rb[r.wrapS]||tV.RepeatWrapping,t.wrapT=rb[r.wrapT]||tV.RepeatWrapping,n.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=l,l}loadImageSource(e,t){let r=this.json,n=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let i=r.images[e],a=self.URL||self.webkitURL,o=i.uri||"",s=!1;if(void 0!==i.bufferView)o=this.getDependency("bufferView",i.bufferView).then(function(e){s=!0;let t=new Blob([e],{type:i.mimeType});return o=a.createObjectURL(t)});else if(void 0===i.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(o).then(function(e){return new Promise(function(r,i){let a=r;!0===t.isImageBitmapLoader&&(a=function(e){let t=new tV.Texture(e);t.needsUpdate=!0,r(t)}),t.load(tV.LoaderUtils.resolveURL(e,n.path),a,void 0,i)})}).then(function(e){var t;return!0===s&&a.revokeObjectURL(o),rw(e,i),e.userData.mimeType=i.mimeType||((t=i.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,n){let i=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((a=a.clone()).channel=r.texCoord),i.extensions[t1.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[t1.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=i.associations.get(a);a=i.extensions[t1.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return void 0!==n&&("number"==typeof n&&(n=3001===n?tz:tZ),"colorSpace"in a?a.colorSpace=n:a.encoding=n===tz?3001:3e3),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,r=e.material,n=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new tV.PointsMaterial,tV.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new tV.LineBasicMaterial,tV.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(n||i||a){let e="ClonedMaterial:"+r.uuid+":";n&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),n&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return tV.MeshStandardMaterial}loadMaterial(e){let t,r=this,n=this.json,i=this.extensions,a=n.materials[e],o={},s=a.extensions||{},l=[];if(s[t1.KHR_MATERIALS_UNLIT]){let e=i[t1.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(o,a,r))}else{let n=a.pbrMetallicRoughness||{};if(o.color=new tV.Color(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],tZ),o.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(r.assignTexture(o,"map",n.baseColorTexture,tz)),o.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,o.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(r.assignTexture(o,"metalnessMap",n.metallicRoughnessTexture)),l.push(r.assignTexture(o,"roughnessMap",n.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}!0===a.doubleSided&&(o.side=tV.DoubleSide);let u=a.alphaMode||rS.OPAQUE;if(u===rS.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,u===rS.MASK&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==tV.MeshBasicMaterial&&(l.push(r.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new tV.Vector2(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==tV.MeshBasicMaterial&&(l.push(r.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==tV.MeshBasicMaterial){let e=a.emissiveFactor;o.emissive=new tV.Color().setRGB(e[0],e[1],e[2],tZ)}return void 0!==a.emissiveTexture&&t!==tV.MeshBasicMaterial&&l.push(r.assignTexture(o,"emissiveMap",a.emissiveTexture,tz)),Promise.all(l).then(function(){let n=new t(o);return a.name&&(n.name=a.name),rw(n,a),r.associations.set(n,{materials:e}),a.extensions&&rT(i,n,a),n})}createUniqueName(e){let t=tV.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,n=this.primitiveCache,i=[];for(let a=0,o=e.length;a0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,n=t.weights.length;r1?new tV.Group:1===t.length?t[0]:new tV.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of n.associations)(e instanceof tV.Material||e instanceof tV.Texture)&&t.set(e,r);return e.traverse(e=>{let r=n.associations.get(e);null!=r&&t.set(e,r)}),t})(i),i})}_createAnimationTracks(e,t,r,n,i){let a,o=[],s=e.name?e.name:e.uuid,l=[];switch(rE[i.path]===rE.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(s),rE[i.path]){case rE.weights:a=tV.NumberKeyframeTrack;break;case rE.rotation:a=tV.QuaternionKeyframeTrack;break;case rE.position:case rE.scale:a=tV.VectorKeyframeTrack;break;default:a=1===r.itemSize?tV.NumberKeyframeTrack:tV.VectorKeyframeTrack}let u=void 0!==n.interpolation?rF[n.interpolation]:tV.InterpolateLinear,c=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&i<98?this.textureLoader=new tV.TextureLoader(this.options.manager):this.textureLoader=new tV.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new tV.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}}function rL(e,t,r){let n=t.attributes,i=[];for(let t in n){let a=rx[t]||t.toLowerCase();a in e.attributes||i.push(function(t,n){return r.getDependency("accessor",t).then(function(t){e.setAttribute(n,t)})}(n[t],a))}if(void 0!==t.indices&&!e.index){let n=r.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});i.push(n)}return rw(e,t),!function(e,t,r){let n=t.attributes,i=new tV.Box3;if(void 0===n.POSITION)return;{let e=r.json.accessors[n.POSITION],t=e.min,a=e.max;if(void 0===t||void 0===a)return console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new tV.Vector3(t[0],t[1],t[2]),new tV.Vector3(a[0],a[1],a[2])),e.normalized){let t=rD(rC[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}let a=t.targets;if(void 0!==a){let e=new tV.Vector3,t=new tV.Vector3;for(let n=0,i=a.length;n{let r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(n)},r,n)}decodeDracoFile(e,t,r,n){let i={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){let r;for(let e in t.attributeTypes){let r=t.attributeTypes[e];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=r.name)}let n=JSON.stringify(t);if(rH.has(e)){let t=rH.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(n=>(r=n,new Promise((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),rH.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new rP.BufferGeometry;e.index&&t.setIndex(new rP.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let n=r_.toString(),i=["/* draco decoder */",r,"\n/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let t=e.draco,r=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(i),i.byteLength);try{let e=function(e,t,r,n){let i,a,o=n.attributeIDs,s=n.attributeTypes,l=t.GetEncodedGeometryType(r);if(l===e.TRIANGULAR_MESH)i=new e.Mesh,a=t.DecodeBufferToMesh(r,i);else if(l===e.POINT_CLOUD)i=new e.PointCloud,a=t.DecodeBufferToPointCloud(r,i);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!a.ok()||0===i.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+a.error_msg());let u={index:null,attributes:[]};for(let r in o){let a,l,c=self[s[r]];if(n.useUniqueIDs)l=o[r],a=t.GetAttributeByUniqueId(i,l);else{if(-1===(l=t.GetAttributeId(i,e[o[r]])))continue;a=t.GetAttribute(i,l)}u.attributes.push(function(e,t,r,n,i,a){let o=a.num_components(),s=r.num_points()*o,l=s*i.BYTES_PER_ELEMENT,u=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,a,u,l,c);let d=new i(e.HEAPF32.buffer,c,s).slice();return e._free(c),{name:n,array:d,itemSize:o}}(e,t,i,r,c,a))}return l===e.TRIANGULAR_MESH&&(u.index=function(e,t,r){let n=3*r.num_faces(),i=4*n,a=e._malloc(i);t.GetTrianglesUInt32Array(r,i,a);let o=new Uint32Array(e.HEAPF32.buffer,a,n).slice();return e._free(a),{array:o,itemSize:1}}(e,t,i)),e.destroy(i),u}(t,r,o,a),i=e.attributes.map(e=>e.array.buffer);e.index&&i.push(e.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:e},i)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(o),t.destroy(r)}})}}}var rk=e.i(80520);let rU={clone:function(e){let t=new Map,r=new Map,n=e.clone();return function e(t,r,n){n(t,r);for(let i=0;i{let{isChild:r=!1,object:n,children:i,deep:a,castShadow:o,receiveShadow:s,inject:l,keys:u,...c}=e,d={keys:u,deep:a,inject:l,castShadow:o,receiveShadow:s};if(Array.isArray(n=el.useMemo(()=>{if(!1===r&&!Array.isArray(n)){let e=!1;if(n.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return rU.clone(n)}return n},[n,r])))return el.createElement("group",(0,tW.default)({},c,{ref:t}),n.map(e=>el.createElement(rj,(0,tW.default)({key:e.uuid,object:e},d))),i);let{children:f,...h}=function(e,t){let{keys:r=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData","bindMode","bindMatrix","bindMatrixInverse","skeleton"],deep:n,inject:i,castShadow:a,receiveShadow:o}=t,s={};for(let t of r)s[t]=e[t];return n&&(s.geometry&&"materialsOnly"!==n&&(s.geometry=s.geometry.clone()),s.material&&"geometriesOnly"!==n&&(s.material=s.material.clone())),i&&(s="function"==typeof i?{...s,children:i(e)}:el.isValidElement(i)?{...s,children:i}:{...s,...i}),e instanceof ef.Mesh&&(a&&(s.castShadow=!0),o&&(s.receiveShadow=!0)),s}(n,d),m=n.type[0].toLowerCase()+n.type.slice(1);return el.createElement(m,(0,tW.default)({},h,c,{ref:t}),n.children.map(e=>"Bone"===e.type?el.createElement("primitive",(0,tW.default)({key:e.uuid,object:e},d)):el.createElement(rj,(0,tW.default)({key:e.uuid,object:e},d,{isChild:!0}))),i,f)}),rJ=null,rN="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function rK(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=arguments.length>2?arguments[2]:void 0;return i=>{n&&n(i),e&&(rJ||(rJ=new rO),rJ.setDecoderPath("string"==typeof e?e:rN),i.setDRACOLoader(rJ)),r&&i.setMeshoptDecoder((()=>{let e;if(t)return t;let r=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let i="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(r)&&(i="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");let a=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let r=0;for(let i=0;i{(e=t.instance).exports.__wasm_call_ctors()});function o(t,r,n,i,a,o){let s=e.exports.sbrk,l=n+3&-4,u=s(l*i),c=s(a.length),d=new Uint8Array(e.exports.memory.buffer);d.set(a,c);let f=t(u,n,i,c,a.length);if(0===f&&o&&o(u,l,i),r.set(d.subarray(u,u+n*i)),s(u-s(0)),0!==f)throw Error("Malformed buffer data: ".concat(f))}let s={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:a,supported:!0,decodeVertexBuffer(t,r,n,i,a){o(e.exports.meshopt_decodeVertexBuffer,t,r,n,i,e.exports[s[a]])},decodeIndexBuffer(t,r,n,i){o(e.exports.meshopt_decodeIndexBuffer,t,r,n,i)},decodeIndexSequence(t,r,n,i){o(e.exports.meshopt_decodeIndexSequence,t,r,n,i)},decodeGltfBuffer(t,r,n,i,a,u){o(e.exports[l[a]],t,r,n,i,e.exports[s[u]])}}})())}}let rQ=(e,t,r,n)=>(0,rk.useLoader)(t$,e,rK(t,r,n));rQ.preload=(e,t,r,n)=>rk.useLoader.preload(t$,e,rK(t,r,n)),rQ.clear=e=>rk.useLoader.clear(t$,e),rQ.setDecoderPath=e=>{rN=e};var rW=e.i(89887);function rV(e){var t,r,n,i,a;let{materialName:o,material:s,lightMap:l}=e,u=(0,tw.useDebug)(),c=null!=(n=null==u?void 0:u.debugMode)&&n,d=(0,tM.textureToUrl)(o),f=(0,tT.useTexture)(d,e=>(0,tS.setupColor)(e)),h=new Set(null!=(i=null==s||null==(t=s.userData)?void 0:t.flag_names)?i:[]).has("SelfIlluminating"),m=new Set(null!=(a=null==s||null==(r=s.userData)?void 0:r.surface_flag_names)?a:[]).has("SurfaceOutsideVisible"),p=(0,el.useCallback)(e=>{(0,tR.injectCustomFog)(e,tD.globalFogUniforms);let t=null!=m&&m;e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new ef.Vector3(0,.4,1):new ef.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ","#include \n".concat("\nvec3 interiorLinearToSRGB(vec3 linear) {\n vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055;\n vec3 lower = linear * 12.92;\n return mix(lower, higher, step(vec3(0.0031308), linear));\n}\n\nvec3 interiorSRGBToLinear(vec3 srgb) {\n vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4));\n vec3 lower = srgb / 12.92;\n return mix(lower, higher, step(vec3(0.04045), srgb));\n}\n\n// Debug grid overlay function using screen-space derivatives for sharp, anti-aliased lines\n// Returns 1.0 on grid lines, 0.0 elsewhere\nfloat debugGrid(vec2 uv, float gridSize, float lineWidth) {\n vec2 scaledUV = uv * gridSize;\n vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV);\n float line = min(grid.x, grid.y);\n return 1.0 - min(line / lineWidth, 1.0);\n}\n","\nuniform bool useSceneLighting;\nuniform vec3 interiorDebugColor;\n")),e.fragmentShader=e.fragmentShader.replace("#include ","// Lightmap handled in custom output calculation\n#ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n#endif"),e.fragmentShader=e.fragmentShader.replace("#include ","// Torque-style lighting: output = clamp(lighting × texture, 0, 1) in sRGB space\n// Get texture in sRGB space (undo Three.js linear decode)\nvec3 textureSRGB = interiorLinearToSRGB(diffuseColor.rgb);\n\n// Compute lighting in sRGB space\nvec3 lightingSRGB = vec3(0.0);\n\nif (useSceneLighting) {\n // Three.js computed: reflectedLight = lighting × texture_linear / PI\n // Extract pure lighting: lighting = reflectedLight × PI / texture_linear\n vec3 totalLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 safeTexLinear = max(diffuseColor.rgb, vec3(0.001));\n vec3 extractedLighting = totalLight * PI / safeTexLinear;\n // NOTE: extractedLighting is ALREADY sRGB values because mission sun/ambient colors\n // are sRGB values (Torque used them directly in gamma space). Three.js treats them\n // as linear but the numerical values are the same. DO NOT convert to sRGB here!\n // IMPORTANT: Torque clamps scene lighting to [0,1] BEFORE adding to lightmap\n // (sceneLighting.cc line 1785: tmp.clamp())\n lightingSRGB = clamp(extractedLighting, 0.0, 1.0);\n}\n\n// Add lightmap contribution (for BOTH outside and inside surfaces)\n// In Torque, scene lighting is ADDED to lightmaps for outside surfaces at mission load\n// (stored in .ml files). Inside surfaces only have base lightmap. Both need lightmap here.\n#ifdef USE_LIGHTMAP\n // Lightmap is stored as linear in Three.js (decoded from sRGB texture), convert back\n lightingSRGB += interiorLinearToSRGB(lightMapTexel.rgb);\n#endif\n// Torque clamps the sum to [0,1] per channel (sceneLighting.cc lines 1817-1827)\nlightingSRGB = clamp(lightingSRGB, 0.0, 1.0);\n\n// Torque formula: output = clamp(lighting × texture, 0, 1) in sRGB/gamma space\nvec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0);\n\n// Convert back to linear for Three.js output pipeline\nvec3 resultLinear = interiorSRGBToLinear(resultSRGB);\n\n// Reassign outgoingLight before opaque_fragment consumes it\noutgoingLight = resultLinear + totalEmissiveRadiance;\n\n#include "),e.fragmentShader=e.fragmentShader.replace("#include ","// Debug mode: overlay colored grid on top of normal rendering\n// Blue grid = SurfaceOutsideVisible (receives scene ambient light)\n// Red grid = inside surface (no scene ambient light)\n#if DEBUG_MODE && defined(USE_MAP)\n // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide\n float gridIntensity = debugGrid(vMapUv, 4.0, 1.5);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1);\n#endif\n\n#include ")},[m]),A=(0,el.useRef)(null),g=(0,el.useRef)(null);(0,el.useEffect)(()=>{var e;let t=null!=(e=A.current)?e:g.current;t&&(null!=t.defines||(t.defines={}),t.defines.DEBUG_MODE=+!!c,t.needsUpdate=!0)},[c]);let B={DEBUG_MODE:+!!c},C="".concat(m);return h?(0,es.jsx)("meshBasicMaterial",{ref:A,map:f,toneMapped:!1,defines:B,onBeforeCompile:p},C):(0,es.jsx)("meshLambertMaterial",{ref:g,map:f,lightMap:null!=l?l:void 0,toneMapped:!1,defines:B,onBeforeCompile:p},C)}function rX(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=ef.SRGBColorSpace),null!=t?t:null}function rq(e){let{node:t}=e,r=(0,el.useMemo)(()=>t.material?Array.isArray(t.material)?t.material.map(e=>rX(e)):[rX(t.material)]:[],[t.material]);return(0,es.jsx)("mesh",{geometry:t.geometry,castShadow:!0,receiveShadow:!0,children:t.material?(0,es.jsx)(el.Suspense,{fallback:(0,es.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(t.material)?t.material.map((e,t)=>(0,es.jsx)(rV,{materialName:e.userData.resource_path,material:e,lightMap:r[t]},t)):(0,es.jsx)(rV,{materialName:t.material.userData.resource_path,material:t.material,lightMap:r[0]})}):null})}let rY=(0,el.memo)(e=>{var t;let{interiorFile:r}=e,{nodes:n}=rQ((0,tM.interiorToUrl)(r)),i=(0,tw.useDebug)(),a=null!=(t=null==i?void 0:i.debugMode)&&t;return(0,es.jsxs)("group",{rotation:[0,-Math.PI/2,0],children:[Object.entries(n).filter(e=>{let[,t]=e;return t.isMesh}).map(e=>{let[t,r]=e;return(0,es.jsx)(rq,{node:r},t)}),a?(0,es.jsx)(rW.FloatingLabel,{children:r}):null]})});function rz(e){let{color:t,label:r}=e;return(0,es.jsxs)("mesh",{children:[(0,es.jsx)("boxGeometry",{args:[10,10,10]}),(0,es.jsx)("meshStandardMaterial",{color:t,wireframe:!0}),r?(0,es.jsx)(rW.FloatingLabel,{color:t,children:r}):null]})}function rZ(e){var t;let{label:r}=e,n=(0,tw.useDebug)();return null!=(t=null==n?void 0:n.debugMode)&&t?(0,es.jsx)(rz,{color:"red",label:r}):null}let r$=(0,el.memo)(function(e){let{object:t}=e,r=(0,tF.getProperty)(t,"interiorFile"),n=(0,el.useMemo)(()=>(0,tF.getPosition)(t),[t]),i=(0,el.useMemo)(()=>(0,tF.getScale)(t),[t]),a=(0,el.useMemo)(()=>(0,tF.getRotation)(t),[t]);return(0,es.jsx)("group",{position:n,quaternion:a,scale:i,children:(0,es.jsx)(tQ,{fallback:(0,es.jsx)(rZ,{label:r}),children:(0,es.jsx)(el.Suspense,{fallback:(0,es.jsx)(rz,{color:"orange"}),children:(0,es.jsx)(rY,{interiorFile:r})})})})});function r0(e,t){let{path:r}=t,[n]=(0,rk.useLoader)(ef.CubeTextureLoader,[e],e=>e.setPath(r));return n}r0.preload=(e,t)=>{let{path:r}=t;return rk.useLoader.preload(ef.CubeTextureLoader,[e],e=>e.setPath(r))};let r1=()=>{};function r9(e){return e.wrapS=ef.RepeatWrapping,e.wrapT=ef.RepeatWrapping,e.minFilter=ef.LinearFilter,e.magFilter=ef.LinearFilter,e.colorSpace=ef.NoColorSpace,e.needsUpdate=!0,e}function r2(e){let{textureUrl:t,radius:r,heightPercent:n,speed:i,windDirection:a,layerIndex:o}=e,{debugMode:s}=(0,tw.useDebug)(),{animationEnabled:l}=(0,tw.useSettings)(),u=(0,el.useRef)(null),c=(0,tT.useTexture)(t,r9),d=(0,el.useMemo)(()=>{let e=n-.05;return function(e,t,r,n){let i=new ef.BufferGeometry,a=new Float32Array(75),o=new Float32Array(50),s=[.05,.05,.05,.05,.05,.05,r,r,r,.05,.05,r,t,r,.05,.05,r,r,r,.05,.05,.05,.05,.05,.05],l=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let n=5*t+r,i=-e+r*l,u=e-t*l,c=e*s[n];a[3*n]=i,a[3*n+1]=c,a[3*n+2]=u,o[2*n]=r,o[2*n+1]=t}!function(e){let t=t=>({x:e[3*t],y:e[3*t+1],z:e[3*t+2]}),r=(t,r,n,i)=>{e[3*t]=r,e[3*t+1]=n,e[3*t+2]=i},n=t(1),i=t(3),a=t(5),o=t(6),s=t(8),l=t(9),u=t(15),c=t(16),d=t(18),f=t(19),h=t(21),m=t(23),p=a.x+(n.x-a.x)*.5,A=a.y+(n.y-a.y)*.5,g=a.z+(n.z-a.z)*.5;r(0,o.x+(p-o.x)*2,o.y+(A-o.y)*2,o.z+(g-o.z)*2),p=l.x+(i.x-l.x)*.5,A=l.y+(i.y-l.y)*.5,g=l.z+(i.z-l.z)*.5,r(4,s.x+(p-s.x)*2,s.y+(A-s.y)*2,s.z+(g-s.z)*2),p=h.x+(u.x-h.x)*.5,A=h.y+(u.y-h.y)*.5,g=h.z+(u.z-h.z)*.5,r(20,c.x+(p-c.x)*2,c.y+(A-c.y)*2,c.z+(g-c.z)*2),p=m.x+(f.x-m.x)*.5,A=m.y+(f.y-m.y)*.5,g=m.z+(f.z-m.z)*.5,r(24,d.x+(p-d.x)*2,d.y+(A-d.y)*2,d.z+(g-d.z)*2)}(a);let u=function(e,t){let r=new Float32Array(25);for(let n=0;n<25;n++){let i=e[3*n],a=e[3*n+2],o=1.3-Math.sqrt(i*i+a*a)/t;o<.4?o=0:o>.8&&(o=1),r[n]=o}return r}(a,e),c=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,n=r+1,i=r+5,a=i+1;c.push(r,i,a),c.push(r,a,n)}return i.setIndex(c),i.setAttribute("position",new ef.Float32BufferAttribute(a,3)),i.setAttribute("uv",new ef.Float32BufferAttribute(o,2)),i.setAttribute("alpha",new ef.Float32BufferAttribute(u,1)),i.computeBoundingSphere(),i}(r,n,e,0)},[r,n]);(0,el.useEffect)(()=>()=>{d.dispose()},[d]);let f=(0,el.useMemo)(()=>new ef.ShaderMaterial({uniforms:{cloudTexture:{value:c},uvOffset:{value:new ef.Vector2(0,0)},debugMode:{value:+!!s},layerIndex:{value:o}},vertexShader:"\n attribute float alpha;\n\n uniform vec2 uvOffset;\n\n varying vec2 vUv;\n varying float vAlpha;\n\n void main() {\n // Apply UV offset for scrolling\n vUv = uv + uvOffset;\n vAlpha = alpha;\n\n vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n // Set depth to far plane so clouds are always visible and behind other geometry\n gl_Position = pos.xyww;\n }\n",fragmentShader:"\n uniform sampler2D cloudTexture;\n uniform float debugMode;\n uniform int layerIndex;\n\n varying vec2 vUv;\n varying float vAlpha;\n\n // Debug grid using screen-space derivatives for sharp, anti-aliased lines\n float debugGrid(vec2 uv, float gridSize, float lineWidth) {\n vec2 scaledUV = uv * gridSize;\n vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV);\n float line = min(grid.x, grid.y);\n return 1.0 - min(line / lineWidth, 1.0);\n }\n\n void main() {\n vec4 texColor = texture2D(cloudTexture, vUv);\n\n // Tribes 2 uses GL_MODULATE: final = texture × vertex color\n // Vertex color is white with varying alpha, so:\n // Final RGB = Texture RGB × 1.0 = Texture RGB\n // Final Alpha = Texture Alpha × Vertex Alpha\n float finalAlpha = texColor.a * vAlpha;\n vec3 color = texColor.rgb;\n\n // Debug mode: overlay R/G/B grid for layers 0/1/2\n if (debugMode > 0.5) {\n float gridIntensity = debugGrid(vUv, 4.0, 1.5);\n vec3 gridColor;\n if (layerIndex == 0) {\n gridColor = vec3(1.0, 0.0, 0.0); // Red\n } else if (layerIndex == 1) {\n gridColor = vec3(0.0, 1.0, 0.0); // Green\n } else {\n gridColor = vec3(0.0, 0.0, 1.0); // Blue\n }\n color = mix(color, gridColor, gridIntensity * 0.5);\n }\n\n // Output clouds with texture color and combined alpha\n gl_FragColor = vec4(color, finalAlpha);\n }\n",transparent:!0,depthWrite:!1,side:ef.DoubleSide}),[c,s,o]);return(0,el.useEffect)(()=>()=>{f.dispose()},[f]),(0,tx.useFrame)(l?(e,t)=>{let r=1e3*t/32;null!=u.current||(u.current=new ef.Vector2(0,0)),u.current.x+=a.x*i*r,u.current.y+=a.y*i*r,u.current.x-=Math.floor(u.current.x),u.current.y-=Math.floor(u.current.y),f.uniforms.uvOffset.value.copy(u.current)}:r1),(0,es.jsx)("mesh",{geometry:d,frustumCulled:!1,renderOrder:10,children:(0,es.jsx)("primitive",{object:f,attach:"material"})})}function r3(e){var t,r;let{object:n}=e,{data:i}=ty({queryKey:["detailMapList",r=(0,tF.getProperty)(n,"materialList")],queryFn:()=>(0,tM.loadDetailMapList)(r),enabled:!!r},tt,void 0),a=.95*(null!=(t=(0,tF.getFloat)(n,"visibleDistance"))?t:500),o=(0,el.useMemo)(()=>{var e,t,r;return[null!=(e=(0,tF.getFloat)(n,"cloudSpeed1"))?e:1e-4,null!=(t=(0,tF.getFloat)(n,"cloudSpeed2"))?t:2e-4,null!=(r=(0,tF.getFloat)(n,"cloudSpeed3"))?r:3e-4]},[n]),s=(0,el.useMemo)(()=>{var e,t,r;return[null!=(e=(0,tF.getFloat)(n,"cloudHeightPer1"))?e:.35,null!=(t=(0,tF.getFloat)(n,"cloudHeightPer2"))?t:.25,null!=(r=(0,tF.getFloat)(n,"cloudHeightPer3"))?r:.2]},[n]),l=(0,el.useMemo)(()=>{let e=(0,tF.getProperty)(n,"windVelocity");if(e){let[t,r]=e.split(" ").map(e=>parseFloat(e));if(0!==t||0!==r)return new ef.Vector2(r,-t).normalize()}return new ef.Vector2(1,0)},[n]),u=(0,el.useMemo)(()=>{if(!i)return[];let e=[];for(let t=0;t<3;t++){let r=i[7+t];r&&e.push({texture:r,height:s[t],speed:o[t]})}return e},[i,o,s]),c=(0,el.useRef)(null);return((0,tx.useFrame)(e=>{let{camera:t}=e;c.current&&c.current.position.copy(t.position)}),u&&0!==u.length)?(0,es.jsx)("group",{ref:c,children:u.map((e,t)=>{let r=(0,tM.textureToUrl)(e.texture);return(0,es.jsx)(el.Suspense,{fallback:null,children:(0,es.jsx)(r2,{textureUrl:r,radius:a,heightPercent:e.height,speed:e.speed,windDirection:l,layerIndex:t})},t)})}):null}tM.BASE_URL;let r8=!1;function r5(e){if(!e)return;let[t,r,n]=e.split(" ").map(e=>parseFloat(e));return[new ef.Color().setRGB(t,r,n),new ef.Color().setRGB(t,r,n).convertSRGBToLinear()]}function r6(e){let{skyBoxFiles:t,fogColor:r,fogState:n}=e,{camera:i}=(0,tE.useThree)(),a=r0(t,{path:""}),o=!!r,s=(0,el.useMemo)(()=>i.projectionMatrixInverse,[i]),l=(0,el.useMemo)(()=>n?(0,tD.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),u=(0,el.useRef)({skybox:{value:a},fogColor:{value:null!=r?r:new ef.Color(0,0,0)},enableFog:{value:o},inverseProjectionMatrix:{value:s},cameraMatrixWorld:{value:i.matrixWorld},cameraHeight:tD.globalFogUniforms.cameraHeight,fogVolumeData:{value:l},horizonFogHeight:{value:.18}}),c=(0,el.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]);return(0,el.useEffect)(()=>{u.current.skybox.value=a,u.current.fogColor.value=null!=r?r:new ef.Color(0,0,0),u.current.enableFog.value=o,u.current.fogVolumeData.value=l,u.current.horizonFogHeight.value=c},[a,r,o,l,c]),(0,es.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,es.jsxs)("bufferGeometry",{children:[(0,es.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,es.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,es.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:"\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = vec4(position.xy, 0.9999, 1.0);\n }\n ",fragmentShader:'\n uniform samplerCube skybox;\n uniform vec3 fogColor;\n uniform bool enableFog;\n uniform mat4 inverseProjectionMatrix;\n uniform mat4 cameraMatrixWorld;\n uniform float cameraHeight;\n uniform float fogVolumeData[12];\n uniform float horizonFogHeight;\n\n varying vec2 vUv;\n\n // Convert linear to sRGB for display\n // shaderMaterial does NOT get automatic linear->sRGB output conversion\n // Use proper sRGB transfer function (not simplified gamma 2.2) to match Three.js\n vec3 linearToSRGB(vec3 linear) {\n vec3 low = linear * 12.92;\n vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055;\n return mix(low, high, step(vec3(0.0031308), linear));\n }\n\n void main() {\n vec2 ndc = vUv * 2.0 - 1.0;\n vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0);\n viewPos.xyz /= viewPos.w;\n vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz);\n direction = vec3(direction.z, direction.y, -direction.x);\n // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear\n vec4 skyColor = textureCube(skybox, direction);\n vec3 finalColor;\n\n if (enableFog) {\n vec3 effectiveFogColor = fogColor;\n\n // Calculate how much fog volume the ray passes through\n // For skybox at "infinite" distance, the relevant height is how much\n // of the volume is above/below camera depending on view direction\n float volumeFogInfluence = 0.0;\n\n for (int i = 0; i < 3; i++) {\n int offset = i * 4;\n float volVisDist = fogVolumeData[offset + 0];\n float volMinH = fogVolumeData[offset + 1];\n float volMaxH = fogVolumeData[offset + 2];\n float volPct = fogVolumeData[offset + 3];\n\n if (volVisDist <= 0.0) continue;\n\n // Check if camera is inside this volume\n if (cameraHeight >= volMinH && cameraHeight <= volMaxH) {\n // Camera is inside the fog volume\n // Looking horizontally or up at shallow angles means ray travels\n // through more fog before exiting the volume\n float heightAboveCamera = volMaxH - cameraHeight;\n float heightBelowCamera = cameraHeight - volMinH;\n float volumeHeight = volMaxH - volMinH;\n\n // For horizontal rays (direction.y ≈ 0), maximum fog influence\n // For rays going up steeply, less fog (exits volume quickly)\n // For rays going down, more fog (travels through volume below)\n float rayInfluence;\n if (direction.y >= 0.0) {\n // Looking up: influence based on how steep we\'re looking\n // Shallow angles = long path through fog = high influence\n rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y);\n } else {\n // Looking down: always high fog (into the volume)\n rayInfluence = 1.0;\n }\n\n // Scale by percentage and volume depth factor\n volumeFogInfluence += rayInfluence * volPct;\n }\n }\n\n // Base fog factor from view direction (for haze at horizon)\n // In Torque, the fog "bans" (bands) are rendered as geometry from\n // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox.\n // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3).\n //\n // horizonFogHeight is the direction.y value where the fog band ends:\n // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2)\n //\n // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18\n //\n // Torque renders the fog bands as geometry with linear vertex alpha\n // interpolation. We use a squared curve (t^2) to create a gentler\n // falloff at the top of the gradient, matching Tribes 2\'s appearance.\n float baseFogFactor;\n if (direction.y <= 0.0) {\n // Looking at or below horizon: full fog\n baseFogFactor = 1.0;\n } else if (direction.y >= horizonFogHeight) {\n // Above fog band: no fog\n baseFogFactor = 0.0;\n } else {\n // Within fog band: squared curve for gentler falloff at top\n float t = direction.y / horizonFogHeight;\n baseFogFactor = (1.0 - t) * (1.0 - t);\n }\n\n // Combine base fog with volume fog influence\n // When inside a volume, increase fog intensity\n float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5);\n\n finalColor = mix(skyColor.rgb, effectiveFogColor, finalFogFactor);\n } else {\n finalColor = skyColor.rgb;\n }\n // Convert linear result to sRGB for display\n gl_FragColor = vec4(linearToSRGB(finalColor), 1.0);\n }\n ',depthWrite:!1,depthTest:!1})]})}function r4(e){let{materialList:t,fogColor:r,fogState:n}=e,{data:i}=ty({queryKey:["detailMapList",t],queryFn:()=>(0,tM.loadDetailMapList)(t)},tt,void 0),a=(0,el.useMemo)(()=>i?[(0,tM.textureToUrl)(i[1]),(0,tM.textureToUrl)(i[3]),(0,tM.textureToUrl)(i[4]),(0,tM.textureToUrl)(i[5]),(0,tM.textureToUrl)(i[0]),(0,tM.textureToUrl)(i[2])]:null,[i]);return a?(0,es.jsx)(r6,{skyBoxFiles:a,fogColor:r,fogState:n}):null}function r7(e){let{skyColor:t,fogColor:r,fogState:n}=e,{camera:i}=(0,tE.useThree)(),a=!!r,o=(0,el.useMemo)(()=>i.projectionMatrixInverse,[i]),s=(0,el.useMemo)(()=>n?(0,tD.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),l=(0,el.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]),u=(0,el.useRef)({skyColor:{value:t},fogColor:{value:null!=r?r:new ef.Color(0,0,0)},enableFog:{value:a},inverseProjectionMatrix:{value:o},cameraMatrixWorld:{value:i.matrixWorld},cameraHeight:tD.globalFogUniforms.cameraHeight,fogVolumeData:{value:s},horizonFogHeight:{value:l}});return(0,el.useEffect)(()=>{u.current.skyColor.value=t,u.current.fogColor.value=null!=r?r:new ef.Color(0,0,0),u.current.enableFog.value=a,u.current.fogVolumeData.value=s,u.current.horizonFogHeight.value=l},[t,r,a,s,l]),(0,es.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,es.jsxs)("bufferGeometry",{children:[(0,es.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,es.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,es.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:"\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = vec4(position.xy, 0.9999, 1.0);\n }\n ",fragmentShader:"\n uniform vec3 skyColor;\n uniform vec3 fogColor;\n uniform bool enableFog;\n uniform mat4 inverseProjectionMatrix;\n uniform mat4 cameraMatrixWorld;\n uniform float cameraHeight;\n uniform float fogVolumeData[12];\n uniform float horizonFogHeight;\n\n varying vec2 vUv;\n\n // Convert linear to sRGB for display\n vec3 linearToSRGB(vec3 linear) {\n vec3 low = linear * 12.92;\n vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055;\n return mix(low, high, step(vec3(0.0031308), linear));\n }\n\n void main() {\n vec2 ndc = vUv * 2.0 - 1.0;\n vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0);\n viewPos.xyz /= viewPos.w;\n vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz);\n direction = vec3(direction.z, direction.y, -direction.x);\n\n vec3 finalColor;\n\n if (enableFog) {\n // Calculate volume fog influence (same logic as SkyBoxTexture)\n float volumeFogInfluence = 0.0;\n\n for (int i = 0; i < 3; i++) {\n int offset = i * 4;\n float volVisDist = fogVolumeData[offset + 0];\n float volMinH = fogVolumeData[offset + 1];\n float volMaxH = fogVolumeData[offset + 2];\n float volPct = fogVolumeData[offset + 3];\n\n if (volVisDist <= 0.0) continue;\n\n if (cameraHeight >= volMinH && cameraHeight <= volMaxH) {\n float rayInfluence;\n if (direction.y >= 0.0) {\n rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y);\n } else {\n rayInfluence = 1.0;\n }\n volumeFogInfluence += rayInfluence * volPct;\n }\n }\n\n // Base fog factor from view direction\n float baseFogFactor;\n if (direction.y <= 0.0) {\n baseFogFactor = 1.0;\n } else if (direction.y >= horizonFogHeight) {\n baseFogFactor = 0.0;\n } else {\n float t = direction.y / horizonFogHeight;\n baseFogFactor = (1.0 - t) * (1.0 - t);\n }\n\n // Combine base fog with volume fog influence\n float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5);\n\n finalColor = mix(skyColor, fogColor, finalFogFactor);\n } else {\n finalColor = skyColor;\n }\n\n gl_FragColor = vec4(linearToSRGB(finalColor), 1.0);\n }\n ",depthWrite:!1,depthTest:!1})]})}function ne(e,t){let{fogDistance:r,visibleDistance:n}=e;return[r,n]}function nt(e){let{fogState:t,enabled:r}=e,{scene:n,camera:i}=(0,tE.useThree)(),a=(0,el.useRef)(null),o=(0,el.useMemo)(()=>(0,tD.packFogVolumeData)(t.fogVolumes),[t.fogVolumes]);return(0,el.useEffect)(()=>{r8||((0,tR.installCustomFogShader)(),r8=!0)},[]),(0,el.useEffect)(()=>{(0,tD.resetGlobalFogUniforms)();let[e,r]=ne(t,i.position.y),s=new ef.Fog(t.fogColor,e,r);return n.fog=s,a.current=s,(0,tD.updateGlobalFogUniforms)(i.position.y,o),()=>{n.fog=null,a.current=null,(0,tD.resetGlobalFogUniforms)()}},[n,i,t,o]),(0,el.useEffect)(()=>{let e=a.current;if(e)if(r){let[r,n]=ne(t,i.position.y);e.near=r,e.far=n}else e.near=1e10,e.far=1e10},[r,t,i.position.y]),(0,tx.useFrame)(()=>{let e=a.current;if(!e)return;let n=i.position.y;if((0,tD.updateGlobalFogUniforms)(n,o,r),r){let[r,i]=ne(t,n);e.near=r,e.far=i,e.color.copy(t.fogColor)}}),null}let nr=/borg|xorg|porg|dorg|plant|tree|bush|fern|vine|grass|leaf|flower|frond|palm|foliage/i;function nn(e){return nr.test(e)}let ni=(0,el.createContext)(null);function na(e){let{children:t,shapeName:r,type:n}=e,i=(0,el.useMemo)(()=>nn(r),[r]),a=(0,el.useMemo)(()=>({shapeName:r,type:n,isOrganic:i}),[r,n,i]);return(0,es.jsx)(ni.Provider,{value:a,children:t})}var no=e.i(51475);let ns=new Map,nl={directional:1,ambient:1.5};function nu(e){e.onBeforeCompile=t=>{(0,tR.injectCustomFog)(t,tD.globalFogUniforms),e instanceof ef.MeshLambertMaterial&&(t.uniforms.shapeDirectionalFactor={value:nl.directional},t.uniforms.shapeAmbientFactor={value:nl.ambient},t.fragmentShader=t.fragmentShader.replace("#include ","#include \nuniform float shapeDirectionalFactor;\nuniform float shapeAmbientFactor;\n"),t.fragmentShader=t.fragmentShader.replace("#include ","#include \n // Apply shape-specific lighting multipliers\n reflectedLight.directDiffuse *= shapeDirectionalFactor;\n reflectedLight.indirectDiffuse *= shapeAmbientFactor;\n"))}}function nc(e,t,r,n){let i=r.has("Translucent"),a=r.has("Additive"),o=r.has("SelfIlluminating");if(r.has("NeverEnvMap"),o){let e=new ef.MeshBasicMaterial({map:t,side:2,transparent:a,alphaTest:.5*!a,fog:!0,...a&&{blending:ef.AdditiveBlending}});return nu(e),e}if(n||i){let e={map:t,transparent:!1,alphaTest:.5,reflectivity:0},r=new ef.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),n=new ef.MeshLambertMaterial({...e,side:0});return nu(r),nu(n),[r,n]}let s=new ef.MeshLambertMaterial({map:t,side:2,reflectivity:0});return nu(s),s}let nd=(0,el.memo)(function(e){var t;let{material:r,shapeName:n,geometry:i,backGeometry:a,castShadow:o=!1,receiveShadow:s=!1}=e,l=r.userData.resource_path,u=new Set(null!=(t=r.userData.flag_names)?t:[]),c=function(e){let{animationEnabled:t}=(0,tw.useSettings)(),{data:r}=ty({queryKey:["ifl",e],queryFn:()=>(0,tM.loadImageFrameList)(e),enabled:!0,suspense:!0,throwOnError:tB,placeholderData:void 0},tt,void 0),n=(0,el.useMemo)(()=>r.map(t=>(0,tM.iflTextureToUrl)(t.name,e)),[r,e]),i=(0,tT.useTexture)(n),a=(0,el.useMemo)(()=>{var t;let n,a=ns.get(e);return a||(a=function(e){let t=e[0].image.width,r=e[0].image.height,n=e.length,i=Math.ceil(Math.sqrt(n)),a=Math.ceil(n/i),o=document.createElement("canvas");o.width=t*i,o.height=r*a;let s=o.getContext("2d");e.forEach((e,n)=>{let a=Math.floor(n/i);s.drawImage(e.image,n%i*t,a*r)});let l=new ef.CanvasTexture(o);return l.colorSpace=ef.SRGBColorSpace,l.generateMipmaps=!1,l.minFilter=ef.NearestFilter,l.magFilter=ef.NearestFilter,l.wrapS=ef.ClampToEdgeWrapping,l.wrapT=ef.ClampToEdgeWrapping,l.repeat.set(1/i,1/a),{texture:l,columns:i,rows:a,frameCount:n,frameStartTicks:[],totalTicks:0,lastFrame:-1}}(i),ns.set(e,a)),n=0,(t=a).frameStartTicks=r.map(e=>{let t=n;return n+=e.frameCount,t}),t.totalTicks=n,a},[e,i,r]);return(0,no.useTick)(e=>{let r=t?function(e,t){if(0===e.totalTicks)return 0;let r=t%e.totalTicks,{frameStartTicks:n}=e;for(let e=n.length-1;e>=0;e--)if(r>=n[e])return e;return 0}(a,e):0;!function(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,n=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,n/e.rows)}(a,r)}),a.texture}("textures/".concat(l,".ifl")),d=n&&nn(n),f=(0,el.useMemo)(()=>nc(r,c,u,d),[r,c,u,d]);return Array.isArray(f)?(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)("mesh",{geometry:a||i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:f[0],attach:"material"})}),(0,es.jsx)("mesh",{geometry:i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:f[1],attach:"material"})})]}):(0,es.jsx)("mesh",{geometry:i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:f,attach:"material"})})}),nf=(0,el.memo)(function(e){var t;let{material:r,shapeName:n,geometry:i,backGeometry:a,castShadow:o=!1,receiveShadow:s=!1}=e,l=r.userData.resource_path,u=new Set(null!=(t=r.userData.flag_names)?t:[]),c=(0,el.useMemo)(()=>(l||console.warn('No resource_path was found on "'.concat(n,'" - rendering fallback.')),l?(0,tM.textureToUrl)(l):tM.FALLBACK_TEXTURE_URL),[l,n]),d=n&&nn(n),f=u.has("Translucent"),h=(0,tT.useTexture)(c,e=>d||f?(0,tS.setupAlphaTestedTexture)(e):(0,tS.setupColor)(e)),m=(0,el.useMemo)(()=>nc(r,h,u,d),[r,h,u,d]);return Array.isArray(m)?(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)("mesh",{geometry:a||i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:m[0],attach:"material"})}),(0,es.jsx)("mesh",{geometry:i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:m[1],attach:"material"})})]}):(0,es.jsx)("mesh",{geometry:i,castShadow:o,receiveShadow:s,children:(0,es.jsx)("primitive",{object:m,attach:"material"})})}),nh=(0,el.memo)(function(e){var t;let{material:r,shapeName:n,geometry:i,backGeometry:a,castShadow:o=!1,receiveShadow:s=!1}=e,l=new Set(null!=(t=r.userData.flag_names)?t:[]).has("IflMaterial"),u=r.userData.resource_path;return l&&u?(0,es.jsx)(nd,{material:r,shapeName:n,geometry:i,backGeometry:a,castShadow:o,receiveShadow:s}):r.name?(0,es.jsx)(nf,{material:r,shapeName:n,geometry:i,backGeometry:a,castShadow:o,receiveShadow:s}):null});function nm(e){let{color:t,label:r}=e;return(0,es.jsxs)("mesh",{children:[(0,es.jsx)("boxGeometry",{args:[10,10,10]}),(0,es.jsx)("meshStandardMaterial",{color:t,wireframe:!0}),r?(0,es.jsx)(rW.FloatingLabel,{color:t,children:r}):null]})}function np(e){let{color:t,label:r}=e,{debugMode:n}=(0,tw.useDebug)();return n?(0,es.jsx)(nm,{color:t,label:r}):null}function nA(e){let{shapeName:t,loadingColor:r="yellow",children:n}=e;return t?(0,es.jsx)(tQ,{fallback:(0,es.jsx)(np,{color:"red",label:t}),children:(0,es.jsxs)(el.Suspense,{fallback:(0,es.jsx)(nm,{color:r}),children:[(0,es.jsx)(ng,{}),n]})}):(0,es.jsx)(np,{color:"orange"})}let ng=(0,el.memo)(function(){let{shapeName:e,isOrganic:t}=(0,el.useContext)(ni),{debugMode:r}=(0,tw.useDebug)(),{nodes:n}=rQ((0,tM.shapeToUrl)(e)),i=(0,el.useMemo)(()=>{let e=Object.values(n).filter(e=>e.skeleton);if(e.length>0){var t=e[0].skeleton;let r=new Set;return t.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&r.add(t)}),r}return new Set},[n]),a=(0,el.useMemo)(()=>Object.entries(n).filter(e=>{let[t,r]=e;return r.material&&"Unassigned"!==r.material.name&&!r.name.match(/^Hulk/i)}).map(e=>{let[r,n]=e,a=function(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,n=e.attributes.skinWeight,i=e.index,a=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(o)){a[e]=!0;break}}if(i){let t=[],r=i.array;for(let e=0;e1){let t=0,r=0,n=0;for(let a of e)t+=i[3*a],r+=i[3*a+1],n+=i[3*a+2];let a=Math.sqrt(t*t+r*r+n*n);for(let o of(a>0&&(t/=a,r/=a,n/=a),e))i[3*o]=t,i[3*o+1]=r,i[3*o+2]=n}if(r.needsUpdate=!0,t){let e=(o=a.clone()).attributes.normal,t=e.array;for(let e=0;e{let{node:r,geometry:n,backGeometry:i}=t;return(0,es.jsx)(el.Suspense,{fallback:(0,es.jsx)("mesh",{geometry:n,children:(0,es.jsx)("meshStandardMaterial",{color:"gray",wireframe:!0})}),children:r.material?Array.isArray(r.material)?r.material.map((t,r)=>(0,es.jsx)(nh,{material:t,shapeName:e,geometry:n,backGeometry:i,castShadow:o,receiveShadow:o},r)):(0,es.jsx)(nh,{material:r.material,shapeName:e,geometry:n,backGeometry:i,castShadow:o,receiveShadow:o}):null},r.id)}),r?(0,es.jsx)(rW.FloatingLabel,{children:e}):null]})});var nv=e.i(6112);let nB={1:"Storm",2:"Inferno"},nC=(0,el.createContext)(null);function ny(){let e=(0,el.useContext)(nC);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function nb(e){let{children:t}=e,{camera:r}=(0,tE.useThree)(),[n,i]=(0,el.useState)(0),[a,o]=(0,el.useState)({}),s=(0,el.useCallback)(e=>{o(t=>({...t,[e.id]:e}))},[]),l=(0,el.useCallback)(e=>{o(t=>{let{[e.id]:r,...n}=t;return n})},[]),u=Object.keys(a).length,c=(0,el.useCallback)(()=>{i(e=>0===u?0:(e+1)%u)},[u]),d=(0,el.useCallback)(e=>{e>=0&&e{if(n({registerCamera:s,unregisterCamera:l,nextCamera:c,setCameraIndex:d,cameraCount:u}),[s,l,c,d,u]);return(0,es.jsx)(nC.Provider,{value:f,children:t})}let nM=(0,el.lazy)(()=>e.A(61921).then(e=>({default:e.AudioEmitter}))),nx={AudioEmitter:function(e){let{audioEnabled:t}=(0,tw.useSettings)();return t?(0,es.jsx)(nM,{...e}):null},Camera:function(e){let{object:t}=e,{registerCamera:r,unregisterCamera:n}=ny(),i=(0,el.useId)(),a=(0,tF.getProperty)(t,"dataBlock"),o=(0,el.useMemo)(()=>(0,tF.getPosition)(t),[t]),s=(0,el.useMemo)(()=>(0,tF.getRotation)(t),[t]);return(0,el.useEffect)(()=>{if("Observer"===a){let e={id:i,position:new ef.Vector3(...o),rotation:s};return r(e),()=>{n(e)}}},[i,a,r,n,o,s]),null},ForceFieldBare:(0,el.lazy)(()=>e.A(25147).then(e=>({default:e.ForceFieldBare}))),InteriorInstance:r$,Item:function(e){var t,r;let{object:n}=e,i=tj(),a=null!=(t=(0,tF.getProperty)(n,"dataBlock"))?t:"",o=(0,nv.useDatablock)(a),s=(0,el.useMemo)(()=>(0,tF.getPosition)(n),[n]),l=(0,el.useMemo)(()=>(0,tF.getScale)(n),[n]),u=(0,el.useMemo)(()=>(0,tF.getRotation)(n),[n]),c=(0,tF.getProperty)(o,"shapeFile");c||console.error(" missing shape for datablock: ".concat(a));let d=(null==a?void 0:a.toLowerCase())==="flag",f=null!=(r=null==i?void 0:i.team)?r:null,h=f&&f>0?nB[f]:null,m=d&&h?"".concat(h," Flag"):null;return(0,es.jsx)(na,{shapeName:c,type:"Item",children:(0,es.jsx)("group",{position:s,quaternion:u,scale:l,children:(0,es.jsx)(nA,{shapeName:c,loadingColor:"pink",children:m?(0,es.jsx)(rW.FloatingLabel,{opacity:.6,children:m}):null})})})},SimGroup:function(e){var t;let{object:r}=e,n=tj(),i=(0,el.useMemo)(()=>{let e=null,t=!1;if(n&&n.hasTeams){if(t=!0,null!=n.team)e=n.team;else if(r._name){let t=r._name.match(/^team(\d+)$/i);t&&(e=parseInt(t[1],10))}}else r._name&&(t="teams"===r._name.toLowerCase());return{object:r,parent:n,hasTeams:t,team:e}},[r,n]);return(0,es.jsx)(tU.Provider,{value:i,children:(null!=(t=r._children)?t:[]).map((e,t)=>nE(e,t))})},Sky:function(e){var t;let{object:r}=e,{fogEnabled:n,highQualityFog:i}=(0,tw.useSettings)(),a=(0,tF.getProperty)(r,"materialList"),o=(0,el.useMemo)(()=>r5((0,tF.getProperty)(r,"SkySolidColor")),[r]),s=null!=(t=(0,tF.getInt)(r,"useSkyTextures"))?t:1,l=(0,el.useMemo)(()=>(function(e){var t,r;let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=null!=(t=(0,tF.getFloat)(e,"fogDistance"))?t:0,a=null!=(r=(0,tF.getFloat)(e,"visibleDistance"))?r:1e3,o=(0,tF.getFloat)(e,"high_fogDistance"),s=(0,tF.getFloat)(e,"high_visibleDistance"),l=n&&null!=o&&o>0?o:i,u=n&&null!=s&&s>0?s:a,c=function(e){if(!e)return new ef.Color(.5,.5,.5);let[t,r,n]=e.split(" ").map(e=>parseFloat(e));return new ef.Color().setRGB(t,r,n).convertSRGBToLinear()}((0,tF.getProperty)(e,"fogColor")),d=[];for(let t=1;t<=3;t++){let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return null;let r=e.split(" ").map(e=>parseFloat(e));if(r.length<3)return null;let[n,i,a]=r;return n<=0||a<=i?null:{visibleDistance:n,minHeight:i,maxHeight:a,percentage:Math.max(0,Math.min(1,t))}}((0,tF.getProperty)(e,"fogVolume".concat(t)),1);r&&d.push(r)}let f=d.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:l,visibleDistance:u,fogColor:c,fogVolumes:d,fogLine:f,enabled:u>l}})(r,i),[r,i]),u=(0,el.useMemo)(()=>r5((0,tF.getProperty)(r,"fogColor")),[r]),c=o||u,d=l.enabled&&n,f=l.fogColor,{scene:h,gl:m}=(0,tE.useThree)();(0,el.useEffect)(()=>{if(d){let e=f.clone();h.background=e,m.setClearColor(e)}else if(c){let e=c[0].clone();h.background=e,m.setClearColor(e)}else h.background=null;return()=>{h.background=null}},[h,m,d,f,c]);let p=null==o?void 0:o[1];return(0,es.jsxs)(es.Fragment,{children:[a&&s?(0,es.jsx)(el.Suspense,{fallback:null,children:(0,es.jsx)(r4,{materialList:a,fogColor:d?f:void 0,fogState:d?l:void 0},a)}):p?(0,es.jsx)(r7,{skyColor:p,fogColor:d?f:void 0,fogState:d?l:void 0}):null,(0,es.jsx)(el.Suspense,{children:(0,es.jsx)(r3,{object:r})}),l.enabled?(0,es.jsx)(nt,{fogState:l,enabled:n}):null]})},StaticShape:function(e){var t;let{object:r}=e,n=null!=(t=(0,tF.getProperty)(r,"dataBlock"))?t:"",i=(0,nv.useDatablock)(n),a=(0,el.useMemo)(()=>(0,tF.getPosition)(r),[r]),o=(0,el.useMemo)(()=>(0,tF.getRotation)(r),[r]),s=(0,el.useMemo)(()=>(0,tF.getScale)(r),[r]),l=(0,tF.getProperty)(i,"shapeFile");return l||console.error(" missing shape for datablock: ".concat(n)),(0,es.jsx)(na,{shapeName:l,type:"StaticShape",children:(0,es.jsx)("group",{position:a,quaternion:o,scale:s,children:(0,es.jsx)(nA,{shapeName:l})})})},Sun:function(e){let{object:t}=e,r=(0,el.useMemo)(()=>{var e;let[r,n,i]=(null!=(e=(0,tF.getProperty)(t,"direction"))?e:"0.57735 0.57735 -0.57735").split(" ").map(e=>parseFloat(e)),a=Math.sqrt(r*r+i*i+n*n);return new ef.Vector3(r/a,i/a,n/a)},[t]),n=(0,el.useMemo)(()=>new ef.Vector3(-(5e3*r.x),-(5e3*r.y),-(5e3*r.z)),[r]),i=(0,el.useMemo)(()=>{var e;let[r,n,i]=(null!=(e=(0,tF.getProperty)(t,"color"))?e:"0.7 0.7 0.7 1").split(" ").map(e=>parseFloat(e));return new ef.Color(r,n,i)},[t]),a=(0,el.useMemo)(()=>{var e;let[r,n,i]=(null!=(e=(0,tF.getProperty)(t,"ambient"))?e:"0.5 0.5 0.5 1").split(" ").map(e=>parseFloat(e));return new ef.Color(r,n,i)},[t]);return(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)("directionalLight",{position:n,color:i,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4}),(0,es.jsx)("ambientLight",{color:a,intensity:1})]})},TerrainBlock:tk,TSStatic:function(e){let{object:t}=e,r=(0,tF.getProperty)(t,"shapeName"),n=(0,el.useMemo)(()=>(0,tF.getPosition)(t),[t]),i=(0,el.useMemo)(()=>(0,tF.getRotation)(t),[t]),a=(0,el.useMemo)(()=>(0,tF.getScale)(t),[t]);return r||console.error(" missing shapeName for object",t),(0,es.jsx)(na,{shapeName:r,type:"TSStatic",children:(0,es.jsx)("group",{position:n,quaternion:i,scale:a,children:(0,es.jsx)(nA,{shapeName:r})})})},Turret:function(e){var t;let{object:r}=e,n=null!=(t=(0,tF.getProperty)(r,"dataBlock"))?t:"",i=(0,tF.getProperty)(r,"initialBarrel"),a=(0,nv.useDatablock)(n),o=(0,nv.useDatablock)(i),s=(0,el.useMemo)(()=>(0,tF.getPosition)(r),[r]),l=(0,el.useMemo)(()=>(0,tF.getRotation)(r),[r]),u=(0,el.useMemo)(()=>(0,tF.getScale)(r),[r]),c=(0,tF.getProperty)(a,"shapeFile"),d=(0,tF.getProperty)(o,"shapeFile");return c||console.error(" missing shape for datablock: ".concat(n)),i&&!d&&console.error(" missing shape for barrel datablock: ".concat(i)),(0,es.jsx)(na,{shapeName:c,type:"Turret",children:(0,es.jsxs)("group",{position:s,quaternion:l,scale:u,children:[(0,es.jsx)(nA,{shapeName:c}),d?(0,es.jsx)(na,{shapeName:d,type:"Turret",children:(0,es.jsx)("group",{position:[0,1.5,0],children:(0,es.jsx)(nA,{shapeName:d})})}):null]})})},WaterBlock:(0,el.lazy)(()=>e.A(18599).then(e=>({default:e.WaterBlock}))),WayPoint:function(e){let{object:t}=e;tj();let r=(0,el.useMemo)(()=>(0,tF.getPosition)(t),[t]),n=(0,tF.getProperty)(t,"name");return n?(0,es.jsx)(rW.FloatingLabel,{position:r,opacity:.6,children:n}):null}};function nE(e,t){let r=nx[e._className];return r?(0,es.jsx)(el.Suspense,{children:(0,es.jsx)(r,{object:e})},t):null}var nF=e.i(86608),nS=e.i(38433),nT=e.i(33870),nw=e.i(91996);let nR=async e=>{let t;try{t=(0,tM.getUrlForPath)(e)}catch(t){return console.warn("Script not in manifest: ".concat(e," (").concat(t,")")),null}try{let r=await fetch(t);if(!r.ok)return console.error("Script fetch failed: ".concat(e," (").concat(r.status,")")),null;return await r.text()}catch(t){return console.error("Script fetch error: ".concat(e)),console.error(t),null}},nD=(0,nT.createScriptCache)(),nI={findFiles:e=>{let t=(0,tb.default)(e,{nocase:!0});return(0,nw.getResourceList)().filter(e=>t(e)).map(e=>{let[t,r]=(0,nw.getSourceAndPath)(e);return r})},isFile:e=>null!=(0,nw.getResourceMap)()[(0,nw.getResourceKey)(e)]},nG=(0,el.memo)(function(e){let{name:t,onLoadingChange:r}=e,{data:n}=ty({queryKey:["parsedMission",t],queryFn:()=>(0,tM.loadMission)(t)},tt,void 0),{missionGroup:i,runtime:a,progress:o}=function(e,t){let[r,n]=(0,el.useState)({missionGroup:void 0,runtime:void 0,progress:0});return(0,el.useEffect)(()=>{if(!t)return;let r=new AbortController,i=t.missionTypes[0],a=(0,nS.createProgressTracker)(),o=()=>{n(e=>({...e,progress:a.progress}))};a.on("update",o);let{runtime:s}=(0,nF.runServer)({missionName:e,missionType:i,runtimeOptions:{loadScript:nR,fileSystem:nI,cache:nD,signal:r.signal,progress:a,ignoreScripts:["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]},onMissionLoadDone:()=>{n({missionGroup:s.getObjectByName("MissionGroup"),runtime:s,progress:1})}});return()=>{a.off("update",o),r.abort(),s.destroy()}},[e,t]),r}(t,n),s=!i||!a;return((0,el.useEffect)(()=>{null==r||r(s,o)},[s,o,r]),s)?null:(0,es.jsx)(tH.RuntimeProvider,{runtime:a,children:nE(i)})});function nL(e,t){var r=eB(e,t,"update");if(r.set){if(!r.get)throw TypeError("attempted to read set only private field");return"__destrWrapper"in r||(r.__destrWrapper={set value(v){r.set.call(e,v)},get value(){return r.get.call(e)}}),r.__destrWrapper}if(!r.writable)throw TypeError("attempted to set read only private field");return r}var nP=(K=new WeakMap,class extends eF{build(e,t,r){var n;let i=t.queryKey,a=null!=(n=t.queryHash)?n:eO(i,t),o=this.get(a);return o||(o=new e5({client:e,queryKey:i,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){eC(this,K).has(e.queryHash)||(eC(this,K).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=eC(this,K).get(e.queryHash);t&&(e.destroy(),t===e&&eC(this,K).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){eZ.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return eC(this,K).get(e)}getAll(){return[...eC(this,K).values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>eP(t,e))}findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.getAll();return Object.keys(e).length>0?t.filter(t=>eP(e,t)):t}notify(e){eZ.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){eZ.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){eZ.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}constructor(e={}){super(),eb(this,K,{writable:!0,value:void 0}),this.config=e,eM(this,K,new Map)}}),nH=(Q=new WeakMap,W=new WeakMap,V=new WeakMap,X=new WeakMap,q=new WeakSet,class extends e8{setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){eC(this,W).includes(e)||(eC(this,W).push(e),this.clearGcTimeout(),eC(this,V).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){eM(this,W,eC(this,W).filter(t=>t!==e)),this.scheduleGc(),eC(this,V).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){eC(this,W).length||("pending"===this.state.status?this.scheduleGc():eC(this,V).remove(this))}continue(){var e,t;return null!=(t=null==(e=eC(this,X))?void 0:e.continue())?t:this.execute(this.state.variables)}async execute(e){var t,r,n,i,a,o,s,l,u,c,d,f,h,m,p,A,g,B,C,y,b;let M=()=>{ex(this,q,nO).call(this,{type:"continue"})},x={client:eC(this,Q),meta:this.options.meta,mutationKey:this.options.mutationKey};eM(this,X,e3({fn:()=>this.options.mutationFn?this.options.mutationFn(e,x):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{ex(this,q,nO).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{ex(this,q,nO).call(this,{type:"pause"})},onContinue:M,retry:null!=(t=this.options.retry)?t:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>eC(this,V).canRun(this)}));let E="pending"===this.state.status,F=!eC(this,X).canStart();try{if(E)M();else{ex(this,q,nO).call(this,{type:"pending",variables:e,isPaused:F}),await (null==(c=(d=eC(this,V).config).onMutate)?void 0:c.call(d,e,this,x));let t=await (null==(f=(h=this.options).onMutate)?void 0:f.call(h,e,x));t!==this.state.context&&ex(this,q,nO).call(this,{type:"pending",context:t,variables:e,isPaused:F})}let t=await eC(this,X).start();return await (null==(r=(n=eC(this,V).config).onSuccess)?void 0:r.call(n,t,e,this.state.context,this,x)),await (null==(i=(a=this.options).onSuccess)?void 0:i.call(a,t,e,this.state.context,x)),await (null==(o=(s=eC(this,V).config).onSettled)?void 0:o.call(s,t,null,this.state.variables,this.state.context,this,x)),await (null==(l=(u=this.options).onSettled)?void 0:l.call(u,t,null,e,this.state.context,x)),ex(this,q,nO).call(this,{type:"success",data:t}),t}catch(t){try{throw await (null==(m=(p=eC(this,V).config).onError)?void 0:m.call(p,t,e,this.state.context,this,x)),await (null==(A=(g=this.options).onError)?void 0:A.call(g,t,e,this.state.context,x)),await (null==(B=(C=eC(this,V).config).onSettled)?void 0:B.call(C,void 0,t,this.state.variables,this.state.context,this,x)),await (null==(y=(b=this.options).onSettled)?void 0:y.call(b,void 0,t,e,this.state.context,x)),t}finally{ex(this,q,nO).call(this,{type:"error",error:t})}}finally{eC(this,V).runNext(this)}}constructor(e){super(),eE(this,q),eb(this,Q,{writable:!0,value:void 0}),eb(this,W,{writable:!0,value:void 0}),eb(this,V,{writable:!0,value:void 0}),eb(this,X,{writable:!0,value:void 0}),eM(this,Q,e.client),this.mutationId=e.mutationId,eM(this,V,e.mutationCache),eM(this,W,[]),this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}});function nO(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),eZ.batch(()=>{eC(this,W).forEach(t=>{t.onMutationUpdate(e)}),eC(this,V).notify({mutation:this,type:"updated",action:e})})}var n_=(Y=new WeakMap,z=new WeakMap,Z=new WeakMap,class extends eF{build(e,t,r){let n=new nH({client:e,mutationCache:this,mutationId:++nL(this,Z).value,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){eC(this,Y).add(e);let t=nk(e);if("string"==typeof t){let r=eC(this,z).get(t);r?r.push(e):eC(this,z).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(eC(this,Y).delete(e)){let t=nk(e);if("string"==typeof t){let r=eC(this,z).get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&eC(this,z).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=nk(e);if("string"!=typeof t)return!0;{let r=eC(this,z).get(t),n=null==r?void 0:r.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=nk(e);if("string"!=typeof t)return Promise.resolve();{var r,n;let i=null==(r=eC(this,z).get(t))?void 0:r.find(t=>t!==e&&t.state.isPaused);return null!=(n=null==i?void 0:i.continue())?n:Promise.resolve()}}clear(){eZ.batch(()=>{eC(this,Y).forEach(e=>{this.notify({type:"removed",mutation:e})}),eC(this,Y).clear(),eC(this,z).clear()})}getAll(){return Array.from(eC(this,Y))}find(e){let t={exact:!0,...e};return this.getAll().find(e=>eH(t,e))}findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().filter(t=>eH(e,t))}notify(e){eZ.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return eZ.batch(()=>Promise.all(e.map(e=>e.continue().catch(eR))))}constructor(e={}){super(),eb(this,Y,{writable:!0,value:void 0}),eb(this,z,{writable:!0,value:void 0}),eb(this,Z,{writable:!0,value:void 0}),this.config=e,eM(this,Y,new Set),eM(this,z,new Map),eM(this,Z,0)}});function nk(e){var t;return null==(t=e.options.scope)?void 0:t.id}function nU(e){return{onFetch:(t,r)=>{var n,i,a,o,s;let l=t.options,u=null==(a=t.fetchOptions)||null==(i=a.meta)||null==(n=i.fetchMore)?void 0:n.direction,c=(null==(o=t.state.data)?void 0:o.pages)||[],d=(null==(s=t.state.data)?void 0:s.pageParams)||[],f={pages:[],pageParams:[]},h=0,m=async()=>{let r=!1,n=eq(t.options,t.fetchOptions),i=async(e,i,a)=>{if(r)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let o=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:a?"backward":"forward",meta:t.options.meta};return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)}),e})(),s=await n(o),{maxPages:l}=t.options,u=a?eV:eW;return{pages:u(e.pages,s,l),pageParams:u(e.pageParams,i,l)}};if(u&&c.length){let e="backward"===u,t={pages:c,pageParams:d},r=(e?function(e,t){var r;let{pages:n,pageParams:i}=t;return n.length>0?null==(r=e.getPreviousPageParam)?void 0:r.call(e,n[0],n,i[0],i):void 0}:nj)(l,t);f=await i(t,r,e)}else{let t=null!=e?e:c.length;do{var a;let e=0===h?null!=(a=d[0])?a:l.initialPageParam:nj(l,f);if(h>0&&null==e)break;f=await i(f,e),h++}while(h{var e,n;return null==(e=(n=t.options).persister)?void 0:e.call(n,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=m}}}function nj(e,t){let{pages:r,pageParams:n}=t,i=r.length-1;return r.length>0?e.getNextPageParam(r[i],r,n[i],n):void 0}var nJ=($=new WeakMap,ee=new WeakMap,et=new WeakMap,er=new WeakMap,en=new WeakMap,ei=new WeakMap,ea=new WeakMap,eo=new WeakMap,class{mount(){nL(this,ei).value++,1===eC(this,ei)&&(eM(this,ea,eY.subscribe(async e=>{e&&(await this.resumePausedMutations(),eC(this,$).onFocus())})),eM(this,eo,e$.subscribe(async e=>{e&&(await this.resumePausedMutations(),eC(this,$).onOnline())})))}unmount(){var e,t;nL(this,ei).value--,0===eC(this,ei)&&(null==(e=eC(this,ea))||e.call(this),eM(this,ea,void 0),null==(t=eC(this,eo))||t.call(this),eM(this,eo,void 0))}isFetching(e){return eC(this,$).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return eC(this,ee).findAll({...e,status:"pending"}).length}getQueryData(e){var t;let r=this.defaultQueryOptions({queryKey:e});return null==(t=eC(this,$).get(r.queryHash))?void 0:t.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=eC(this,$).build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(eG(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return eC(this,$).findAll(e).map(e=>{let{queryKey:t,state:r}=e;return[t,r.data]})}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),i=eC(this,$).get(n.queryHash),a=null==i?void 0:i.state.data,o="function"==typeof t?t(a):t;if(void 0!==o)return eC(this,$).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return eZ.batch(()=>eC(this,$).findAll(e).map(e=>{let{queryKey:n}=e;return[n,this.setQueryData(n,t,r)]}))}getQueryState(e){var t;let r=this.defaultQueryOptions({queryKey:e});return null==(t=eC(this,$).get(r.queryHash))?void 0:t.state}removeQueries(e){let t=eC(this,$);eZ.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=eC(this,$);return eZ.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={revert:!0,...t};return Promise.all(eZ.batch(()=>eC(this,$).findAll(e).map(e=>e.cancel(r)))).then(eR).catch(eR)}invalidateQueries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return eZ.batch(()=>{var r,n;return(eC(this,$).findAll(e).forEach(e=>{e.invalidate()}),(null==e?void 0:e.refetchType)==="none")?Promise.resolve():this.refetchQueries({...e,type:null!=(n=null!=(r=null==e?void 0:e.refetchType)?r:null==e?void 0:e.type)?n:"active"},t)})}refetchQueries(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={...r,cancelRefetch:null==(t=r.cancelRefetch)||t};return Promise.all(eZ.batch(()=>eC(this,$).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(eR)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(eR)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=eC(this,$).build(this,t);return r.isStaleByTime(eG(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(eR).catch(eR)}fetchInfiniteQuery(e){return e.behavior=nU(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(eR).catch(eR)}ensureInfiniteQueryData(e){return e.behavior=nU(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return e$.isOnline()?eC(this,ee).resumePausedMutations():Promise.resolve()}getQueryCache(){return eC(this,$)}getMutationCache(){return eC(this,ee)}getDefaultOptions(){return eC(this,et)}setDefaultOptions(e){eM(this,et,e)}setQueryDefaults(e,t){eC(this,er).set(e_(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...eC(this,er).values()],r={};return t.forEach(t=>{ek(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){eC(this,en).set(e_(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...eC(this,en).values()],r={};return t.forEach(t=>{ek(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...eC(this,et).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=eO(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===eX&&(t.enabled=!1),t}defaultMutationOptions(e){return(null==e?void 0:e._defaulted)?e:{...eC(this,et).mutations,...(null==e?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){eC(this,$).clear(),eC(this,ee).clear()}constructor(e={}){eb(this,$,{writable:!0,value:void 0}),eb(this,ee,{writable:!0,value:void 0}),eb(this,et,{writable:!0,value:void 0}),eb(this,er,{writable:!0,value:void 0}),eb(this,en,{writable:!0,value:void 0}),eb(this,ei,{writable:!0,value:void 0}),eb(this,ea,{writable:!0,value:void 0}),eb(this,eo,{writable:!0,value:void 0}),eM(this,$,e.queryCache||new nP),eM(this,ee,e.mutationCache||new n_),eM(this,et,e.defaultOptions||{}),eM(this,er,new Map),eM(this,en,new Map),eM(this,ei,0)}}),nN=e.i(8155);let nK=e=>e,nQ=e=>{let t=(0,nN.createStore)(e),r=e=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nK,r=el.default.useSyncExternalStore(e.subscribe,el.default.useCallback(()=>t(e.getState()),[e,t]),el.default.useCallback(()=>t(e.getInitialState()),[e,t]));return el.default.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},nW=el.createContext(null);function nV(e){let{map:t,children:r,onChange:n,domElement:i}=e,a=t.map(e=>e.name+e.keys).join("-"),o=el.useMemo(()=>{let e,r;return e=()=>t.reduce((e,t)=>({...e,[t.name]:!1}),{}),(r=(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let a=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,o=e(n.getState());a=r=>{let n=e(r);if(!i(o,n)){let e=o;t(o=n,e)}},(null==r?void 0:r.fireImmediately)&&t(o,o)}return i(a)},e(t,r,n)})?nQ(r):nQ},[a]),s=el.useMemo(()=>[o.subscribe,o.getState,o],[a]),l=o.setState;return el.useEffect(()=>{let e=t.map(e=>{let{name:t,keys:r,up:i}=e;return{keys:r,up:i,fn:e=>{l({[t]:e}),n&&n(t,e,s[1]())}}}).reduce((e,t)=>{let{keys:r,fn:n,up:i=!0}=t;return r.forEach(t=>e[t]={fn:n,pressed:!1,up:i}),e},{}),r=t=>{let{key:r,code:n}=t,i=e[r]||e[n];if(!i)return;let{fn:a,pressed:o,up:s}=i;i.pressed=!0,(s||!o)&&a(!0)},a=t=>{let{key:r,code:n}=t,i=e[r]||e[n];if(!i)return;let{fn:a,up:o}=i;i.pressed=!1,o&&a(!1)},o=i||window;return o.addEventListener("keydown",r,{passive:!0}),o.addEventListener("keyup",a,{passive:!0}),()=>{o.removeEventListener("keydown",r),o.removeEventListener("keyup",a)}},[i,a]),el.createElement(nW.Provider,{value:s,children:r})}var nX=Object.defineProperty;class nq{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let r=this._listeners[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let r=t.slice(0);for(let t=0,n=r.length;t((e,t,r)=>t in e?nX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r))(this,"_listeners")}}var nY=Object.defineProperty,nz=(e,t,r)=>(((e,t,r)=>t in e?nY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),r);let nZ=new ef.Euler(0,0,0,"YXZ"),n$=new ef.Vector3,n0={type:"change"},n1={type:"lock"},n9={type:"unlock"},n2=Math.PI/2;class n3 extends nq{constructor(e,t){super(),nz(this,"camera"),nz(this,"domElement"),nz(this,"isLocked"),nz(this,"minPolarAngle"),nz(this,"maxPolarAngle"),nz(this,"pointerSpeed"),nz(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(nZ.setFromQuaternion(this.camera.quaternion),nZ.y-=.002*e.movementX*this.pointerSpeed,nZ.x-=.002*e.movementY*this.pointerSpeed,nZ.x=Math.max(n2-this.maxPolarAngle,Math.min(n2-this.minPolarAngle,nZ.x)),this.camera.quaternion.setFromEuler(nZ),this.dispatchEvent(n0))}),nz(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(n1),this.isLocked=!0):(this.dispatchEvent(n9),this.isLocked=!1))}),nz(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),nz(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),nz(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),nz(this,"dispose",()=>{this.disconnect()}),nz(this,"getObject",()=>this.camera),nz(this,"direction",new ef.Vector3(0,0,-1)),nz(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),nz(this,"moveForward",e=>{n$.setFromMatrixColumn(this.camera.matrix,0),n$.crossVectors(this.camera.up,n$),this.camera.position.addScaledVector(n$,e)}),nz(this,"moveRight",e=>{n$.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(n$,e)}),nz(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),nz(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}var n8=function(e){return e.forward="forward",e.backward="backward",e.left="left",e.right="right",e.up="up",e.down="down",e.camera1="camera1",e.camera2="camera2",e.camera3="camera3",e.camera4="camera4",e.camera5="camera5",e.camera6="camera6",e.camera7="camera7",e.camera8="camera8",e.camera9="camera9",e}(n8||{});function n5(){let{speedMultiplier:e,setSpeedMultiplier:t}=(0,tw.useControls)(),[r,n]=function(e){let[t,r,n]=el.useContext(nW);return[t,r]}(),{camera:i,gl:a}=(0,tE.useThree)(),{nextCamera:o,setCameraIndex:s,cameraCount:l}=ny(),u=(0,el.useRef)(null),c=(0,el.useRef)(new ef.Vector3),d=(0,el.useRef)(new ef.Vector3),f=(0,el.useRef)(new ef.Vector3);return(0,el.useEffect)(()=>{let e=new n3(i,a.domElement);u.current=e;let t=t=>{e.isLocked?o():t.target===a.domElement&&e.lock()};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t),e.dispose()}},[i,a,o]),(0,el.useEffect)(()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return r(t=>{for(let r=0;r{let e=e=>{e.preventDefault();let r=e.deltaY>0?-1:1,n=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*r;t(e=>Math.max(.1,Math.min(5,Math.round((e+n)*20)/20)))},r=a.domElement;return r.addEventListener("wheel",e,{passive:!1}),()=>{r.removeEventListener("wheel",e)}},[a]),(0,tx.useFrame)((t,r)=>{let{forward:a,backward:o,left:s,right:l,up:u,down:h}=n();(a||o||s||l||u||h)&&(i.getWorldDirection(c.current),c.current.normalize(),d.current.crossVectors(i.up,c.current).normalize(),f.current.set(0,0,0),a&&f.current.add(c.current),o&&f.current.sub(c.current),s&&f.current.add(d.current),l&&f.current.sub(d.current),u&&(f.current.y+=1),h&&(f.current.y-=1),f.current.lengthSq()>0&&(f.current.normalize().multiplyScalar(80*e*r),i.position.add(f.current)))}),null}let n6=[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"camera1",keys:["Digit1"]},{name:"camera2",keys:["Digit2"]},{name:"camera3",keys:["Digit3"]},{name:"camera4",keys:["Digit4"]},{name:"camera5",keys:["Digit5"]},{name:"camera6",keys:["Digit6"]},{name:"camera7",keys:["Digit7"]},{name:"camera8",keys:["Digit8"]},{name:"camera9",keys:["Digit9"]}];function n4(){return(0,el.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",e,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",e,{capture:!0})}},[]),(0,es.jsx)(nV,{map:n6,children:(0,es.jsx)(n5,{})})}var n7=function(){var e;return"undefined"!=typeof window&&!!(null==(e=window.document)?void 0:e.createElement)}();function ie(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function it(e){return e?"self"in e?e.self:ie(e).defaultView||window:self}function ir(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{activeElement:r}=ie(e);if(!(null==r?void 0:r.nodeName))return null;if(ia(r)&&r.contentDocument)return ir(r.contentDocument.body,t);if(t){let e=r.getAttribute("aria-activedescendant");if(e){let t=ie(r).getElementById(e);if(t)return t}}return r}function ii(e,t){return e===t||e.contains(t)}function ia(e){return"IFRAME"===e.tagName}function io(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==is.indexOf(e.type)}var is=["button","color","file","image","reset","submit"];function il(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function iu(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function ic(e){return e.isContentEditable||iu(e)}function id(e){let t=0,r=0;if(iu(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let n=ie(e).getSelection();if((null==n?void 0:n.rangeCount)&&n.anchorNode&&ii(e,n.anchorNode)&&n.focusNode&&ii(e,n.focusNode)){let i=n.getRangeAt(0),a=i.cloneRange();a.selectNodeContents(e),a.setEnd(i.startContainer,i.startOffset),t=a.toString().length,a.setEnd(i.endContainer,i.endOffset),r=a.toString().length}}return{start:t,end:r}}function ih(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function im(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return im(e.parentElement)||document.scrollingElement||document.body}function ip(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,a,!0),r()}),a=()=>{i(),r()};return e.addEventListener(t,a,{once:!0,capture:!0}),i}function i_(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,i=[];try{for(let a of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(i_(e,t,r,a))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var ik={...el},iU=ik.useId;ik.useDeferredValue;var ij=ik.useInsertionEffect,iJ=n7?el.useLayoutEffect:el.useEffect;function iN(e){let t=(0,el.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return ij?ij(()=>{t.current=e}):t.current=e,(0,el.useCallback)(function(){for(var e,r=arguments.length,n=Array(r),i=0;i{if(t.some(Boolean))return e=>{for(let r of t)iT(r,e)}},t)}function iQ(e){if(iU){let t=iU();return e||t}let[t,r]=(0,el.useState)(e);return iJ(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r("id-".concat(n))},[e,t]),e||t}function iW(e,t){let r=(0,el.useRef)(!1);(0,el.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,el.useEffect)(()=>()=>{r.current=!1},[])}function iV(){return(0,el.useReducer)(()=>[],[])}function iX(e){return iN("function"==typeof e?e:()=>e)}function iq(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=(0,el.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function iY(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,[r,n]=(0,el.useState)(null);return{portalRef:iK(n,t),portalNode:r,domReady:!e||r}}var iz=!1,iZ=!1,i$=0,i0=0;function i1(e){(function(e){let t=e.movementX||e.screenX-i$,r=e.movementY||e.screenY-i0;return i$=e.screenX,i0=e.screenY,t||r||!1})(e)&&(iZ=!0)}function i9(){iZ=!1}function i2(e){let t=el.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function i3(e,t){return el.memo(e,t)}function i8(e,t){let r,{wrapElement:n,render:i,...a}=t,o=iK(t.ref,i&&(0,el.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(el.isValidElement(i)){let e={...i.props,ref:o};r=el.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!iC(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?"".concat(e[n]," ").concat(t[n]):t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=function(){for(var e=arguments.length,r=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return e(t)};return t.displayName=e.name,t}function i6(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=el.createContext(void 0),n=el.createContext(void 0),i=()=>el.useContext(r),a=t=>e.reduceRight((e,r)=>(0,es.jsx)(r,{...t,children:e}),(0,es.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=el.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=el.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:a,ScopedContextProvider:e=>(0,es.jsx)(a,{...e,children:t.reduceRight((t,r)=>(0,es.jsx)(r,{...e,children:t}),(0,es.jsx)(n.Provider,{...e}))})}}var i4=i6(),i7=i4.useContext;i4.useScopedContext,i4.useProviderContext;var ae=i6([i4.ContextProvider],[i4.ScopedContextProvider]),at=ae.useContext;ae.useScopedContext;var ar=ae.useProviderContext,an=ae.ContextProvider,ai=ae.ScopedContextProvider,aa=(0,el.createContext)(void 0),ao=(0,el.createContext)(void 0),as=(0,el.createContext)(!0),al="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function au(e){return!(!e.matches(al)||!il(e)||e.closest("[inert]"))}function ac(e){if(!au(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=ir(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function ad(e,t){let r=Array.from(e.querySelectorAll(al));t&&r.unshift(e);let n=r.filter(au);return n.forEach((e,t)=>{if(ia(e)&&e.contentDocument){let r=e.contentDocument.body;n.splice(t,1,...ad(r))}}),n}function af(e,t,r){let n=Array.from(e.querySelectorAll(al)),i=n.filter(ac);return(t&&ac(e)&&i.unshift(e),i.forEach((e,t)=>{if(ia(e)&&e.contentDocument){let n=af(e.contentDocument.body,!1,r);i.splice(t,1,...n)}}),!i.length&&r)?n:i}function ah(e,t){return function(e,t,r,n){let i=ir(e),a=ad(e,t),o=a.indexOf(i),s=a.slice(o+1);return s.find(ac)||(r?a.find(ac):null)||(n?s[0]:null)||null}(document.body,!1,e,t)}function am(e,t){return function(e,t,r,n){let i=ir(e),a=ad(e,t).reverse(),o=a.indexOf(i),s=a.slice(o+1);return s.find(ac)||(r?a.find(ac):null)||(n?s[0]:null)||null}(document.body,!1,e,t)}function ap(e){let t=ir(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function aA(e){let t=ir(e);if(!t)return!1;if(ii(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector("#".concat(CSS.escape(r))))}function ag(e){!aA(e)&&au(e)&&e.focus()}var av=iD(),aB=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],aC=Symbol("safariFocusAncestor");function ay(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function ab(e,t){return iN(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var aM=!1,ax=!0;function aE(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(ax=!1)}function aF(e){e.metaKey||e.ctrlKey||e.altKey||(ax=!0)}var aS=i5(function(e){var t,r,n,i,a;let{focusable:o=!0,accessibleWhenDisabled:s,autoFocus:l,onFocusVisible:u,...c}=e,d=(0,el.useRef)(null);(0,el.useEffect)(()=>{o&&(aM||(i_("mousedown",aE,!0),i_("keydown",aF,!0),aM=!0))},[o]),av&&(0,el.useEffect)(()=>{if(!o)return;let e=d.current;if(!e||!ay(e))return;let t="labels"in e?e.labels:null;if(!t)return;let r=()=>queueMicrotask(()=>e.focus());for(let e of t)e.addEventListener("mouseup",r);return()=>{for(let e of t)e.removeEventListener("mouseup",r)}},[o]);let f=o&&iE(c),h=!!f&&!s,[m,p]=(0,el.useState)(!1);(0,el.useEffect)(()=>{o&&h&&m&&p(!1)},[o,h,m]),(0,el.useEffect)(()=>{if(!o||!m)return;let e=d.current;if(!e||"undefined"==typeof IntersectionObserver)return;let t=new IntersectionObserver(()=>{au(e)||p(!1)});return t.observe(e),()=>t.disconnect()},[o,m]);let A=ab(c.onKeyPressCapture,f),g=ab(c.onMouseDownCapture,f),B=ab(c.onClickCapture,f),C=c.onMouseDown,y=iN(e=>{if(null==C||C(e),e.defaultPrevented||!o)return;let t=e.currentTarget;if(!av||iI(e)||!io(t)&&!ay(t))return;let r=!1,n=()=>{r=!0};t.addEventListener("focusin",n,{capture:!0,once:!0});let i=function(e){for(;e&&!au(e);)e=e.closest(al);return e||null}(t.parentElement);i&&(i[aC]=!0),iO(t,"mouseup",()=>{t.removeEventListener("focusin",n,!0),i&&(i[aC]=!1),r||ag(t)})}),b=(e,t)=>{if(t&&(e.currentTarget=t),!o)return;let r=e.currentTarget;r&&ap(r)&&(null==u||u(e),e.defaultPrevented||(r.dataset.focusVisible="true",p(!0)))},M=c.onKeyDownCapture,x=iN(e=>{if(null==M||M(e),e.defaultPrevented||!o||m||e.metaKey||e.altKey||e.ctrlKey||!iG(e))return;let t=e.currentTarget;iO(t,"focusout",()=>b(e,t))}),E=c.onFocusCapture,F=iN(e=>{if(null==E||E(e),e.defaultPrevented||!o)return;if(!iG(e))return void p(!1);let t=e.currentTarget;ax||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:aB.includes(n))}(e.target)?iO(e.target,"focusout",()=>b(e,t)):p(!1)}),S=c.onBlur,T=iN(e=>{null==S||S(e),o&&iH(e)&&(e.currentTarget.removeAttribute("data-focus-visible"),p(!1))}),w=(0,el.useContext)(as),R=iN(e=>{o&&l&&e&&w&&queueMicrotask(()=>{!ap(e)&&au(e)&&e.focus()})}),D=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,el.useState)(()=>r(void 0));return iJ(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,t]),n}(d),I=o&&(!D||"button"===D||"summary"===D||"input"===D||"select"===D||"textarea"===D||"a"===D),G=o&&(!D||"button"===D||"input"===D||"select"===D||"textarea"===D),L=c.style,P=(0,el.useMemo)(()=>h?{pointerEvents:"none",...L}:L,[h,L]);return c={"data-focus-visible":o&&m||void 0,"data-autofocus":l||void 0,"aria-disabled":f||void 0,...c,ref:iK(d,R,c.ref),style:P,tabIndex:(t=o,r=h,n=I,i=G,a=c.tabIndex,t?r?n&&!i?-1:void 0:n?a:a||0:a),disabled:!!G&&!!h||void 0,contentEditable:f?void 0:c.contentEditable,onKeyPressCapture:A,onClickCapture:B,onMouseDownCapture:g,onMouseDown:y,onKeyDownCapture:x,onFocusCapture:F,onBlur:T},iF(c)});function aT(e){let t=[];for(let r of e)t.push(...r);return t}function aw(e){return e.slice().reverse()}function aR(e,t,r){return iN(n=>{var i;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!iG(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||function(e){let t=e.target;return(!t||!!iu(t))&&1===e.key.length&&!e.ctrlKey&&!e.metaKey}(n))return;let a=e.getState(),o=null==(i=iA(e,a.activeId))?void 0:i.element;if(!o)return;let{view:s,...l}=n;o!==(null==r?void 0:r.current)&&o.focus(),!function(e,t,r){let n=new KeyboardEvent(t,r);return e.dispatchEvent(n)}(o,n.type,l)&&n.preventDefault(),n.currentTarget.contains(o)&&n.stopPropagation()})}i2(function(e){return i8("div",aS(e))});var aD=i5(function(e){let{store:t,composite:r=!0,focusOnMove:n=r,moveOnKeyPress:i=!0,...a}=e,o=ar();iM(t=t||o,!1);let s=(0,el.useRef)(null),l=(0,el.useRef)(null),u=function(e){let[t,r]=(0,el.useState)(!1),n=(0,el.useCallback)(()=>r(!0),[]),i=e.useState(t=>iA(e,t.activeId));return(0,el.useEffect)(()=>{let e=null==i?void 0:i.element;t&&e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(t),c=t.useState("moves"),[,d]=function(e){let[t,r]=(0,el.useState)(null);return iJ(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(r?t.setBaseElement:null);(0,el.useEffect)(()=>{var e;if(!t||!c||!r||!n)return;let{activeId:i}=t.getState(),a=null==(e=iA(t,i))?void 0:e.element;a&&("scrollIntoView"in a?(a.focus({preventScroll:!0}),a.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):a.focus())},[t,c,r,n]),iJ(()=>{if(!t||!c||!r)return;let{baseElement:e,activeId:n}=t.getState();if(null!==n||!e)return;let i=l.current;l.current=null,i&&iL(i,{relatedTarget:e}),ap(e)||e.focus()},[t,c,r]);let f=t.useState("activeId"),h=t.useState("virtualFocus");iJ(()=>{var e;if(!t||!r||!h)return;let n=l.current;if(l.current=null,!n)return;let i=(null==(e=iA(t,f))?void 0:e.element)||ir(n);i!==n&&iL(n,{relatedTarget:i})},[t,f,h,r]);let m=aR(t,a.onKeyDownCapture,l),p=aR(t,a.onKeyUpCapture,l),A=a.onFocusCapture,g=iN(e=>{if(null==A||A(e),e.defaultPrevented||!t)return;let{virtualFocus:r}=t.getState();if(!r)return;let n=e.relatedTarget,i=function(e){let t=e[ig];return delete e[ig],t}(e.currentTarget);iG(e)&&i&&(e.stopPropagation(),l.current=n)}),B=a.onFocus,C=iN(e=>{if(null==B||B(e),e.defaultPrevented||!r||!t)return;let{relatedTarget:n}=e,{virtualFocus:i}=t.getState();i?iG(e)&&!iv(t,n)&&queueMicrotask(u):iG(e)&&t.setActiveId(null)}),y=a.onBlurCapture,b=iN(e=>{var r;if(null==y||y(e),e.defaultPrevented||!t)return;let{virtualFocus:n,activeId:i}=t.getState();if(!n)return;let a=null==(r=iA(t,i))?void 0:r.element,o=e.relatedTarget,s=iv(t,o),u=l.current;l.current=null,iG(e)&&s?(o===a?u&&u!==o&&iL(u,e):a?iL(a,e):u&&iL(u,e),e.stopPropagation()):!iv(t,e.target)&&a&&iL(a,e)}),M=a.onKeyDown,x=iX(i),E=iN(e=>{var r;if(null==M||M(e),e.nativeEvent.isComposing||e.defaultPrevented||!t||!iG(e))return;let{orientation:n,renderedItems:i,activeId:a}=t.getState(),o=iA(t,a);if(null==(r=null==o?void 0:o.element)?void 0:r.isConnected)return;let s="horizontal"!==n,l="vertical"!==n,u=i.some(e=>!!e.rowId);if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&iu(e.currentTarget))return;let c={ArrowUp:(u||s)&&(()=>{if(u){let e=aT(aw(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==t?void 0:t.last()}),ArrowRight:(u||l)&&t.first,ArrowDown:(u||s)&&t.first,ArrowLeft:(u||l)&&t.last,Home:t.first,End:t.last,PageUp:t.first,PageDown:t.last}[e.key];if(c){let r=c();if(void 0!==r){if(!x(e))return;e.preventDefault(),t.move(r)}}});return a=iq(a,e=>(0,es.jsx)(an,{value:t,children:e}),[t]),a={"aria-activedescendant":t.useState(e=>{var n;if(t&&r&&e.virtualFocus)return null==(n=iA(t,e.activeId))?void 0:n.id}),...a,ref:iK(s,d,a.ref),onKeyDownCapture:m,onKeyUpCapture:p,onFocusCapture:g,onFocus:C,onBlurCapture:b,onKeyDown:E},a=aS({focusable:t.useState(e=>r&&(e.virtualFocus||null===e.activeId)),...a})});i2(function(e){return i8("div",aD(e))});var aI=i6();aI.useContext,aI.useScopedContext;var aG=aI.useProviderContext,aL=i6([aI.ContextProvider],[aI.ScopedContextProvider]);aL.useContext,aL.useScopedContext;var aP=aL.useProviderContext,aH=aL.ContextProvider,aO=aL.ScopedContextProvider,a_=(0,el.createContext)(void 0),ak=(0,el.createContext)(void 0),aU=i6([aH],[aO]);aU.useContext,aU.useScopedContext;var aj=aU.useProviderContext,aJ=aU.ContextProvider,aN=aU.ScopedContextProvider,aK=i5(function(e){let{store:t,...r}=e,n=aj();return t=t||n,r={...r,ref:iK(null==t?void 0:t.setAnchorElement,r.ref)}});i2(function(e){return i8("div",aK(e))});var aQ=(0,el.createContext)(void 0),aW=i6([aJ,an],[aN,ai]),aV=aW.useContext,aX=aW.useScopedContext,aq=aW.useProviderContext,aY=aW.ContextProvider,az=aW.ScopedContextProvider,aZ=(0,el.createContext)(void 0),a$=(0,el.createContext)(!1);function a0(e,t){let r=e.__unstableInternals;return iM(r,"Invalid store"),r[t]}function a1(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n2&&void 0!==arguments[2]?arguments[2]:d;return r.add(t),m.set(t,e),()=>{var e;null==(e=h.get(t))||e(),h.delete(t),m.delete(t),r.delete(t)}},A=function(e,t){var n,s;let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!iC(i,e))return;let c=(s=i[e],"function"==typeof t?t("function"==typeof s?s():s):t);if(c===i[e])return;if(!l)for(let t of r)null==(n=null==t?void 0:t.setState)||n.call(t,e,c);let p=i;i={...i,[e]:c};let A=Symbol();o=A,u.add(e);let g=(t,r,n)=>{var a;let o=m.get(t);(!o||o.some(t=>n?n.has(t):t===e))&&(null==(a=h.get(t))||a(),h.set(t,t(i,r)))};for(let e of d)g(e,p);queueMicrotask(()=>{if(o!==A)return;let e=i;for(let e of f)g(e,a,u);a=e,u.clear()})},g={getState:()=>i,setState:A,__unstableInternals:{setup:e=>(c.add(e),()=>c.delete(e)),init:()=>{let e=l.size,t=Symbol();l.add(t);let n=()=>{l.delete(t),l.size||s()};if(e)return n;let a=Object.keys(i).map(e=>iy(...r.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&iC(n,e))return a8(t,[e],t=>{A(e,t[e],!0)})}))),o=[];for(let e of c)o.push(e());return s=iy(...a,...o,...r.map(a2)),n},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(h.set(t,t(i,i)),p(e,t)),batch:(e,t)=>(h.set(t,t(i,a)),p(e,t,f)),pick:e=>a1(function(e,t){let r={};for(let n of t)iC(e,n)&&(r[n]=e[n]);return r}(i,e),g),omit:e=>a1(function(e,t){let r={...e};for(let e of t)iC(r,e)&&delete r[e];return r}(i,e),g)}};return g}function a9(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function ot(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var or=i5(function(e){let{store:t,focusable:r=!0,autoSelect:n=!1,getAutoSelectId:i,setValueOnChange:a,showMinLength:o=0,showOnChange:s,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:c,showOnKeyPress:d=c,blurActiveItemOnClick:f,setValueOnClick:h=!0,moveOnKeyPress:m=!0,autoComplete:p="list",...A}=e,g=aq();iM(t=t||g,!1);let B=(0,el.useRef)(null),[C,y]=iV(),b=(0,el.useRef)(!1),M=(0,el.useRef)(!1),x=t.useState(e=>e.virtualFocus&&n),E="inline"===p||"both"===p,[F,S]=(0,el.useState)(E);!function(e,t){let r=(0,el.useRef)(!1);iJ(()=>{if(r.current)return e();r.current=!0},t),iJ(()=>()=>{r.current=!1},[])}(()=>{E&&S(!0)},[E]);let T=t.useState("value"),w=(0,el.useRef)();(0,el.useEffect)(()=>a8(t,["selectedValue","activeId"],(e,t)=>{w.current=t.selectedValue}),[]);let R=t.useState(e=>{var t;if(E&&F){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=w.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),D=t.useState("renderedItems"),I=t.useState("open"),G=t.useState("contentElement"),L=(0,el.useMemo)(()=>{if(!E||!F)return T;if(oe(D,R,x)){if(ot(T,R)){let e=(null==R?void 0:R.slice(T.length))||"";return T+e}return T}return R||T},[E,F,D,R,x,T]);(0,el.useEffect)(()=>{let e=B.current;if(!e)return;let t=()=>S(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,el.useEffect)(()=>{if(!E||!F||!R||!oe(D,R,x)||!ot(T,R))return;let e=iB;return queueMicrotask(()=>{let t=B.current;if(!t)return;let{start:r,end:n}=id(t),i=T.length,a=R.length;ip(t,i,a),e=()=>{if(!ap(t))return;let{start:e,end:o}=id(t);e===i&&o===a&&ip(t,r,n)}}),()=>e()},[C,E,F,R,D,x,T]);let P=(0,el.useRef)(null),H=iN(i),O=(0,el.useRef)(null);(0,el.useEffect)(()=>{if(!I||!G)return;let e=im(G);if(!e)return;P.current=e;let r=()=>{b.current=!1},n=()=>{if(!t||!b.current)return;let{activeId:e}=t.getState();null!==e&&e!==O.current&&(b.current=!1)},i={passive:!0,capture:!0};return e.addEventListener("wheel",r,i),e.addEventListener("touchmove",r,i),e.addEventListener("scroll",n,i),()=>{e.removeEventListener("wheel",r,!0),e.removeEventListener("touchmove",r,!0),e.removeEventListener("scroll",n,!0)}},[I,G,t]),iJ(()=>{T&&(M.current||(b.current=!0))},[T]),iJ(()=>{"always"!==x&&I||(b.current=I)},[x,I]);let _=t.useState("resetValueOnSelect");iW(()=>{var e,r;let n=b.current;if(!t||!I||!n&&!_)return;let{baseElement:i,contentElement:a,activeId:o}=t.getState();if(!i||ap(i)){if(null==a?void 0:a.hasAttribute("data-placing")){let e=new MutationObserver(y);return e.observe(a,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(x&&n){let r=H(D),n=void 0!==r?r:null!=(e=function(e){let t=e.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"});return null==t?void 0:t.id}(D))?e:t.first();O.current=n,t.move(null!=n?n:null)}else{let e=null==(r=t.item(o||t.first()))?void 0:r.element;e&&"scrollIntoView"in e&&e.scrollIntoView({block:"nearest",inline:"nearest"})}}},[t,I,C,T,x,_,H,D]),(0,el.useEffect)(()=>{if(!E)return;let e=B.current;if(!e)return;let r=[e,G].filter(e=>!!e),n=e=>{r.every(t=>iH(e,t))&&(null==t||t.setValue(L))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[E,G,t,L]);let k=e=>e.currentTarget.value.length>=o,U=A.onChange,j=iX(null!=s?s:k),J=iX(null!=a?a:!t.tag),N=iN(e=>{if(null==U||U(e),e.defaultPrevented||!t)return;let r=e.currentTarget,{value:n,selectionStart:i,selectionEnd:a}=r,o=e.nativeEvent;if(b.current=!0,"input"===o.type&&(o.isComposing&&(b.current=!1,M.current=!0),E)){let e="insertText"===o.inputType||"insertCompositionText"===o.inputType,t=i===n.length;S(e&&t)}if(J(e)){let e=n===t.getState().value;t.setValue(n),queueMicrotask(()=>{ip(r,i,a)}),E&&x&&e&&y()}j(e)&&t.show(),x&&b.current||t.setActiveId(null)}),K=A.onCompositionEnd,Q=iN(e=>{b.current=!0,M.current=!1,null==K||K(e),!e.defaultPrevented&&x&&y()}),W=A.onMouseDown,V=iX(null!=f?f:()=>!!(null==t?void 0:t.getState().includesBaseElement)),X=iX(h),q=iX(null!=u?u:k),Y=iN(e=>{null==W||W(e),e.defaultPrevented||e.button||e.ctrlKey||t&&(V(e)&&t.setActiveId(null),X(e)&&t.setValue(L),q(e)&&iO(e.currentTarget,"mouseup",t.show))}),z=A.onKeyDown,Z=iX(null!=d?d:k),$=iN(e=>{if(null==z||z(e),e.repeat||(b.current=!1),e.defaultPrevented||e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||!t)return;let{open:r}=t.getState();!r&&("ArrowUp"===e.key||"ArrowDown"===e.key)&&Z(e)&&(e.preventDefault(),t.show())}),ee=A.onBlur,et=iN(e=>{if(b.current=!1,null==ee||ee(e),e.defaultPrevented)return}),er=iQ(A.id),en=t.useState(e=>null===e.activeId);return A={id:er,role:"combobox","aria-autocomplete":"inline"===p||"list"===p||"both"===p||"none"===p?p:void 0,"aria-haspopup":ih(G,"listbox"),"aria-expanded":I,"aria-controls":null==G?void 0:G.id,"data-active-item":en||void 0,value:L,...A,ref:iK(B,A.ref),onChange:N,onCompositionEnd:Q,onMouseDown:Y,onKeyDown:$,onBlur:et},A=aD({store:t,focusable:r,...A,moveOnKeyPress:e=>!ix(m,e)&&(E&&S(!0),!0)}),{autoComplete:"off",...A=aK({store:t,...A})}}),on=i2(function(e){return i8("input",or(e))});function oi(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var oa=Symbol("composite-hover"),oo=i5(function(e){let{store:t,focusOnHover:r=!0,blurOnHoverEnd:n=!!r,...i}=e,a=at();iM(t=t||a,!1);let o=((0,el.useEffect)(()=>{iz||(i_("mousemove",i1,!0),i_("mousedown",i9,!0),i_("mouseup",i9,!0),i_("keydown",i9,!0),i_("scroll",i9,!0),iz=!0)},[]),iN(()=>iZ)),s=i.onMouseMove,l=iX(r),u=iN(e=>{if((null==s||s(e),!e.defaultPrevented&&o())&&l(e)){if(!aA(e.currentTarget)){let e=null==t?void 0:t.getState().baseElement;e&&!ap(e)&&e.focus()}null==t||t.setActiveId(e.currentTarget.id)}}),c=i.onMouseLeave,d=iX(n),f=iN(e=>{var r;null==c||c(e),!(e.defaultPrevented||!o()||function(e){let t=oi(e);return!!t&&ii(e.currentTarget,t)}(e)||function(e){let t=oi(e);if(!t)return!1;do{if(iC(t,oa)&&t[oa])return!0;t=t.parentElement}while(t)return!1}(e))&&l(e)&&d(e)&&(null==t||t.setActiveId(null),null==(r=null==t?void 0:t.getState().baseElement)||r.focus())}),h=(0,el.useCallback)(e=>{e&&(e[oa]=!0)},[]);return iF(i={...i,ref:iK(h,i.ref),onMouseMove:u,onMouseLeave:f})});i3(i2(function(e){return i8("div",oo(e))}));var os=i5(function(e){let{store:t,shouldRegisterItem:r=!0,getItem:n=ib,element:i,...a}=e,o=i7();t=t||o;let s=iQ(a.id),l=(0,el.useRef)(i);return(0,el.useEffect)(()=>{let e=l.current;if(!s||!e||!r)return;let i=n({id:s,element:e});return null==t?void 0:t.renderItem(i)},[s,r,n,t]),iF(a={...a,ref:iK(l,a.ref)})});function ol(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?io(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(io(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}i2(function(e){return i8("div",os(e))});var ou=Symbol("command"),oc=i5(function(e){let{clickOnEnter:t=!0,clickOnSpace:r=!0,...n}=e,i=(0,el.useRef)(null),[a,o]=(0,el.useState)(!1);(0,el.useEffect)(()=>{i.current&&o(io(i.current))},[]);let[s,l]=(0,el.useState)(!1),u=(0,el.useRef)(!1),c=iE(n),[d,f]=function(e,t,r){let n=e.onLoadedMetadataCapture,i=(0,el.useMemo)(()=>Object.assign(()=>{},{...n,[t]:r}),[n,t,r]);return[null==n?void 0:n[t],{onLoadedMetadataCapture:i}]}(n,ou,!0),h=n.onKeyDown,m=iN(e=>{null==h||h(e);let n=e.currentTarget;if(e.defaultPrevented||d||c||!iG(e)||iu(n)||n.isContentEditable)return;let i=t&&"Enter"===e.key,a=r&&" "===e.key,o="Enter"===e.key&&!t,s=" "===e.key&&!r;if(o||s)return void e.preventDefault();if(i||a){let t=ol(e);if(i){if(!t){e.preventDefault();let{view:t,...r}=e,i=()=>iP(n,r);n7&&/firefox\//i.test(navigator.userAgent)?iO(n,"keyup",i):queueMicrotask(i)}}else a&&(u.current=!0,t||(e.preventDefault(),l(!0)))}}),p=n.onKeyUp,A=iN(e=>{if(null==p||p(e),e.defaultPrevented||d||c||e.metaKey)return;let t=r&&" "===e.key;if(u.current&&t&&(u.current=!1,!ol(e))){e.preventDefault(),l(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>iP(t,n))}});return aS(n={"data-active":s||void 0,type:a?"button":void 0,...f,...n,ref:iK(i,n.ref),onKeyDown:m,onKeyUp:A})});i2(function(e){return i8("button",oc(e))});var{useSyncExternalStore:od}=e.i(2239).default,of=()=>()=>{};function oh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ib,r=el.useCallback(t=>e?a3(e,null,t):of(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&iC(i,r)?i[r]:void 0};return od(r,n,n)}function om(e,t){let r=el.useRef({}),n=el.useCallback(t=>e?a3(e,null,t):of(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,a=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==a[e]&&(a[e]=t,i=!0)}if("string"==typeof r){if(!n||!iC(n,r))continue;let t=n[r];t!==a[e]&&(a[e]=t,i=!0)}}return i&&(r.current={...a}),r.current};return od(n,i,i)}function op(e,t,r,n){let i=iC(t,r)?t[r]:void 0,a=function(e){let t=(0,el.useRef)(e);return iJ(()=>{t.current=e}),t}({value:i,setValue:n?t[n]:void 0});iJ(()=>a8(e,[r],(e,t)=>{let{value:n,setValue:i}=a.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),iJ(()=>{if(void 0!==i)return e.setState(r,i),a5(e,[r],()=>{void 0!==i&&e.setState(r,i)})})}function oA(e,t){let[r,n]=el.useState(()=>e(t));iJ(()=>a2(r),[r]);let i=el.useCallback(e=>oh(r,e),[r]);return[el.useMemo(()=>({...r,useState:i}),[r,i]),iN(()=>{n(r=>e({...t,...r.getState()}))})]}function og(e,t,r){var n;let i,a,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!t||!r)return;let{renderedItems:s}=t.getState(),l=im(e);if(!l)return;let u=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),a=t?r-i+n:i+n;return"HTML"===e.tagName?a+e.scrollTop:a}(l,o);for(let e=0;e1&&void 0!==arguments[1]&&arguments[1],{top:r}=e.getBoundingClientRect();return t?r+e.clientHeight:r}(l,o)-u,d=Math.abs(c);if(o&&c<=0||!o&&c>=0){void 0!==a&&ar||(e&&(null==h?void 0:h.baseElement)&&h.baseElement===e.baseElement?h.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===d,ariaSetSize:e=>null!=s?s:e&&(null==h?void 0:h.ariaSetSize)&&h.baseElement===e.baseElement?h.ariaSetSize:void 0,ariaPosInSet(e){if(null!=l)return l;if(!e||!(null==h?void 0:h.ariaPosInSet)||h.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===p);return h.ariaPosInSet+t.findIndex(e=>e.id===d)},isTabbable(e){if(!(null==e?void 0:e.renderedItems.length))return!0;if(e.virtualFocus)return!1;if(a)return!0;if(null===e.activeId)return!1;let r=null==t?void 0:t.item(e.activeId);return null!=r&&!!r.disabled||null==r||!r.element||e.activeId===d}}),b=(0,el.useCallback)(e=>{var t;let r={...e,id:d||e.id,rowId:p,disabled:!!m,children:null==(t=e.element)?void 0:t.textContent};return o?o(r):r},[d,p,m,o]),M=u.onFocus,x=(0,el.useRef)(!1),E=iN(e=>{var r,n;if(null==M||M(e),e.defaultPrevented||iI(e)||!d||!t||(r=t,!iG(e)&&iv(r,e.target)))return;let{virtualFocus:i,baseElement:a}=t.getState();if(t.setActiveId(d),ic(e.currentTarget)&&function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(iu(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=ie(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(e.currentTarget),i&&iG(e))!ic(n=e.currentTarget)&&("INPUT"!==n.tagName||io(n))&&(null==a?void 0:a.isConnected)&&((iD()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),x.current=!0,e.relatedTarget===a||iv(t,e.relatedTarget))?(a[ig]=!0,a.focus({preventScroll:!0})):a.focus())}),F=u.onBlurCapture,S=iN(e=>{if(null==F||F(e),e.defaultPrevented)return;let r=null==t?void 0:t.getState();(null==r?void 0:r.virtualFocus)&&x.current&&(x.current=!1,e.preventDefault(),e.stopPropagation())}),T=u.onKeyDown,w=iX(n),R=iX(i),D=iN(e=>{if(null==T||T(e),e.defaultPrevented||!iG(e)||!t)return;let{currentTarget:r}=e,n=t.getState(),i=t.item(d),a=!!(null==i?void 0:i.rowId),o="horizontal"!==n.orientation,s="vertical"!==n.orientation,l=()=>!(!a&&!s&&n.baseElement&&iu(n.baseElement)),u={ArrowUp:(a||o)&&t.up,ArrowRight:(a||s)&&t.next,ArrowDown:(a||o)&&t.down,ArrowLeft:(a||s)&&t.previous,Home:()=>{if(l())return!a||e.ctrlKey?null==t?void 0:t.first():null==t?void 0:t.previous(-1)},End:()=>{if(l())return!a||e.ctrlKey?null==t?void 0:t.last():null==t?void 0:t.next(-1)},PageUp:()=>og(r,t,null==t?void 0:t.up,!0),PageDown:()=>og(r,t,null==t?void 0:t.down)}[e.key];if(u){if(ic(r)){let t=id(r),n=s&&"ArrowLeft"===e.key,i=s&&"ArrowRight"===e.key,a=o&&"ArrowUp"===e.key,l=o&&"ArrowDown"===e.key;if(i||l){let{length:e}=function(e){if(iu(e))return e.value;if(e.isContentEditable){let t=ie(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(t.end!==e)return}else if((n||a)&&0!==t.start)return}let n=u();if(w(e)||void 0!==n){if(!R(e))return;e.preventDefault(),t.move(n)}}}),I=(0,el.useMemo)(()=>({id:d,baseElement:A}),[d,A]);return u={id:d,"data-active-item":g||void 0,...u=iq(u,e=>(0,es.jsx)(aa.Provider,{value:I,children:e}),[I]),ref:iK(f,u.ref),tabIndex:y?u.tabIndex:-1,onFocus:E,onBlurCapture:S,onKeyDown:D},u=oc(u),iF({...u=os({store:t,...u,getItem:b,shouldRegisterItem:!!d&&u.shouldRegisterItem}),"aria-setsize":B,"aria-posinset":C})});i3(i2(function(e){return i8("button",ov(e))}));var oB=i5(function(e){var t,r;let{store:n,value:i,hideOnClick:a,setValueOnClick:o,selectValueOnClick:s=!0,resetValueOnSelect:l,focusOnHover:u=!1,moveOnKeyPress:c=!0,getItem:d,...f}=e,h=aX();iM(n=n||h,!1);let{resetValueOnSelectState:m,multiSelectable:p,selected:A}=om(n,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,i)}),g=(0,el.useCallback)(e=>{let t={...e,value:i};return d?d(t):t},[i,d]);o=null!=o?o:!p,a=null!=a?a:null!=i&&!p;let B=f.onClick,C=iX(o),y=iX(s),b=iX(null!=(t=null!=l?l:m)?t:p),M=iX(a),x=iN(e=>{null==B||B(e),!(e.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(e))&&!function(e){let t=e.currentTarget;if(!t)return!1;let r=iR();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(e)&&(null!=i&&(y(e)&&(b(e)&&(null==n||n.resetValue()),null==n||n.setSelectedValue(e=>Array.isArray(e)?e.includes(i)?e.filter(e=>e!==i):[...e,i]:i)),C(e)&&(null==n||n.setValue(i))),M(e)&&(null==n||n.hide()))}),E=f.onKeyDown,F=iN(e=>{if(null==E||E(e),e.defaultPrevented)return;let t=null==n?void 0:n.getState().baseElement;!(!t||ap(t))&&(1===e.key.length||"Backspace"===e.key||"Delete"===e.key)&&(queueMicrotask(()=>t.focus()),iu(t)&&(null==n||n.setValue(t.value)))});p&&null!=A&&(f={"aria-selected":A,...f}),f=iq(f,e=>(0,es.jsx)(aZ.Provider,{value:i,children:(0,es.jsx)(a$.Provider,{value:null!=A&&A,children:e})}),[i,A]),f={role:null!=(r=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,el.useContext)(aQ)])?r:"option",children:i,...f,onClick:x,onKeyDown:F};let S=iX(c);return f=ov({store:n,...f,getItem:g,moveOnKeyPress:e=>{if(!S(e))return!1;let t=new Event("combobox-item-move"),r=null==n?void 0:n.getState().baseElement;return null==r||r.dispatchEvent(t),!0}}),f=oo({store:n,focusOnHover:u,...f})}),oC=i3(i2(function(e){return i8("div",oB(e))})),oy=e.i(74080);function ob(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function oM(){for(var e=arguments.length,t=Array(e),r=0;r{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function ox(e,t,r){return!r&&!1!==t&&(!e||!!t)}var oE=i5(function(e){let{store:t,alwaysVisible:r,...n}=e,i=aG();iM(t=t||i,!1);let a=(0,el.useRef)(null),o=iQ(n.id),[s,l]=(0,el.useState)(null),u=t.useState("open"),c=t.useState("mounted"),d=t.useState("animated"),f=t.useState("contentElement"),h=oh(t.disclosure,"contentElement");iJ(()=>{a.current&&(null==t||t.setContentElement(a.current))},[t]),iJ(()=>{let e;return null==t||t.setState("animated",t=>(e=t,!0)),()=>{void 0!==e&&(null==t||t.setState("animated",e))}},[t]),iJ(()=>{if(d){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":c?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[d,f,u,c]),iJ(()=>{if(!t||!d||!s||!f)return;let e=()=>null==t?void 0:t.setState("animating",!1),r=()=>(0,oy.flushSync)(e);if("leave"===s&&u||"enter"===s&&!u)return;if("number"==typeof d)return ob(d,r);let{transitionDuration:n,animationDuration:i,transitionDelay:a,animationDelay:o}=getComputedStyle(f),{transitionDuration:l="0",animationDuration:c="0",transitionDelay:m="0",animationDelay:p="0"}=h?getComputedStyle(h):{},A=oM(a,o,m,p)+oM(n,i,l,c);if(!A){"enter"===s&&t.setState("animated",!1),e();return}return ob(Math.max(A-1e3/60,0),r)},[t,d,f,h,u,s]);let m=ox(c,(n=iq(n,e=>(0,es.jsx)(aO,{value:t,children:e}),[t])).hidden,r),p=n.style,A=(0,el.useMemo)(()=>m?{...p,display:"none"}:p,[m,p]);return iF(n={id:o,"data-open":u||void 0,"data-enter":"enter"===s||void 0,"data-leave":"leave"===s||void 0,hidden:m,...n,ref:iK(o?t.setContentElement:null,a,n.ref),style:A})}),oF=i2(function(e){return i8("div",oE(e))});i2(function(e){let{unmountOnHide:t,...r}=e,n=aG();return!1===oh(r.store||n,e=>!t||(null==e?void 0:e.mounted))?null:(0,es.jsx)(oF,{...r})});var oS=i5(function(e){let{store:t,alwaysVisible:r,...n}=e,i=aX(!0),a=aV(),o=!!(t=t||a)&&t===i;iM(t,!1);let s=(0,el.useRef)(null),l=iQ(n.id),u=t.useState("mounted"),c=ox(u,n.hidden,r),d=c?{...n.style,display:"none"}:n.style,f=t.useState(e=>Array.isArray(e.selectedValue)),h=function(e,t,r){let n=function(e){let[t]=(0,el.useState)(e);return t}(r),[i,a]=(0,el.useState)(n);return(0,el.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);a(null==e?n:e)},o=new MutationObserver(i);return o.observe(r,{attributeFilter:[t]}),i(),()=>o.disconnect()},[e,t,n]),i}(s,"role",n.role),m="listbox"===h||"tree"===h||"grid"===h,[p,A]=(0,el.useState)(!1),g=t.useState("contentElement");iJ(()=>{if(!u)return;let e=s.current;if(!e||g!==e)return;let t=()=>{A(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,g]),p||(n={role:"listbox","aria-multiselectable":m&&f||void 0,...n}),n=iq(n,e=>(0,es.jsx)(az,{value:t,children:(0,es.jsx)(aQ.Provider,{value:h,children:e})}),[t,h]);let B=!l||i&&o?null:t.setContentElement;return iF(n={id:l,hidden:c,...n,ref:iK(B,s,n.ref),style:d})}),oT=i2(function(e){return i8("div",oS(e))}),ow=(0,el.createContext)(null),oR=i5(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});i2(function(e){return i8("span",oR(e))});var oD=i5(function(e){return oR(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),oI=i2(function(e){return i8("span",oD(e))});function oG(e){queueMicrotask(()=>{null==e||e.focus()})}var oL=i5(function(e){let{preserveTabOrder:t,preserveTabOrderAnchor:r,portalElement:n,portalRef:i,portal:a=!0,...o}=e,s=(0,el.useRef)(null),l=iK(s,o.ref),u=(0,el.useContext)(ow),[c,d]=(0,el.useState)(null),[f,h]=(0,el.useState)(null),m=(0,el.useRef)(null),p=(0,el.useRef)(null),A=(0,el.useRef)(null),g=(0,el.useRef)(null);return iJ(()=>{let e=s.current;if(!e||!a)return void d(null);let t=n?"function"==typeof n?n(e):n:ie(e).createElement("div");if(!t)return void d(null);let r=t.isConnected;if(r||(u||ie(e).body).appendChild(t),t.id||(t.id=e.id?"portal/".concat(e.id):function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return"".concat(e?"".concat(e,"-"):"").concat(Math.random().toString(36).slice(2,8))}()),d(t),iT(i,t),!r)return()=>{t.remove(),iT(i,null)}},[a,n,u,i]),iJ(()=>{if(!a||!t||!r)return;let e=ie(r).createElement("span");return e.style.position="fixed",r.insertAdjacentElement("afterend",e),h(e),()=>{e.remove(),h(null)}},[a,t,r]),(0,el.useEffect)(()=>{if(!c||!t)return;let e=0,r=t=>{if(!iH(t))return;let r="focusin"===t.type;if(cancelAnimationFrame(e),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}e=requestAnimationFrame(()=>{for(let e of af(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(e),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,t]),o={...o=iq(o,e=>{if(e=(0,es.jsx)(ow.Provider,{value:c||u,children:e}),!a)return e;if(!c)return(0,es.jsx)("span",{ref:l,id:o.id,style:{position:"fixed"},hidden:!0});e=(0,es.jsxs)(es.Fragment,{children:[t&&c&&(0,es.jsx)(oI,{ref:p,"data-focus-trap":o.id,className:"__focus-trap-inner-before",onFocus:e=>{iH(e,c)?oG(ah()):oG(m.current)}}),e,t&&c&&(0,es.jsx)(oI,{ref:A,"data-focus-trap":o.id,className:"__focus-trap-inner-after",onFocus:e=>{iH(e,c)?oG(am()):oG(g.current)}})]}),c&&(e=(0,oy.createPortal)(e,c));let r=(0,es.jsxs)(es.Fragment,{children:[t&&c&&(0,es.jsx)(oI,{ref:m,"data-focus-trap":o.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&iH(e,c)?oG(p.current):oG(am())}}),t&&(0,es.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),t&&c&&(0,es.jsx)(oI,{ref:g,"data-focus-trap":o.id,className:"__focus-trap-outer-after",onFocus:e=>{if(iH(e,c))oG(A.current);else{let e=ah();if(e===p.current)return void requestAnimationFrame(()=>{var e;return null==(e=ah())?void 0:e.focus()});oG(e)}}})]});return f&&t&&(r=(0,oy.createPortal)(r,f)),(0,es.jsxs)(es.Fragment,{children:[r,e]})},[c,u,a,o.id,t,f]),ref:l}});i2(function(e){return i8("div",oL(e))});var oP=(0,el.createContext)(0);function oH(e){let{level:t,children:r}=e,n=(0,el.useContext)(oP),i=Math.max(Math.min(t||n+1,6),1);return(0,es.jsx)(oP.Provider,{value:i,children:r})}var oO=i5(function(e){let{autoFocusOnShow:t=!0,...r}=e;return iq(r,e=>(0,es.jsx)(as.Provider,{value:t,children:e}),[t])});i2(function(e){return i8("div",oO(e))});var o_=new WeakMap;function ok(e,t,r){o_.has(e)||o_.set(e,new Map);let n=o_.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let a=r(),o=()=>{a(),i(),n.delete(t)};return n.set(t,o),()=>{n.get(t)===o&&(a(),n.set(t,i))}}function oU(e,t,r){return ok(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function oj(e,t,r){return ok(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function oJ(e,t){return e?ok(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var oN=["SCRIPT","STYLE"];function oK(e){return"__ariakit-dialog-snapshot-".concat(e)}function oQ(e,t,r,n){for(let i of t){if(!(null==i?void 0:i.isConnected))continue;let a=t.some(e=>!!e&&e!==i&&e.contains(i)),o=ie(i),s=i;for(;i.parentElement&&i!==o.body;){if(null==n||n(i.parentElement,s),!a)for(let n of i.parentElement.children)(function(e,t,r){return!oN.includes(t.tagName)&&!!function(e,t){let r=ie(t),n=oK(e);if(!r.body[n])return!0;for(;;){if(t===r.body)return!1;if(t[n])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&ii(t,e))})(e,n,t)&&r(n,s);i=i.parentElement}}}function oW(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;ni===e))}function oV(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"__ariakit-dialog-".concat(t?"ancestor":"outside").concat(e?"-".concat(e):"")}function oX(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return iy(oj(e,oV("",!0),!0),oj(e,oV(t,!0),!0))}function oq(e,t){if(e[oV(t,!0)])return!0;let r=oV(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function oY(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return oQ(e,t,t=>{oW(t,...n)||r.unshift(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return iy(oj(e,oV(),!0),oj(e,oV(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(oX(t,e))}),()=>{for(let e of r)e()}}function oz(e){let{store:t,type:r,listener:n,capture:i,domReady:a}=e,o=iN(n),s=oh(t,"open"),l=(0,el.useRef)(!1);iJ(()=>{if(!s||!a)return;let{contentElement:e}=t.getState();if(!e)return;let r=()=>{l.current=!0};return e.addEventListener("focusin",r,!0),()=>e.removeEventListener("focusin",r,!0)},[t,s,a]),(0,el.useEffect)(()=>{if(s)return i_(r,e=>{let{contentElement:r,disclosureElement:n}=t.getState(),i=e.target;if(r&&i)!(!("HTML"===i.tagName||ii(ie(i).body,i))||ii(r,i)||function(e,t){if(!e)return!1;if(ii(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=ie(e).getElementById(r);if(t)return ii(e,t)}return!1}(n,i)||i.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(e,r))&&(!l.current||oq(i,r.id))&&(i&&i[aC]||o(e))},i)},[s,i])}function oZ(e,t){return"function"==typeof e?e(t):!!e}var o$=(0,el.createContext)({});function o0(){return"inert"in HTMLElement.prototype}function o1(e,t){if(!("style"in e))return iB;if(o0())return oj(e,"inert",!0);let r=af(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&ii(t,e)))return iB;let r=ok(e,"focus",()=>(e.focus=iB,()=>{delete e.focus}));return iy(oU(e,"tabindex","-1"),r)});return iy(...r,oU(e,"aria-hidden","true"),oJ(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function o9(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=a4(e.store,a6(e.disclosure,["contentElement","disclosureElement"]));a7(e,t);let r=null==t?void 0:t.getState(),n=iS(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=iS(e.animated,null==r?void 0:r.animated,!1),a=a1({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:iS(null==r?void 0:r.contentElement,null),disclosureElement:iS(null==r?void 0:r.disclosureElement,null)},t);return a9(a,()=>a8(a,["animated","animating"],e=>{e.animated||a.setState("animating",!1)})),a9(a,()=>a3(a,["open"],()=>{a.getState().animated&&a.setState("animating",!0)})),a9(a,()=>a8(a,["open","animating"],e=>{a.setState("mounted",e.open||e.animating)})),{...a,disclosure:e.disclosure,setOpen:e=>a.setState("open",e),show:()=>a.setState("open",!0),hide:()=>a.setState("open",!1),toggle:()=>a.setState("open",e=>!e),stopAnimation:()=>a.setState("animating",!1),setContentElement:e=>a.setState("contentElement",e),setDisclosureElement:e=>a.setState("disclosureElement",e)}}function o2(e,t,r){return iW(t,[r.store,r.disclosure]),op(e,r,"open","setOpen"),op(e,r,"mounted","setMounted"),op(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}i5(function(e){return e});var o3=i2(function(e){return i8("div",e)});function o8(e){let{store:t,backdrop:r,alwaysVisible:n,hidden:i}=e,a=(0,el.useRef)(null),o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,r]=oA(o9,e);return o2(t,r,e)}({disclosure:t}),s=oh(t,"contentElement");(0,el.useEffect)(()=>{let e=a.current;e&&s&&(e.style.zIndex=getComputedStyle(s).zIndex)},[s]),iJ(()=>{let e=null==s?void 0:s.id;if(!e)return;let t=a.current;if(t)return oX(t,e)},[s]);let l=oE({ref:a,store:o,role:"presentation","data-backdrop":(null==s?void 0:s.id)||"",alwaysVisible:n,hidden:null!=i?i:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!r)return null;if((0,el.isValidElement)(r))return(0,es.jsx)(o3,{...l,render:r});let u="boolean"!=typeof r?r:"div";return(0,es.jsx)(o3,{...l,render:(0,es.jsx)(u,{})})}function o5(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o9(e)}Object.assign(o3,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=i2(function(e){return i8(t,e)}),e),{}));var o6=iD();function o4(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;let r="current"in e?e.current:e;return r?t?au(r)?r:null:r:null}var o7=i5(function(e){let{store:t,open:r,onClose:n,focusable:i=!0,modal:a=!0,portal:o=!!a,backdrop:s=!!a,hideOnEscape:l=!0,hideOnInteractOutside:u=!0,getPersistentElements:c,preventBodyScroll:d=!!a,autoFocusOnShow:f=!0,autoFocusOnHide:h=!0,initialFocus:m,finalFocus:p,unmountOnHide:A,unstable_treeSnapshotKey:g,...B}=e,C=aP(),y=(0,el.useRef)(null),b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,r]=oA(o5,e);return o2(t,r,e)}({store:t||C,open:r,setOpen(e){if(e)return;let t=y.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});n&&t.addEventListener("close",n,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&b.setOpen(!0)}}),{portalRef:M,domReady:x}=iY(o,B.portalRef),E=B.preserveTabOrder,F=oh(b,e=>E&&!a&&e.mounted),S=iQ(B.id),T=oh(b,"open"),w=oh(b,"mounted"),R=oh(b,"contentElement"),D=ox(w,B.hidden,B.alwaysVisible),I=function(e){let{attribute:t,contentId:r,contentElement:n,enabled:i}=e,[a,o]=iV(),s=(0,el.useCallback)(()=>{if(!i||!n)return!1;let{body:e}=ie(n),a=e.getAttribute(t);return!a||a===r},[a,i,n,t,r]);return(0,el.useEffect)(()=>{if(!i||!r||!n)return;let{body:e}=ie(n);if(s())return e.setAttribute(t,r),()=>e.removeAttribute(t);let a=new MutationObserver(()=>(0,oy.flushSync)(o));return a.observe(e,{attributeFilter:[t]}),()=>a.disconnect()},[a,i,r,n,s,t]),s}({attribute:"data-dialog-prevent-body-scroll",contentElement:R,contentId:S,enabled:d&&!D});(0,el.useEffect)(()=>{var e,t;if(!I()||!R)return;let r=ie(R),n=it(R),{documentElement:i,body:a}=r,o=i.style.getPropertyValue("--scrollbar-width"),s=o?Number.parseInt(o,10):n.innerWidth-i.clientWidth,l=Math.round(i.getBoundingClientRect().left)+i.scrollLeft?"paddingLeft":"paddingRight",u=iR()&&!(n7&&navigator.platform.startsWith("Mac")&&!iw());return iy((e="--scrollbar-width",t="".concat(s,"px"),i?ok(i,e,()=>{let r=i.style.getPropertyValue(e);return i.style.setProperty(e,t),()=>{r?i.style.setProperty(e,r):i.style.removeProperty(e)}}):()=>{}),u?(()=>{var e,t;let{scrollX:r,scrollY:i,visualViewport:o}=n,u=null!=(e=null==o?void 0:o.offsetLeft)?e:0,c=null!=(t=null==o?void 0:o.offsetTop)?t:0,d=oJ(a,{position:"fixed",overflow:"hidden",top:"".concat(-(i-Math.floor(c)),"px"),left:"".concat(-(r-Math.floor(u)),"px"),right:"0",[l]:"".concat(s,"px")});return()=>{d(),n.scrollTo({left:r,top:i,behavior:"instant"})}})():oJ(a,{overflow:"hidden",[l]:"".concat(s,"px")}))},[I,R]);let G=function(e){let t=(0,el.useRef)();return(0,el.useEffect)(()=>{if(!e){t.current=null;return}return i_("mousedown",e=>{t.current=e.target},!0)},[e]),t}(oh(b,"open")),L={store:b,domReady:x,capture:!0};oz({...L,type:"click",listener:e=>{let{contentElement:t}=b.getState(),r=G.current;r&&il(r)&&oq(r,null==t?void 0:t.id)&&oZ(u,e)&&b.hide()}}),oz({...L,type:"focusin",listener:e=>{let{contentElement:t}=b.getState();t&&e.target!==ie(t)&&oZ(u,e)&&b.hide()}}),oz({...L,type:"contextmenu",listener:e=>{oZ(u,e)&&b.hide()}});let{wrapElement:P,nestedDialogs:H}=function(e){let t=(0,el.useContext)(o$),[r,n]=(0,el.useState)([]),i=(0,el.useCallback)(e=>{var r;return n(t=>[...t,e]),iy(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);iJ(()=>a8(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let a=(0,el.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,el.useCallback)(e=>(0,es.jsx)(o$.Provider,{value:a,children:e}),[a]),nestedDialogs:r}}(b);B=iq(B,P,[P]),iJ(()=>{if(!T)return;let e=y.current,t=ir(e,!0);t&&"BODY"!==t.tagName&&(e&&ii(e,t)||b.setDisclosureElement(t))},[b,T]),o6&&(0,el.useEffect)(()=>{if(!w)return;let{disclosureElement:e}=b.getState();if(!e||!io(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),iO(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||ag(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[b,w]),(0,el.useEffect)(()=>{if(!w||!x)return;let e=y.current;if(!e)return;let t=it(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height","".concat(i,"px"))};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[w,x]),(0,el.useEffect)(()=>{if(!a||!w||!x)return;let e=y.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t=b.hide;let r=ie(e).createElement("button");return r.type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[b,a,w,x]),iJ(()=>{if(!o0()||T||!w||!x)return;let e=y.current;if(e)return o1(e)},[T,w,x]);let O=T&&x;iJ(()=>{if(!S||!O)return;var e=[y.current];let{body:t}=ie(e[0]),r=[];return oQ(S,e,e=>{r.push(oj(e,oK(S),!0))}),iy(oj(t,oK(S),!0),()=>{for(let e of r)e()})},[S,O,g]);let _=iN(c);iJ(()=>{if(!S||!O)return;let{disclosureElement:e}=b.getState(),t=[y.current,..._()||[],...H.map(e=>e.getState().contentElement)];return a?iy(oY(S,t),function(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return oQ(e,t,e=>{oW(e,...n)||!function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;ni===e))}(e,...n)&&r.unshift(o1(e,t))},e=>{e.hasAttribute("role")&&(t.some(t=>t&&ii(t,e))||r.unshift(oU(e,"role","none")))}),()=>{for(let e of r)e()}}(S,t)):oY(S,[e,...t])},[S,b,O,_,H,a,g]);let k=!!f,U=iX(f),[j,J]=(0,el.useState)(!1);(0,el.useEffect)(()=>{if(!T||!k||!x||!(null==R?void 0:R.isConnected))return;let e=o4(m,!0)||R.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=af(e,t,r);return n||null}(R,!0,o&&F)||R,t=au(e);U(t?e:null)&&(J(!0),queueMicrotask(()=>{e.focus(),o6&&t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[T,k,x,R,m,o,F,U]);let N=!!h,K=iX(h),[Q,W]=(0,el.useState)(!1);(0,el.useEffect)(()=>{if(T)return W(!0),()=>W(!1)},[T]);let V=(0,el.useCallback)(function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{disclosureElement:r}=b.getState();if(function(e){let t=ir();return!(!t||e&&ii(e,t))&&!!au(t)}(e))return;let n=o4(p)||r;if(null==n?void 0:n.id){let e=ie(n),t='[aria-activedescendant="'.concat(n.id,'"]'),r=e.querySelector(t);r&&(n=r)}if(n&&!au(n)){let e=n.closest("[data-dialog]");if(null==e?void 0:e.id){let t=ie(e),r='[aria-controls~="'.concat(e.id,'"]'),i=t.querySelector(r);i&&(n=i)}}let i=n&&au(n);if(!i&&t)return void requestAnimationFrame(()=>V(e,!1));K(i?n:null)&&i&&(null==n||n.focus({preventScroll:!0}))},[b,p,K]),X=(0,el.useRef)(!1);iJ(()=>{if(T||!Q||!N)return;let e=y.current;X.current=!0,V(e)},[T,Q,x,N,V]),(0,el.useEffect)(()=>{if(!Q||!N)return;let e=y.current;return()=>{if(X.current){X.current=!1;return}V(e)}},[Q,N,V]);let q=iX(l);(0,el.useEffect)(()=>{if(x&&w)return i_("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=y.current;if(!t||oq(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=b.getState();("BODY"===r.tagName||ii(t,r)||!n||ii(n,r))&&q(e)&&b.hide()},!0)},[b,x,w,q]);let Y=(B=iq(B,e=>(0,es.jsx)(oH,{level:a?1:void 0,children:e}),[a])).hidden,z=B.alwaysVisible;B=iq(B,e=>s?(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)(o8,{store:b,backdrop:s,hidden:Y,alwaysVisible:z}),e]}):e,[b,s,Y,z]);let[Z,$]=(0,el.useState)(),[ee,et]=(0,el.useState)();return B=oO({...B={id:S,"data-dialog":"",role:"dialog",tabIndex:i?-1:void 0,"aria-labelledby":Z,"aria-describedby":ee,...B=iq(B,e=>(0,es.jsx)(aO,{value:b,children:(0,es.jsx)(a_.Provider,{value:$,children:(0,es.jsx)(ak.Provider,{value:et,children:e})})}),[b]),ref:iK(y,B.ref)},autoFocusOnShow:j}),B=oL({portal:o,...B=aS({...B=oE({store:b,...B}),focusable:i}),portalRef:M,preserveTabOrder:F})});function se(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:aP;return i2(function(r){let n=t();return oh(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,es.jsx)(e,{...r}):null})}se(i2(function(e){return i8("div",o7(e))}),aP);let st=Math.min,sr=Math.max,sn=Math.round,si=Math.floor,sa=e=>({x:e,y:e}),so={left:"right",right:"left",bottom:"top",top:"bottom"},ss={start:"end",end:"start"};function sl(e,t){return"function"==typeof e?e(t):e}function su(e){return e.split("-")[0]}function sc(e){return e.split("-")[1]}function sd(e){return"x"===e?"y":"x"}function sf(e){return"y"===e?"height":"width"}let sh=new Set(["top","bottom"]);function sm(e){return sh.has(su(e))?"y":"x"}function sp(e){return e.replace(/start|end/g,e=>ss[e])}let sA=["left","right"],sg=["right","left"],sv=["top","bottom"],sB=["bottom","top"];function sC(e){return e.replace(/left|right|bottom|top/g,e=>so[e])}function sy(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function sb(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function sM(e,t,r){let n,{reference:i,floating:a}=e,o=sm(t),s=sd(sm(t)),l=sf(s),u=su(t),c="y"===o,d=i.x+i.width/2-a.width/2,f=i.y+i.height/2-a.height/2,h=i[l]/2-a[l]/2;switch(u){case"top":n={x:d,y:i.y-a.height};break;case"bottom":n={x:d,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:f};break;case"left":n={x:i.x-a.width,y:f};break;default:n={x:i.x,y:i.y}}switch(sc(t)){case"start":n[s]-=h*(r&&c?-1:1);break;case"end":n[s]+=h*(r&&c?-1:1)}return n}let sx=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,s=a.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=sM(u,n,l),f=n,h={},m=0;for(let r=0;r{try{return e.matches(t)}catch(e){return!1}})}let sj=["transform","translate","scale","rotate","perspective"],sJ=["transform","translate","scale","rotate","perspective","filter"],sN=["paint","layout","strict","content"];function sK(e){let t=sQ(),r=sG(e)?sX(e):e;return sj.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||sJ.some(e=>(r.willChange||"").includes(e))||sN.some(e=>(r.contain||"").includes(e))}function sQ(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let sW=new Set(["html","body","#document"]);function sV(e){return sW.has(sw(e))}function sX(e){return sR(e).getComputedStyle(e)}function sq(e){return sG(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sY(e){if("html"===sw(e))return e;let t=e.assignedSlot||e.parentNode||sP(e)&&e.host||sD(e);return sP(t)?t.host:t}function sz(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let i=function e(t){let r=sY(t);return sV(r)?t.ownerDocument?t.ownerDocument.body:t.body:sL(r)&&sO(r)?r:e(r)}(e),a=i===(null==(n=e.ownerDocument)?void 0:n.body),o=sR(i);if(a){let e=sZ(o);return t.concat(o,o.visualViewport||[],sO(i)?i:[],e&&r?sz(e):[])}return t.concat(i,sz(i,[],r))}function sZ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function s$(e){let t=sX(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=sL(e),a=i?e.offsetWidth:r,o=i?e.offsetHeight:n,s=sn(r)!==a||sn(n)!==o;return s&&(r=a,n=o),{width:r,height:n,$:s}}function s0(e){return sG(e)?e:e.contextElement}function s1(e){let t=s0(e);if(!sL(t))return sa(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:a}=s$(t),o=(a?sn(r.width):r.width)/n,s=(a?sn(r.height):r.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}let s9=sa(0);function s2(e){let t=sR(e);return sQ()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:s9}function s3(e,t,r,n){var i;void 0===t&&(t=!1),void 0===r&&(r=!1);let a=e.getBoundingClientRect(),o=s0(e),s=sa(1);t&&(n?sG(n)&&(s=s1(n)):s=s1(e));let l=(void 0===(i=r)&&(i=!1),n&&(!i||n===sR(o))&&i)?s2(o):sa(0),u=(a.left+l.x)/s.x,c=(a.top+l.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(o){let e=sR(o),t=n&&sG(n)?sR(n):n,r=e,i=sZ(r);for(;i&&n&&t!==r;){let e=s1(i),t=i.getBoundingClientRect(),n=sX(i),a=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=a,c+=o,i=sZ(r=sR(i))}}return sb({width:d,height:f,x:u,y:c})}function s8(e,t){let r=sq(e).scrollLeft;return t?t.left+r:s3(sD(e)).left+r}function s5(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-s8(e,r),y:r.top+t.scrollTop}}let s6=new Set(["absolute","fixed"]);function s4(e,t,r){let n;if("viewport"===t)n=function(e,t){let r=sR(e),n=sD(e),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;let e=sQ();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}let u=s8(n);if(u<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(n.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else u<=25&&(a+=u);return{width:a,height:o,x:s,y:l}}(e,r);else if("document"===t)n=function(e){let t=sD(e),r=sq(e),n=e.ownerDocument.body,i=sr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=sr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),o=-r.scrollLeft+s8(e),s=-r.scrollTop;return"rtl"===sX(n).direction&&(o+=sr(t.clientWidth,n.clientWidth)-i),{width:i,height:a,x:o,y:s}}(sD(e));else if(sG(t))n=function(e,t){let r=s3(e,!0,"fixed"===t),n=r.top+e.clientTop,i=r.left+e.clientLeft,a=sL(e)?s1(e):sa(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y;return{width:o,height:s,x:i*a.x,y:n*a.y}}(t,r);else{let r=s2(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return sb(n)}function s7(e){return"static"===sX(e).position}function le(e,t){if(!sL(e)||"fixed"===sX(e).position)return null;if(t)return t(e);let r=e.offsetParent;return sD(e)===r&&(r=r.ownerDocument.body),r}function lt(e,t){var r;let n=sR(e);if(sU(e))return n;if(!sL(e)){let t=sY(e);for(;t&&!sV(t);){if(sG(t)&&!s7(t))return t;t=sY(t)}return n}let i=le(e,t);for(;i&&(r=i,s_.has(sw(r)))&&s7(i);)i=le(i,t);return i&&sV(i)&&s7(i)&&!sK(i)?n:i||function(e){let t=sY(e);for(;sL(t)&&!sV(t);){if(sK(t))return t;if(sU(t))break;t=sY(t)}return null}(e)||n}let lr=async function(e){let t=this.getOffsetParent||lt,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=sL(t),i=sD(t),a="fixed"===r,o=s3(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=sa(0);if(n||!n&&!a)if(("body"!==sw(t)||sO(i))&&(s=sq(t)),n){let e=s3(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=s8(i));a&&!n&&i&&(l.x=s8(i));let u=!i||n||a?sa(0):s5(i,s);return{x:o.left+s.scrollLeft-l.x-u.x,y:o.top+s.scrollTop-l.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},ln={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,a="fixed"===i,o=sD(n),s=!!t&&sU(t.floating);if(n===o||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=sa(1),c=sa(0),d=sL(n);if((d||!d&&!a)&&(("body"!==sw(n)||sO(o))&&(l=sq(n)),sL(n))){let e=s3(n);u=s1(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}let f=!o||d||a?sa(0):s5(o,l);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}},getDocumentElement:sD,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,a=[..."clippingAncestors"===r?sU(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=sz(e,[],!1).filter(e=>sG(e)&&"body"!==sw(e)),i=null,a="fixed"===sX(e).position,o=a?sY(e):e;for(;sG(o)&&!sV(o);){let t=sX(o),r=sK(o);r||"fixed"!==t.position||(i=null),(a?!r&&!i:!r&&"static"===t.position&&!!i&&s6.has(i.position)||sO(o)&&!r&&function e(t,r){let n=sY(t);return!(n===r||!sG(n)||sV(n))&&("fixed"===sX(n).position||e(n,r))}(e,o))?n=n.filter(e=>e!==o):i=t,o=sY(o)}return t.set(e,n),n}(t,this._c):[].concat(r),n],o=a[0],s=a.reduce((e,r)=>{let n=s4(t,r,i);return e.top=sr(n.top,e.top),e.right=st(n.right,e.right),e.bottom=st(n.bottom,e.bottom),e.left=sr(n.left,e.left),e},s4(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:lt,getElementRects:lr,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=s$(e);return{width:t,height:r}},getScale:s1,isElement:sG,isRTL:function(e){return"rtl"===sX(e).direction}};function li(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function la(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function lo(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function ls(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var ll=i5(function(e){let{store:t,modal:r=!1,portal:n=!!r,preserveTabOrder:i=!0,autoFocusOnShow:a=!0,wrapperProps:o,fixed:s=!1,flip:l=!0,shift:u=0,slide:c=!0,overlap:d=!1,sameWidth:f=!1,fitViewport:h=!1,gutter:m,arrowPadding:p=4,overflowPadding:A=8,getAnchorRect:g,updatePosition:B,...C}=e,y=aj();iM(t=t||y,!1);let b=t.useState("arrowElement"),M=t.useState("anchorElement"),x=t.useState("disclosureElement"),E=t.useState("popoverElement"),F=t.useState("contentElement"),S=t.useState("placement"),T=t.useState("mounted"),w=t.useState("rendered"),R=(0,el.useRef)(null),[D,I]=(0,el.useState)(!1),{portalRef:G,domReady:L}=iY(n,C.portalRef),P=iN(g),H=iN(B),O=!!B;iJ(()=>{if(!(null==E?void 0:E.isConnected))return;E.style.setProperty("--popover-overflow-padding","".concat(A,"px"));let e={contextElement:M||void 0,getBoundingClientRect:()=>{let e=null==P?void 0:P(M);if(e||!M){if(!e)return la();let{x:t,y:r,width:n,height:i}=e;return la(t,r,n,i)}return M.getBoundingClientRect()}},r=async()=>{var r,n,i,a;if(!T)return;b||(R.current=R.current||document.createElement("div"));let o=b||R.current,g=[(r={gutter:m,shift:u},void 0===(n=e=>{var t;let{placement:n}=e,i=((null==o?void 0:o.clientHeight)||0)/2,a="number"==typeof r.gutter?r.gutter+i:null!=(t=r.gutter)?t:i;return{crossAxis:n.split("-")[1]?void 0:r.shift,mainAxis:a,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:a,placement:o,middlewareData:s}=e,l=await sS(e,n);return o===(null==(t=s.offset)?void 0:t.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return iM(!r||r.every(lo),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,a,o;let{placement:s,middlewareData:l,rects:u,initialPlacement:c,platform:d,elements:f}=e,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:A="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:B=!0,...C}=sl(t,e);if(null!=(r=l.arrow)&&r.alignmentOffset)return{};let y=su(s),b=sm(c),M=su(c)===c,x=await (null==d.isRTL?void 0:d.isRTL(f.floating)),E=p||(M||!B?[sC(c)]:function(e){let t=sC(e);return[sp(e),t,sp(t)]}(c)),F="none"!==g;!p&&F&&E.push(...function(e,t,r,n){let i=sc(e),a=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?sg:sA;return t?sA:sg;case"left":case"right":return t?sv:sB;default:return[]}}(su(e),"start"===r,n);return i&&(a=a.map(e=>e+"-"+i),t&&(a=a.concat(a.map(sp)))),a}(c,B,g,x));let S=[c,...E],T=await sE(e,C),w=[],R=(null==(n=l.flip)?void 0:n.overflows)||[];if(h&&w.push(T[y]),m){let e=function(e,t,r){void 0===r&&(r=!1);let n=sc(e),i=sd(sm(e)),a=sf(i),o="x"===i?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=sC(o)),[o,sC(o)]}(s,u,x);w.push(T[e[0]],T[e[1]])}if(R=[...R,{placement:s,overflows:w}],!w.every(e=>e<=0)){let e=((null==(i=l.flip)?void 0:i.index)||0)+1,t=S[e];if(t&&("alignment"!==m||b===sm(t)||R.every(e=>sm(e.placement)!==b||e.overflows[0]>0)))return{data:{index:e,overflows:R},reset:{placement:t}};let r=null==(a=R.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:a.placement;if(!r)switch(A){case"bestFit":{let e=null==(o=R.filter(e=>{if(F){let t=sm(e.placement);return t===b||"y"===t}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])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=c}if(s!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:A}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:a,middlewareData:o}=e,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=sl(t,e),c={x:r,y:n},d=sm(i),f=sd(d),h=c[f],m=c[d],p=sl(s,e),A="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){let e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+A.mainAxis,r=a.reference[f]+a.reference[e]-A.mainAxis;hr&&(h=r)}if(u){var g,B;let e="y"===f?"width":"height",t=sF.has(su(i)),r=a.reference[d]-a.floating[e]+(t&&(null==(g=o.offset)?void 0:g[d])||0)+(t?0:A.crossAxis),n=a.reference[d]+a.reference[e]+(t?0:(null==(B=o.offset)?void 0:B[d])||0)-(t?A.crossAxis:0);mn&&(m=n)}return{[f]:h,[d]:m}}})},async fn(e){let{x:t,y:n,placement:i}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=sl(r,e),u={x:t,y:n},c=await sE(e,l),d=sm(su(i)),f=sd(d),h=u[f],m=u[d];if(a){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=h+c[e],n=h-c[t];h=sr(r,st(h,n))}if(o){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=m+c[e],n=m-c[t];m=sr(r,st(m,n))}let p=s.fn({...e,[f]:h,[d]:m});return{...p,data:{x:p.x-t,y:p.y-n,enabled:{[f]:a,[d]:o}}}}}}}({slide:c,shift:u,overlap:d,overflowPadding:A}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=sl(r,e)||{};if(null==u)return{};let d=sy(c),f={x:t,y:n},h=sd(sm(i)),m=sf(h),p=await o.getDimensions(u),A="y"===h,g=A?"clientHeight":"clientWidth",B=a.reference[m]+a.reference[h]-f[h]-a.floating[m],C=f[h]-a.reference[h],y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u)),b=y?y[g]:0;b&&await (null==o.isElement?void 0:o.isElement(y))||(b=s.floating[g]||a.floating[m]);let M=b/2-p[m]/2-1,x=st(d[A?"top":"left"],M),E=st(d[A?"bottom":"right"],M),F=b-p[m]-E,S=b/2-p[m]/2+(B/2-C/2),T=sr(x,st(S,F)),w=!l.arrow&&null!=sc(i)&&S!==T&&a.reference[m]/2-(S{},...d}=sl(a,e),f=await sE(e,d),h=su(o),m=sc(o),p="y"===sm(o),{width:A,height:g}=s.floating;"top"===h||"bottom"===h?(n=h,i=m===(await (null==l.isRTL?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(i=h,n="end"===m?"top":"bottom");let B=g-f.top-f.bottom,C=A-f.left-f.right,y=st(g-f[n],B),b=st(A-f[i],C),M=!e.middlewareData.shift,x=y,E=b;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=C),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(x=B),M&&!m){let e=sr(f.left,0),t=sr(f.right,0),r=sr(f.top,0),n=sr(f.bottom,0);p?E=A-2*(0!==e||0!==t?e+t:sr(f.left,f.right)):x=g-2*(0!==r||0!==n?r+n:sr(f.top,f.bottom))}await c({...e,availableWidth:E,availableHeight:x});let F=await l.getDimensions(u.floating);return A!==F.width||g!==F.height?{reset:{rects:!0}}:{}}}],B=await ((e,t,r)=>{let n=new Map,i={platform:ln,...r},a={...i.platform,_c:n};return sx(e,t,{...i,platform:a})})(e,E,{placement:S,strategy:s?"fixed":"absolute",middleware:g});null==t||t.setState("currentPlacement",B.placement),I(!0);let C=ls(B.x),y=ls(B.y);if(Object.assign(E.style,{top:"0",left:"0",transform:"translate3d(".concat(C,"px,").concat(y,"px,0)")}),o&&B.middlewareData.arrow){let{x:e,y:t}=B.middlewareData.arrow,r=B.placement.split("-")[0],n=o.clientWidth/2,i=o.clientHeight/2,a=null!=e?e+n:-n,s=null!=t?t+i:-i;E.style.setProperty("--popover-transform-origin",{top:"".concat(a,"px calc(100% + ").concat(i,"px)"),bottom:"".concat(a,"px ").concat(-i,"px"),left:"calc(100% + ".concat(n,"px) ").concat(s,"px"),right:"".concat(-n,"px ").concat(s,"px")}[r]),Object.assign(o.style,{left:null!=e?"".concat(e,"px"):"",top:null!=t?"".concat(t,"px"):"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,c=s0(e),d=a||o?[...c?sz(c):[],...sz(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});let f=c&&l?function(e,t){let r,n=null,i=sD(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(s||t(),!f||!h)return;let m=si(d),p=si(i.clientWidth-(c+f)),A={rootMargin:-m+"px "+-p+"px "+-si(i.clientHeight-(d+h))+"px "+-si(c)+"px",threshold:sr(0,st(1,l))||1},g=!0;function B(t){let n=t[0].intersectionRatio;if(n!==l){if(!g)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==n||li(u,e.getBoundingClientRect())||o(),g=!1}try{n=new IntersectionObserver(B,{...A,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(B,A)}n.observe(e)}(!0),a}(c,r):null,h=-1,m=null;s&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!u&&m.observe(c),m.observe(t));let p=u?s3(e):null;return u&&function t(){let n=s3(e);p&&!li(p,n)&&r(),p=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,u&&cancelAnimationFrame(i)}}(e,E,async()=>{O?(await H({updatePosition:r}),I(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{I(!1),n()}},[t,w,E,b,M,E,S,T,L,s,l,u,c,d,f,h,m,p,A,P,O,H]),iJ(()=>{if(!T||!L||!(null==E?void 0:E.isConnected)||!(null==F?void 0:F.isConnected))return;let e=()=>{E.style.zIndex=getComputedStyle(F).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,L,E,F]);let _=s?"fixed":"absolute";return C=iq(C,e=>(0,es.jsx)("div",{...o,style:{position:_,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==t?void 0:t.setPopoverElement,children:e}),[t,_,o]),C={"data-placing":!D||void 0,...C=iq(C,e=>(0,es.jsx)(aN,{value:t,children:e}),[t]),style:{position:"relative",...C.style}},C=o7({store:t,modal:r,portal:n,preserveTabOrder:i,preserveTabOrderAnchor:x||M,autoFocusOnShow:D&&a,...C,portalRef:G})});se(i2(function(e){return i8("div",ll(e))}),aj);var lu=i5(function(e){let{store:t,modal:r,tabIndex:n,alwaysVisible:i,autoFocusOnHide:a=!0,hideOnInteractOutside:o=!0,...s}=e,l=aq();iM(t=t||l,!1);let u=t.useState("baseElement"),c=(0,el.useRef)(!1),d=oh(t.tag,e=>null==e?void 0:e.renderedItems.length);return s=oS({store:t,alwaysVisible:i,...s}),s=ll({store:t,modal:r,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:u,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:d,...s,getPersistentElements(){var e;let n=(null==(e=s.getPersistentElements)?void 0:e.call(s))||[];if(!r||!t)return n;let{contentElement:i,baseElement:a}=t.getState();if(!a)return n;let o=ie(a),l=[];if((null==i?void 0:i.id)&&l.push('[aria-controls~="'.concat(i.id,'"]')),(null==a?void 0:a.id)&&l.push('[aria-controls~="'.concat(a.id,'"]')),!l.length)return[...n,a];let u=l.join(",");return[...n,...o.querySelectorAll(u)]},autoFocusOnHide:e=>!ix(a,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(e){var r,n;let i=null==t?void 0:t.getState(),a=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,s=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n'[aria-controls~="'.concat(e,'"]')).join(", ");return!!t&&e.matches(t)}return!1}(e.target,a,s))return!1;let l="function"==typeof o?o(e):o;return l&&(c.current="click"===e.type),l}})}),lc=se(i2(function(e){return i8("div",lu(e))}),aq);(0,el.createContext)(null),(0,el.createContext)(null);var ld=i6([an],[ai]),lf=ld.useContext;ld.useScopedContext,ld.useProviderContext,ld.ContextProvider,ld.ScopedContextProvider;var lh={id:null};function lm(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function lp(e,t){return e.filter(e=>e.rowId===t)}function lA(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function lg(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var lv=iD()&&iw();function lB(){let{tag:e,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=a4(t.store,function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:{},r=null==(e=t.store)?void 0:e.getState(),n=function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a7(r,r.store);let n=null==(e=r.store)?void 0:e.getState(),i=iS(r.items,null==n?void 0:n.items,r.defaultItems,[]),a=new Map(i.map(e=>[e.id,e])),o={items:i,renderedItems:iS(null==n?void 0:n.renderedItems,[])},s=null==(t=r.store)?void 0:t.__unstablePrivateStore,l=a1({items:i,renderedItems:o.renderedItems},s),u=a1(o,r.store),c=e=>{let t=function(e,t){let r=e.map((e,t)=>[t,e]),n=!1;return(r.sort((e,r)=>{var i;let[a,o]=e,[s,l]=r,u=t(o),c=t(l);return u!==c&&u&&c?(i=u,c.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_PRECEDING)?(a>s&&(n=!0),-1):(a{let[t,r]=e;return r}):e}(e,e=>e.element);l.setState("renderedItems",t),u.setState("renderedItems",t)};a9(u,()=>a2(l)),a9(l,()=>a5(l,["items"],e=>{u.setState("items",e.items)})),a9(l,()=>a5(l,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=u.getState();e.renderedItems!==t&&c(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let n=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>c(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),n=[...e].reverse().find(e=>!!e.element),i=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;i&&(null==n?void 0:n.element);){let e=i;if(n&&e.contains(n.element))return i;i=i.parentElement}return ie(i).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&n.observe(t.element);return()=>{cancelAnimationFrame(r),n.disconnect()}}));let d=function(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t(t=>{let n=t.findIndex(t=>{let{id:r}=t;return r===e.id}),i=t.slice();if(-1!==n){let o={...r=t[n],...e};i[n]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!r)return n&&a.delete(e.id),t.filter(t=>{let{id:r}=t;return r!==e.id});let i=t.findIndex(t=>{let{id:r}=t;return r===e.id});if(-1===i)return t;let o=t.slice();return o[i]=r,a.set(e.id,r),o})}},f=e=>d(e,e=>l.setState("items",e),!0);return{...u,registerItem:f,renderItem:e=>iy(f(e),d(e,e=>l.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=l.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:l}}(t),i=iS(t.activeId,null==r?void 0:r.activeId,t.defaultActiveId),a=a1({...n.getState(),id:iS(t.id,null==r?void 0:r.id,"id-".concat(Math.random().toString(36).slice(2,8))),activeId:i,baseElement:iS(null==r?void 0:r.baseElement,null),includesBaseElement:iS(t.includesBaseElement,null==r?void 0:r.includesBaseElement,null===i),moves:iS(null==r?void 0:r.moves,0),orientation:iS(t.orientation,null==r?void 0:r.orientation,"both"),rtl:iS(t.rtl,null==r?void 0:r.rtl,!1),virtualFocus:iS(t.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:iS(t.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:iS(t.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:iS(t.focusShift,null==r?void 0:r.focusShift,!1)},n,t.store);a9(a,()=>a8(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=lm(e.renderedItems))?void 0:r.id})}));let o=function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"next",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=a.getState(),{skip:o=0,activeId:s=i.activeId,focusShift:l=i.focusShift,focusLoop:u=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:d=i.includesBaseElement,renderedItems:f=i.renderedItems,rtl:h=i.rtl}=n,m="up"===r||"down"===r,p="next"===r||"down"===r,A=m?aT(function(e,t,r){let n=lg(e);for(let i of e)for(let e=0;ee.id===s);if(!g)return null==(t=lm(A))?void 0:t.id;let B=A.some(e=>e.rowId),C=A.indexOf(g),y=A.slice(C+1),b=lp(y,g.rowId);if(o){let e=b.filter(e=>s?!e.disabled&&e.id!==s:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let M=u&&(m?"horizontal"!==u:"vertical"!==u),x=B&&c&&(m?"horizontal"!==c:"vertical"!==c),E=p?(!B||m)&&M&&d:!!m&&d;if(M){let e=lm(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[lh]:[],...e.slice(0,n)]}(x&&!E?A:lp(A,g.rowId),s,E),s);return null==e?void 0:e.id}if(x){let e=lm(E?b:y,s);return E?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let F=lm(b,s);return!F&&E?null:null==F?void 0:F.id};return{...n,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=lm(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=lm(aw(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("up",e))}}({...t,activeId:a,includesBaseElement:iS(t.includesBaseElement,null==i?void 0:i.includesBaseElement,!0),orientation:iS(t.orientation,null==i?void 0:i.orientation,"vertical"),focusLoop:iS(t.focusLoop,null==i?void 0:i.focusLoop,!0),focusWrap:iS(t.focusWrap,null==i?void 0:i.focusWrap,!0),virtualFocus:iS(t.virtualFocus,null==i?void 0:i.virtualFocus,!0)}),s=function(){let{popover:e,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=a4(t.store,a6(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));a7(t,r);let n=null==r?void 0:r.getState(),i=o5({...t,store:r}),a=iS(t.placement,null==n?void 0:n.placement,"bottom"),o=a1({...i.getState(),placement:a,currentPlacement:a,anchorElement:iS(null==n?void 0:n.anchorElement,null),popoverElement:iS(null==n?void 0:n.popoverElement,null),arrowElement:iS(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...o,setAnchorElement:e=>o.setState("anchorElement",e),setPopoverElement:e=>o.setState("popoverElement",e),setArrowElement:e=>o.setState("arrowElement",e),render:()=>o.setState("rendered",Symbol("rendered"))}}({...t,placement:iS(t.placement,null==i?void 0:i.placement,"bottom-start")}),l=iS(t.value,null==i?void 0:i.value,t.defaultValue,""),u=iS(t.selectedValue,null==i?void 0:i.selectedValue,null==n?void 0:n.values,t.defaultSelectedValue,""),c=Array.isArray(u),d={...o.getState(),...s.getState(),value:l,selectedValue:u,resetValueOnSelect:iS(t.resetValueOnSelect,null==i?void 0:i.resetValueOnSelect,c),resetValueOnHide:iS(t.resetValueOnHide,null==i?void 0:i.resetValueOnHide,c&&!e),activeValue:null==i?void 0:i.activeValue},f=a1(d,o,s,r);return lv&&a9(f,()=>a8(f,["virtualFocus"],()=>{f.setState("virtualFocus",!1)})),a9(f,()=>{if(e)return iy(a8(f,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),a8(e,["values"],e=>{f.setState("selectedValue",e.values)}))}),a9(f,()=>a8(f,["resetValueOnHide","mounted"],e=>{e.resetValueOnHide&&(e.mounted||f.setState("value",l))})),a9(f,()=>a8(f,["open"],e=>{e.open||(f.setState("activeId",a),f.setState("moves",0))})),a9(f,()=>a8(f,["moves","activeId"],(e,t)=>{e.moves===t.moves&&f.setState("activeValue",void 0)})),a9(f,()=>a5(f,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=f.getState(),n=o.item(r);f.setState("activeValue",null==n?void 0:n.value)})),{...s,...o,...f,tag:e,setValue:e=>f.setState("value",e),resetValue:()=>f.setState("value",d.value),setSelectedValue:e=>f.setState("selectedValue",e)}}function lC(){var e,t,r,n,i,a;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[s,l]=oA(lB,o=function(e){var t;let r=lf();return{id:iQ((t=e={...e,tag:void 0!==e.tag?e.tag:r}).id),...t}}(o));return iW(l,[(e=o).tag]),op(s,e,"value","setValue"),op(s,e,"selectedValue","setSelectedValue"),op(s,e,"resetValueOnHide"),op(s,e,"resetValueOnSelect"),Object.assign((n=s,iW(i=l,[(a=e).popover]),op(n,a,"placement"),t=o2(n,i,a),r=t,iW(l,[e.store]),op(r,e,"items","setItems"),op(t=r,e,"activeId","setActiveId"),op(t,e,"includesBaseElement"),op(t,e,"virtualFocus"),op(t,e,"orientation"),op(t,e,"rtl"),op(t,e,"focusLoop"),op(t,e,"focusWrap"),op(t,e,"focusShift"),t),{tag:e.tag})}function ly(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=lC(e);return(0,es.jsx)(aY,{value:t,children:e.children})}var lb=(0,el.createContext)(void 0),lM=i5(function(e){let[t,r]=(0,el.useState)();return iF(e={role:"group","aria-labelledby":t,...e=iq(e,e=>(0,es.jsx)(lb.Provider,{value:r,children:e}),[])})});i2(function(e){return i8("div",lM(e))});var lx=i5(function(e){let{store:t,...r}=e;return lM(r)});i2(function(e){return i8("div",lx(e))});var lE=i5(function(e){let{store:t,...r}=e,n=aX();return iM(t=t||n,!1),"grid"===ih(t.useState("contentElement"))&&(r={role:"rowgroup",...r}),r=lx({store:t,...r})}),lF=i2(function(e){return i8("div",lE(e))}),lS=i5(function(e){let t=(0,el.useContext)(lb),r=iQ(e.id);return iJ(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),iF(e={id:r,"aria-hidden":!0,...e})});i2(function(e){return i8("div",lS(e))});var lT=i5(function(e){let{store:t,...r}=e;return lS(r)});i2(function(e){return i8("div",lT(e))});var lw=i5(function(e){return lT(e)}),lR=i2(function(e){return i8("div",lw(e))}),lD=e.i(38360);let lI={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},lG=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function lL(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{keys:n,threshold:i=lI.MATCHES,baseSort:a=lG,sorter:o=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:a,keyIndex:o}=t;return n!==a?n>a?-1:1:i===o?r(e,t):i{let{rank:n,rankedValue:i,keyIndex:a,keyThreshold:o}=e,{itemValue:s,attributes:l}=t,d=lP(s,u,c),f=i,{minRanking:h,maxRanking:m,threshold:p}=l;return d=lI.MATCHES?d=h:d>m&&(d=m),d>n&&(n=d,a=r,o=p,f=s),{rankedValue:f,rank:n,keyIndex:a,keyThreshold:o}},{rankedValue:s,rank:lI.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:s,rank:lP(s,u,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:f,keyThreshold:h=i}=d;return f>=h&&e.push({...d,item:a,index:o}),e},[])).map(e=>{let{item:t}=e;return t})}function lP(e,t,r){if(e=lH(e,r),(t=lH(t,r)).length>e.length)return lI.NO_MATCH;if(e===t)return lI.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),a=i.value;if(e.length===t.length&&0===a)return lI.EQUAL;if(0===a)return lI.STARTS_WITH;let o=i;for(;!o.done;){if(o.value>0&&" "===e[o.value-1])return lI.WORD_STARTS_WITH;o=n.next()}return a>0?lI.CONTAINS:1===t.length?lI.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return lI.NO_MATCH;var o=n-a;let s=r/t.length;return lI.MATCHES+1/o*s}(e,t)}function lH(e,t){let{keepDiacritics:r}=t;return e="".concat(e),r||(e=(0,lD.default)(e)),e}lL.rankings=lI;let lO={maxRanking:1/0,minRanking:-1/0};var l_=e.i(29402);let lk=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),lU={"missions.vl2":"Official","TR2final105-client.vl2":"Team Rabbit 2","z_mappacks/CTF/Classic_maps_v1.vl2":"Classic","z_mappacks/CTF/DynamixFinalPack.vl2":"Official","z_mappacks/CTF/KryMapPack_b3EDIT.vl2":"KryMapPack","z_mappacks/CTF/S5maps.vl2":"S5","z_mappacks/CTF/S8maps.vl2":"S8","z_mappacks/CTF/TWL-MapPack.vl2":"TWL","z_mappacks/CTF/TWL-MapPackEDIT.vl2":"TWL","z_mappacks/CTF/TWL2-MapPack.vl2":"TWL2","z_mappacks/CTF/TWL2-MapPackEDIT.vl2":"TWL2","z_mappacks/TWL_T2arenaOfficialMaps.vl2":"Arena","z_mappacks/z_DMP2-V0.6.vl2":"DMP2 (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX.vl2":"DMP (Discord Map Pack)"},lj={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},lJ=(0,nw.getMissionList)().filter(e=>!lk.has(e)).map(e=>{var t,r;let n=(0,nw.getMissionInfo)(e),[i]=(0,nw.getSourceAndPath)(n.resourcePath),a=(e=>{let t=e.match(/^(.*)(\/[^/]+)$/);return t?t[1]:""})(i),o=null!=(r=null!=(t=lU[i])?t:lj[a])?r:null;return{resourcePath:n.resourcePath,missionName:e,displayName:n.displayName,sourcePath:i,groupName:o,missionTypes:n.missionTypes}}),lN=new Map(lJ.map(e=>[e.missionName,e])),lK=function(e){let t=new Map;for(let n of e){var r;let e=null!=(r=t.get(n.groupName))?r:[];e.push(n),t.set(n.groupName,e)}return t.forEach((e,r)=>{t.set(r,(0,l_.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,l_.default)(Array.from(t.entries()),[e=>{let[t]=e;return"Official"===t?0:null==t?2:1},e=>{let[t]=e;return t?t.toLowerCase():""}],["asc","asc"])}(lJ),lQ="undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function lW(e){let{mission:t}=e;return(0,es.jsxs)(es.Fragment,{children:[(0,es.jsxs)("span",{className:"MissionSelect-itemHeader",children:[(0,es.jsx)("span",{className:"MissionSelect-itemName",children:t.displayName||t.missionName}),t.missionTypes.length>0&&(0,es.jsx)("span",{className:"MissionSelect-itemTypes",children:t.missionTypes.map(e=>(0,es.jsx)("span",{className:"MissionSelect-itemType",children:e},e))})]}),(0,es.jsx)("span",{className:"MissionSelect-itemMissionName",children:t.missionName})]})}function lV(e){let{value:t,onChange:r}=e,[n,i]=(0,el.useState)(""),a=(0,el.useRef)(null),o=lC({resetValueOnHide:!0,selectedValue:t,setSelectedValue:e=>{e&&r(e)},setValue:e=>{(0,el.startTransition)(()=>i(e))}});(0,el.useEffect)(()=>{let e=e=>{if("k"===e.key&&(e.metaKey||e.ctrlKey)){var t;e.preventDefault(),null==(t=a.current)||t.focus(),o.show()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]);let s=lN.get(t),l=(0,el.useMemo)(()=>n?{type:"flat",missions:lL(lJ,n,{keys:["displayName","missionName"]})}:{type:"grouped",groups:lK},[n]),u=s?s.displayName||s.missionName:t,c="flat"===l.type?0===l.missions.length:0===l.groups.length;return(0,es.jsxs)(ly,{store:o,children:[(0,es.jsxs)("div",{className:"MissionSelect-inputWrapper",children:[(0,es.jsx)(on,{ref:a,autoSelect:!0,placeholder:u,className:"MissionSelect-input",onFocus:()=>{document.exitPointerLock(),o.show()}}),(0,es.jsx)("kbd",{className:"MissionSelect-shortcut",children:lQ?"⌘K":"^K"})]}),(0,es.jsx)(lc,{gutter:4,fitViewport:!0,className:"MissionSelect-popover",children:(0,es.jsxs)(oT,{className:"MissionSelect-list",children:["flat"===l.type?l.missions.map(e=>(0,es.jsx)(oC,{value:e.missionName,className:"MissionSelect-item",focusOnHover:!0,children:(0,es.jsx)(lW,{mission:e})},e.missionName)):l.groups.map(e=>{let[t,r]=e;return t?(0,es.jsxs)(lF,{className:"MissionSelect-group",children:[(0,es.jsx)(lR,{className:"MissionSelect-groupLabel",children:t}),r.map(e=>(0,es.jsx)(oC,{value:e.missionName,className:"MissionSelect-item",focusOnHover:!0,children:(0,es.jsx)(lW,{mission:e})},e.missionName))]},t):(0,es.jsx)(el.Fragment,{children:r.map(e=>(0,es.jsx)(oC,{value:e.missionName,className:"MissionSelect-item",focusOnHover:!0,children:(0,es.jsx)(lW,{mission:e})},e.missionName))},"ungrouped")}),c&&(0,es.jsx)("div",{className:"MissionSelect-noResults",children:"No missions found"})]})})]})}function lX(e){let{missionName:t,onChangeMission:r}=e,{fogEnabled:n,setFogEnabled:i,fov:a,setFov:o,audioEnabled:s,setAudioEnabled:l,animationEnabled:u,setAnimationEnabled:c}=(0,tw.useSettings)(),{speedMultiplier:d,setSpeedMultiplier:f}=(0,tw.useControls)(),{debugMode:h,setDebugMode:m}=(0,tw.useDebug)();return(0,es.jsxs)("div",{id:"controls",onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,es.jsx)(lV,{value:t,onChange:r}),(0,es.jsxs)("div",{className:"CheckboxField",children:[(0,es.jsx)("input",{id:"fogInput",type:"checkbox",checked:n,onChange:e=>{i(e.target.checked)}}),(0,es.jsx)("label",{htmlFor:"fogInput",children:"Fog?"})]}),(0,es.jsxs)("div",{className:"CheckboxField",children:[(0,es.jsx)("input",{id:"audioInput",type:"checkbox",checked:s,onChange:e=>{l(e.target.checked)}}),(0,es.jsx)("label",{htmlFor:"audioInput",children:"Audio?"})]}),(0,es.jsxs)("div",{className:"CheckboxField",children:[(0,es.jsx)("input",{id:"animationInput",type:"checkbox",checked:u,onChange:e=>{c(e.target.checked)}}),(0,es.jsx)("label",{htmlFor:"animationInput",children:"Animation?"})]}),(0,es.jsxs)("div",{className:"CheckboxField",children:[(0,es.jsx)("input",{id:"debugInput",type:"checkbox",checked:h,onChange:e=>{m(e.target.checked)}}),(0,es.jsx)("label",{htmlFor:"debugInput",children:"Debug?"})]}),(0,es.jsxs)("div",{className:"Field",children:[(0,es.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),(0,es.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:a,onChange:e=>o(parseInt(e.target.value))}),(0,es.jsx)("output",{htmlFor:"speedInput",children:a})]}),(0,es.jsxs)("div",{className:"Field",children:[(0,es.jsx)("label",{htmlFor:"speedInput",children:"Speed"}),(0,es.jsx)("input",{id:"speedInput",type:"range",min:.1,max:5,step:.05,value:d,onChange:e=>f(parseFloat(e.target.value))})]})]})}let lq=el.forwardRef((e,t)=>{let{envMap:r,resolution:n=256,frames:i=1/0,makeDefault:a,children:o,...s}=e,l=(0,tE.useThree)(e=>{let{set:t}=e;return t}),u=(0,tE.useThree)(e=>{let{camera:t}=e;return t}),c=(0,tE.useThree)(e=>{let{size:t}=e;return t}),d=el.useRef(null);el.useImperativeHandle(t,()=>d.current,[]);let f=el.useRef(null),h=function(e,t,r){let n=(0,tE.useThree)(e=>e.size),i=(0,tE.useThree)(e=>e.viewport),a="number"==typeof e?e:n.width*i.dpr,o=n.height*i.dpr,s=("number"==typeof e?void 0:e)||{},{samples:l=0,depth:u,...c}=s,d=null!=u?u:s.depthBuffer,f=el.useMemo(()=>{let e=new ef.WebGLRenderTarget(a,o,{minFilter:ef.LinearFilter,magFilter:ef.LinearFilter,type:ef.HalfFloatType,...c});return d&&(e.depthTexture=new ef.DepthTexture(a,o,ef.FloatType)),e.samples=l,e},[]);return el.useLayoutEffect(()=>{f.setSize(a,o),l&&(f.samples=l)},[l,f,a,o]),el.useEffect(()=>()=>f.dispose(),[]),f}(n);el.useLayoutEffect(()=>{s.manual||(d.current.aspect=c.width/c.height)},[c,s]),el.useLayoutEffect(()=>{d.current.updateProjectionMatrix()});let m=0,p=null,A="function"==typeof o;return(0,tx.useFrame)(e=>{A&&(i===1/0||m{if(a)return l(()=>({camera:d.current})),()=>l(()=>({camera:u}))},[d,a,l]),el.createElement(el.Fragment,null,el.createElement("perspectiveCamera",(0,tW.default)({ref:d},s),!A&&o),el.createElement("group",{ref:f},A&&o(h.texture)))});function lY(){let{fov:e}=(0,tw.useSettings)();return(0,es.jsx)(lq,{makeDefault:!0,position:[0,256,0],fov:e})}var lz=e.i(51434),lZ=e.i(81405);function l$(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function l0(e){let{showPanel:t=0,className:r,parent:n}=e,i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,[n,i]=el.useState();return el.useLayoutEffect(()=>{let t=e();return i(t),l$(r,t),()=>l$(r,null)},t),n}(()=>new lZ.default,[]);return el.useEffect(()=>{if(i){let e=n&&n.current||document.body;i.showPanel(t),null==e||e.appendChild(i.dom);let a=(null!=r?r:"").split(" ").filter(e=>e);a.length&&i.dom.classList.add(...a);let o=(0,ec.j)(()=>i.begin()),s=(0,ec.k)(()=>i.end());return()=>{a.length&&i.dom.classList.remove(...a),null==e||e.removeChild(i.dom),o(),s()}}},[n,i,r,t]),null}var l1=e.i(60099);function l9(){let{debugMode:e}=(0,tw.useDebug)(),t=(0,el.useRef)(null);return(0,el.useEffect)(()=>{let e=t.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")}),e?(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)(l0,{className:"StatsPanel"}),(0,es.jsx)("axesHelper",{ref:t,args:[70],renderOrder:999,children:(0,es.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),(0,es.jsx)(l1.Html,{position:[80,0,0],center:!0,children:(0,es.jsx)("span",{className:"AxisLabel","data-axis":"y",children:"Y"})}),(0,es.jsx)(l1.Html,{position:[0,80,0],center:!0,children:(0,es.jsx)("span",{className:"AxisLabel","data-axis":"z",children:"Z"})}),(0,es.jsx)(l1.Html,{position:[0,0,80],center:!0,children:(0,es.jsx)("span",{className:"AxisLabel","data-axis":"x",children:"X"})})]}):null}let l2=new nJ,l3={toneMapping:ef.NoToneMapping,outputColorSpace:ef.SRGBColorSpace};function l8(){let e=(0,eu.useSearchParams)(),t=(0,eu.useRouter)(),[r,n]=(0,el.useState)(e.get("mission")||"TWL2_WoodyMyrk"),[i,a]=(0,el.useState)(0),[o,s]=(0,el.useState)(!0),l=i<1;(0,el.useEffect)(()=>{if(l)s(!0);else{let e=setTimeout(()=>s(!1),500);return()=>clearTimeout(e)}},[l]),(0,el.useEffect)(()=>(window.setMissionName=n,window.getMissionList=nw.getMissionList,window.getMissionInfo=nw.getMissionInfo,()=>{delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo}),[]),(0,el.useEffect)(()=>{let e=new URLSearchParams;e.set("mission",r),t.replace("?".concat(e.toString()),{scroll:!1})},[r,t]);let u=(0,el.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;a(t)},[]);return(0,es.jsx)(tA,{client:l2,children:(0,es.jsx)("main",{children:(0,es.jsxs)(tw.SettingsProvider,{children:[(0,es.jsxs)("div",{id:"canvasContainer",children:[o&&(0,es.jsxs)("div",{id:"loadingIndicator","data-complete":!l,children:[(0,es.jsx)("div",{className:"LoadingSpinner"}),(0,es.jsx)("div",{className:"LoadingProgress",children:(0,es.jsx)("div",{className:"LoadingProgress-bar",style:{width:"".concat(100*i,"%")}})}),(0,es.jsxs)("div",{className:"LoadingProgress-text",children:[Math.round(100*i),"%"]})]}),(0,es.jsx)(ev,{frameloop:"always",gl:l3,shadows:"soft",children:(0,es.jsx)(nb,{children:(0,es.jsxs)(lz.AudioProvider,{children:[(0,es.jsx)(nG,{name:r,onLoadingChange:u},r),(0,es.jsx)(lY,{}),(0,es.jsx)(l9,{}),(0,es.jsx)(n4,{})]})})})]}),(0,es.jsx)(lX,{missionName:r,onChangeMission:n})]})})})}function l5(){return(0,es.jsx)(el.Suspense,{children:(0,es.jsx)(l8,{})})}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/a99c02adf7563d85.js b/docs/_next/static/chunks/a99c02adf7563d85.js deleted file mode 100644 index 0fdbaacf..00000000 --- a/docs/_next/static/chunks/a99c02adf7563d85.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47071,80520,e=>{"use strict";e.s(["useTexture",()=>a],47071);var t=e.i(71645),n=e.i(90072),r=e.i(16096);e.s(["useLoader",()=>i.G],80520);var i=e.i(46712),i=i;let o=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let l=(0,r.useThree)(e=>e.gl),s=(0,i.G)(n.TextureLoader,o(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(s)},[a]),(0,t.useEffect)(()=>{if("initTexture"in l){let e=[];Array.isArray(s)?e=s:s instanceof n.Texture?e=[s]:o(s)&&(e=Object.values(s)),e.forEach(e=>{e instanceof n.Texture&&l.initTexture(e)})}},[l,s]),(0,t.useMemo)(()=>{if(!o(e))return s;{let t={},n=0;for(let r in e)t[r]=s[n++];return t}},[e,s])}a.preload=e=>i.G.preload(n.TextureLoader,e),a.clear=e=>i.G.clear(n.TextureLoader,e)},6112,51475,77482,e=>{"use strict";e.s(["useDatablock",()=>u],6112),e.s(["RuntimeProvider",()=>s,"useRuntime",()=>c],77482);var t=e.i(43476),n=e.i(71645);e.s(["TickProvider",()=>o,"useTick",()=>a],51475);var r=e.i(5230);let i=(0,n.createContext)(null);function o(e){let{children:o}=e,a=(0,n.useRef)(void 0),l=(0,n.useRef)(0),s=(0,n.useRef)(0);(0,r.useFrame)((e,t)=>{for(l.current+=t;l.current>=.03125;)if(l.current-=.03125,s.current++,a.current)for(let e of a.current)e(s.current)});let c=(0,n.useCallback)(e=>(null!=a.current||(a.current=new Set),a.current.add(e),()=>{a.current.delete(e)}),[]),u=(0,n.useCallback)(()=>s.current,[]),f=(0,n.useMemo)(()=>({subscribe:c,getTick:u}),[c,u]);return(0,t.jsx)(i.Provider,{value:f,children:o})}function a(e){let t=(0,n.useContext)(i);if(!t)throw Error("useTick must be used within a TickProvider");let r=(0,n.useRef)(e);r.current=e,(0,n.useEffect)(()=>t.subscribe(e=>r.current(e)),[t])}let l=(0,n.createContext)(null);function s(e){let{runtime:n,children:r}=e;return(0,t.jsx)(l.Provider,{value:n,children:(0,t.jsx)(o,{children:r})})}function c(){let e=(0,n.useContext)(l);if(!e)throw Error("useRuntime must be used within a RuntimeProvider");return e}function u(e){let t=c();if(e)return t.state.datablocks.get(e)}},75567,e=>{"use strict";e.s(["setupAlphaTestedTexture",()=>i,"setupColor",()=>r,"setupMask",()=>o]);var t=e.i(90072);function n(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{repeat:r=[1,1],disableMipmaps:i=!1}=n;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...r),e.flipY=!1,e.anisotropy=16,i?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[1,1];return n(e,{repeat:t})}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[1,1];return n(e,{repeat:t,disableMipmaps:!0})}function o(e){let n=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return n.colorSpace=t.NoColorSpace,n.wrapS=n.wrapT=t.RepeatWrapping,n.generateMipmaps=!1,n.minFilter=t.LinearFilter,n.magFilter=t.LinearFilter,n.needsUpdate=!0,n}},47021,e=>{"use strict";e.s(["fogFragmentShader",()=>n,"injectCustomFog",()=>i,"installCustomFogShader",()=>r]);var t=e.i(8560);let n="\n#ifdef USE_FOG\n float dist = vFogDepth;\n\n // Discard fragments at or beyond visible distance - matches Torque's behavior\n // where objects beyond visibleDistance are not rendered at all.\n // This prevents fully-fogged geometry from showing as silhouettes against\n // the sky's fog-to-sky gradient.\n if (dist >= fogFar) {\n discard;\n }\n\n // Step 1: Calculate distance-based haze (quadratic falloff)\n // Since we discard at fogFar, haze never reaches 1.0 here\n float haze = 0.0;\n if (dist > fogNear) {\n float fogScale = 1.0 / (fogFar - fogNear);\n float distFactor = (dist - fogNear) * fogScale - 1.0;\n haze = 1.0 - distFactor * distFactor;\n }\n\n // Step 2: Calculate fog volume contributions\n // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false)\n // All fog uses the global fogColor - see Tribes2_Fog_System.md for details\n float volumeFog = 0.0;\n\n #ifdef USE_VOLUMETRIC_FOG\n {\n #ifdef USE_FOG_WORLD_POSITION\n float fragmentHeight = vFogWorldPosition.y;\n #else\n float fragmentHeight = cameraHeight;\n #endif\n\n float deltaY = fragmentHeight - cameraHeight;\n float absDeltaY = abs(deltaY);\n\n // Determine if we're going up (positive) or down (negative)\n if (absDeltaY > 0.01) {\n // Non-horizontal ray: ray-march through fog volumes\n for (int i = 0; i < 3; i++) {\n int offset = i * 4;\n float volVisDist = fogVolumeData[offset + 0];\n float volMinH = fogVolumeData[offset + 1];\n float volMaxH = fogVolumeData[offset + 2];\n float volPct = fogVolumeData[offset + 3];\n\n // Skip inactive volumes (visibleDistance = 0)\n if (volVisDist <= 0.0) continue;\n\n // Calculate fog factor for this volume\n // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage\n // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0)\n // Since we don't have quality settings, we use visFactor = 1.0\n float factor = (1.0 / volVisDist) * volPct;\n\n // Find ray intersection with this volume's height range\n float rayMinY = min(cameraHeight, fragmentHeight);\n float rayMaxY = max(cameraHeight, fragmentHeight);\n\n // Check if ray intersects volume height range\n if (rayMinY < volMaxH && rayMaxY > volMinH) {\n float intersectMin = max(rayMinY, volMinH);\n float intersectMax = min(rayMaxY, volMaxH);\n float intersectHeight = intersectMax - intersectMin;\n\n // Calculate distance traveled through this volume using similar triangles:\n // subDist / dist = intersectHeight / absDeltaY\n float subDist = dist * (intersectHeight / absDeltaY);\n\n // Accumulate fog: fog += subDist * factor\n volumeFog += subDist * factor;\n }\n }\n } else {\n // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume\n for (int i = 0; i < 3; i++) {\n int offset = i * 4;\n float volVisDist = fogVolumeData[offset + 0];\n float volMinH = fogVolumeData[offset + 1];\n float volMaxH = fogVolumeData[offset + 2];\n float volPct = fogVolumeData[offset + 3];\n\n if (volVisDist <= 0.0) continue;\n\n // If camera is inside this volume, apply fog for full distance\n if (cameraHeight >= volMinH && cameraHeight <= volMaxH) {\n float factor = (1.0 / volVisDist) * volPct;\n volumeFog += dist * factor;\n }\n }\n }\n }\n #endif\n\n // Step 3: Combine haze and volume fog\n // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct\n // This gives fog volumes priority over haze\n float volPct = min(volumeFog, 1.0);\n float hazePct = haze;\n if (volPct + hazePct > 1.0) {\n hazePct = 1.0 - volPct;\n }\n float fogFactor = hazePct + volPct;\n\n // Apply fog using global fogColor (per-volume colors not used in Tribes 2)\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif\n";function r(){t.ShaderChunk.fog_pars_fragment="\n#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n\n // Custom volumetric fog uniforms (only defined when USE_VOLUMETRIC_FOG is set)\n // Format: [visDist, minH, maxH, percentage] x 3 volumes = 12 floats\n #ifdef USE_VOLUMETRIC_FOG\n uniform float fogVolumeData[12];\n uniform float cameraHeight;\n #endif\n\n #ifdef USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n #endif\n#endif\n",t.ShaderChunk.fog_fragment=n,t.ShaderChunk.fog_pars_vertex="\n#ifdef USE_FOG\n varying float vFogDepth;\n #ifdef USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n #endif\n#endif\n",t.ShaderChunk.fog_vertex="\n#ifdef USE_FOG\n // Use Euclidean distance from camera, not view-space z-depth\n // This ensures fog doesn't change when rotating the camera\n vFogDepth = length(mvPosition.xyz);\n #ifdef USE_FOG_WORLD_POSITION\n vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz;\n #endif\n#endif\n"}function i(e,t){e.uniforms.fogVolumeData=t.fogVolumeData,e.uniforms.cameraHeight=t.cameraHeight,e.vertexShader=e.vertexShader.replace("#include ","#include \n#ifdef USE_FOG\n #define USE_FOG_WORLD_POSITION\n #define USE_VOLUMETRIC_FOG\n varying vec3 vFogWorldPosition;\n#endif"),e.vertexShader=e.vertexShader.replace("#include ","#include \n#ifdef USE_FOG\n vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz;\n#endif"),e.fragmentShader=e.fragmentShader.replace("#include ","#include \n#ifdef USE_FOG\n #define USE_VOLUMETRIC_FOG\n uniform float fogVolumeData[12];\n uniform float cameraHeight;\n #define USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n#endif"),e.fragmentShader=e.fragmentShader.replace("#include ",n)}},48066,e=>{"use strict";e.s(["globalFogUniforms",()=>t,"packFogVolumeData",()=>i,"resetGlobalFogUniforms",()=>r,"updateGlobalFogUniforms",()=>n]);let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0}};function n(e,n){t.cameraHeight.value=e,t.fogVolumeData.value.set(n)}function r(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0)}function i(e){let t=new Float32Array(12);for(let n=0;n<3;n++){let r=4*n,i=e[n];i&&(t[r+0]=i.visibleDistance,t[r+1]=i.minHeight,t[r+2]=i.maxHeight,t[r+3]=i.percentage)}return t}},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},77975,e=>{"use strict";e.s(["useDistanceFromCamera",()=>o],77975);var t=e.i(5230),n=e.i(16096),r=e.i(71645),i=e.i(90072);function o(e){let{camera:o}=(0,n.useThree)(),a=(0,r.useRef)(null),l=function(e){let n=(0,r.useRef)(null);return(0,t.useFrame)(()=>{e.current&&(null!=n.current||(n.current=new i.Vector3),e.current.getWorldPosition(n.current))}),n}(e);return(0,t.useFrame)(()=>{l.current?a.current=o.position.distanceTo(l.current):a.current=null}),a}},89887,60099,e=>{"use strict";let t,n;e.s(["FloatingLabel",()=>M],89887);var r=e.i(43476),i=e.i(71645),o=e.i(77975),a=e.i(5230);e.s(["Html",()=>F],60099);var l=e.i(31067),s=e.i(88014),c=e.i(90072),u=e.i(16096);let f=new c.Vector3,d=new c.Vector3,m=new c.Vector3,g=new c.Vector2;function h(e,t,n){let r=f.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,o=n.height/2;return[r.x*i+i,-(r.y*o)+o]}let v=e=>1e-10>Math.abs(e)?0:e;function p(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="matrix3d(";for(let n=0;16!==n;n++)r+=v(t[n]*e.elements[n])+(15!==n?",":")");return n+r}let x=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>p(e,t)),y=(n=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>p(e,n(t),"translate(-50%,-50%)")),F=i.forwardRef((e,t)=>{let{children:n,eps:r=.001,style:o,className:p,prepend:F,center:b,fullscreen:M,portal:S,distanceFactor:P,sprite:_=!1,transform:D=!1,occlude:T,onOcclude:E,castShadow:w,receiveShadow:O,material:C,geometry:H,zIndexRange:R=[0x1000037,0],calculatePosition:W=h,as:V="div",wrapperClass:L,pointerEvents:U="auto",...z}=e,{gl:G,camera:k,scene:A,size:I,raycaster:j,events:N,viewport:Y}=(0,u.useThree)(),[q]=i.useState(()=>document.createElement(V)),B=i.useRef(null),K=i.useRef(null),X=i.useRef(0),Z=i.useRef([0,0]),$=i.useRef(null),J=i.useRef(null),Q=(null==S?void 0:S.current)||N.connected||G.domElement.parentNode,ee=i.useRef(null),et=i.useRef(!1),en=i.useMemo(()=>T&&"blending"!==T||Array.isArray(T)&&T.length&&function(e){return e&&"object"==typeof e&&"current"in e}(T[0]),[T]);i.useLayoutEffect(()=>{let e=G.domElement;T&&"blending"===T?(e.style.zIndex="".concat(Math.floor(R[0]/2)),e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[T]),i.useLayoutEffect(()=>{if(K.current){let e=B.current=s.createRoot(q);if(A.updateMatrixWorld(),D)q.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=W(K.current,k,I);q.style.cssText="position:absolute;top:0;left:0;transform:translate3d(".concat(e[0],"px,").concat(e[1],"px,0);transform-origin:0 0;")}return Q&&(F?Q.prepend(q):Q.appendChild(q)),()=>{Q&&Q.removeChild(q),e.unmount()}}},[Q,D]),i.useLayoutEffect(()=>{L&&(q.className=L)},[L]);let er=i.useMemo(()=>D?{position:"absolute",top:0,left:0,width:I.width,height:I.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:b?"translate3d(-50%,-50%,0)":"none",...M&&{top:-I.height/2,left:-I.width/2,width:I.width,height:I.height},...o},[o,b,M,I,D]),ei=i.useMemo(()=>({position:"absolute",pointerEvents:U}),[U]);i.useLayoutEffect(()=>{var e,r;et.current=!1,D?null==(e=B.current)||e.render(i.createElement("div",{ref:$,style:er},i.createElement("div",{ref:J,style:ei},i.createElement("div",{ref:t,className:p,style:o,children:n})))):null==(r=B.current)||r.render(i.createElement("div",{ref:t,style:er,className:p,children:n}))});let eo=i.useRef(!0);(0,a.useFrame)(e=>{if(K.current){k.updateMatrixWorld(),K.current.updateWorldMatrix(!0,!1);let e=D?Z.current:W(K.current,k,I);if(D||Math.abs(X.current-k.zoom)>r||Math.abs(Z.current[0]-e[0])>r||Math.abs(Z.current[1]-e[1])>r){let t=function(e,t){let n=f.setFromMatrixPosition(e.matrixWorld),r=d.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),o=t.getWorldDirection(m);return i.angleTo(o)>Math.PI/2}(K.current,k),n=!1;en&&(Array.isArray(T)?n=T.map(e=>e.current):"blending"!==T&&(n=[A]));let r=eo.current;n?eo.current=function(e,t,n,r){let i=f.setFromMatrixPosition(e.matrixWorld),o=i.clone();o.project(t),g.set(o.x,o.y),n.setFromCamera(g,t);let a=n.intersectObjects(r,!0);if(a.length){let e=a[0].distance;return i.distanceTo(n.ray.origin)({vertexShader:D?void 0:'\n /*\n This shader is from the THREE\'s SpriteMaterial.\n We need to turn the backing plane into a Sprite\n (make it always face the camera) if "transfrom"\n is false.\n */\n #include \n\n void main() {\n vec2 center = vec2(0., 1.);\n float rotation = 0.0;\n\n // This is somewhat arbitrary, but it seems to work well\n // Need to figure out how to derive this dynamically if it even matters\n float size = 0.03;\n\n vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n vec2 scale;\n scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n\n gl_Position = projectionMatrix * mvPosition;\n }\n ',fragmentShader:"\n void main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n "}),[D]);return i.createElement("group",(0,l.default)({},z,{ref:K}),T&&!en&&i.createElement("mesh",{castShadow:w,receiveShadow:O,ref:ee},H||i.createElement("planeGeometry",null),C||i.createElement("shaderMaterial",{side:c.DoubleSide,vertexShader:ea.vertexShader,fragmentShader:ea.fragmentShader})))}),b=[0,0,0],M=(0,i.memo)(function(e){let{children:t,color:n="white",position:l=b,opacity:s="fadeWithDistance"}=e,c="fadeWithDistance"===s,u=(0,i.useRef)(null),f=(0,o.useDistanceFromCamera)(u),[d,m]=(0,i.useState)(0!==s),g=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(c&&g.current&&null!=f.current){let e=Math.max(0,Math.min(1,1-f.current/200));g.current.style.opacity=e.toString()}},[d,c]),(0,a.useFrame)(()=>{if(c){let e=f.current,t=null!=e&&e<200;if(d!==t&&m(t),g.current&&t){let t=Math.max(0,Math.min(1,1-e/200));g.current.style.opacity=t.toString()}}else m(0!==s),g.current&&(g.current.style.opacity=s.toString())}),(0,r.jsx)("group",{ref:u,children:d?(0,r.jsx)(F,{position:l,center:!0,children:(0,r.jsx)("div",{ref:g,className:"StaticShapeLabel",style:{color:n},children:t})}):null})})},51434,e=>{"use strict";e.s(["AudioProvider",()=>a,"useAudio",()=>l]);var t=e.i(43476),n=e.i(71645),r=e.i(16096),i=e.i(90072);let o=(0,n.createContext)(void 0);function a(e){let{children:a}=e,{camera:l}=(0,r.useThree)(),[s,c]=(0,n.useState)({audioLoader:null,audioListener:null});return(0,n.useEffect)(()=>{let e=new i.AudioLoader,t=l.children.find(e=>e instanceof i.AudioListener);t||(t=new i.AudioListener,l.add(t)),c({audioLoader:e,audioListener:t})},[l]),(0,t.jsx)(o.Provider,{value:s,children:a})}function l(){let e=(0,n.useContext)(o);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}},61921,e=>{e.v(t=>Promise.all(["static/chunks/5342f4b5b8c465ca.js"].map(t=>e.l(t))).then(()=>t(29055)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/40a2f59d0c05dc35.js"].map(t=>e.l(t))).then(()=>t(63724)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/f863efae27259b81.js"].map(t=>e.l(t))).then(()=>t(42585)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/49f75d30e4f6ac74.js b/docs/_next/static/chunks/c3ce0157f6850d44.js similarity index 99% rename from docs/_next/static/chunks/49f75d30e4f6ac74.js rename to docs/_next/static/chunks/c3ce0157f6850d44.js index f22157c5..ba339dd5 100644 --- a/docs/_next/static/chunks/49f75d30e4f6ac74.js +++ b/docs/_next/static/chunks/c3ce0157f6850d44.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24478,(e,t,n)=>{"use strict";n.ConcurrentRoot=1,n.ContinuousEventPriority=8,n.DefaultEventPriority=32,n.DiscreteEventPriority=2,n.IdleEventPriority=0x10000000,n.LegacyRoot=0,n.NoEventPriority=0},39695,(e,t,n)=>{"use strict";t.exports=e.r(24478)},55838,(e,t,n)=>{"use strict";var r=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,s=r.useEffect,o=r.useLayoutEffect,l=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,c=r[1];return o(function(){i.value=n,i.getSnapshot=t,u(i)&&c({inst:i})},[e,n,t]),s(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),l(n),n};n.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},2239,(e,t,n)=>{"use strict";t.exports=e.r(55838)},52822,(e,t,n)=>{"use strict";var r=e.r(71645),i=e.r(2239),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=i.useSyncExternalStore,o=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;n.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var h=o(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;var p=s(e,(h=u(function(){function e(e){if(!l){if(l=!0,s=e,e=r(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return o=t}return o=e}if(t=o,a(s,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(s=e,t):(s=e,o=n)}var s,o,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,n,r,i]))[0],h[1]);return l(function(){d.hasValue=!0,d.value=p},[p]),c(p),p}},30224,(e,t,n)=>{"use strict";t.exports=e.r(52822)},29779,(e,t,n)=>{"use strict";function r(e,t){var n=e.length;for(e.push(t);0>>1,i=e[r];if(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[o]=n,r=o);else if(us(c,n))e[r]=c,e[u]=n,r=u;else break}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(n.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();n.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,f=null,m=3,g=!1,v=!1,y=!1,_="function"==typeof setTimeout?setTimeout:null,x="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=i(d);null!==t;){if(null===t.callback)a(d);else if(t.startTime<=e)a(d),t.sortIndex=t.expirationTime,r(h,t);else break;t=i(d)}}function M(e){if(y=!1,S(e),!v)if(null!==i(h))v=!0,L();else{var t=i(d);null!==t&&N(M,t.startTime-e)}}var w=!1,E=-1,T=5,A=-1;function C(){return!(n.unstable_now()-Ae&&C());){var s=f.callback;if("function"==typeof s){f.callback=null,m=f.priorityLevel;var l=s(f.expirationTime<=e);if(e=n.unstable_now(),"function"==typeof l){f.callback=l,S(e),t=!0;break t}f===i(h)&&a(h),S(e)}else a(h);f=i(h)}if(null!==f)t=!0;else{var u=i(d);null!==u&&N(M,u.startTime-e),t=!1}}break e}finally{f=null,m=r,g=!1}}}finally{t?o():w=!1}}}if("function"==typeof b)o=function(){b(R)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,I=P.port2;P.port1.onmessage=R,o=function(){I.postMessage(null)}}else o=function(){_(R,0)};function L(){w||(w=!0,o())}function N(e,t){E=_(function(){e(n.unstable_now())},t)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(e){e.callback=null},n.unstable_continueExecution=function(){v||g||(v=!0,L())},n.unstable_forceFrameRate=function(e){0>e||125s?(e.sortIndex=a,r(d,e),null===i(h)&&e===i(d)&&(y?(x(E),E=-1):y=!0,N(M,a-s))):(e.sortIndex=o,r(h,e),v||g||(v=!0,L())),e},n.unstable_shouldYield=C,n.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}},51849,(e,t,n)=>{"use strict";t.exports=e.r(29779)},40336,(e,t,n)=>{"use strict";var r=e.i(47167);t.exports=function(t){function n(e,t,n,r){return new rP(e,t,n,r)}function i(){}function a(e){var t="https://react.dev/errors/"+e;if(1)":-1i||u[r]!==c[i]){var h="\n"+u[r].replace(" at new "," at ");return e.displayName&&h.includes("")&&(h=h.replace("",e.displayName)),h}while(1<=r&&0<=i)break}}}finally{io=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?l(n):""}function c(e){try{var t="";do t+=function(e){switch(e.tag){case 26:case 27:case 5:return l(e.type);case 16:return l("Lazy");case 13:return l("Suspense");case 19:return l("SuspenseList");case 0:case 15:return u(e.type,!1);case 11:return u(e.type.render,!1);case 1:return u(e.type,!0);default:return""}}(e),e=e.return;while(e)return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}function h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do 0!=(4098&(t=e).flags)&&(n=t.return),e=t.return;while(e)}return 3===t.tag?n:null}function d(e){if(h(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(null===(t=h(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(r=i.return)){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return d(i),e;if(s===r)return d(i),t;s=s.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){return{current:e}}function m(e){0>a4||(e.current=a3[a4],a3[a4]=null,a4--)}function g(e,t){a3[++a4]=e.current,e.current=t}function v(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194176&e;case 4194304:case 8388608:case 0x1000000:case 0x2000000:return 0x3c00000&e;case 0x4000000:return 0x4000000;case 0x8000000:return 0x8000000;case 0x10000000:return 0x10000000;case 0x20000000:return 0x20000000;case 0x40000000:return 0;default:return e}}function y(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,s=e.warmLanes;e=0!==e.finishedLanes;var o=0x7ffffff&n;return 0!==o?0!=(n=o&~i)?r=v(n):0!=(a&=o)?r=v(a):e||0!=(s=o&~s)&&(r=v(s)):0!=(o=n&~i)?r=v(o):0!==a?r=v(a):e||0!=(s=n&~s)&&(r=v(s)),0===r?0:0!==t&&t!==r&&0==(t&i)&&((i=r&-r)>=(s=t&-t)||32===i&&0!=(4194176&s))?t:r}function _(e,t){return 0==(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function x(){var e=a7;return 0==(4194176&(a7<<=1))&&(a7=128),e}function b(){var e=se;return 0==(0x3c00000&(se<<=1))&&(se=4194304),e}function S(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function M(e,t){e.pendingLanes|=t,0x10000000!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function w(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-a6(t);e.entangledLanes|=t,e.entanglements[r]=0x40000000|e.entanglements[r]|4194218&n}function E(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-a6(n),i=1<>=s,i-=s,sb=1<<32-a6(t)+i|n<d?(p=h,h=null):p=h.sibling;var v=m(n,h,s[d],o);if(null===v){null===h&&(h=p);break}e&&h&&null===v.alternate&&t(n,h),a=l(v,a,d),null===c?u=v:c.sibling=v,c=v,h=p}if(d===s.length)return r(n,h),sR&&C(n,d),u;if(null===h){for(;dp?(v=d,d=null):v=d.sibling;var _=m(n,d,y.value,u);if(null===_){null===d&&(d=v);break}e&&d&&null===_.alternate&&t(n,d),s=l(_,s,p),null===h?c=_:h.sibling=_,h=_,d=v}if(y.done)return r(n,d),sR&&C(n,p),c;if(null===d){for(;!y.done;p++,y=o.next())null!==(y=f(n,y.value,u))&&(s=l(y,s,p),null===h?c=y:h.sibling=y,h=y);return sR&&C(n,p),c}for(d=i(d);!y.done;p++,y=o.next())null!==(y=g(d,n,p,y.value,u))&&(e&&null!==y.alternate&&d.delete(null===y.key?p:y.key),s=l(y,s,p),null===h?c=y:h.sibling=y,h=y);return e&&d.forEach(function(e){return t(n,e)}),sR&&C(n,p),c}(c,h,d=v.call(d),p)}if("function"==typeof d.then)return n(c,h,ev(d),p);if(d.$$typeof===r3)return n(c,h,nl(c,d),p);e_(c,d)}return"string"==typeof d&&""!==d||"number"==typeof d||"bigint"==typeof d?(d=""+d,null!==h&&6===h.tag?(r(c,h.sibling),(p=o(h,d)).return=c):(r(c,h),(p=rF(d,c.mode,p)).return=c),u(c=p)):r(c,h)}(c,h,d,p);return sQ=null,v}catch(e){if(e===sJ)throw e;var y=n(29,e,null,c.mode);return y.lanes=p,y.return=c,y}finally{}}}function eS(e,t){g(s4,e=o1),g(s3,t),o1=e|t.baseLanes}function eM(){g(s4,o1),g(s3,s3.current)}function ew(){o1=s4.current,m(s3),m(s4)}function eE(e){var t=e.alternate;g(s8,1&s8.current),g(s5,e),null===s6&&(null===t||null!==s3.current?s6=e:null!==t.memoizedState&&(s6=e))}function eT(e){if(22===e.tag){if(g(s8,s8.current),g(s5,e),null===s6){var t=e.alternate;null!==t&&null!==t.memoizedState&&(s6=e)}}else eA(e)}function eA(){g(s8,s8.current),g(s5,s5.current)}function eC(e){m(s5),s6===e&&(s6=null),m(s8)}function eR(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||ap(n)||af(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function eP(){throw Error(a(321))}function eI(e,t){if(null===t)return!1;for(var n=0;na?a:8);var s=is.T,o={};is.T=o,tC(e,!1,t,n);try{var l=i(),u=is.S;if(null!==u&&u(o,l),null!==l&&"object"==typeof l&&"function"==typeof l.then){var c,h,d=(c=[],h={status:"pending",value:null,reason:null,then:function(e){c.push(e)}},l.then(function(){h.status="fulfilled",h.value=r;for(var e=0;e";case oB:return":has("+(n6(e)||"")+")";case oH:return'[role="'+e.value+'"]';case oG:return'"'+e.value+'"';case oV:return'[data-testname="'+e.value+'"]';default:throw Error(a(365))}}function n8(e,t){var n=[];e=[e,0];for(var r=0;rln&&(t.flags|=128,r=!0,nM(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=eR(s))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,nS(t,e),nM(i,!0),null===i.tail&&"hidden"===i.tailMode&&!s.alternate&&!sR)return nw(t),null}else 2*sa()-i.renderingStartTime>ln&&0x20000000!==n&&(t.flags|=128,r=!0,nM(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=i.last)?e.sibling=s:t.child=s,i.last=s)}if(null!==i.tail)return t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=sa(),t.sibling=null,e=s8.current,g(s8,r?1&e|2:1&e),t;return nw(t),null;case 22:case 23:return eC(t),ew(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?0!=(0x20000000&n)&&0==(128&t.flags)&&(nw(t),6&t.subtreeFlags&&(t.flags|=8192)):nw(t),null!==(n=t.updateQueue)&&nS(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&m(oA),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),nt(oE),nw(t),null;case 25:return null}throw Error(a(156,t.tag))}(t.alternate,t,o1);if(null!==n){oY=n;return}if(null!==(t=t.sibling)){oY=t;return}oY=t=e}while(null!==t)0===o2&&(o2=5)}function r_(e,t){do{var n=function(e,t){switch(I(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return nt(oE),N(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return U(t),null;case 13:if(eC(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));B()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return m(s8),null;case 4:return N(),null;case 10:return nt(t.type),null;case 22:case 23:return eC(t),ew(),null!==e&&m(oA),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return nt(oE),null;default:return null}}(e.alternate,e);if(null!==n){n.flags&=32767,oY=n;return}if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling)){oY=e;return}oY=e=n}while(null!==e)o2=6,oY=null}function rx(e,t,n,r,i,s,o,l,u,c){var h=is.T,d=iN();try{iL(2),is.T=null,function(e,t,n,r,i,s,o,l){do rS();while(null!==ls)if(0!=(6&oX))throw Error(a(327));var u,c,h=e.finishedWork;if(r=e.finishedLanes,null!==h){if(e.finishedWork=null,e.finishedLanes=0,h===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var d=h.lanes|h.childLanes;!function(e,t,n,r,i,a){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=s&~n;0n?32:n;n=is.T;var i=iN();try{if(iL(r),is.T=null,null===ls)var s=!1;else{r=lu,lu=null;var o=ls,l=lo;if(ls=null,lo=0,0!=(6&oX))throw Error(a(331));var u=oX;if(oX|=4,n2(o.current),nZ(o,o.current,l,r),oX=u,J(0,!1),sh&&"function"==typeof sh.onPostCommitFiberRoot)try{sh.onPostCommitFiberRoot(sc,o)}catch(e){}s=!0}return s}finally{iL(i),is.T=n,rb(e,t)}}return!1}function rM(e,t,n){t=A(n,t),t=tk(e.stateNode,t,2),null!==(e=ea(e,t,2))&&(M(e,2),Y(e))}function rw(e,t,n){if(3===e.tag)rM(e,e,n);else for(;null!==t;){if(3===t.tag){rM(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===li||!li.has(r))){e=A(n,e),null!==(r=ea(t,n=tz(2),2))&&(tB(n,r,t,e),M(r,2),Y(r));break}}t=t.return}}function rE(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new oj;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(o0=!0,i.add(n),e=rT.bind(null,e,t,n),t.then(e,e))}function rT(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,oq===e&&(oJ&n)===n&&(4===o2||3===o2&&(0x3c00000&oJ)===oJ&&300>sa()-lt?0==(2&oX)&&rl(e,0):o5|=n,o8===oJ&&(o8=0)),Y(e)}function rA(e,t){0===t&&(t=b()),null!==(e=j(e,t))&&(M(e,t),Y(e))}function rC(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),rA(e,n)}function rR(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}null!==r&&r.delete(t),rA(e,n)}function rP(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rI(e){return!(!(e=e.prototype)||!e.isReactComponent)}function rL(e,t){var r=e.alternate;return null===r?((r=n(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=0x1e00000&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function rN(e,t){e.flags&=0x1e00002;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,e.dependencies=null===(t=n.dependencies)?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function rD(e,t,r,i,s,o){var l=0;if(i=e,"function"==typeof e)rI(e)&&(l=1);else if("string"==typeof e)l=aF&&aK?ak(e,r,sM.current)?26:a2(e)?27:5:aF?ak(e,r,sM.current)?26:5:aK&&a2(e)?27:5;else e:switch(e){case r$:return rU(r.children,s,o,t);case rQ:l=8,s|=24;break;case r0:return(e=n(12,r,t,2|s)).elementType=r0,e.lanes=o,e;case r5:return(e=n(13,r,t,s)).elementType=r5,e.lanes=o,e;case r6:return(e=n(19,r,t,s)).elementType=r6,e.lanes=o,e;case r7:return rO(r,s,o,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case r1:case r3:l=10;break e;case r2:l=9;break e;case r4:l=11;break e;case r8:l=14;break e;case r9:l=16,i=null;break e}l=29,r=Error(a(130,null===e?"null":typeof e,"")),i=null}return(t=n(l,r,t,s)).elementType=e,t.type=i,t.lanes=o,t}function rU(e,t,r,i){return(e=n(7,e,i,t)).lanes=r,e}function rO(e,t,r,i){(e=n(22,e,i,t)).elementType=r7,e.lanes=r;var s={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var e=s._current;if(null===e)throw Error(a(456));if(0==(2&s._pendingVisibility)){var t=j(e,2);null!==t&&(s._pendingVisibility|=2,rt(t,e,2))}},attach:function(){var e=s._current;if(null===e)throw Error(a(456));if(0!=(2&s._pendingVisibility)){var t=j(e,2);null!==t&&(s._pendingVisibility&=-3,rt(t,e,2))}}};return e.stateNode=s,e}function rF(e,t,r){return(e=n(6,e,null,t)).lanes=r,e}function rk(e,t,r){return(t=n(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rz(e,t,n,r,i,a,s,o){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=iE,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=S(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=S(0),this.hiddenUpdates=S(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function rB(e,t,r,i,a,s,o,l,u,c,h,d){return e=new rz(e,t,r,o,l,u,c,d),t=1,!0===s&&(t|=24),s=n(3,null,null,t),e.current=s,s.stateNode=e,t=nc(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:i,isDehydrated:r,cache:t},en(s),e}function rH(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw Error(a(268,e=Object.keys(e).join(",")))}return null===(e=null!==(e=p(t))?function e(t){var n=t.tag;if(5===n||26===n||27===n||6===n)return t;for(t=t.child;null!==t;){if(null!==(n=e(t)))return n;t=t.sibling}return null}(e):null)?null:id(e.stateNode)}function rV(e,t,n,r,i,a){i=i?a5:a5,null===r.context?r.context=i:r.pendingContext=i,(r=ei(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(r.callback=a),null!==(n=ea(e,r,t))&&(rt(n,e,t),es(n,e,t))}function rG(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n>>=0)?32:31-(a8(e)/a9|0)|0},a8=Math.log,a9=Math.LN2,a7=128,se=4194304,st=rq.unstable_scheduleCallback,sn=rq.unstable_cancelCallback,sr=rq.unstable_shouldYield,si=rq.unstable_requestPaint,sa=rq.unstable_now,ss=rq.unstable_ImmediatePriority,so=rq.unstable_UserBlockingPriority,sl=rq.unstable_NormalPriority,su=rq.unstable_IdlePriority,sc=(rq.log,rq.unstable_setDisableYieldValue,null),sh=null,sd="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},sp=new WeakMap,sf=[],sm=0,sg=null,sv=0,sy=[],s_=0,sx=null,sb=1,sS="",sM=f(null),sw=f(null),sE=f(null),sT=f(null),sA=null,sC=null,sR=!1,sP=null,sI=!1,sL=Error(a(519)),sN=[],sD=0,sU=0,sO=null,sF=null,sk=!1,sz=!1,sB=!1,sH=0,sV=null,sG=0,sW=0,sj=null,sX=!1,sq=!1,sY=Object.prototype.hasOwnProperty,sJ=Error(a(460)),sZ=Error(a(474)),sK={then:function(){}},s$=null,sQ=null,s0=0,s1=eb(!0),s2=eb(!1),s3=f(null),s4=f(0),s5=f(null),s6=null,s8=f(0),s9=0,s7=null,oe=null,ot=null,on=!1,or=!1,oi=!1,oa=0,os=0,oo=null,ol=0,ou=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},oc={readContext:no,use:eV,useCallback:eP,useContext:eP,useEffect:eP,useImperativeHandle:eP,useLayoutEffect:eP,useInsertionEffect:eP,useMemo:eP,useReducer:eP,useRef:eP,useState:eP,useDebugValue:eP,useDeferredValue:eP,useTransition:eP,useSyncExternalStore:eP,useId:eP};oc.useCacheRefresh=eP,oc.useMemoCache=eP,oc.useHostTransitionStatus=eP,oc.useFormState=eP,oc.useActionState=eP,oc.useOptimistic=eP;var oh={readContext:no,use:eV,useCallback:function(e,t){return ez().memoizedState=[e,void 0===t?null:t],e},useContext:no,useEffect:tl,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,ts(4194308,4,td.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=ez();t=void 0===t?null:t;var r=e();return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ez();if(void 0!==n)var i=n(t);else i=t;return r.memoizedState=r.baseState=i,r.queue=e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},e=e.dispatch=tE.bind(null,s7,e),[r.memoizedState,e]},useRef:function(e){return ez().memoizedState={current:e}},useState:function(e){var t=(e=e0(e)).queue,n=tT.bind(null,s7,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:tf,useDeferredValue:function(e,t){return tv(ez(),e,t)},useTransition:function(){var e=e0(!1);return e=t_.bind(null,s7,e.queue,!0,!1),ez().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=s7,i=ez();if(sR){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===oq)throw Error(a(349));0!=(60&oJ)||eJ(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,tl(eK.bind(null,r,s,e),[e]),r.flags|=2048,ti(9,eZ.bind(null,r,s,n,t),{destroy:void 0},null),n},useId:function(){var e=ez(),t=oq.identifierPrefix;if(sR){var n=sS,r=sb;t=":"+t+"R"+(n=(r&~(1<<32-a6(r)-1)).toString(32)+n),0<(n=oa++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ol++).toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return ez().memoizedState=tw.bind(null,s7)}};oh.useMemoCache=eG,oh.useHostTransitionStatus=tb,oh.useFormState=e7,oh.useActionState=e7,oh.useOptimistic=function(e){var t=ez();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=tC.bind(null,s7,!0,n),n.dispatch=t,[e,t]};var od={readContext:no,use:eV,useCallback:tm,useContext:no,useEffect:tu,useImperativeHandle:tp,useInsertionEffect:tc,useLayoutEffect:th,useMemo:tg,useReducer:ej,useRef:ta,useState:function(){return ej(eW)},useDebugValue:tf,useDeferredValue:function(e,t){return ty(eB(),oe.memoizedState,e,t)},useTransition:function(){var e=ej(eW)[0],t=eB().memoizedState;return["boolean"==typeof e?e:eH(e),t]},useSyncExternalStore:eY,useId:tS};od.useCacheRefresh=tM,od.useMemoCache=eG,od.useHostTransitionStatus=tb,od.useFormState=te,od.useActionState=te,od.useOptimistic=function(e,t){return e1(eB(),oe,e,t)};var op={readContext:no,use:eV,useCallback:tm,useContext:no,useEffect:tu,useImperativeHandle:tp,useInsertionEffect:tc,useLayoutEffect:th,useMemo:tg,useReducer:eq,useRef:ta,useState:function(){return eq(eW)},useDebugValue:tf,useDeferredValue:function(e,t){var n=eB();return null===oe?tv(n,e,t):ty(n,oe.memoizedState,e,t)},useTransition:function(){var e=eq(eW)[0],t=eB().memoizedState;return["boolean"==typeof e?e:eH(e),t]},useSyncExternalStore:eY,useId:tS};op.useCacheRefresh=tM,op.useMemoCache=eG,op.useHostTransitionStatus=tb,op.useFormState=tr,op.useActionState=tr,op.useOptimistic=function(e,t){var n=eB();return null!==oe?e1(n,oe,e,t):(n.baseState=e,[e,n.queue.dispatch])};var of={isMounted:function(e){return!!(e=e._reactInternals)&&h(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=n7(),i=ei(r);i.payload=t,null!=n&&(i.callback=n),null!==(t=ea(e,i,r))&&(rt(t,e,r),es(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=n7(),i=ei(r);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=ea(e,i,r))&&(rt(t,e,r),es(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=n7(),r=ei(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=ea(e,r,n))&&(rt(t,e,n),es(t,e,n))}},om="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof r.default&&"function"==typeof r.default.emit)return void r.default.emit("uncaughtException",e);console.error(e)},og=Error(a(461)),ov=!1,oy={dehydrated:null,treeContext:null,retryLane:0},o_=f(null),ox=null,ob=null,oS="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},oM=rq.unstable_scheduleCallback,ow=rq.unstable_NormalPriority,oE={$$typeof:r3,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},oT=is.S;is.S=function(e,t){"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===sV){var n=sV=[];sG=0,sW=ee(),sj={status:"pending",value:void 0,then:function(e){n.push(e)}}}sG++,t.then(et,et)}(0,t),null!==oT&&oT(e,t)};var oA=f(null),oC=!1,oR=!1,oP=!1,oI="function"==typeof WeakSet?WeakSet:Set,oL=null,oN=!1,oD=null,oU=!1,oO=null,oF=8192,ok={getCacheForType:function(e){var t=no(oE),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n}},oz=0,oB=1,oH=2,oV=3,oG=4;if("function"==typeof Symbol&&Symbol.for){var oW=Symbol.for;oz=oW("selector.component"),oB=oW("selector.has_pseudo_class"),oH=oW("selector.role"),oV=oW("selector.test_id"),oG=oW("selector.text")}var oj="function"==typeof WeakMap?WeakMap:Map,oX=0,oq=null,oY=null,oJ=0,oZ=0,oK=null,o$=!1,oQ=!1,o0=!1,o1=0,o2=0,o3=0,o4=0,o5=0,o6=0,o8=0,o9=null,o7=null,le=!1,lt=0,ln=1/0,lr=null,li=null,la=!1,ls=null,lo=0,ll=0,lu=null,lc=0,lh=null;return rj.attemptContinuousHydration=function(e){if(13===e.tag){var t=j(e,0x4000000);null!==t&&rt(t,e,0x4000000),rW(e,0x4000000)}},rj.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag){var t=n7(),n=j(e,t);null!==n&&rt(n,e,t),rW(e,t)}},rj.attemptSynchronousHydration=function(e){switch(e.tag){case 3:if((e=e.stateNode).current.memoizedState.isDehydrated){var t=v(e.pendingLanes);if(0!==t){for(e.pendingLanes|=2,e.entangledLanes|=2;t;){var n=1<<31-a6(t);e.entanglements[1]|=n,t&=~n}Y(e),0==(6&oX)&&(ln=sa()+500,J(0,!1))}}break;case 13:null!==(t=j(e,2))&&rt(t,e,2),rs(),rW(e,2)}},rj.batchedUpdates=function(e,t){return e(t)},rj.createComponentSelector=function(e){return{$$typeof:oz,value:e}},rj.createContainer=function(e,t,n,r,i,a,s,o,l,u){return rB(e,t,!1,null,n,r,a,s,o,l,u,null)},rj.createHasPseudoClassSelector=function(e){return{$$typeof:oB,value:e}},rj.createHydrationContainer=function(e,t,n,r,i,a,s,o,l,u,c,h,d){var p;return(e=rB(n,r,!0,e,i,a,o,l,u,c,h,d)).context=(p=null,a5),n=e.current,(i=ei(r=n7())).callback=null!=t?t:null,ea(n,i,r),e.current.lanes=r,M(e,r),Y(e),e},rj.createPortal=function(e,t,n){var r=3=c&&s>=d&&i<=h&&o<=p){e.splice(t,1);break}if(r!==c||n.width!==u.width||po){if(!(s!==d||n.height!==u.height||hi)){c>r&&(u.width+=c-r,u.x=r),hs&&(u.height+=d-s,u.y=s),pn&&(n=l)),l ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},rj.getPublicRootInstance=function(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 27:case 5:return id(e.child.stateNode);default:return e.child.stateNode}},rj.injectIntoDevTools=function(){var e={bundleType:0,version:iu,rendererPackageName:ic,currentDispatcherRef:is,findFiberByHostInstance:iP,reconcilerVersion:"19.0.0"};if(null!==ih&&(e.rendererConfig=ih),"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{sc=t.inject(e),sh=t}catch(e){}e=!!t.checkDCE}}return e},rj.isAlreadyRendering=function(){return!1},rj.observeVisibleRects=function(e,t,n,r){if(!iq)throw Error(a(363));var i=i0(e=n9(e,t),n,r).disconnect;return{disconnect:function(){i()}}},rj.shouldError=function(){return null},rj.shouldSuspend=function(){return!1},rj.startHostTransition=function(e,t,n,r){if(5!==e.tag)throw Error(a(476));var s=tx(e).queue;t_(e,s,t,iV,null===n?i:function(){var t=tx(e).next.queue;return tA(e,t,{},n7()),n(r)})},rj.updateContainer=function(e,t,n,r){var i=t.current,a=n7();return rV(i,a,e,t,n,r),a},rj.updateContainerSync=function(e,t,n,r){return 0===t.tag&&rS(),rV(t.current,2,e,t,n,r),2},rj},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})},98133,(e,t,n)=>{"use strict";t.exports=e.r(40336)},45015,(e,t,n)=>{"use strict";function r(e,t){var n=e.length;for(e.push(t);0>>1,i=e[r];if(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[o]=n,r=o);else if(us(c,n))e[r]=c,e[u]=n,r=u;else break}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(n.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();n.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,f=null,m=3,g=!1,v=!1,y=!1,_="function"==typeof setTimeout?setTimeout:null,x="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=i(d);null!==t;){if(null===t.callback)a(d);else if(t.startTime<=e)a(d),t.sortIndex=t.expirationTime,r(h,t);else break;t=i(d)}}function M(e){if(y=!1,S(e),!v)if(null!==i(h))v=!0,L();else{var t=i(d);null!==t&&N(M,t.startTime-e)}}var w=!1,E=-1,T=5,A=-1;function C(){return!(n.unstable_now()-Ae&&C());){var s=f.callback;if("function"==typeof s){f.callback=null,m=f.priorityLevel;var l=s(f.expirationTime<=e);if(e=n.unstable_now(),"function"==typeof l){f.callback=l,S(e),t=!0;break t}f===i(h)&&a(h),S(e)}else a(h);f=i(h)}if(null!==f)t=!0;else{var u=i(d);null!==u&&N(M,u.startTime-e),t=!1}}break e}finally{f=null,m=r,g=!1}}}finally{t?o():w=!1}}}if("function"==typeof b)o=function(){b(R)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,I=P.port2;P.port1.onmessage=R,o=function(){I.postMessage(null)}}else o=function(){_(R,0)};function L(){w||(w=!0,o())}function N(e,t){E=_(function(){e(n.unstable_now())},t)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(e){e.callback=null},n.unstable_continueExecution=function(){v||g||(v=!0,L())},n.unstable_forceFrameRate=function(e){0>e||125s?(e.sortIndex=a,r(d,e),null===i(h)&&e===i(d)&&(y?(x(E),E=-1):y=!0,N(M,a-s))):(e.sortIndex=o,r(h,e),v||g||(v=!0,L())),e},n.unstable_shouldYield=C,n.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}},95087,(e,t,n)=>{"use strict";t.exports=e.r(45015)},46712,90072,8560,8155,46791,e=>{"use strict";let t,n,r,i,a,s,o,l,u,c;e.s(["B",()=>px,"C",()=>pG,"D",()=>pW,"E",()=>pb,"G",()=>pq,"a",()=>py,"b",()=>pv,"c",()=>fr,"d",()=>fa,"e",()=>p$,"f",()=>fb,"i",()=>pm,"j",()=>fc,"k",()=>fh,"u",()=>p_],46712),e.i(47167);var h=e.i(71645),d=e.i(39695);e.s(["ACESFilmicToneMapping",()=>ef,"AddEquation",()=>N,"AddOperation",()=>eu,"AdditiveAnimationBlendMode",()=>tH,"AdditiveBlending",()=>R,"AgXToneMapping",()=>eg,"AlphaFormat",()=>e$,"AlwaysCompare",()=>nm,"AlwaysDepth",()=>ee,"AlwaysStencilFunc",()=>no,"AmbientLight",()=>un,"AnimationAction",()=>uY,"AnimationClip",()=>lU,"AnimationLoader",()=>lG,"AnimationMixer",()=>uZ,"AnimationObjectGroup",()=>uq,"AnimationUtils",()=>lS,"ArcCurve",()=>od,"ArrayCamera",()=>uS,"ArrowHelper",()=>ck,"AttachedBindMode",()=>ey,"Audio",()=>uP,"AudioAnalyser",()=>uO,"AudioContext",()=>ug,"AudioListener",()=>uR,"AudioLoader",()=>uv,"AxesHelper",()=>cz,"BackSide",()=>E,"BasicDepthPacking",()=>tj,"BasicShadowMap",()=>x,"BatchedMesh",()=>sL,"Bone",()=>a1,"BooleanKeyframeTrack",()=>lC,"Box2",()=>cr,"Box3",()=>rf,"Box3Helper",()=>cU,"BoxGeometry",()=>ai,"BoxHelper",()=>cD,"BufferAttribute",()=>iF,"BufferGeometry",()=>i0,"BufferGeometryLoader",()=>uu,"ByteType",()=>eB,"Cache",()=>lO,"Camera",()=>ac,"CameraHelper",()=>cI,"CanvasTexture",()=>s6,"CapsuleGeometry",()=>s7,"CatmullRomCurve3",()=>oy,"CineonToneMapping",()=>ep,"CircleGeometry",()=>oe,"ClampToEdgeWrapping",()=>eA,"Clock",()=>uM,"Color",()=>iE,"ColorKeyframeTrack",()=>lR,"ColorManagement",()=>n8,"CompressedArrayTexture",()=>s4,"CompressedCubeTexture",()=>s5,"CompressedTexture",()=>s3,"CompressedTextureLoader",()=>lW,"ConeGeometry",()=>on,"ConstantAlphaFactor",()=>K,"ConstantColorFactor",()=>J,"Controls",()=>cH,"CubeCamera",()=>am,"CubeReflectionMapping",()=>eb,"CubeRefractionMapping",()=>eS,"CubeTexture",()=>ag,"CubeTextureLoader",()=>lq,"CubeUVReflectionMapping",()=>eE,"CubicBezierCurve",()=>oS,"CubicBezierCurve3",()=>oM,"CubicInterpolant",()=>lw,"CullFaceBack",()=>v,"CullFaceFront",()=>y,"CullFaceFrontBack",()=>_,"CullFaceNone",()=>g,"Curve",()=>oc,"CurvePath",()=>oP,"CustomBlending",()=>L,"CustomToneMapping",()=>em,"CylinderGeometry",()=>ot,"Cylindrical",()=>ce,"Data3DTexture",()=>rd,"DataArrayTexture",()=>rc,"DataTexture",()=>a2,"DataTextureLoader",()=>lY,"DataUtils",()=>iN,"DecrementStencilOp",()=>t6,"DecrementWrapStencilOp",()=>t9,"DefaultLoadingManager",()=>lk,"DepthFormat",()=>e1,"DepthStencilFormat",()=>e2,"DepthTexture",()=>s8,"DetachedBindMode",()=>e_,"DirectionalLight",()=>ut,"DirectionalLightHelper",()=>cC,"DiscreteInterpolant",()=>lT,"DodecahedronGeometry",()=>oi,"DoubleSide",()=>T,"DstAlphaFactor",()=>W,"DstColorFactor",()=>X,"DynamicCopyUsage",()=>nM,"DynamicDrawUsage",()=>nv,"DynamicReadUsage",()=>nx,"EdgesGeometry",()=>ou,"EllipseCurve",()=>oh,"EqualCompare",()=>nc,"EqualDepth",()=>er,"EqualStencilFunc",()=>nn,"EquirectangularReflectionMapping",()=>eM,"EquirectangularRefractionMapping",()=>ew,"Euler",()=>rK,"EventDispatcher",()=>nL,"ExternalTexture",()=>s9,"ExtrudeGeometry",()=>oQ,"FileLoader",()=>lV,"Float16BufferAttribute",()=>ij,"Float32BufferAttribute",()=>iX,"FloatType",()=>ej,"Fog",()=>aS,"FogExp2",()=>ab,"FramebufferTexture",()=>s2,"FrontSide",()=>w,"Frustum",()=>sd,"FrustumArray",()=>sm,"GLBufferAttribute",()=>u2,"GLSL1",()=>nE,"GLSL3",()=>nT,"GreaterCompare",()=>nd,"GreaterDepth",()=>ea,"GreaterEqualCompare",()=>nf,"GreaterEqualDepth",()=>ei,"GreaterEqualStencilFunc",()=>ns,"GreaterStencilFunc",()=>ni,"GridHelper",()=>cM,"Group",()=>ay,"HalfFloatType",()=>eX,"HemisphereLight",()=>lK,"HemisphereLightHelper",()=>cS,"IcosahedronGeometry",()=>o1,"ImageBitmapLoader",()=>um,"ImageLoader",()=>lX,"ImageUtils",()=>re,"IncrementStencilOp",()=>t5,"IncrementWrapStencilOp",()=>t8,"InstancedBufferAttribute",()=>a6,"InstancedBufferGeometry",()=>ul,"InstancedInterleavedBuffer",()=>u1,"InstancedMesh",()=>si,"Int16BufferAttribute",()=>iH,"Int32BufferAttribute",()=>iG,"Int8BufferAttribute",()=>ik,"IntType",()=>eG,"InterleavedBuffer",()=>aw,"InterleavedBufferAttribute",()=>aT,"Interpolant",()=>lM,"InterpolateDiscrete",()=>tD,"InterpolateLinear",()=>tU,"InterpolateSmooth",()=>tO,"InterpolationSamplingMode",()=>nI,"InterpolationSamplingType",()=>nP,"InvertStencilOp",()=>t7,"KeepStencilOp",()=>t3,"KeyframeTrack",()=>lA,"LOD",()=>aW,"LatheGeometry",()=>o2,"Layers",()=>r$,"LessCompare",()=>nu,"LessDepth",()=>et,"LessEqualCompare",()=>nh,"LessEqualDepth",()=>en,"LessEqualStencilFunc",()=>nr,"LessStencilFunc",()=>nt,"Light",()=>lZ,"LightProbe",()=>ua,"Line",()=>sH,"Line3",()=>ch,"LineBasicMaterial",()=>sN,"LineCurve",()=>ow,"LineCurve3",()=>oE,"LineDashedMaterial",()=>lg,"LineLoop",()=>sX,"LineSegments",()=>sj,"LinearFilter",()=>eD,"LinearInterpolant",()=>lE,"LinearMipMapLinearFilter",()=>ek,"LinearMipMapNearestFilter",()=>eO,"LinearMipmapLinearFilter",()=>eF,"LinearMipmapNearestFilter",()=>eU,"LinearSRGBColorSpace",()=>tQ,"LinearToneMapping",()=>eh,"LinearTransfer",()=>t0,"Loader",()=>lz,"LoaderUtils",()=>uo,"LoadingManager",()=>lF,"LoopOnce",()=>tI,"LoopPingPong",()=>tN,"LoopRepeat",()=>tL,"MOUSE",()=>f,"Material",()=>iC,"MaterialLoader",()=>us,"MathUtils",()=>nG,"Matrix2",()=>ct,"Matrix3",()=>nJ,"Matrix4",()=>rH,"MaxEquation",()=>F,"Mesh",()=>an,"MeshBasicMaterial",()=>iR,"MeshDepthMaterial",()=>lp,"MeshDistanceMaterial",()=>lf,"MeshLambertMaterial",()=>ld,"MeshMatcapMaterial",()=>lm,"MeshNormalMaterial",()=>lh,"MeshPhongMaterial",()=>lu,"MeshPhysicalMaterial",()=>ll,"MeshStandardMaterial",()=>lo,"MeshToonMaterial",()=>lc,"MinEquation",()=>O,"MirroredRepeatWrapping",()=>eC,"MixOperation",()=>el,"MultiplyBlending",()=>I,"MultiplyOperation",()=>eo,"NearestFilter",()=>eR,"NearestMipMapLinearFilter",()=>eN,"NearestMipMapNearestFilter",()=>eI,"NearestMipmapLinearFilter",()=>eL,"NearestMipmapNearestFilter",()=>eP,"NeutralToneMapping",()=>ev,"NeverCompare",()=>nl,"NeverDepth",()=>Q,"NeverStencilFunc",()=>ne,"NoBlending",()=>A,"NoColorSpace",()=>tK,"NoToneMapping",()=>ec,"NormalAnimationBlendMode",()=>tB,"NormalBlending",()=>C,"NotEqualCompare",()=>np,"NotEqualDepth",()=>es,"NotEqualStencilFunc",()=>na,"NumberKeyframeTrack",()=>lP,"Object3D",()=>ia,"ObjectLoader",()=>uc,"ObjectSpaceNormalMap",()=>tZ,"OctahedronGeometry",()=>o3,"OneFactor",()=>z,"OneMinusConstantAlphaFactor",()=>$,"OneMinusConstantColorFactor",()=>Z,"OneMinusDstAlphaFactor",()=>j,"OneMinusDstColorFactor",()=>q,"OneMinusSrcAlphaFactor",()=>G,"OneMinusSrcColorFactor",()=>H,"OrthographicCamera",()=>l7,"PCFShadowMap",()=>b,"PCFSoftShadowMap",()=>S,"Path",()=>oI,"PerspectiveCamera",()=>af,"Plane",()=>sl,"PlaneGeometry",()=>o4,"PlaneHelper",()=>cO,"PointLight",()=>l9,"PointLightHelper",()=>cy,"Points",()=>s$,"PointsMaterial",()=>sq,"PolarGridHelper",()=>cw,"PolyhedronGeometry",()=>or,"PositionalAudio",()=>uU,"PropertyBinding",()=>uX,"PropertyMixer",()=>uF,"QuadraticBezierCurve",()=>oT,"QuadraticBezierCurve3",()=>oA,"Quaternion",()=>nj,"QuaternionKeyframeTrack",()=>lL,"QuaternionLinearInterpolant",()=>lI,"RAD2DEG",()=>nO,"RED_GREEN_RGTC2_Format",()=>tR,"RED_RGTC1_Format",()=>tA,"REVISION",()=>p,"RGBADepthPacking",()=>tX,"RGBAFormat",()=>e0,"RGBAIntegerFormat",()=>e9,"RGBA_ASTC_10x10_Format",()=>tb,"RGBA_ASTC_10x5_Format",()=>ty,"RGBA_ASTC_10x6_Format",()=>t_,"RGBA_ASTC_10x8_Format",()=>tx,"RGBA_ASTC_12x10_Format",()=>tS,"RGBA_ASTC_12x12_Format",()=>tM,"RGBA_ASTC_4x4_Format",()=>tc,"RGBA_ASTC_5x4_Format",()=>th,"RGBA_ASTC_5x5_Format",()=>td,"RGBA_ASTC_6x5_Format",()=>tp,"RGBA_ASTC_6x6_Format",()=>tf,"RGBA_ASTC_8x5_Format",()=>tm,"RGBA_ASTC_8x6_Format",()=>tg,"RGBA_ASTC_8x8_Format",()=>tv,"RGBA_BPTC_Format",()=>tw,"RGBA_ETC2_EAC_Format",()=>tu,"RGBA_PVRTC_2BPPV1_Format",()=>ts,"RGBA_PVRTC_4BPPV1_Format",()=>ta,"RGBA_S3TC_DXT1_Format",()=>te,"RGBA_S3TC_DXT3_Format",()=>tt,"RGBA_S3TC_DXT5_Format",()=>tn,"RGBDepthPacking",()=>tq,"RGBFormat",()=>eQ,"RGBIntegerFormat",()=>e8,"RGB_BPTC_SIGNED_Format",()=>tE,"RGB_BPTC_UNSIGNED_Format",()=>tT,"RGB_ETC1_Format",()=>to,"RGB_ETC2_Format",()=>tl,"RGB_PVRTC_2BPPV1_Format",()=>ti,"RGB_PVRTC_4BPPV1_Format",()=>tr,"RGB_S3TC_DXT1_Format",()=>e7,"RGDepthPacking",()=>tY,"RGFormat",()=>e5,"RGIntegerFormat",()=>e6,"RawShaderMaterial",()=>ls,"Ray",()=>rB,"Raycaster",()=>u4,"RectAreaLight",()=>ur,"RedFormat",()=>e3,"RedIntegerFormat",()=>e4,"ReinhardToneMapping",()=>ed,"RenderTarget",()=>rl,"RenderTarget3D",()=>uK,"RepeatWrapping",()=>eT,"ReplaceStencilOp",()=>t4,"ReverseSubtractEquation",()=>U,"RingGeometry",()=>o5,"SIGNED_RED_GREEN_RGTC2_Format",()=>tP,"SIGNED_RED_RGTC1_Format",()=>tC,"SRGBColorSpace",()=>t$,"SRGBTransfer",()=>t1,"Scene",()=>aM,"ShaderMaterial",()=>au,"ShadowMaterial",()=>la,"Shape",()=>oL,"ShapeGeometry",()=>o6,"ShapePath",()=>cB,"ShapeUtils",()=>oZ,"ShortType",()=>eH,"Skeleton",()=>a5,"SkeletonHelper",()=>cv,"SkinnedMesh",()=>a0,"Source",()=>rn,"Sphere",()=>rL,"SphereGeometry",()=>o8,"Spherical",()=>u7,"SphericalHarmonics3",()=>ui,"SplineCurve",()=>oC,"SpotLight",()=>l3,"SpotLightHelper",()=>cp,"Sprite",()=>aB,"SpriteMaterial",()=>aA,"SrcAlphaFactor",()=>V,"SrcAlphaSaturateFactor",()=>Y,"SrcColorFactor",()=>B,"StaticCopyUsage",()=>nS,"StaticDrawUsage",()=>ng,"StaticReadUsage",()=>n_,"StereoCamera",()=>ub,"StreamCopyUsage",()=>nw,"StreamDrawUsage",()=>ny,"StreamReadUsage",()=>nb,"StringKeyframeTrack",()=>lN,"SubtractEquation",()=>D,"SubtractiveBlending",()=>P,"TOUCH",()=>m,"TangentSpaceNormalMap",()=>tJ,"TetrahedronGeometry",()=>o9,"Texture",()=>rs,"TextureLoader",()=>lJ,"TextureUtils",()=>cG,"Timer",()=>u8,"TimestampQuery",()=>nR,"TorusGeometry",()=>o7,"TorusKnotGeometry",()=>le,"Triangle",()=>ix,"TriangleFanDrawMode",()=>tW,"TriangleStripDrawMode",()=>tG,"TrianglesDrawMode",()=>tV,"TubeGeometry",()=>lt,"UVMapping",()=>ex,"Uint16BufferAttribute",()=>iV,"Uint32BufferAttribute",()=>iW,"Uint8BufferAttribute",()=>iz,"Uint8ClampedBufferAttribute",()=>iB,"Uniform",()=>u$,"UniformsGroup",()=>u0,"UniformsUtils",()=>al,"UnsignedByteType",()=>ez,"UnsignedInt101111Type",()=>eK,"UnsignedInt248Type",()=>eJ,"UnsignedInt5999Type",()=>eZ,"UnsignedIntType",()=>eW,"UnsignedShort4444Type",()=>eq,"UnsignedShort5551Type",()=>eY,"UnsignedShortType",()=>eV,"VSMShadowMap",()=>M,"Vector2",()=>nW,"Vector3",()=>nX,"Vector4",()=>ro,"VectorKeyframeTrack",()=>lD,"VideoFrameTexture",()=>s1,"VideoTexture",()=>s0,"WebGL3DRenderTarget",()=>rp,"WebGLArrayRenderTarget",()=>rh,"WebGLCoordinateSystem",()=>nA,"WebGLCubeRenderTarget",()=>av,"WebGLRenderTarget",()=>ru,"WebGPUCoordinateSystem",()=>nC,"WebXRController",()=>ax,"WireframeGeometry",()=>ln,"WrapAroundEnding",()=>tz,"ZeroCurvatureEnding",()=>tF,"ZeroFactor",()=>k,"ZeroSlopeEnding",()=>tk,"ZeroStencilOp",()=>t2,"arrayNeedsUint32",()=>nK,"cloneUniforms",()=>aa,"createCanvasElement",()=>n1,"createElementNS",()=>n0,"getByteLength",()=>cV,"getUnlitUniformColorSpace",()=>ao,"mergeUniforms",()=>as,"probeAsync",()=>n4,"warnOnce",()=>n3],90072);let p="180",f={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},m={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},g=0,v=1,y=2,_=3,x=0,b=1,S=2,M=3,w=0,E=1,T=2,A=0,C=1,R=2,P=3,I=4,L=5,N=100,D=101,U=102,O=103,F=104,k=200,z=201,B=202,H=203,V=204,G=205,W=206,j=207,X=208,q=209,Y=210,J=211,Z=212,K=213,$=214,Q=0,ee=1,et=2,en=3,er=4,ei=5,ea=6,es=7,eo=0,el=1,eu=2,ec=0,eh=1,ed=2,ep=3,ef=4,em=5,eg=6,ev=7,ey="attached",e_="detached",ex=300,eb=301,eS=302,eM=303,ew=304,eE=306,eT=1e3,eA=1001,eC=1002,eR=1003,eP=1004,eI=1004,eL=1005,eN=1005,eD=1006,eU=1007,eO=1007,eF=1008,ek=1008,ez=1009,eB=1010,eH=1011,eV=1012,eG=1013,eW=1014,ej=1015,eX=1016,eq=1017,eY=1018,eJ=1020,eZ=35902,eK=35899,e$=1021,eQ=1022,e0=1023,e1=1026,e2=1027,e3=1028,e4=1029,e5=1030,e6=1031,e8=1032,e9=1033,e7=33776,te=33777,tt=33778,tn=33779,tr=35840,ti=35841,ta=35842,ts=35843,to=36196,tl=37492,tu=37496,tc=37808,th=37809,td=37810,tp=37811,tf=37812,tm=37813,tg=37814,tv=37815,ty=37816,t_=37817,tx=37818,tb=37819,tS=37820,tM=37821,tw=36492,tE=36494,tT=36495,tA=36283,tC=36284,tR=36285,tP=36286,tI=2200,tL=2201,tN=2202,tD=2300,tU=2301,tO=2302,tF=2400,tk=2401,tz=2402,tB=2500,tH=2501,tV=0,tG=1,tW=2,tj=3200,tX=3201,tq=3202,tY=3203,tJ=0,tZ=1,tK="",t$="srgb",tQ="srgb-linear",t0="linear",t1="srgb",t2=0,t3=7680,t4=7681,t5=7682,t6=7683,t8=34055,t9=34056,t7=5386,ne=512,nt=513,nn=514,nr=515,ni=516,na=517,ns=518,no=519,nl=512,nu=513,nc=514,nh=515,nd=516,np=517,nf=518,nm=519,ng=35044,nv=35048,ny=35040,n_=35045,nx=35049,nb=35041,nS=35046,nM=35050,nw=35042,nE="100",nT="300 es",nA=2e3,nC=2001,nR={COMPUTE:"compute",RENDER:"render"},nP={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},nI={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};class nL{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return void 0!==n&&void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){let n=this._listeners;if(void 0===n)return;let r=n[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(void 0===t)return;let n=t[e.type];if(void 0!==n){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+nN[e>>16&255]+nN[e>>24&255]+"-"+nN[255&t]+nN[t>>8&255]+"-"+nN[t>>16&15|64]+nN[t>>24&255]+"-"+nN[63&n|128]+nN[n>>8&255]+"-"+nN[n>>16&255]+nN[n>>24&255]+nN[255&r]+nN[r>>8&255]+nN[r>>16&255]+nN[r>>24&255]).toLowerCase()}function nk(e,t,n){return Math.max(t,Math.min(n,e))}function nz(e,t){return(e%t+t)%t}function nB(e,t,n){return(1-n)*e+n*t}function nH(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/0xffffffff;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/0x7fffffff,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function nV(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(0xffffffff*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(0x7fffffff*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let nG={DEG2RAD:nU,RAD2DEG:nO,generateUUID:nF,clamp:nk,euclideanModulo:nz,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:nB,damp:function(e,t,n,r){return nB(e,t,1-Math.exp(-n*r))},pingpong:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t-Math.abs(nz(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(nD=e);let t=nD+=0x6d2b79f5;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/0x100000000},degToRad:function(e){return e*nU},radToDeg:function(e){return e*nO},isPowerOfTwo:function(e){return(e&e-1)==0&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){let a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),u=a((t+r)/2),c=s((t+r)/2),h=a((t-r)/2),d=s((t-r)/2),p=a((r-t)/2),f=s((r-t)/2);switch(i){case"XYX":e.set(o*c,l*h,l*d,o*u);break;case"YZY":e.set(l*d,o*c,l*h,o*u);break;case"ZXZ":e.set(l*h,l*d,o*c,o*u);break;case"XZX":e.set(o*c,l*f,l*p,o*u);break;case"YXY":e.set(l*p,o*c,l*f,o*u);break;case"ZYZ":e.set(l*f,l*p,o*c,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:nV,denormalize:nH};class nW{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=nk(this.x,e.x,t.x),this.y=nk(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=nk(this.x,e,t),this.y=nk(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(nk(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());return 0===t?Math.PI/2:Math.acos(nk(this.dot(e)/t,-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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}constructor(e=0,t=0){nW.prototype.isVector2=!0,this.x=e,this.y=t}}class nj{static slerpFlat(e,t,n,r,i,a,s){let o=n[r+0],l=n[r+1],u=n[r+2],c=n[r+3],h=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(0===s){e[t+0]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c;return}if(1===s){e[t+0]=h,e[t+1]=d,e[t+2]=p,e[t+3]=f;return}if(c!==f||o!==h||l!==d||u!==p){let e=1-s,t=o*h+l*d+u*p+c*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){let i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,s=Math.sin(s*a)/i}let i=s*n;if(o=o*e+h*i,l=l*e+d*i,u=u*e+p*i,c=c*e+f*i,e===1-s){let e=1/Math.sqrt(o*o+l*l+u*u+c*c);o*=e,l*=e,u*=e,c*=e}}e[t]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c}static multiplyQuaternionsFlat(e,t,n,r,i,a){let s=n[r],o=n[r+1],l=n[r+2],u=n[r+3],c=i[a],h=i[a+1],d=i[a+2],p=i[a+3];return e[t]=s*p+u*c+o*d-l*h,e[t+1]=o*p+u*h+l*c-s*d,e[t+2]=l*p+u*d+s*h-o*c,e[t+3]=u*p-s*c-o*h-l*d,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){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=e._x,r=e._y,i=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(n/2),u=s(r/2),c=s(i/2),h=o(n/2),d=o(r/2),p=o(i/2);switch(a){case"XYZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"YXZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"ZXY":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"ZYX":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"YZX":this._x=h*u*c+l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c-h*d*p;break;case"XZY":this._x=h*u*c-l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&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],s=t[5],o=t[9],l=t[2],u=t[6],c=t[10],h=n+s+c;if(h>0){let e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(u-o)*e,this._y=(i-l)*e,this._z=(a-r)*e}else if(n>s&&n>c){let e=2*Math.sqrt(1+n-s-c);this._w=(u-o)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+l)/e}else if(s>c){let e=2*Math.sqrt(1+s-n-c);this._w=(i-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(o+u)/e}else{let e=2*Math.sqrt(1+c-n-s);this._w=(a-r)/e,this._x=(i+l)/e,this._y=(o+u)/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._x=0,this._y=-e.z,this._z=e.y)):(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(nk(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(0===n)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 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=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,s=t._x,o=t._y,l=t._z,u=t._w;return this._x=n*u+a*s+r*l-i*o,this._y=r*u+a*o+i*s-n*l,this._z=i*u+a*l+n*o-r*s,this._w=a*u-n*s-r*o-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);let n=this._x,r=this._y,i=this._z,a=this._w,s=a*e._w+n*e._x+r*e._y+i*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;let o=1-s*s;if(o<=Number.EPSILON){let e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}let l=Math.sqrt(o),u=Math.atan2(l,s),c=Math.sin((1-t)*u)/l,h=Math.sin(t*u)/l;return this._w=a*c+this._w*h,this._x=n*c+this._x*h,this._y=r*c+this._y*h,this._z=i*c+this._z*h,this._onChangeCallback(),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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}}class nX{set(e,t,n){return void 0===n&&(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(nY.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(nY.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,s=e.z,o=e.w,l=2*(a*r-s*n),u=2*(s*t-i*r),c=2*(i*n-a*t);return this.x=t+o*l+a*c-s*u,this.y=n+o*u+s*l-i*c,this.z=r+o*c+i*u-a*l,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=nk(this.x,e.x,t.x),this.y=nk(this.y,e.y,t.y),this.z=nk(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=nk(this.x,e,t),this.y=nk(this.y,e,t),this.z=nk(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(nk(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,s=t.y,o=t.z;return this.x=r*o-i*s,this.y=i*a-n*o,this.z=n*s-r*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return nq.copy(this).projectOnVector(e),this.sub(nq)}reflect(e){return this.sub(nq.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(nk(this.dot(e)/t,-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,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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=2*Math.random()-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}constructor(e=0,t=0,n=0){nX.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}}let nq=new nX,nY=new nj;class nJ{set(e,t,n,r,i,a,s,o,l){let u=this.elements;return u[0]=e,u[1]=r,u[2]=s,u[3]=t,u[4]=i,u[5]=o,u[6]=n,u[7]=a,u[8]=l,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],s=n[3],o=n[6],l=n[1],u=n[4],c=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],_=r[7],x=r[2],b=r[5],S=r[8];return i[0]=a*f+s*v+o*x,i[3]=a*m+s*y+o*b,i[6]=a*g+s*_+o*S,i[1]=l*f+u*v+c*x,i[4]=l*m+u*y+c*b,i[7]=l*g+u*_+c*S,i[2]=h*f+d*v+p*x,i[5]=h*m+d*y+p*b,i[8]=h*g+d*_+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],s=e[5],o=e[6],l=e[7],u=e[8];return t*a*u-t*s*l-n*i*u+n*s*o+r*i*l-r*a*o}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=u*a-s*l,h=s*o-u*i,d=l*i-a*o,p=t*c+n*h+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=c*f,e[1]=(r*l-u*n)*f,e[2]=(s*n-r*a)*f,e[3]=h*f,e[4]=(u*t-r*o)*f,e[5]=(r*i-s*t)*f,e[6]=d*f,e[7]=(n*o-l*t)*f,e[8]=(a*t-n*i)*f,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,s){let o=Math.cos(i),l=Math.sin(i);return this.set(n*o,n*l,-n*(o*a+l*s)+a+e,-r*l,r*o,-r*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(nZ.makeScale(e,t)),this}rotate(e){return this.premultiply(nZ.makeRotation(-e)),this}translate(e,t){return this.premultiply(nZ.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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,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)}constructor(e,t,n,r,i,a,s,o,l){nJ.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,a,s,o,l)}}let nZ=new nJ;function nK(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}let n$={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function nQ(e,t){return new n$[e](t)}function n0(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function n1(){let e=n0("canvas");return e.style.display="block",e}let n2={};function n3(e){e in n2||(n2[e]=!0,console.warn(e))}function n4(e,t,n){return new Promise(function(r,i){setTimeout(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()}},n)})}let n5=new nJ().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),n6=new nJ().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),n8=function(){let e={enabled:!0,workingColorSpace:tQ,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n&&(this.spaces[t].transfer===t1&&(e.r=n9(e.r),e.g=n9(e.g),e.b=n9(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===t1&&(e.r=n7(e.r),e.g=n7(e.g),e.b=n7(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===tK?t0:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.workingColorSpace;return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return n3("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return n3("THREE.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({[tQ]:{primaries:t,whitePoint:r,transfer:t0,toXYZ:n5,fromXYZ:n6,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:t$},outputColorSpaceConfig:{drawingBufferColorSpace:t$}},[t$]:{primaries:t,whitePoint:r,transfer:t1,toXYZ:n5,fromXYZ:n6,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:t$}}}),e}();function n9(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function n7(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class re{static getDataURL(e){let n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)n=e;else{void 0===t&&(t=n0("canvas")),t.width=e.width,t.height=e.height;let r=t.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=t}return n.toDataURL(r)}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let t=n0("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;e0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ex)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case eT:e.x=e.x-Math.floor(e.x);break;case eA:e.x=e.x<0?0:1;break;case eC:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case eT:e.y=e.y-Math.floor(e.y);break;case eA:e.y=e.y<0?0:1;break;case eC:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}constructor(e=rs.DEFAULT_IMAGE,t=rs.DEFAULT_MAPPING,n=eA,r=eA,i=eD,a=eF,s=e0,o=ez,l=rs.DEFAULT_ANISOTROPY,u=tK){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ri++}),this.uuid=nF(),this.name="",this.source=new rn(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new nW(0,0),this.repeat=new nW(1,1),this.center=new nW(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new nJ,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!e&&!!e.depth&&e.depth>1,this.pmremVersion=0}}rs.DEFAULT_IMAGE=null,rs.DEFAULT_MAPPING=ex,rs.DEFAULT_ANISOTROPY=1;class ro{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=void 0!==e.w?e.w:1,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=e.elements,s=a[0],o=a[4],l=a[8],u=a[1],c=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(o-u)&&.01>Math.abs(l-d)&&.01>Math.abs(h-p)){if(.1>Math.abs(o+u)&&.1>Math.abs(l+d)&&.1>Math.abs(h+p)&&.1>Math.abs(s+c+f-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(c+1)/2,m=(f+1)/2,g=(o+u)/4,v=(l+d)/4,y=(h+p)/4;return e>a&&e>m?e<.01?(n=0,r=.707106781,i=.707106781):(r=g/(n=Math.sqrt(e)),i=v/n):a>m?a<.01?(n=.707106781,r=0,i=.707106781):(n=g/(r=Math.sqrt(a)),i=y/r):m<.01?(n=.707106781,r=.707106781,i=0):(n=v/(i=Math.sqrt(m)),r=y/i),this.set(n,r,i,t),this}let m=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(u-o)*(u-o));return .001>Math.abs(m)&&(m=1),this.x=(p-h)/m,this.y=(l-d)/m,this.z=(u-o)/m,this.w=Math.acos((s+c+f-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}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.w=Math.min(this.w,e.w),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.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=nk(this.x,e.x,t.x),this.y=nk(this.y,e.y,t.y),this.z=nk(this.z,e.z,t.z),this.w=nk(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=nk(this.x,e,t),this.y=nk(this.y,e,t),this.z=nk(this.z,e,t),this.w=nk(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(nk(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,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)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}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.w+=(e.w-this.w)*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.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}constructor(e=0,t=0,n=0,r=1){ro.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}}class rl extends nL{_setTextureOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={minFilter:eD,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(t.mapping=e.mapping),void 0!==e.wrapS&&(t.wrapS=e.wrapS),void 0!==e.wrapT&&(t.wrapT=e.wrapT),void 0!==e.wrapR&&(t.wrapR=e.wrapR),void 0!==e.magFilter&&(t.magFilter=e.magFilter),void 0!==e.minFilter&&(t.minFilter=e.minFilter),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.anisotropy&&(t.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(t.internalFormat=e.internalFormat);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r1;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;t1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);let n=e.geometry;if(void 0!==n){let r=n.getAttribute("position");if(!0===t&&void 0!==r&&!0!==e.isInstancedMesh)for(let t=0,n=r.count;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,rg),rg.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(rw),rE.subVectors(this.max,rw),ry.subVectors(e.a,rw),r_.subVectors(e.b,rw),rx.subVectors(e.c,rw),rb.subVectors(r_,ry),rS.subVectors(rx,r_),rM.subVectors(ry,rx);let t=[0,-rb.z,rb.y,0,-rS.z,rS.y,0,-rM.z,rM.y,rb.z,0,-rb.x,rS.z,0,-rS.x,rM.z,0,-rM.x,-rb.y,rb.x,0,-rS.y,rS.x,0,-rM.y,rM.x,0];return!!rC(t,ry,r_,rx,rE)&&!!rC(t=[1,0,0,0,1,0,0,0,1],ry,r_,rx,rE)&&(rT.crossVectors(rb,rS),rC(t=[rT.x,rT.y,rT.z],ry,r_,rx,rE))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,rg).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(rg).length()),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()||(rm[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),rm[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),rm[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),rm[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),rm[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),rm[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),rm[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),rm[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(rm)),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}constructor(e=new nX(Infinity,Infinity,Infinity),t=new nX(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}}let rm=[new nX,new nX,new nX,new nX,new nX,new nX,new nX,new nX],rg=new nX,rv=new rf,ry=new nX,r_=new nX,rx=new nX,rb=new nX,rS=new nX,rM=new nX,rw=new nX,rE=new nX,rT=new nX,rA=new nX;function rC(e,t,n,r,i){for(let a=0,s=e.length-3;a<=s;a+=3){rA.fromArray(e,a);let s=i.x*Math.abs(rA.x)+i.y*Math.abs(rA.y)+i.z*Math.abs(rA.z),o=t.dot(rA),l=n.dot(rA),u=r.dot(rA);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>s)return!1}return!0}let rR=new rf,rP=new nX,rI=new nX;class rL{set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;void 0!==t?n.copy(t):rR.setFromPoints(e).getCenter(n);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.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=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;rP.subVectors(e,this.center);let t=rP.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(rP,n/e),this.radius+=n}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(rI.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(rP.copy(e.center).add(rI)),this.expandByPoint(rP.copy(e.center).sub(rI)))),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}constructor(e=new nX,t=-1){this.isSphere=!0,this.center=e,this.radius=t}}let rN=new nX,rD=new nX,rU=new nX,rO=new nX,rF=new nX,rk=new nX,rz=new nX;class rB{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,rN)),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=rN.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(rN.copy(this.origin).addScaledVector(this.direction,t),rN.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){let i,a,s,o;rD.copy(e).add(t).multiplyScalar(.5),rU.copy(t).sub(e).normalize(),rO.copy(this.origin).sub(rD);let l=.5*e.distanceTo(t),u=-this.direction.dot(rU),c=rO.dot(this.direction),h=-rO.dot(rU),d=rO.lengthSq(),p=Math.abs(1-u*u);if(p>0)if(i=u*h-c,a=u*c-h,o=l*p,i>=0)if(a>=-o)if(a<=o){let e=1/p;i*=e,a*=e,s=i*(i+u*a+2*c)+a*(u*i+a+2*h)+d}else s=-(i=Math.max(0,-(u*(a=l)+c)))*i+a*(a+2*h)+d;else s=-(i=Math.max(0,-(u*(a=-l)+c)))*i+a*(a+2*h)+d;else a<=-o?(a=(i=Math.max(0,-(-u*l+c)))>0?-l:Math.min(Math.max(-l,-h),l),s=-i*i+a*(a+2*h)+d):a<=o?(i=0,s=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):(a=(i=Math.max(0,-(u*l+c)))>0?l:Math.min(Math.max(-l,-h),l),s=-i*i+a*(a+2*h)+d);else a=u>0?-l:l,s=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,i),r&&r.copy(rD).addScaledVector(rU,a),s}intersectSphere(e,t){rN.subVectors(e.center,this.origin);let n=rN.dot(this.direction),r=rN.dot(rN)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),s=n-a,o=n+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?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 null===n?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let n,r,i,a,s,o,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return(l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),u>=0?(i=(e.min.y-h.y)*u,a=(e.max.y-h.y)*u):(i=(e.max.y-h.y)*u,a=(e.min.y-h.y)*u),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a=0?(s=(e.min.z-h.z)*c,o=(e.max.z-h.z)*c):(s=(e.max.z-h.z)*c,o=(e.min.z-h.z)*c),n>o||s>r||((s>n||n!=n)&&(n=s),(o=0?n:r,t)}intersectsBox(e){return null!==this.intersectBox(e,rN)}intersectTriangle(e,t,n,r,i){let a;rF.subVectors(t,e),rk.subVectors(n,e),rz.crossVectors(rF,rk);let s=this.direction.dot(rz);if(s>0){if(r)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}rO.subVectors(this.origin,e);let o=a*this.direction.dot(rk.crossVectors(rO,rk));if(o<0)return null;let l=a*this.direction.dot(rF.cross(rO));if(l<0||o+l>s)return null;let u=-a*rO.dot(rz);return u<0?null:this.at(u/s,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)}constructor(e=new nX,t=new nX(0,0,-1)){this.origin=e,this.direction=t}}class rH{set(e,t,n,r,i,a,s,o,l,u,c,h,d,p,f,m){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]=s,g[13]=o,g[2]=l,g[6]=u,g[10]=c,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 rH().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 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){let t=this.elements,n=e.elements,r=1/rV.setFromMatrixColumn(e,0).length(),i=1/rV.setFromMatrixColumn(e,1).length(),a=1/rV.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),s=Math.sin(n),o=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){let e=a*u,n=a*c,r=s*u,i=s*c;t[0]=o*u,t[4]=-o*c,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-s*o,t[2]=i-e*l,t[6]=r+n*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*u,n=o*c,r=l*u,i=l*c;t[0]=e+i*s,t[4]=r*s-n,t[8]=a*l,t[1]=a*c,t[5]=a*u,t[9]=-s,t[2]=n*s-r,t[6]=i+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*u,n=o*c,r=l*u,i=l*c;t[0]=e-i*s,t[4]=-a*c,t[8]=r+n*s,t[1]=n+r*s,t[5]=a*u,t[9]=i-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*u,n=a*c,r=s*u,i=s*c;t[0]=o*u,t[4]=r*l-n,t[8]=e*l+i,t[1]=o*c,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,n=a*l,r=s*o,i=s*l;t[0]=o*u,t[4]=i-e*c,t[8]=r*c+n,t[1]=c,t[5]=a*u,t[9]=-s*u,t[2]=-l*u,t[6]=n*c+r,t[10]=e-i*c}else if("XZY"===e.order){let e=a*o,n=a*l,r=s*o,i=s*l;t[0]=o*u,t[4]=-c,t[8]=l*u,t[1]=e*c+i,t[5]=a*u,t[9]=n*c-r,t[2]=r*c-n,t[6]=s*u,t[10]=i*c+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(rW,e,rj)}lookAt(e,t,n){let r=this.elements;return rY.subVectors(e,t),0===rY.lengthSq()&&(rY.z=1),rY.normalize(),rX.crossVectors(n,rY),0===rX.lengthSq()&&(1===Math.abs(n.z)?rY.x+=1e-4:rY.z+=1e-4,rY.normalize(),rX.crossVectors(n,rY)),rX.normalize(),rq.crossVectors(rY,rX),r[0]=rX.x,r[4]=rq.x,r[8]=rY.x,r[1]=rX.y,r[5]=rq.y,r[9]=rY.y,r[2]=rX.z,r[6]=rq.z,r[10]=rY.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],s=n[4],o=n[8],l=n[12],u=n[1],c=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],_=n[11],x=n[15],b=r[0],S=r[4],M=r[8],w=r[12],E=r[1],T=r[5],A=r[9],C=r[13],R=r[2],P=r[6],I=r[10],L=r[14],N=r[3],D=r[7],U=r[11],O=r[15];return i[0]=a*b+s*E+o*R+l*N,i[4]=a*S+s*T+o*P+l*D,i[8]=a*M+s*A+o*I+l*U,i[12]=a*w+s*C+o*L+l*O,i[1]=u*b+c*E+h*R+d*N,i[5]=u*S+c*T+h*P+d*D,i[9]=u*M+c*A+h*I+d*U,i[13]=u*w+c*C+h*L+d*O,i[2]=p*b+f*E+m*R+g*N,i[6]=p*S+f*T+m*P+g*D,i[10]=p*M+f*A+m*I+g*U,i[14]=p*w+f*C+m*L+g*O,i[3]=v*b+y*E+_*R+x*N,i[7]=v*S+y*T+_*P+x*D,i[11]=v*M+y*A+_*I+x*U,i[15]=v*w+y*C+_*L+x*O,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],s=e[5],o=e[9],l=e[13],u=e[2],c=e[6],h=e[10],d=e[14],p=e[3],f=e[7];return p*(i*o*c-r*l*c-i*s*h+n*l*h+r*s*d-n*o*d)+f*(t*o*d-t*l*h+i*a*h-r*a*d+r*l*u-i*o*u)+e[11]*(t*l*c-t*s*d-i*a*c+n*a*d+i*s*u-n*l*u)+e[15]*(-r*s*u-t*o*c+t*s*h+r*a*c-n*a*h+n*o*u)}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,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],s=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=c*m*l-f*h*l+f*o*d-s*m*d-c*o*g+s*h*g,y=p*h*l-u*m*l-p*o*d+a*m*d+u*o*g-a*h*g,_=u*f*l-p*c*l+p*s*d-a*f*d-u*s*g+a*c*g,x=p*c*o-u*f*o-p*s*h+a*f*h+u*s*m-a*c*m,b=t*v+n*y+r*_+i*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/b;return e[0]=v*S,e[1]=(f*h*i-c*m*i-f*r*d+n*m*d+c*r*g-n*h*g)*S,e[2]=(s*m*i-f*o*i+f*r*l-n*m*l-s*r*g+n*o*g)*S,e[3]=(c*o*i-s*h*i-c*r*l+n*h*l+s*r*d-n*o*d)*S,e[4]=y*S,e[5]=(u*m*i-p*h*i+p*r*d-t*m*d-u*r*g+t*h*g)*S,e[6]=(p*o*i-a*m*i-p*r*l+t*m*l+a*r*g-t*o*g)*S,e[7]=(a*h*i-u*o*i+u*r*l-t*h*l-a*r*d+t*o*d)*S,e[8]=_*S,e[9]=(p*c*i-u*f*i-p*n*d+t*f*d+u*n*g-t*c*g)*S,e[10]=(a*f*i-p*s*i+p*n*l-t*f*l-a*n*g+t*s*g)*S,e[11]=(u*s*i-a*c*i-u*n*l+t*c*l+a*n*d-t*s*d)*S,e[12]=x*S,e[13]=(u*f*r-p*c*r+p*n*h-t*f*h-u*n*m+t*c*m)*S,e[14]=(p*s*r-a*f*r-p*n*o+t*f*o+a*n*m-t*s*m)*S,e[15]=(a*c*r-u*s*r+u*n*o-t*c*o-a*n*h+t*s*h)*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];return Math.sqrt(Math.max(t,e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}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,s=e.y,o=e.z,l=i*a,u=i*s;return this.set(l*a+n,l*s-r*o,l*o+r*s,0,l*s+r*o,u*s+n,u*o-r*a,0,l*o-r*s,u*o+r*a,i*o*o+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,s=t._z,o=t._w,l=i+i,u=a+a,c=s+s,h=i*l,d=i*u,p=i*c,f=a*u,m=a*c,g=s*c,v=o*l,y=o*u,_=o*c,x=n.x,b=n.y,S=n.z;return r[0]=(1-(f+g))*x,r[1]=(d+_)*x,r[2]=(p-y)*x,r[3]=0,r[4]=(d-_)*b,r[5]=(1-(h+g))*b,r[6]=(m+v)*b,r[7]=0,r[8]=(p+y)*S,r[9]=(m-v)*S,r[10]=(1-(h+f))*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,i=rV.set(r[0],r[1],r[2]).length(),a=rV.set(r[4],r[5],r[6]).length(),s=rV.set(r[8],r[9],r[10]).length();0>this.determinant()&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],rG.copy(this);let o=1/i,l=1/a,u=1/s;return rG.elements[0]*=o,rG.elements[1]*=o,rG.elements[2]*=o,rG.elements[4]*=l,rG.elements[5]*=l,rG.elements[6]*=l,rG.elements[8]*=u,rG.elements[9]*=u,rG.elements[10]*=u,t.setFromRotationMatrix(rG),n.x=i,n.y=a,n.z=s,this}makePerspective(e,t,n,r,i,a){let s,o,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:nA,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=this.elements;if(u)s=i/(a-i),o=a*i/(a-i);else if(l===nA)s=-(a+i)/(a-i),o=-2*a*i/(a-i);else if(l===nC)s=-a/(a-i),o=-a*i/(a-i);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return c[0]=2*i/(t-e),c[4]=0,c[8]=(t+e)/(t-e),c[12]=0,c[1]=0,c[5]=2*i/(n-r),c[9]=(n+r)/(n-r),c[13]=0,c[2]=0,c[6]=0,c[10]=s,c[14]=o,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a){let s,o,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:nA,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=this.elements;if(u)s=1/(a-i),o=a/(a-i);else if(l===nA)s=-2/(a-i),o=-(a+i)/(a-i);else if(l===nC)s=-1/(a-i),o=-i/(a-i);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return c[0]=2/(t-e),c[4]=0,c[8]=0,c[12]=-(t+e)/(t-e),c[1]=0,c[5]=2/(n-r),c[9]=0,c[13]=-(n+r)/(n-r),c[2]=0,c[6]=0,c[10]=s,c[14]=o,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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,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}constructor(e,t,n,r,i,a,s,o,l,u,c,h,d,p,f,m){rH.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,a,s,o,l,u,c,h,d,p,f,m)}}let rV=new nX,rG=new rH,rW=new nX(0,0,0),rj=new nX(1,1,1),rX=new nX,rq=new nX,rY=new nX,rJ=new rH,rZ=new nj;class rK{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){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]: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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=e.elements,i=r[0],a=r[4],s=r[8],o=r[1],l=r[5],u=r[9],c=r[2],h=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(nk(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-nk(u,-1,1)),.9999999>Math.abs(u)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(nk(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,i));break;case"ZYX":this._y=Math.asin(-nk(c,-1,1)),.9999999>Math.abs(c)?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,i)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(nk(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-nk(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,i)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return rJ.makeRotationFromQuaternion(e),this.setFromRotationMatrix(rJ,t,n)}setFromVector3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}reorder(e){return rZ.setFromEuler(this),this.setFromQuaternion(rZ,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],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}constructor(e=0,t=0,n=0,r=rK.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}}rK.DEFAULT_ORDER="XYZ";class r${set(e){this.mask=1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:[];this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(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),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(r.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(r.boundingBox=this.boundingBox.toJSON())),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&&!0!==this.environment.isRenderTargetTexture&&(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(void 0!==t&&void 0!==t.shapes){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),s.length>0&&(n.images=s),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),c.length>0&&(n.nodes=c)}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){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];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)),!0===t)for(let t=0;t0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){is.subVectors(r,t),io.subVectors(n,t),il.subVectors(e,t);let a=is.dot(is),s=is.dot(io),o=is.dot(il),l=io.dot(io),u=io.dot(il),c=a*l-s*s;if(0===c)return i.set(0,0,0),null;let h=1/c,d=(l*o-s*u)*h,p=(a*u-s*o)*h;return i.set(1-d-p,p,d)}static containsPoint(e,t,n,r){return null!==this.getBarycoord(e,t,n,r,iu)&&iu.x>=0&&iu.y>=0&&iu.x+iu.y<=1}static getInterpolation(e,t,n,r,i,a,s,o){return null===this.getBarycoord(e,t,n,r,iu)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(i,iu.x),o.addScaledVector(a,iu.y),o.addScaledVector(s,iu.z),o)}static getInterpolatedAttribute(e,t,n,r,i,a){return iv.setScalar(0),iy.setScalar(0),i_.setScalar(0),iv.fromBufferAttribute(e,t),iy.fromBufferAttribute(e,n),i_.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(iv,i.x),a.addScaledVector(iy,i.y),a.addScaledVector(i_,i.z),a}static isFrontFacing(e,t,n,r){return is.subVectors(n,t),io.subVectors(e,t),0>is.cross(io).dot(r)}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 is.subVectors(this.c,this.b),io.subVectors(this.a,this.b),.5*is.cross(io).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ix.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ix.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,i){return ix.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return ix.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ix.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n,r,i=this.a,a=this.b,s=this.c;ic.subVectors(a,i),ih.subVectors(s,i),ip.subVectors(e,i);let o=ic.dot(ip),l=ih.dot(ip);if(o<=0&&l<=0)return t.copy(i);im.subVectors(e,a);let u=ic.dot(im),c=ih.dot(im);if(u>=0&&c<=u)return t.copy(a);let h=o*c-u*l;if(h<=0&&o>=0&&u<=0)return n=o/(o-u),t.copy(i).addScaledVector(ic,n);ig.subVectors(e,s);let d=ic.dot(ig),p=ih.dot(ig);if(p>=0&&d<=p)return t.copy(s);let f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return r=l/(l-p),t.copy(i).addScaledVector(ih,r);let m=u*p-d*c;if(m<=0&&c-u>=0&&d-p>=0)return id.subVectors(s,a),r=(c-u)/(c-u+(d-p)),t.copy(a).addScaledVector(id,r);let g=1/(m+f+h);return n=f*g,r=h*g,t.copy(i).addScaledVector(ic,n).addScaledVector(ih,r)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}constructor(e=new nX,t=new nX,n=new nX){this.a=e,this.b=t,this.c=n}}let ib={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},iS={h:0,s:0,l:0},iM={h:0,s:0,l:0};function iw(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*6*(2/3-n):e}class iE{set(e,t,n){return void 0===t&&void 0===n?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,n),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t$;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,n8.colorSpaceToWorking(this,t),this}setRGB(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n8.workingColorSpace;return this.r=e,this.g=t,this.b=n,n8.colorSpaceToWorking(this,r),this}setHSL(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n8.workingColorSpace;if(e=nz(e,1),t=nk(t,0,1),n=nk(n,0,1),0===t)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=iw(i,r,e+1/3),this.g=iw(i,r,e),this.b=iw(i,r,e-1/3)}return n8.colorSpaceToWorking(this,r),this}setStyle(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t$;function r(t){void 0!==t&&1>parseFloat(t)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=t[1],s=t[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(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,n);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(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,n);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=t[1],i=r.length;if(3===i)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,n);if(6===i)return this.setHex(parseInt(r,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t$,n=ib[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),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=n9(e.r),this.g=n9(e.g),this.b=n9(e.b),this}copyLinearToSRGB(e){return this.r=n7(e.r),this.g=n7(e.g),this.b=n7(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t$;return n8.workingToColorSpace(iT.copy(this),e),65536*Math.round(nk(255*iT.r,0,255))+256*Math.round(nk(255*iT.g,0,255))+Math.round(nk(255*iT.b,0,255))}getHexString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t$;return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n8.workingColorSpace;n8.workingToColorSpace(iT.copy(this),r);let i=iT.r,a=iT.g,s=iT.b,o=Math.max(i,a,s),l=Math.min(i,a,s),u=(l+o)/2;if(l===o)t=0,n=0;else{let e=o-l;switch(n=u<=.5?e/(o+l):e/(2-o-l),o){case i:t=(a-s)/e+6*(a1&&void 0!==arguments[1]?arguments[1]:n8.workingColorSpace;return n8.workingToColorSpace(iT.copy(this),t),e.r=iT.r,e.g=iT.g,e.b=iT.b,e}getStyle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t$;n8.workingToColorSpace(iT.copy(this),e);let t=iT.r,n=iT.g,r=iT.b;return e!==t$?"color(".concat(e," ").concat(t.toFixed(3)," ").concat(n.toFixed(3)," ").concat(r.toFixed(3),")"):"rgb(".concat(Math.round(255*t),",").concat(Math.round(255*n),",").concat(Math.round(255*r),")")}offsetHSL(e,t,n){return this.getHSL(iS),this.setHSL(iS.h+e,iS.s+t,iS.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(iS),e.getHSL(iM);let n=nB(iS.h,iM.h,t),r=nB(iS.s,iM.s,t),i=nB(iS.l,iM.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}}let iT=new iE;iE.NAMES=ib;let iA=0;class iC extends nL{get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let n=e[t];if(void 0===n){console.warn("THREE.Material: parameter '".concat(t,"' has value of undefined."));continue}let r=this[t];if(void 0===r){console.warn("THREE.Material: '".concat(t,"' is not a property of THREE.").concat(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=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(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),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(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),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(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,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==C&&(n.blending=this.blending),this.side!==w&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==V&&(n.blendSrc=this.blendSrc),this.blendDst!==G&&(n.blendDst=this.blendDst),this.blendEquation!==N&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==en&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==no&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==t3&&(n.stencilFail=this.stencilFail),this.stencilZFail!==t3&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==t3&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),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(null!==t){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.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:iA++}),this.uuid=nF(),this.name="",this.type="Material",this.blending=C,this.side=w,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=V,this.blendDst=G,this.blendEquation=N,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new iE(0,0,0),this.blendAlpha=0,this.depthFunc=en,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=no,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=t3,this.stencilZFail=t3,this.stencilZPass=t3,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}}class iR extends iC{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}constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new iE(0xffffff),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 rK,this.combine=eo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}}let iP=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,i[e]=24,i[256|e]=24):(r[e]=31744,r[256|e]=64512,i[e]=13,i[256|e]=13)}let a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;(8388608&t)==0;)t<<=1,n-=8388608;t&=-8388609,n+=0x38800000,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=0x38000000+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=0x47800000,s[32]=0x80000000;for(let e=33;e<63;++e)s[e]=0x80000000+(e-32<<23);s[63]=0xc7800000;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:s,offsetTable:o}}();function iI(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=nk(e,-65504,65504),iP.floatView[0]=e;let t=iP.uint32View[0],n=t>>23&511;return iP.baseTable[n]+((8388607&t)>>iP.shiftTable[n])}function iL(e){let t=e>>10;return iP.uint32View[0]=iP.mantissaTable[iP.offsetTable[t]+(1023&e)]+iP.exponentTable[t],iP.floatView[0]}class iN{static toHalfFloat(e){return iI(e)}static fromHalfFloat(e){return iL(e)}}let iD=new nX,iU=new nW,iO=0;class iF{onUploadCallback(){}set needsUpdate(e){!0===e&&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;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=nH(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=nV(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=nH(t,this.array)),t}setX(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=nH(t,this.array)),t}setY(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=nH(t,this.array)),t}setZ(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=nH(t,this.array)),t}setW(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array),r=nV(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array),r=nV(r,this.array),i=nV(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==ng&&(e.usage=this.usage),e}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:iO++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=ng,this.updateRanges=[],this.gpuType=ej,this.version=0}}class ik extends iF{constructor(e,t,n){super(new Int8Array(e),t,n)}}class iz extends iF{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class iB extends iF{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class iH extends iF{constructor(e,t,n){super(new Int16Array(e),t,n)}}class iV extends iF{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class iG extends iF{constructor(e,t,n){super(new Int32Array(e),t,n)}}class iW extends iF{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class ij extends iF{getX(e){let t=iL(this.array[e*this.itemSize]);return this.normalized&&(t=nH(t,this.array)),t}setX(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize]=iI(t),this}getY(e){let t=iL(this.array[e*this.itemSize+1]);return this.normalized&&(t=nH(t,this.array)),t}setY(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+1]=iI(t),this}getZ(e){let t=iL(this.array[e*this.itemSize+2]);return this.normalized&&(t=nH(t,this.array)),t}setZ(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+2]=iI(t),this}getW(e){let t=iL(this.array[e*this.itemSize+3]);return this.normalized&&(t=nH(t,this.array)),t}setW(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+3]=iI(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array)),this.array[e+0]=iI(t),this.array[e+1]=iI(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array),r=nV(r,this.array)),this.array[e+0]=iI(t),this.array[e+1]=iI(n),this.array[e+2]=iI(r),this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array),r=nV(r,this.array),i=nV(i,this.array)),this.array[e+0]=iI(t),this.array[e+1]=iI(n),this.array[e+2]=iI(r),this.array[e+3]=iI(i),this}constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}}class iX extends iF{constructor(e,t,n){super(new Float32Array(e),t,n)}}let iq=0,iY=new rH,iJ=new ia,iZ=new nX,iK=new rf,i$=new rf,iQ=new nX;class i0 extends nL{getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(nK(e)?iW:iV)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(void 0!==n){let t=new nJ().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return iY.makeRotationFromQuaternion(e),this.applyMatrix4(iY),this}rotateX(e){return iY.makeRotationX(e),this.applyMatrix4(iY),this}rotateY(e){return iY.makeRotationY(e),this.applyMatrix4(iY),this}rotateZ(e){return iY.makeRotationZ(e),this.applyMatrix4(iY),this}translate(e,t,n){return iY.makeTranslation(e,t,n),this.applyMatrix4(iY),this}scale(e,t,n){return iY.makeScale(e,t,n),this.applyMatrix4(iY),this}lookAt(e){return iJ.lookAt(e),iJ.updateMatrix(),this.applyMatrix4(iJ.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(iZ).negate(),this.translate(iZ.x,iZ.y,iZ.z),this}setFromPoints(e){let t=this.getAttribute("position");if(void 0===t){let t=[];for(let n=0,r=e.length;nt.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new rf);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new nX(-1/0,-1/0,-1/0),new nX(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(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 s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.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;null!==n&&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(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2)||(i1.copy(i).invert(),i2.copy(e.ray).applyMatrix4(i1),(null===n.boundingBox||!1!==i2.intersectsBox(n.boundingBox))&&this._computeIntersections(e,t,i2))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,s=i.index,o=i.attributes.position,l=i.attributes.uv,u=i.attributes.uv1,c=i.attributes.normal,h=i.groups,d=i.drawRange;if(null!==s)if(Array.isArray(a))for(let i=0,o=h.length;in.far?null:{distance:l,point:at.clone(),object:e}}(e,t,n,r,i5,i6,i8,ae);if(c){let e=new nX;ix.getBarycoord(ae,i5,i6,i8,e),i&&(c.uv=ix.getInterpolatedAttribute(i,o,l,u,e,new nW)),a&&(c.uv1=ix.getInterpolatedAttribute(a,o,l,u,e,new nW)),s&&(c.normal=ix.getInterpolatedAttribute(s,o,l,u,e,new nX),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));let t={a:o,b:l,c:u,normal:new nX,materialIndex:0};ix.getNormal(i5,i6,i8,t.normal),c.face=t,c.barycoord=e}return c}class ai extends i0{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ai(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}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 s=this;r=Math.floor(r),i=Math.floor(i);let o=[],l=[],u=[],c=[],h=0,d=0;function p(e,t,n,r,i,a,p,f,m,g,v){let y=a/m,_=p/g,x=a/2,b=p/2,S=f/2,M=m+1,w=g+1,E=0,T=0,A=new nX;for(let a=0;a0?1:-1,u.push(A.x,A.y,A.z),c.push(o/m),c.push(1-a/g),E+=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)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}}class ac extends ia{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)}constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new rH,this.projectionMatrix=new rH,this.projectionMatrixInverse=new rH,this.coordinateSystem=nA,this._reversedDepth=!1}}let ah=new nX,ad=new nW,ap=new nW;class af extends ac{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=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*nO*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*nU*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*nO*Math.atan(Math.tan(.5*nU*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){ah.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ah.x,ah.y).multiplyScalar(-e/ah.z),ah.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ah.x,ah.y).multiplyScalar(-e/ah.z)}getViewSize(e,t){return this.getViewBounds(e,ad,ap),t.subVectors(ap,ad)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(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(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*nU*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/s,r*=a.width/e,n*=a.height/s}let s=this.filmOffset;0!==s&&(i+=e*s/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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}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()}}class am extends ia{updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,s,o]=t;for(let e of t)this.remove(e);if(e===nA)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),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(e===nC)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),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.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){null===this.parent&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,s,o,l,u]=this.children,c=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let f=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,s),e.setRenderTarget(n,3,r),e.render(t,o),e.setRenderTarget(n,4,r),e.render(t,l),n.texture.generateMipmaps=f,e.setRenderTarget(n,5,r),e.render(t,u),e.setRenderTarget(c,h,d),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new af(-90,1,e,t);r.layers=this.layers,this.add(r);let i=new af(-90,1,e,t);i.layers=this.layers,this.add(i);let a=new af(-90,1,e,t);a.layers=this.layers,this.add(a);let s=new af(-90,1,e,t);s.layers=this.layers,this.add(s);let o=new af(-90,1,e,t);o.layers=this.layers,this.add(o);let l=new af(-90,1,e,t);l.layers=this.layers,this.add(l)}}class ag extends rs{get images(){return this.image}set images(e){this.image=e}constructor(e=[],t=eb,n,r,i,a,s,o,l,u){super(e,t,n,r,i,a,s,o,l,u),this.isCubeTexture=!0,this.flipY=!1}}class av extends ru{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=new ai(5,5,5),r=new au({name:"CubemapFromEquirect",uniforms:aa({tEquirect:{value:null}}),vertexShader:"\n\n varying vec3 vWorldDirection;\n\n vec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n }\n\n void main() {\n\n vWorldDirection = transformDirection( position, modelMatrix );\n\n #include \n #include \n\n }\n ",fragmentShader:"\n\n uniform sampler2D tEquirect;\n\n varying vec3 vWorldDirection;\n\n #include \n\n void main() {\n\n vec3 direction = normalize( vWorldDirection );\n\n vec2 sampleUV = equirectUv( direction );\n\n gl_FragColor = texture2D( tEquirect, sampleUV );\n\n }\n ",side:E,blending:A});r.uniforms.tEquirect.value=t;let i=new an(n,r),a=t.minFilter;return t.minFilter===eF&&(t.minFilter=eD),new am(1,10,this).update(e,i),t.minFilter=a,i.geometry.dispose(),i.material.dispose(),this}clear(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1};this.texture=new ag([n,n,n,n,n,n]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}}class ay extends ia{constructor(){super(),this.isGroup=!0,this.type="Group"}}let a_={type:"move"};class ax{getHandSpace(){return null===this._hand&&(this._hand=new ay,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ay,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new nX,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new nX),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ay,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new nX,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new nX),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&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}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let r of(a=!0,e.hand.values())){let e=t.getJointPose(r,n),i=this._getHandJoint(l,r);null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=null!==e}let r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],s=r.position.distanceTo(i.position);l.inputState.pinching&&s>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&null!==(i=t.getPose(e.gripSpace,n))&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1);null!==s&&(null===(r=t.getPose(e.targetRaySpace,n))&&null!==i&&(r=i),null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,r.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(r.linearVelocity)):s.hasLinearVelocity=!1,r.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(r.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(a_)))}return null!==s&&(s.visible=null!==r),null!==o&&(o.visible=null!==i),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let n=new ay;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}constructor(){this._targetRay=null,this._grip=null,this._hand=null}}class ab{clone(){return new ab(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new iE(e),this.density=t}}class aS{clone(){return new aS(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new iE(e),this.near=t,this.far=n}}class aM extends ia{copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(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),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}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 rK,this.environmentIntensity=1,this.environmentRotation=new rK,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}class aw{onUploadCallback(){}set needsUpdate(e){!0===e&&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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=nF()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=nF()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=ng,this.updateRanges=[],this.version=0,this.uuid=nF()}}let aE=new nX;class aT{get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;te.far||t.push({distance:o,point:aC.clone(),uv:ix.getInterpolation(aC,aD,aU,aO,aF,ak,az,new nW),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}constructor(e=new aA){if(super(),this.isSprite=!0,this.type="Sprite",void 0===n){n=new i0;let e=new aw(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);n.setIndex([0,1,2,0,2,3]),n.setAttribute("position",new aT(e,3,0,!1)),n.setAttribute("uv",new aT(e,2,3,!1))}this.geometry=n,this.material=e,this.center=new nW(.5,.5),this.count=1}}function aH(e,t,n,r,i,a){aI.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(aL.x=a*aI.x-i*aI.y,aL.y=i*aI.x+a*aI.y):aL.copy(aI),e.copy(t),e.x+=aL.x,e.y+=aL.y,e.applyMatrix4(aN)}let aV=new nX,aG=new nX;class aW extends ia{copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,n=t.length;e1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n=Math.abs(n);let i=this.levels;for(t=0;t0){let n,r;for(n=1,r=t.length;n0){aV.setFromMatrixPosition(this.matrixWorld);let n=e.ray.origin.distanceTo(aV);this.getObjectForDistance(n).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){let n,r;aV.setFromMatrixPosition(e.matrixWorld),aG.setFromMatrixPosition(this.matrixWorld);let i=aV.distanceTo(aG)/e.zoom;for(n=1,t[0].object.visible=!0,r=t.length;n=e)t[n-1].object.visible=!1,t[n].object.visible=!0;else break}for(this._currentLevel=n-1;n1?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||so.getNormalMatrix(e),r=this.coplanarPoint(sa).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)}constructor(e=new nX(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}}let su=new rL,sc=new nW(.5,.5),sh=new nX;class sd{set(e,t,n,r,i,a){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(r),s[4].copy(i),s[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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nA,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.planes,i=e.elements,a=i[0],s=i[1],o=i[2],l=i[3],u=i[4],c=i[5],h=i[6],d=i[7],p=i[8],f=i[9],m=i[10],g=i[11],v=i[12],y=i[13],_=i[14],x=i[15];if(r[0].setComponents(l-a,d-u,g-p,x-v).normalize(),r[1].setComponents(l+a,d+u,g+p,x+v).normalize(),r[2].setComponents(l+s,d+c,g+f,x+y).normalize(),r[3].setComponents(l-s,d-c,g-f,x-y).normalize(),n)r[4].setComponents(o,h,m,_).normalize(),r[5].setComponents(l-o,d-h,g-m,x-_).normalize();else if(r[4].setComponents(l-o,d-h,g-m,x-_).normalize(),t===nA)r[5].setComponents(l+o,d+h,g+m,x+_).normalize();else if(t===nC)r[5].setComponents(o,h,m,_).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),su.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),su.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(su)}intersectsSprite(e){return su.center.set(0,0,0),su.radius=.7071067811865476+sc.distanceTo(e.center),su.applyMatrix4(e.matrixWorld),this.intersectsSphere(su)}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,sh.y=r.normal.y>0?e.max.y:e.min.y,sh.z=r.normal.z>0?e.max.z:e.min.z,0>r.distanceToPoint(sh))return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(0>t[n].distanceToPoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}constructor(e=new sl,t=new sl,n=new sl,r=new sl,i=new sl,a=new sl){this.planes=[e,t,n,r,i,a]}}let sp=new rH,sf=new sd;class sm{intersectsObject(e,t){if(!t.isArrayCamera||0===t.cameras.length)return!1;for(let n=0;n=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});let s=i[this.index];a.push(s),this.index++,s.start=e,s.count=t,s.z=n,s.index=r}reset(){this.list.length=0,this.index=0}constructor(){this.index=0,this.pool=[],this.list=[]}},sR=new an,sP=[];function sI(e,t){if(e.constructor!==t.constructor){let n=Math.min(e.length,t.length);for(let r=0;r65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new iF(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let n in t.attributes){if(!e.hasAttribute(n))throw Error('THREE.BatchedMesh: Added geometry missing "'.concat(n,'". All geometries must have consistent attributes.'));let r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||!1===t[e].active)throw Error("THREE.BatchedMesh: Invalid instanceId ".concat(e,". Instance is either out of range or has been deleted."))}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||!1===t[e].active)throw Error("THREE.BatchedMesh: Invalid geometryId ".concat(e,". Geometry is either out of range or has been deleted."))}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new rf);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let t={visible:!0,active:!0,geometryIndex:e},n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(sg),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=t):(n=this._instanceInfo.length,this._instanceInfo.push(t));let r=this._matricesTexture;s_.identity().toArray(r.image.data,16*n),r.needsUpdate=!0;let i=this._colorsTexture;return i&&(sx.toArray(i.image.data,4*n),i.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this._initializeGeometry(e),this._validateGeometry(e);let i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=-1===n?e.getAttribute("position").count:n;let s=e.getIndex();if(null!==s&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=-1===r?s.count:r),-1!==i.indexStart&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(sg),a[t=this._availableGeometryIds.shift()]=i):(t=this._geometryCount,this._geometryCount++,a.push(i)),this.setGeometryAt(t,e),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,t}setGeometryAt(e,t){if(e>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);let n=this.geometry,r=null!==n.getIndex(),i=n.getIndex(),a=t.getIndex(),s=this._geometryInfo[e];if(r&&a.count>s.reservedIndexCount||t.attributes.position.count>s.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let o=s.vertexStart,l=s.reservedVertexCount;for(let e in s.vertexCount=t.getAttribute("position").count,n.attributes){let r=t.getAttribute(e),i=n.getAttribute(e);!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){let i=e.count;for(let a=0;a=t.length||!1===t[e].active)return this;let n=this._instanceInfo;for(let t=0,r=n.length;tt).sort((e,t)=>n[e].vertexStart-n[t].vertexStart),i=this.geometry;for(let a=0,s=n.length;a=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(null===r.boundingBox){let e=new rf,t=n.index,i=n.attributes.position;for(let n=r.start,a=r.start+r.count;n=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(null===r.boundingSphere){let t=new rL;this.getBoundingBoxAt(e,sM),sM.getCenter(t.center);let i=n.index,a=n.attributes.position,s=0;for(let e=r.start,n=r.start+r.count;e1&&void 0!==arguments[1]?arguments[1]:{};this.validateGeometryId(e);let n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){let t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(sg);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(ee.active);if(Math.max(...n.map(e=>e.vertexStart+e.reservedVertexCount))>e)throw Error("BatchedMesh: Geometry vertex values are being used outside the range ".concat(t,". Cannot shrink further."));if(this.geometry.index&&Math.max(...n.map(e=>e.indexStart+e.reservedIndexCount))>t)throw Error("BatchedMesh: Geometry index values are being used outside the range ".concat(t,". Cannot shrink further."));let r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new i0,this._initializeGeometry(r));let i=this.geometry;for(let e in r.index&&sI(r.index.array,i.index.array),r.attributes)sI(r.attributes[e].array,i.attributes[e].array)}raycast(e,t){let n=this._instanceInfo,r=this._geometryInfo,i=this.matrixWorld,a=this.geometry;sR.material=this.material,sR.geometry.index=a.index,sR.geometry.attributes=a.attributes,null===sR.geometry.boundingBox&&(sR.geometry.boundingBox=new rf),null===sR.geometry.boundingSphere&&(sR.geometry.boundingSphere=new rL);for(let a=0,s=n.length;a({...e,boundingBox:null!==e.boundingBox?e.boundingBox.clone():null,boundingSphere:null!==e.boundingSphere?e.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(e=>({...e})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,r,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let a=r.getIndex(),s=null===a?1:a.array.BYTES_PER_ELEMENT,o=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,c=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data,f=n.isArrayCamera?sS:sb;h&&!n.isArrayCamera&&(s_.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),sb.setFromProjectionMatrix(s_,n.coordinateSystem,n.reversedDepth));let m=0;if(this.sortObjects){s_.copy(this.matrixWorld).invert(),sE.setFromMatrixPosition(n.matrixWorld).applyMatrix4(s_),sT.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(s_);for(let e=0,t=o.length;e0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;er)return;sz.applyMatrix4(e.matrixWorld);let l=t.ray.origin.distanceTo(sz);if(!(lt.far))return{distance:l,point:sB.clone().applyMatrix4(e.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:e}}let sG=new nX,sW=new nX;class sj extends sH{computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;ei.far)return;a.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:s})}}class s0 extends rs{clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),super.dispose()}constructor(e,t,n,r,i=eD,a=eD,s,o,l){super(e,t,n,r,i,a,s,o,l),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;let u=this;"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(function t(){u.needsUpdate=!0,u._requestVideoFrameCallbackId=e.requestVideoFrameCallback(t)}))}}class s1 extends s0{update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}constructor(e,t,n,r,i,a,s,o){super({},e,t,n,r,i,a,s,o),this.isVideoFrameTexture=!0}}class s2 extends rs{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=eR,this.minFilter=eR,this.generateMipmaps=!1,this.needsUpdate=!0}}class s3 extends rs{constructor(e,t,n,r,i,a,s,o,l,u,c,h){super(null,a,s,o,l,u,r,i,c,h),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class s4 extends s3{addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}constructor(e,t,n,r,i,a){super(e,t,n,i,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=eA,this.layerUpdates=new Set}}class s5 extends s3{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,eb),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class s6 extends rs{constructor(e,t,n,r,i,a,s,o,l){super(e,t,n,r,i,a,s,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class s8 extends rs{copy(e){return super.copy(e),this.source=new rn(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}constructor(e,t,n=eW,r,i,a,s=eR,o=eR,l,u=e1,c=1){if(u!==e1&&u!==e2)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:c},r,i,a,s,o,u,n,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}}class s9 extends rs{copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}}class s7 extends i0{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new s7(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}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));let a=[],s=[],o=[],l=[],u=t/2,c=Math.PI/2*e,h=t,d=2*c+h,p=2*n+(i=Math.max(1,Math.floor(i))),f=r+1,m=new nX,g=new nX;for(let v=0;v<=p;v++){let y=0,_=0,x=0,b=0;if(v<=n){let t=v/n,r=t*Math.PI/2;_=-u-e*Math.cos(r),x=e*Math.sin(r),b=-e*Math.cos(r),y=t*c}else if(v<=n+i){let r=(v-n)/i;_=-u+r*t,x=e,b=0,y=c+r*h}else{let t=(v-n-i)/n,r=t*Math.PI/2;_=u+e*Math.sin(r),x=e*Math.cos(r),b=e*Math.sin(r),y=c+h+t*c}let S=Math.max(0,Math.min(1,y/d)),M=0;0===v?M=.5/r:v===p&&(M=-.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=-x*a,g.y=_,g.z=x*i,s.push(g.x,g.y,g.z),m.set(-x*a,b,x*i),m.normalize(),o.push(m.x,m.y,m.z),l.push(t+M,S)}if(v>0){let e=(v-1)*f;for(let t=0;t0||0!==r)&&(u.push(a,s,l),y+=3),(t>0||r!==i-1)&&(u.push(s,o,l),y+=3)}l.addGroup(g,y,0),g+=y})(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(u),this.setAttribute("position",new iX(c,3)),this.setAttribute("normal",new iX(h,3)),this.setAttribute("uv",new iX(d,2))}}class on extends ot{static fromJSON(e){return new on(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}constructor(e=1,t=1,n=32,r=1,i=!1,a=0,s=2*Math.PI){super(0,e,t,n,r,i,a,s),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:s}}}class or extends i0{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new or(e.vertices,e.indices,e.radius,e.details)}constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};let i=[],a=[];function s(e){i.push(e.x,e.y,e.z)}function o(t,n){let r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function l(e,t,n,r){r<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}(function(e){let n=new nX,r=new nX,i=new nX;for(let a=0;a.9&&s<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new iX(i,3)),this.setAttribute("normal",new iX(i.slice(),3)),this.setAttribute("uv",new iX(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}}class oi extends or{static fromJSON(e){return new oi(e.radius,e.detail)}constructor(e=1,t=0){let n=(1+Math.sqrt(5))/2,r=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}}let oa=new nX,os=new nX,oo=new nX,ol=new ix;class ou extends i0{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){let n=Math.cos(nU*t),r=e.getIndex(),i=e.getAttribute("position"),a=r?r.count:i.count,s=[0,0,0],o=["a","b","c"],l=[,,,],u={},c=[];for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:5,t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],n,r=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)t.push(i+=(n=this.getPoint(a/e)).distanceTo(r)),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getLengths(),i=0,a=r.length;t=n||e*r[a-1];let s=0,o=a-1,l;for(;s<=o;)if((l=r[i=Math.floor(s+(o-s)/2)]-t)<0)s=i+1;else if(l>0)o=i-1;else{o=i;break}if(r[i=o]===t)return i/(a-1);let u=r[i],c=r[i+1];return(i+(t-u)/(c-u))/(a-1)}getTangent(e,t){let n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);let i=this.getPoint(n),a=this.getPoint(r),s=t||(i.isVector2?new nW:new nX);return s.copy(a).sub(i).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new nX,r=[],i=[],a=[],s=new nX,o=new rH;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new nX)}i[0]=new nX,a[0]=new nX;let l=Number.MAX_VALUE,u=Math.abs(r[0].x),c=Math.abs(r[0].y),h=Math.abs(r[0].z);u<=l&&(l=u,n.set(1,0,0)),c<=l&&(l=c,n.set(0,1,0)),h<=l&&n.set(0,0,1),s.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],s),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(),s.crossVectors(r[t-1],r[t]),s.length()>Number.EPSILON){s.normalize();let e=Math.acos(nk(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(o.makeRotationAxis(s,e))}a[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(nk(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(s.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(o.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}constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}}class oh extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nW,n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,i=Math.abs(r)n;)r-=n;r1&&void 0!==arguments[1]?arguments[1]:new nX,i=this.points,a=i.length,s=(a-!this.closed)*e,o=Math.floor(s),l=s-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:0===l&&o===a-1&&(o=a-2,l=1),this.closed||o>0?t=i[(o-1)%a]:(of.subVectors(i[0],i[1]).add(i[0]),t=of);let u=i[o%a],c=i[(o+1)%a];if(this.closed||o+21&&void 0!==arguments[1]?arguments[1]:new nW,n=this.v0,r=this.v1,i=this.v2,a=this.v3;return t.set(ob(e,n.x,r.x,i.x,a.x),ob(e,n.y,r.y,i.y,a.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}constructor(e=new nW,t=new nW,n=new nW,r=new nW){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}}class oM extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nX,n=this.v0,r=this.v1,i=this.v2,a=this.v3;return t.set(ob(e,n.x,r.x,i.x,a.x),ob(e,n.y,r.y,i.y,a.y),ob(e,n.z,r.z,i.z,a.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}constructor(e=new nX,t=new nX,n=new nX,r=new nX){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}}class ow extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nW;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nW;return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new nW,t=new nW){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}}class oE extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nX;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nX;return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new nX,t=new nX){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}}class oT extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nW,n=this.v0,r=this.v1,i=this.v2;return t.set(ox(e,n.x,r.x,i.x),ox(e,n.y,r.y,i.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new nW,t=new nW,n=new nW){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}}class oA extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nX,n=this.v0,r=this.v1,i=this.v2;return t.set(ox(e,n.x,r.x,i.x),ox(e,n.y,r.y,i.y),ox(e,n.z,r.z,i.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new nX,t=new nX,n=new nX){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}}class oC extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nW,n=this.points,r=(n.length-1)*e,i=Math.floor(r),a=r-i,s=n[0===i?i:i-1],o=n[i],l=n[i>n.length-2?n.length-1:i+1],u=n[i>n.length-3?n.length-1:i+2];return t.set(o_(a,s.x,o.x,l.x,u.x),o_(a,s.y,o.y,l.y,u.y)),t}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],s=a.getLength(),o=0===s?0:1-e/s;return a.getPointAt(o,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;n0&&void 0!==arguments[0]?arguments[0]:40,t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=[];for(let r=0,i=this.curves;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);let u=l.getPoint(1);return this.currentPoint.copy(u),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}constructor(e){super(),this.type="Path",this.currentPoint=new nW,e&&this.setFromPoints(e)}}class oL extends oI{getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n0)for(let i=t;i=t;i-=r)a=oX(i/r|0,e[i],e[i+1],a);return a&&oB(a,a.next)&&(oq(a),a=a.next),a}function oD(e,t){if(!e)return e;t||(t=e);let n=e,r;do if(r=!1,!n.steiner&&(oB(n,n.next)||0===oz(n.prev,n,n.next))){if(oq(n),(n=t=n.prev)===n.next)break;r=!0}else n=n.next;while(r||n!==t)return t}function oU(e,t){let n=e.x-t.x;return 0===n&&0==(n=e.y-t.y)&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),n}function oO(e,t,n,r,i){return(e=((e=((e=((e=((e=(e-n)*i|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-r)*i|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function oF(e,t,n,r,i,a,s,o){return(i-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(r-o)>=(n-s)*(t-o)&&(n-s)*(a-o)>=(i-s)*(r-o)}function ok(e,t,n,r,i,a,s,o){return(e!==s||t!==o)&&oF(e,t,n,r,i,a,s,o)}function oz(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function oB(e,t){return e.x===t.x&&e.y===t.y}function oH(e,t,n,r){let i=oG(oz(e,t,n)),a=oG(oz(e,t,r)),s=oG(oz(n,r,e)),o=oG(oz(n,r,t));return!!(i!==a&&s!==o||0===i&&oV(e,n,t)||0===a&&oV(e,r,t)||0===s&&oV(n,e,r)||0===o&&oV(n,t,r))}function oV(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 oG(e){return e>0?1:e<0?-1:0}function oW(e,t){return 0>oz(e.prev,e,e.next)?oz(e,t,e.next)>=0&&oz(e,e.prev,t)>=0:0>oz(e,t,e.prev)||0>oz(e,e.next,t)}function oj(e,t){let n=oY(e.i,e.x,e.y),r=oY(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 oX(e,t,n,r){let i=oY(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 oq(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 oY(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class oJ{static triangulate(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return function(e,t){let n,r,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,s=t&&t.length,o=s?t[0]*a:e.length,l=oN(e,0,o,a,!0),u=[];if(!l||l.next===l.prev)return u;if(s&&(l=function(e,t,n,r){let i=[];for(let n=0,a=t.length;n=r.next.y&&r.next.y!==r.y){let e=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=i&&e>s&&(s=e,n=r.x=r.x&&r.x>=l&&i!==r.x&&oF(an.x||r.x===n.x&&(h=n,d=r,0>oz(h.prev,h,d.prev)&&0>oz(d.next,h,h.next))))&&(n=r,c=t)}r=r.next}while(r!==o)return n}(e,t);if(!n)return t;let r=oj(n,e);return oD(r,r.next),oD(n,n.next)}(i[e],n);return n}(e,t,l,a)),e.length>80*a){n=1/0,r=1/0;let t=-1/0,s=-1/0;for(let i=a;it&&(t=a),o>s&&(s=o)}i=0!==(i=Math.max(t-n,s-r))?32767/i:0}return function e(t,n,r,i,a,s,o){if(!t)return;!o&&s&&function(e,t,n,r){let i=e;do 0===i.z&&(i.z=oO(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,function(e){let t,n=1;do{let r,i=e;e=null;let a=null;for(t=0;i;){t++;let s=i,o=0;for(let e=0;e0||l>0&&s;)0!==o&&(0===l||!s||i.z<=s.z)?(r=i,i=i.nextZ,o--):(r=s,s=s.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;i=s}a.nextZ=null,n*=2}while(t>1)}(i)}(t,i,a,s);let l=t;for(;t.prev!==t.next;){let u=t.prev,c=t.next;if(s?function(e,t,n,r){let i=e.prev,a=e.next;if(oz(i,e,a)>=0)return!1;let s=i.x,o=e.x,l=a.x,u=i.y,c=e.y,h=a.y,d=Math.min(s,o,l),p=Math.min(u,c,h),f=Math.max(s,o,l),m=Math.max(u,c,h),g=oO(d,p,t,n,r),v=oO(f,m,t,n,r),y=e.prevZ,_=e.nextZ;for(;y&&y.z>=g&&_&&_.z<=v;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&ok(s,u,o,c,l,h,y.x,y.y)&&oz(y.prev,y,y.next)>=0||(y=y.prevZ,_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==i&&_!==a&&ok(s,u,o,c,l,h,_.x,_.y)&&oz(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;y&&y.z>=g;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&ok(s,u,o,c,l,h,y.x,y.y)&&oz(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;_&&_.z<=v;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==i&&_!==a&&ok(s,u,o,c,l,h,_.x,_.y)&&oz(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}(t,i,a,s):function(e){let t=e.prev,n=e.next;if(oz(t,e,n)>=0)return!1;let r=t.x,i=e.x,a=n.x,s=t.y,o=e.y,l=n.y,u=Math.min(r,i,a),c=Math.min(s,o,l),h=Math.max(r,i,a),d=Math.max(s,o,l),p=n.next;for(;p!==t;){if(p.x>=u&&p.x<=h&&p.y>=c&&p.y<=d&&ok(r,s,i,o,a,l,p.x,p.y)&&oz(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(t)){n.push(u.i,t.i,c.i),oq(t),t=c.next,l=c.next;continue}if((t=c)===l){o?1===o?e(t=function(e,t){let n=e;do{let r=n.prev,i=n.next.next;!oB(r,i)&&oH(r,n,n.next,i)&&oW(r,i)&&oW(i,r)&&(t.push(r.i,n.i,i.i),oq(n),oq(n.next),n=e=i),n=n.next}while(n!==e)return oD(n)}(oD(t),n),n,r,i,a,s,2):2===o&&function(t,n,r,i,a,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){var l,u;if(o.i!==t.i&&(l=o,u=t,l.next.i!==u.i&&l.prev.i!==u.i&&!function(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&&oH(n,n.next,e,t))return!0;n=n.next}while(n!==e)return!1}(l,u)&&(oW(l,u)&&oW(u,l)&&function(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}(l,u)&&(oz(l.prev,l,u.prev)||oz(l,u.prev,u))||oB(l,u)&&oz(l.prev,l,l.next)>0&&oz(u.prev,u,u.next)>0))){let l=oj(o,t);o=oD(o,o.next),l=oD(l,l.next),e(o,n,r,i,a,s,0),e(l,n,r,i,a,s,0);return}t=t.next}o=o.next}while(o!==t)}(t,n,r,i,a,s):e(oD(t),n,r,i,a,s,1);break}}}(l,u,a,n,r,i,0),u}(e,t,n)}}class oZ{static area(e){let t=e.length,n=0;for(let r=t-1,i=0;ioZ.area(e)}static triangulateShape(e,t){let n=[],r=[],i=[];oK(e),o$(n,e);let a=e.length;t.forEach(oK);for(let e=0;e2&&e[t-1].equals(e[0])&&e.pop()}function o$(e,t){for(let n=0;nNumber.EPSILON){let h=Math.sqrt(c),d=Math.sqrt(l*l+u*u),p=t.x-o/h,f=t.y+s/h,m=((n.x-u/d-p)*u-(n.y+l/d-f)*l)/(s*u-o*l),g=(r=p+s*m-e.x)*r+(i=f+o*m-e.y)*i;if(g<=2)return new nW(r,i);a=Math.sqrt(g/2)}else{let e=!1;s>Number.EPSILON?l>Number.EPSILON&&(e=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(u)&&(e=!0),e?(r=-o,i=s,a=Math.sqrt(c)):(r=s,i=o,a=Math.sqrt(c/2))}return new nW(r/a,i/a)}let L=[];for(let e=0,t=C.length,n=t-1,r=e+1;e=0;e--){let t=e/y,n=m*Math.cos(t*Math.PI/2),r=g*Math.sin(t*Math.PI/2)+v;for(let e=0,t=C.length;e=0;){let a=i,s=i-1;s<0&&(s=e.length-1);for(let e=0,i=d+2*y;e0)&&d.push(t,i,l),(e!==n-1||o0!=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}constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new nW(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return nk(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new iE(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new iE(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new iE(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}}class lu extends iC{copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,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.flatShading=e.flatShading,this.fog=e.fog,this}constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new iE(0xffffff),this.specular=new iE(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new iE(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tJ,this.normalScale=new nW(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rK,this.combine=eo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}}class lc extends iC{copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new iE(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new iE(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tJ,this.normalScale=new nW(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}}class lh extends iC{copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tJ,this.normalScale=new nW(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}}class ld extends iC{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.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,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.flatShading=e.flatShading,this.fog=e.fog,this}constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new iE(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new iE(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tJ,this.normalScale=new nW(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rK,this.combine=eo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}}class lp extends iC{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}constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=tj,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}}class lf extends iC{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}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)}}class lm extends iC{copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new iE(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tJ,this.normalScale=new nW(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}}class lg extends sN{copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}}function lv(e,t){return e&&e.constructor!==t?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}function ly(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function l_(e){let t=e.length,n=Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort(function(t,n){return e[t]-e[n]}),n}function lx(e,t,n){let r=e.length,i=new e.constructor(r);for(let a=0,s=0;s!==r;++a){let r=n[a]*t;for(let n=0;n!==t;++n)i[s++]=e[r+n]}return i}function lb(e,t,n,r){let i=1,a=e[0];for(;void 0!==a&&void 0===a[r];)a=e[i++];if(void 0===a)return;let s=a[r];if(void 0!==s)if(Array.isArray(s))do void 0!==(s=a[r])&&(t.push(a.time),n.push(...s)),a=e[i++];while(void 0!==a)else if(void 0!==s.toArray)do void 0!==(s=a[r])&&(t.push(a.time),s.toArray(n,n.length)),a=e[i++];while(void 0!==a)else do void 0!==(s=a[r])&&(t.push(a.time),n.push(s)),a=e[i++];while(void 0!==a)}class lS{static convertArray(e,t){return lv(e,t)}static isTypedArray(e){return ly(e)}static getKeyframeOrder(e){return l_(e)}static sortedArray(e,t,n){return lx(e,t,n)}static flattenJSON(e,t,n,r){lb(e,t,n,r)}static subclip(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30;return function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30,a=e.clone();a.name=t;let s=[];for(let e=0;e=r)){l.push(t.times[e]);for(let n=0;na.tracks[e].times[0]&&(o=a.tracks[e].times[0]);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;r<=0&&(r=30);let i=n.tracks.length,a=t/r;for(let t=0;t=i.times[d]){let e=d*u+l,t=e+u-l;r=i.values.slice(e,t)}else{let e=i.createInterpolant(),t=l,n=u-l;e.evaluate(a),r=e.resultBuffer.slice(t,n)}"quaternion"===s&&new nj().fromArray(r).normalize().conjugate().toArray(r);let p=o.times.length;for(let e=0;e=i)){let s=t[1];e=(i=t[--n-1]))break r}a=n,n=0;break i}break n}for(;n>>1;et;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-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&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==a&&a>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,a),e=!1;break}a=r}if(void 0!==r&&ly(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){console.error("THREE.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()===tO,i=e.length-1,a=1;for(let s=1;s0){e[a]=e[i];for(let e=i*n,r=a*n,s=0;s!==n;++s)t[r+s]=t[e+s];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}constructor(e,t,n,r){if(void 0===e)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=lv(t,this.TimeBufferType),this.values=lv(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}}lA.prototype.ValueTypeName="",lA.prototype.TimeBufferType=Float32Array,lA.prototype.ValueBufferType=Float32Array,lA.prototype.DefaultInterpolation=tU;class lC extends lA{constructor(e,t,n){super(e,t,n)}}lC.prototype.ValueTypeName="bool",lC.prototype.ValueBufferType=Array,lC.prototype.DefaultInterpolation=tD,lC.prototype.InterpolantFactoryMethodLinear=void 0,lC.prototype.InterpolantFactoryMethodSmooth=void 0;class lR extends lA{constructor(e,t,n,r){super(e,t,n,r)}}lR.prototype.ValueTypeName="color";class lP extends lA{constructor(e,t,n,r){super(e,t,n,r)}}lP.prototype.ValueTypeName="number";class lI extends lM{interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(n-t)/(r-t),l=e*s;for(let e=l+s;l!==e;l+=4)nj.slerpFlat(i,0,a,l-s,a,l,o);return i}constructor(e,t,n,r){super(e,t,n,r)}}class lL extends lA{InterpolantFactoryMethodLinear(e){return new lI(this.times,this.values,this.getValueSize(),e)}constructor(e,t,n,r){super(e,t,n,r)}}lL.prototype.ValueTypeName="quaternion",lL.prototype.InterpolantFactoryMethodSmooth=void 0;class lN extends lA{constructor(e,t,n){super(e,t,n)}}lN.prototype.ValueTypeName="string",lN.prototype.ValueBufferType=Array,lN.prototype.DefaultInterpolation=tD,lN.prototype.InterpolantFactoryMethodLinear=void 0,lN.prototype.InterpolantFactoryMethodSmooth=void 0;class lD extends lA{constructor(e,t,n,r){super(e,t,n,r)}}lD.prototype.ValueTypeName="vector";class lU{static parse(e){let t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push((function(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return lP;case"vector":case"vector2":case"vector3":case"vector4":return lD;case"color":return lR;case"quaternion":return lL;case"bool":case"boolean":return lC;case"string":return lN}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){let t=[],n=[];lb(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)})(n[e]).scale(r));let i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i.userData=JSON.parse(e.userData||"{}"),i}static toJSON(e){let t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,r=n.length;e!==r;++e)t.push(lA.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){let i=t.length,a=[];for(let e=0;e1){let e=a[1],t=r[e];t||(r[e]=t=[]),t.push(n)}}let a=[];for(let e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(e,t,n,r,i){if(0!==n.length){let a=[],s=[];lb(n,a,s,r),0!==a.length&&i.push(new e(t,a,s))}},r=[],i=e.name||"default",a=e.fps||30,s=e.blendMode,o=e.length||-1,l=e.hierarchy||[];for(let e=0;e{t&&t(i),this.manager.itemEnd(e)},0),i;if(void 0!==lB[e])return void lB[e].push({onLoad:t,onProgress:n,onError:r});lB[e]=[],lB[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:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),s=this.mimeType,o=this.responseType;fetch(a).then(t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;let n=lB[e],r=t.body.getReader(),i=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),a=i?parseInt(i):0,s=0!==a,o=0;return new Response(new ReadableStream({start(e){!function t(){r.read().then(r=>{let{done:i,value:l}=r;if(i)e.close();else{let r=new ProgressEvent("progress",{lengthComputable:s,loaded:o+=l.byteLength,total:a});for(let e=0,t=n.length;e{e.error(t)})}()}}))}throw new lH('fetch for "'.concat(t.url,'" responded with ').concat(t.status,": ").concat(t.statusText),t)}).then(e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>new DOMParser().parseFromString(e,s));case"json":return e.json();default:if(""===s)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(s),n=new TextDecoder(t&&t[1]?t[1].toLowerCase():void 0);return e.arrayBuffer().then(e=>n.decode(e))}}}).then(t=>{lO.add("file:".concat(e),t);let n=lB[e];delete lB[e];for(let e=0,r=n.length;e{let n=lB[e];if(void 0===n)throw this.manager.itemError(e),t;delete lB[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}constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}}class lG extends lz{load(e,t,n,r){let i=this,a=new lV(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}parse(e){let t=[];for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),l5.setFromMatrixPosition(e.matrixWorld),n.position.copy(l5),l6.copy(n.position),l6.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(l6),n.updateMatrixWorld(),r.makeTranslation(-l5.x,-l5.y,-l5.z),l4.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(l4,n.coordinateSystem,n.reversedDepth)}constructor(){super(new af(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new nW(4,2),this._viewportCount=6,this._viewports=[new ro(2,1,1,1),new ro(0,1,1,1),new ro(3,1,1,1),new ro(1,1,1,1),new ro(3,0,1,1),new ro(1,0,1,1)],this._cubeDirections=[new nX(1,0,0),new nX(-1,0,0),new nX(0,0,1),new nX(0,0,-1),new nX(0,1,0),new nX(0,-1,0)],this._cubeUps=[new nX(0,1,0),new nX(0,1,0),new nX(0,1,0),new nX(0,1,0),new nX(0,0,1),new nX(0,0,-1)]}}class l9 extends lZ{get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}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}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 l8}}class l7 extends ac{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=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){null===this.view&&(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(){null!==this.view&&(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,s=r+t,o=r-t;if(null!==this.view&&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,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,s,o,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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}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()}}class ue extends l1{constructor(){super(new l7(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ut extends lZ{dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ia.DEFAULT_UP),this.updateMatrix(),this.target=new ia,this.shadow=new ue}}class un extends lZ{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class ur extends lZ{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}constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}}class ui{set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){let n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){let n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){let n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new nX)}}class ua extends lZ{copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}constructor(e=new ui,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}}class us extends lz{load(e,t,n,r){let i=this,a=new lV(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}parse(e){let t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}let r=this.createMaterialFromType(e.type);if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=e.sheen),void 0!==e.sheenColor&&(r.sheenColor=new iE().setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(r.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.specularIntensity&&(r.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.dispersion&&(r.dispersion=e.dispersion),void 0!==e.iridescence&&(r.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(r.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(r.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(r.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(r.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(r.depthFunc=e.depthFunc),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(r.blendSrc=e.blendSrc),void 0!==e.blendDst&&(r.blendDst=e.blendDst),void 0!==e.blendEquation&&(r.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(r.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(r.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(r.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==r.blendColor&&r.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(r.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),void 0!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(r.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(let t in e.uniforms){let i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case"t":r.uniforms[t].value=n(i.value);break;case"c":r.uniforms[t].value=new iE().setHex(i.value);break;case"v2":r.uniforms[t].value=new nW().fromArray(i.value);break;case"v3":r.uniforms[t].value=new nX().fromArray(i.value);break;case"v4":r.uniforms[t].value=new ro().fromArray(i.value);break;case"m3":r.uniforms[t].value=new nJ().fromArray(i.value);break;case"m4":r.uniforms[t].value=new rH().fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(r.glslVersion=e.glslVersion),void 0!==e.extensions)for(let t in e.extensions)r.extensions[t]=e.extensions[t];if(void 0!==e.lights&&(r.lights=e.lights),void 0!==e.clipping&&(r.clipping=e.clipping),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=new nW().fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(r.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(r.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapRotation&&r.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=new nW().fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(r.iridescenceMap=n(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=n(e.thicknessMap)),void 0!==e.anisotropyMap&&(r.anisotropyMap=n(e.anisotropyMap)),void 0!==e.sheenColorMap&&(r.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return us.createMaterialFromType(e)}static createMaterialFromType(e){return new({ShadowMaterial:la,SpriteMaterial:aA,RawShaderMaterial:ls,ShaderMaterial:au,PointsMaterial:sq,MeshPhysicalMaterial:ll,MeshStandardMaterial:lo,MeshPhongMaterial:lu,MeshToonMaterial:lc,MeshNormalMaterial:lh,MeshLambertMaterial:ld,MeshDepthMaterial:lp,MeshDistanceMaterial:lf,MeshBasicMaterial:iR,MeshMatcapMaterial:lm,LineDashedMaterial:lg,LineBasicMaterial:sN,Material:iC})[e]}constructor(e){super(e),this.textures={}}}class uo{static extractUrlBase(e){let t=e.lastIndexOf("/");return -1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e))?e:t+e}}class ul extends i0{copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}}class uu extends lz{load(e,t,n,r){let i=this,a=new lV(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}parse(e){let t={},n={};function r(e,r){if(void 0!==t[r])return t[r];let i=e.interleavedBuffers[r],a=function(e,t){if(void 0!==n[t])return n[t];let r=new Uint32Array(e.arrayBuffers[t]).buffer;return n[t]=r,r}(e,i.buffer),s=new aw(nQ(i.type,a),i.stride);return s.uuid=i.uuid,t[r]=s,s}let i=e.isInstancedBufferGeometry?new ul:new i0,a=e.data.index;if(void 0!==a){let e=nQ(a.type,a.array);i.setIndex(new iF(e,1))}let s=e.data.attributes;for(let t in s){let n,a=s[t];if(a.isInterleavedBufferAttribute)n=new aT(r(e.data,a.data),a.itemSize,a.offset,a.normalized);else{let e=nQ(a.type,a.array);n=new(a.isInstancedBufferAttribute?a6:iF)(e,a.itemSize,a.normalized)}void 0!==a.name&&(n.name=a.name),void 0!==a.usage&&n.setUsage(a.usage),i.setAttribute(t,n)}let o=e.data.morphAttributes;if(o)for(let t in o){let n=o[t],a=[];for(let t=0,i=n.length;t0){(n=new lX(new lF(t))).setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t0){(t=new lX(this.manager)).setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t{let t=null,n=null;return void 0!==e.boundingBox&&(t=new rf().fromJSON(e.boundingBox)),void 0!==e.boundingSphere&&(n=new rL().fromJSON(e.boundingSphere)),{...e,boundingBox:t,boundingSphere:n}}),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),void 0!==e.colorsTexture&&(a._colorsTexture=c(e.colorsTexture.uuid)),void 0!==e.boundingSphere&&(a.boundingSphere=new rL().fromJSON(e.boundingSphere)),void 0!==e.boundingBox&&(a.boundingBox=new rf().fromJSON(e.boundingBox));break;case"LOD":a=new aW;break;case"Line":a=new sH(l(e.geometry),u(e.material));break;case"LineLoop":a=new sX(l(e.geometry),u(e.material));break;case"LineSegments":a=new sj(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":a=new s$(l(e.geometry),u(e.material));break;case"Sprite":a=new aB(u(e.material));break;case"Group":a=new ay;break;case"Bone":a=new a1;break;default:a=new ia}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.up&&a.up.fromArray(e.up),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.intensity&&(a.shadow.intensity=e.shadow.intensity),void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(a.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children){let s=e.children;for(let e=0;e{if(!0!==uf.has(a))return t&&t(n),i.manager.itemEnd(e),n;r&&r(uf.get(a)),i.manager.itemError(e),i.manager.itemEnd(e)}):(setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a);let s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,s.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let o=fetch(e,s).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))}).then(function(n){return lO.add("image-bitmap:".concat(e),n),t&&t(n),i.manager.itemEnd(e),n}).catch(function(t){r&&r(t),uf.set(o,t),lO.remove("image-bitmap:".concat(e)),i.manager.itemError(e),i.manager.itemEnd(e)});lO.add("image-bitmap:".concat(e),o),i.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}}class ug{static getContext(){return void 0===r&&(r=new(window.AudioContext||window.webkitAudioContext)),r}static setContext(e){r=e}}class uv extends lz{load(e,t,n,r){let i=this,a=new lV(this.manager);function s(t){r?r(t):console.error(t),i.manager.itemError(e)}a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(e){try{let n=e.slice(0);ug.getContext().decodeAudioData(n,function(e){t(e)}).catch(s)}catch(e){s(e)}},n,r)}constructor(e){super(e)}}let uy=new rH,u_=new rH,ux=new rH;class ub{update(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){let n,r;t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,ux.copy(e.projectionMatrix);let i=t.eyeSep/2,a=i*t.near/t.focus,s=t.near*Math.tan(nU*t.fov*.5)/t.zoom;u_.elements[12]=-i,uy.elements[12]=i,n=-s*t.aspect+a,r=s*t.aspect+a,ux.elements[0]=2*t.near/(r-n),ux.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(ux),n=-s*t.aspect-a,r=s*t.aspect-a,ux.elements[0]=2*t.near/(r-n),ux.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(ux)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(u_),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(uy)}constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new af,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new af,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}}class uS extends af{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class uM{start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}}let uw=new nX,uE=new nj,uT=new nX,uA=new nX,uC=new nX;class uR extends ia{getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(uw,uE,uT),uA.set(0,0,-1).applyQuaternion(uE),uC.set(0,1,0).applyQuaternion(uE),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(uw.x,e),t.positionY.linearRampToValueAtTime(uw.y,e),t.positionZ.linearRampToValueAtTime(uw.z,e),t.forwardX.linearRampToValueAtTime(uA.x,e),t.forwardY.linearRampToValueAtTime(uA.y,e),t.forwardZ.linearRampToValueAtTime(uA.z,e),t.upX.linearRampToValueAtTime(uC.x,e),t.upY.linearRampToValueAtTime(uC.y,e),t.upZ.linearRampToValueAtTime(uC.z,e)}else t.setPosition(uw.x,uw.y,uw.z),t.setOrientation(uA.x,uA.y,uA.z,uC.x,uC.y,uC.z)}constructor(){super(),this.type="AudioListener",this.context=ug.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new uM}}class uP extends ia{getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this)}stop(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this)}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){s.setValue(n,r);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n;e!==r;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){nj.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){let a=this._workIndex*i;nj.multiplyQuaternionsFlat(e,a,e,t,e,n),nj.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,i){let a=1-r;for(let s=0;s!==i;++s){let i=t+s;e[i]=e[i]*a+e[n+s]*r}}_lerpAdditive(e,t,n,r,i){for(let a=0;a!==i;++a){let i=t+a;e[i]=e[i]+e[n+a]*r}}constructor(e,t,n){let r,i,a;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}}let uk="\\[\\]\\.:\\/",uz=RegExp("["+uk+"]","g"),uB="[^"+uk+"]",uH="[^"+uk.replace("\\.","")+"]",uV=/((?:WC+[\/:])*)/.source.replace("WC",uB),uG=/(WCOD+)?/.source.replace("WCOD",uH),uW=RegExp("^"+uV+uG+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",uB)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",uB)+"$"),uj=["material","materials","bones","map"];class uX{static create(e,t,n){return e&&e.isAnimationObjectGroup?new uX.Composite(e,t,n):new uX(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(uz,"")}static parseTrackName(e){let t=uW.exec(e);if(null===t)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(void 0!==r&&-1!==r){let e=n.nodeName.substring(r+1);-1!==uj.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){let n=function(e){for(let r=0;r=i){let a=i++,u=e[a];t[u.uuid]=l,e[l]=u,t[o]=a,e[a]=s;for(let e=0;e!==r;++e){let t=n[e],r=t[a],i=t[l];t[l]=r,t[a]=i}}}this.nCachedObjects_=i}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=e.length;for(let s=0,o=arguments.length;s!==o;++s){let o=arguments[s],l=o.uuid,u=t[l];if(void 0!==u)if(delete t[l],u0&&(t[s.uuid]=u),e[u]=s,e.pop();for(let e=0;e!==r;++e){let t=n[e];t[u]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){let n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];let a=this._paths,s=this._parsedPaths,o=this._objects,l=o.length,u=this.nCachedObjects_,c=Array(l);r=i.length,n[e]=r,a.push(e),s.push(t),i.push(c);for(let n=u,r=o.length;n!==r;++n){let r=o[n];c[n]=new uX(r,e,t)}return c}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){let r=this._paths,i=this._parsedPaths,a=this._bindings,s=a.length-1,o=a[s];t[e[s]]=n,a[n]=o,a.pop(),i[n]=i[s],i.pop(),r[n]=r[s],r.pop()}}constructor(){this.isAnimationObjectGroup=!0,this.uuid=nF(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let e={};this._indicesByUUID=e;for(let t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}}class uY{play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.fadeOut(t),this.fadeIn(t),!0===n){let n=this._clip.duration,r=e._clip.duration;e.warp(1,r/n,t),this.warp(n/r,1,t)}return this}crossFadeTo(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let r=this._mixer,i=r.time,a=this.timeScale,s=this._timeScaleInterpolant;null===s&&(s=r._lendControlInterpolant(),this._timeScaleInterpolant=s);let o=s.parameterPositions,l=s.sampleValues;return o[0]=i,o[1]=i+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);let i=this._startTime;if(null!==i){let r=(e-i)*n;r<0||0===n?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);let a=this._updateTime(t),s=this._updateWeight(e);if(s>0){let e=this._interpolants,t=this._propertyBindings;if(this.blendMode===tH)for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(s);else for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(null!==n){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,a=n===tN;if(0===e)return -1===i?r:a&&(1&i)==1?t-r:r;if(n===tI){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));s:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break s}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){let n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);let s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(a&&(1&i)==1)return t-r}return r}_setEndings(e,t,n){let r=this._interpolantSettings;n?(r.endingStart=tk,r.endingEnd=tk):(e?r.endingStart=this.zeroSlopeAtStart?tk:tF:r.endingStart=tz,t?r.endingEnd=this.zeroSlopeAtEnd?tk:tF:r.endingEnd=tz)}_scheduleFading(e,t,n){let r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);let s=a.parameterPositions,o=a.sampleValues;return s[0]=i,o[0]=t,s[1]=i+e,o[1]=n,this}constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;let i=t.tracks,a=i.length,s=Array(a),o={endingStart:tF,endingEnd:tF};for(let e=0;e!==a;++e){let t=i[e].createInterpolant(null);s[e]=t,t.settings=o}this._interpolantSettings=o,this._interpolants=s,this._propertyBindings=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=tL,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}}let uJ=new Float32Array(1);class uZ extends nL{_bindAction(e,t){let n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,s=e._interpolants,o=n.uuid,l=this._bindingsByRootAndName,u=l[o];void 0===u&&(u={},l[o]=u);for(let e=0;e!==i;++e){let i=r[e],l=i.name,c=u[l];if(void 0!==c)++c.referenceCount,a[e]=c;else{if(void 0!==(c=a[e])){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,o,l));continue}let r=t&&t._propertyBindings[e].binding.parsedPath;c=new uF(uX.create(n,l,r),i.ValueTypeName,i.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,o,l),a[e]=c}s[e].resultBuffer=c.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){let t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return null!==t&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let s=0;s!==n;++s)t[s]._update(r,e,i,a);let s=this._bindings,o=this._nActiveBindings;for(let e=0;e!==o;++e)s[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e1)||void 0===arguments[1]||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return u6(e,this,n,t),n.sort(u5),n}intersectObjects(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let r=0,i=e.length;r1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){let i=this.elements;return i[0]=e,i[2]=t,i[1]=n,i[3]=r,this}constructor(e,t,n,r){ct.prototype.isMatrix2=!0,this.elements=[1,0,0,1],void 0!==e&&this.set(e,t,n,r)}}let cn=new nW;class cr{set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}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}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))}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}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,cn).distanceTo(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}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)}constructor(e=new nW(Infinity,Infinity),t=new nW(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}}let ci=new nX,ca=new nX,cs=new nX,co=new nX,cl=new nX,cu=new nX,cc=new nX;class ch{set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){ci.subVectors(e,this.start),ca.subVectors(this.end,this.start);let n=ca.dot(ca),r=ca.dot(ci)/n;return t&&(r=nk(r,0,1)),r}closestPointToPoint(e,t,n){let r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}distanceSqToLine3(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cu,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:cc,a=1e-8*1e-8,s=this.start,o=e.start,l=this.end,u=e.end;cs.subVectors(l,s),co.subVectors(u,o),cl.subVectors(s,o);let c=cs.dot(cs),h=co.dot(co),d=co.dot(cl);if(c<=a&&h<=a)return r.copy(s),i.copy(o),r.sub(i),r.dot(r);if(c<=a)t=0,n=nk(n=d/h,0,1);else{let e=cs.dot(cl);if(h<=a)n=0,t=nk(-e/c,0,1);else{let r=cs.dot(co),i=c*h-r*r;t=0!==i?nk((r*d-e*h)/i,0,1):0,(n=(r*t+d)/h)<0?(n=0,t=nk(-e/c,0,1)):n>1&&(n=1,t=nk((r-e)/c,0,1))}}return r.copy(s).add(cs.multiplyScalar(t)),i.copy(o).add(co.multiplyScalar(n)),r.sub(i),r.dot(r)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}constructor(e=new nX,t=new nX){this.start=e,this.end=t}}let cd=new nX;class cp extends ia{dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),cd.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(cd),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";let n=new i0,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1;e<32;e++,t++){let n=e/32*Math.PI*2,i=t/32*Math.PI*2;r.push(Math.cos(n),Math.sin(n),1,Math.cos(i),Math.sin(i),1)}n.setAttribute("position",new iX(r,3));let i=new sN({fog:!1,toneMapped:!1});this.cone=new sj(n,i),this.add(this.cone),this.update()}}let cf=new nX,cm=new rH,cg=new rH;class cv extends sj{updateMatrixWorld(e){let t=this.bones,n=this.geometry,r=n.getAttribute("position");cg.copy(this.root.matrixWorld).invert();for(let e=0,n=0;e1)for(let n=0;n.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{cF.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(cF,t)}}setLength(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2*e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.2*t;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()}constructor(e=new nX(0,0,1),t=new nX(0,0,0),n=1,r=0xffff00,s=.2*n,o=.2*s){super(),this.type="ArrowHelper",void 0===i&&((i=new i0).setAttribute("position",new iX([0,0,0,0,1,0],3)),(a=new on(.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new sH(i,new sN({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new an(a,new iR({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,s,o)}}class cz extends sj{setColors(e,t,n){let r=new iE,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()}constructor(e=1){let t=new i0;t.setAttribute("position",new iX([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],3)),t.setAttribute("color",new iX([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(t,new sN({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}}class cB{moveTo(e,t){return this.currentPath=new oI,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){let t,n,r,i,a,s=oZ.isClockWise,o=this.subPaths;if(0===o.length)return[];let l=[];if(1===o.length)return n=o[0],(r=new oL).curves=n.curves,l.push(r),l;let u=!s(o[0].getPoints());u=e?!u:u;let c=[],h=[],d=[],p=0;h[0]=void 0,d[p]=[];for(let r=0,a=o.length;r1){let e=!1,t=0;for(let e=0,t=h.length;eNumber.EPSILON){if(l<0&&(n=t[a],o=-o,s=t[i],l=-l),e.ys.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=l*(e.x-n.x)-o*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(s.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=s.x)return!0}}return r})(a.p,h[r].p)&&(n!==r&&t++,s?(s=!1,c[r].push(a)):e=!0);s&&c[n].push(a)}}t>0&&!1===e&&(d=c)}for(let e=0,t=h.length;et?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}static cover(e,t){let n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}static fill(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}static getByteLength(e,t,n,r){return cV(e,t,n,r)}}function cW(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function cj(e){let t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))},update:function(n,r){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){let e=t.get(n);(!e||e.versione.start-t.start);let t=0;for(let e=1;eha,"ShaderChunk",()=>cX,"ShaderLib",()=>cY,"UniformsLib",()=>cq,"WebGLRenderer",()=>d2,"WebGLUtils",()=>dJ],8560);let cX={alphahash_fragment:"#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif",batching_vertex:"#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n 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 );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n 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 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",fog_vertex:"#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid 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 ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid 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 ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid 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 ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid 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 ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n 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 ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return saturate(v);\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColor;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid 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 ) {\n#else\nvoid 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 ) {\n#endif\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n 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 ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid 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 ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n float depth = unpackRGBAToDepth( texture2D( depths, uv ) );\n #ifdef USE_REVERSED_DEPTH_BUFFER\n return step( depth, compare );\n #else\n return step( compare, depth );\n #endif\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow( sampler2D shadow, vec2 uv, float compare ) {\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float hard_shadow = step( distribution.x, compare );\n #else\n float hard_shadow = step( compare, distribution.x );\n #endif\n if ( hard_shadow != 1.0 ) {\n float distance = compare - distribution.x;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n \n float lightToPositionLength = length( lightToPosition );\n if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n shadow = (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n 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 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include \n #include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include \n #include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include \n #include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n #include \n #ifdef USE_REVERSED_DEPTH_BUFFER\n float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n #else\n float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n #endif\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #include \n #include \n #include \n #include \n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include \n #include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vLineDistance = scale * lineDistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include \n #include \n #include \n #include \n #include \n #include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include \n #include \n #include \n #include \n gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include \n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include \n #include \n #include \n #include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include \n #include \n #include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include \n #include \n #include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n}"},cq={common:{diffuse:{value:new iE(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new nJ},alphaMap:{value:null},alphaMapTransform:{value:new nJ},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new nJ}},envmap:{envMap:{value:null},envMapRotation:{value:new nJ},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new nJ}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new nJ}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new nJ},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new nJ},normalScale:{value:new nW(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new nJ},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new nJ}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new nJ}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new nJ}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new iE(0xffffff)}},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 iE(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new nJ},alphaTest:{value:0},uvTransform:{value:new nJ}},sprite:{diffuse:{value:new iE(0xffffff)},opacity:{value:1},center:{value:new nW(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new nJ},alphaMap:{value:null},alphaMapTransform:{value:new nJ},alphaTest:{value:0}}},cY={basic:{uniforms:as([cq.common,cq.specularmap,cq.envmap,cq.aomap,cq.lightmap,cq.fog]),vertexShader:cX.meshbasic_vert,fragmentShader:cX.meshbasic_frag},lambert:{uniforms:as([cq.common,cq.specularmap,cq.envmap,cq.aomap,cq.lightmap,cq.emissivemap,cq.bumpmap,cq.normalmap,cq.displacementmap,cq.fog,cq.lights,{emissive:{value:new iE(0)}}]),vertexShader:cX.meshlambert_vert,fragmentShader:cX.meshlambert_frag},phong:{uniforms:as([cq.common,cq.specularmap,cq.envmap,cq.aomap,cq.lightmap,cq.emissivemap,cq.bumpmap,cq.normalmap,cq.displacementmap,cq.fog,cq.lights,{emissive:{value:new iE(0)},specular:{value:new iE(1118481)},shininess:{value:30}}]),vertexShader:cX.meshphong_vert,fragmentShader:cX.meshphong_frag},standard:{uniforms:as([cq.common,cq.envmap,cq.aomap,cq.lightmap,cq.emissivemap,cq.bumpmap,cq.normalmap,cq.displacementmap,cq.roughnessmap,cq.metalnessmap,cq.fog,cq.lights,{emissive:{value:new iE(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:cX.meshphysical_vert,fragmentShader:cX.meshphysical_frag},toon:{uniforms:as([cq.common,cq.aomap,cq.lightmap,cq.emissivemap,cq.bumpmap,cq.normalmap,cq.displacementmap,cq.gradientmap,cq.fog,cq.lights,{emissive:{value:new iE(0)}}]),vertexShader:cX.meshtoon_vert,fragmentShader:cX.meshtoon_frag},matcap:{uniforms:as([cq.common,cq.bumpmap,cq.normalmap,cq.displacementmap,cq.fog,{matcap:{value:null}}]),vertexShader:cX.meshmatcap_vert,fragmentShader:cX.meshmatcap_frag},points:{uniforms:as([cq.points,cq.fog]),vertexShader:cX.points_vert,fragmentShader:cX.points_frag},dashed:{uniforms:as([cq.common,cq.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:cX.linedashed_vert,fragmentShader:cX.linedashed_frag},depth:{uniforms:as([cq.common,cq.displacementmap]),vertexShader:cX.depth_vert,fragmentShader:cX.depth_frag},normal:{uniforms:as([cq.common,cq.bumpmap,cq.normalmap,cq.displacementmap,{opacity:{value:1}}]),vertexShader:cX.meshnormal_vert,fragmentShader:cX.meshnormal_frag},sprite:{uniforms:as([cq.sprite,cq.fog]),vertexShader:cX.sprite_vert,fragmentShader:cX.sprite_frag},background:{uniforms:{uvTransform:{value:new nJ},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:cX.background_vert,fragmentShader:cX.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new nJ}},vertexShader:cX.backgroundCube_vert,fragmentShader:cX.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:cX.cube_vert,fragmentShader:cX.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:cX.equirect_vert,fragmentShader:cX.equirect_frag},distanceRGBA:{uniforms:as([cq.common,cq.displacementmap,{referencePosition:{value:new nX},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:cX.distanceRGBA_vert,fragmentShader:cX.distanceRGBA_frag},shadow:{uniforms:as([cq.lights,cq.fog,{color:{value:new iE(0)},opacity:{value:1}}]),vertexShader:cX.shadow_vert,fragmentShader:cX.shadow_frag}};cY.physical={uniforms:as([cY.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new nJ},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new nJ},clearcoatNormalScale:{value:new nW(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new nJ},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new nJ},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new nJ},sheen:{value:0},sheenColor:{value:new iE(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new nJ},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new nJ},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new nJ},transmissionSamplerSize:{value:new nW},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new nJ},attenuationDistance:{value:0},attenuationColor:{value:new iE(0)},specularColor:{value:new iE(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new nJ},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new nJ},anisotropyVector:{value:new nW},anisotropyMap:{value:null},anisotropyMapTransform:{value:new nJ}}]),vertexShader:cX.meshphysical_vert,fragmentShader:cX.meshphysical_frag};let cJ={r:0,b:0,g:0},cZ=new rK,cK=new rH;function c$(e,t,n,r,i,a,s){let o,l,u=new iE(0),c=+(!0!==a),h=null,d=0,p=null;function f(e){let r=!0===e.isScene?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?n:t).get(r)),r}function m(t,n){t.getRGB(cJ,ao(e)),r.buffers.color.setClear(cJ.r,cJ.g,cJ.b,n,s)}return{getClearColor:function(){return u},setClearColor:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;u.set(e),m(u,c=t)},getClearAlpha:function(){return c},setClearAlpha:function(e){m(u,c=e)},render:function(t){let n=!1,i=f(t);null===i?m(u,c):i&&i.isColor&&(m(i,1),n=!0);let a=e.xr.getEnvironmentBlendMode();"additive"===a?r.buffers.color.setClear(0,0,0,1,s):"alpha-blend"===a&&r.buffers.color.setClear(0,0,0,0,s),(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))},addToRenderList:function(t,n){let r=f(n);r&&(r.isCubeTexture||r.mapping===eE)?(void 0===l&&((l=new an(new ai(1,1,1),new au({name:"BackgroundCubeMaterial",uniforms:aa(cY.backgroundCube.uniforms),vertexShader:cY.backgroundCube.vertexShader,fragmentShader:cY.backgroundCube.fragmentShader,side:E,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),cZ.copy(n.backgroundRotation),cZ.x*=-1,cZ.y*=-1,cZ.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(cZ.y*=-1,cZ.z*=-1),l.material.uniforms.envMap.value=r,l.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(cK.makeRotationFromEuler(cZ)),l.material.toneMapped=n8.getTransfer(r.colorSpace)!==t1,(h!==r||d!==r.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,h=r,d=r.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):r&&r.isTexture&&(void 0===o&&((o=new an(new o4(2,2),new au({name:"BackgroundMaterial",uniforms:aa(cY.background.uniforms),vertexShader:cY.background.vertexShader,fragmentShader:cY.background.fragmentShader,side:w,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(o)),o.material.uniforms.t2D.value=r,o.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,o.material.toneMapped=n8.getTransfer(r.colorSpace)!==t1,!0===r.matrixAutoUpdate&&r.updateMatrix(),o.material.uniforms.uvTransform.value.copy(r.matrix),(h!==r||d!==r.version||p!==e.toneMapping)&&(o.material.needsUpdate=!0,h=r,d=r.version,p=e.toneMapping),o.layers.enableAll(),t.unshift(o,o.geometry,o.material,0,0,null))},dispose:function(){void 0!==l&&(l.geometry.dispose(),l.material.dispose(),l=void 0),void 0!==o&&(o.geometry.dispose(),o.material.dispose(),o=void 0)}}}function cQ(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=u(null),a=i,s=!1;function o(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function u(e){let t=[],r=[],i=[];for(let e=0;e=0){let n=i[t],r=s[t];if(void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor)),void 0===n||n.attribute!==r||r&&n.data!==r.data)return!0;o++}return a.attributesNum!==o||a.index!==r}(n,m,l,g))&&function(e,t,n,r){let i={},s=t.attributes,o=0,l=n.getAttributes();for(let t in l)if(l[t].location>=0){let n=s[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,o++}a.attributes=i,a.attributesNum=o,a.index=r}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(v||s)&&(s=!1,function(n,r,i,a){c();let s=a.attributes,o=i.getAttributes(),l=r.defaultAttributeValues;for(let r in o){let i=o[r];if(i.location>=0){let o=s[r];if(void 0===o&&("instanceMatrix"===r&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===r&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){let r=o.normalized,s=o.itemSize,l=t.get(o);if(void 0===l)continue;let u=l.buffer,c=l.type,p=l.bytesPerElement,m=c===e.INT||c===e.UNSIGNED_INT||o.gpuType===eG;if(o.isInterleavedBufferAttribute){let t=o.data,l=t.stride,g=o.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let s=void 0!==n.precision?n.precision:"highp",o=a(s);o!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",o,"instead."),s=o);let l=!0===n.logarithmicDepthBuffer,u=!0===n.reversedDepthBuffer&&t.has("EXT_clip_control"),c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),m=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),g=e.getParameter(e.MAX_VARYING_VECTORS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){let n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:a,textureFormatReadable:function(t){return t===e0||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){let i=n===eX&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return n===ez||r.convert(n)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)||n===ej||!!i},precision:s,logarithmicDepthBuffer:l,reversedDepthBuffer:u,maxTextures:c,maxVertexTextures:h,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:h>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function c2(e){let t=this,n=null,r=0,i=!1,a=!1,s=new sl,o=new nJ,l={value:null,needsUpdate:!1};function u(e,n,r,i){let a=null!==e?e.length:0,u=null;if(0!==a){if(u=l.value,!0!==i||null===u){let t=r+4*a,i=n.matrixWorldInverse;o.getNormalMatrix(i),(null===u||u.length0),t.numPlanes=r,t.numIntersection=0)}}function c3(e){let t=new WeakMap;function n(e,t){return t===eM?e.mapping=eb:t===ew&&(e.mapping=eS),e}function r(e){let n=e.target;n.removeEventListener("dispose",r);let i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){let a=i.mapping;if(a===eM||a===ew)if(t.has(i))return n(t.get(i).texture,i.mapping);else{let a=i.image;if(!a||!(a.height>0))return null;{let s=new av(a.height);return s.fromEquirectangularTexture(e,i),t.set(i,s),i.addEventListener("dispose",r),n(s.texture,i.mapping)}}}return i},dispose:function(){t=new WeakMap}}}let c4=[.125,.215,.35,.446,.526,.582],c5=new l7,c6=new iE,c8=null,c9=0,c7=0,he=!1,ht=(1+Math.sqrt(5))/2,hn=1/ht,hr=[new nX(-ht,hn,0),new nX(ht,hn,0),new nX(-hn,0,ht),new nX(hn,0,ht),new nX(0,ht,-hn),new nX(0,ht,hn),new nX(-1,1,-1),new nX(1,1,-1),new nX(-1,1,1),new nX(1,1,1)],hi=new nX;class ha{fromScene(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},{size:a=256,position:s=hi}=i;c8=this._renderer.getRenderTarget(),c9=this._renderer.getActiveCubeFace(),c7=this._renderer.getActiveMipmapLevel(),he=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,n,r,o,s),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}fromCubemap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=hu(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=hl(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?o=c4[s-e+4-1]:0===s&&(o=0),r.push(o);let l=1/(a-2),u=-l,c=1+l,h=[u,u,c,u,c,c,u,u,c,c,u,c],d=new Float32Array(108),p=new Float32Array(72),f=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];d.set(r,18*e),p.set(h,12*e);let i=[e,e,e,e,e,e];f.set(i,6*e)}let m=new i0;m.setAttribute("position",new iF(d,3)),m.setAttribute("uv",new iF(p,2)),m.setAttribute("faceIndex",new iF(f,1)),t.push(m),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){let r=new Float32Array(20),i=new nX(0,1,0);return new au({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:"".concat(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:hc(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n uniform int samples;\n uniform float weights[ n ];\n uniform bool latitudinal;\n uniform float dTheta;\n uniform float mipInt;\n uniform vec3 poleAxis;\n\n #define ENVMAP_TYPE_CUBE_UV\n #include \n\n vec3 getSample( float theta, vec3 axis ) {\n\n float cosTheta = cos( theta );\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross( axis, vOutputDirection ) * sin( theta )\n + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n return bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n }\n\n void main() {\n\n vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n if ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n }\n\n axis = normalize( axis );\n\n gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n for ( int i = 1; i < n; i++ ) {\n\n if ( i >= samples ) {\n\n break;\n\n }\n\n float theta = dTheta * float( i );\n gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n }\n\n }\n ",blending:A,depthTest:!1,depthWrite:!1})}(r,e,t)}return r}_compileMaterial(e){let t=new an(this._lodPlanes[0],e);this._renderer.compile(t,c5)}_sceneToCubeUV(e,t,n,r,i){let a=new af(90,1,t,n),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,u=l.autoClear,c=l.toneMapping;l.getClearColor(c6),l.toneMapping=ec,l.autoClear=!1,l.state.buffers.depth.getReversed()&&(l.setRenderTarget(r),l.clearDepth(),l.setRenderTarget(null));let h=new iR({name:"PMREM.Background",side:E,depthWrite:!1,depthTest:!1}),d=new an(new ai,h),p=!1,f=e.background;f?f.isColor&&(h.color.copy(f),e.background=null,p=!0):(h.color.copy(c6),p=!0);for(let t=0;t<6;t++){let n=t%3;0===n?(a.up.set(0,s[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x+o[t],i.y,i.z)):1===n?(a.up.set(0,0,s[t]),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y+o[t],i.z)):(a.up.set(0,s[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y,i.z+o[t]));let u=this._cubeSize;ho(r,n*u,t>2?u:0,u,u),l.setRenderTarget(r),p&&l.render(d,a),l.render(e,a)}d.geometry.dispose(),d.material.dispose(),l.toneMapping=c,l.autoClear=u,e.background=f}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===eb||e.mapping===eS;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=hu()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=hl());let i=r?this._cubemapMaterial:this._equirectMaterial,a=new an(this._lodPlanes[0],i);i.uniforms.envMap.value=e;let s=this._cubeSize;ho(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,c5)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodPlanes.length;for(let t=1;t20&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(f," samples when the maximum is set to ").concat(20));let m=[],g=0;for(let e=0;e<20;++e){let t=e/p,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:ev-4?r-v+4:0),_,3*y,2*y),o.setRenderTarget(t),o.render(u,c5)}constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}}function hs(e,t,n){let r=new ru(e,t,n);return r.texture.mapping=eE,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function ho(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function hl(){return new au({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:hc(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n\n #include \n\n void main() {\n\n vec3 outputDirection = normalize( vOutputDirection );\n vec2 uv = equirectUv( outputDirection );\n\n gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n }\n ",blending:A,depthTest:!1,depthWrite:!1})}function hu(){return new au({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:hc(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n uniform float flipEnvMap;\n\n varying vec3 vOutputDirection;\n\n uniform samplerCube envMap;\n\n void main() {\n\n gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n }\n ",blending:A,depthTest:!1,depthWrite:!1})}function hc(){return"\n\n precision mediump float;\n precision mediump int;\n\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position, 1.0 );\n\n }\n "}function hh(e){let t=new WeakMap,n=null;function r(e){let n=e.target;n.removeEventListener("dispose",r);let i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){let a=i.mapping,s=a===eM||a===ew,o=a===eb||a===eS;if(s||o){let a=t.get(i),l=void 0!==a?a.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==l)return null===n&&(n=new ha(e)),(a=s?n.fromEquirectangular(i,a):n.fromCubemap(i,a)).texture.pmremVersion=i.pmremVersion,t.set(i,a),a.texture;{if(void 0!==a)return a.texture;let l=i.image;return s&&l&&l.height>0||o&&l&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(l)?(null===n&&(n=new ha(e)),(a=s?n.fromEquirectangular(i):n.fromCubemap(i)).texture.pmremVersion=i.pmremVersion,t.set(i,a),i.addEventListener("dispose",r),a.texture):null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function hd(e){let t={};function n(n){let r;if(void 0!==t[n])return t[n];switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},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 null===t&&n3("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function hp(e,t,n,r){let i={},a=new WeakMap;function s(e){let o=e.target;for(let e in null!==o.index&&t.remove(o.index),o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",s),delete i[o.id];let l=a.get(o);l&&(t.remove(l),a.delete(o)),r.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){let n=[],r=e.index,i=e.attributes.position,s=0;if(null!==r){let e=r.array;s=r.version;for(let t=0,r=e.length;tt.maxTextureSize&&(f=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let m=new Float32Array(p*f*4*c),g=new rc(m,p,f,c);g.type=ej,g.needsUpdate=!0;let v=4*d;for(let t=0;t0)return e;let i=t*n,a=hM[i];if(void 0===a&&(a=new Float32Array(i),hM[i]=a),0!==t){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function hR(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n":" "," ").concat(i,": ").concat(n[e]))}return r.join("\n")}(e.getShaderSource(t),r)}}let dv=new nX;function dy(e){return""!==e}function d_(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function dx(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}let db=/^[ \t]*#include +<([\w\d./]+)>/gm;function dS(e){return e.replace(db,dw)}let dM=new Map;function dw(e,t){let n=cX[t];if(void 0===n){let e=dM.get(t);if(void 0!==e)n=cX[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e);else throw Error("Can not resolve #include <"+t+">")}return dS(n)}let dE=/#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 dT(e){return e.replace(dE,dA)}function dA(e,t,n,r){let i="";for(let e=parseInt(t);e0&&(i+="\n"),(a=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(dy).join("\n")).length>0&&(a+="\n")):(i=[dC(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,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 "+g:"",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&&!1===n.flatShading?"#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&&!1===n.flatShading?"#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 "+f:"",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","\n"].filter(dy).join("\n"),a=[dC(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,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 "+m:"",n.envMap?"#define "+g:"",n.envMap?"#define "+v:"",y?"#define CUBEUV_TEXEL_WIDTH "+y.texelWidth:"",y?"#define CUBEUV_TEXEL_HEIGHT "+y.texelHeight:"",y?"#define CUBEUV_MAX_MIP "+y.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&&!1===n.flatShading?"#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 "+f:"",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!==ec?"#define TONE_MAPPING":"",n.toneMapping!==ec?cX.tonemapping_pars_fragment:"",n.toneMapping!==ec?function(e,t){let n;switch(t){case eh:n="Linear";break;case ed:n="Reinhard";break;case ep:n="Cineon";break;case ef:n="ACESFilmic";break;case eg:n="AgX";break;case ev:n="Neutral";break;case em:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",cX.colorspace_pars_fragment,function(e,t){let n=function(e){n8._getMatrix(dm,n8.workingColorSpace,e);let t="mat3( ".concat(dm.elements.map(e=>e.toFixed(4))," )");switch(n8.getTransfer(e)){case t0:return[t,"LinearTransferOETF"];case t1:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}(t);return["vec4 ".concat(e,"( vec4 value ) {")," return ".concat(n[1],"( vec4( value.rgb * ").concat(n[0],", value.a ) );"),"}"].join("\n")}("linearToOutputTexel",n.outputColorSpace),function(){n8.getLuminanceCoefficients(dv);let e=dv.x.toFixed(4),t=dv.y.toFixed(4),n=dv.z.toFixed(4);return["float luminance( const in vec3 rgb ) {"," const vec3 weights = vec3( ".concat(e,", ").concat(t,", ").concat(n," );")," return dot( weights, rgb );\n}"].join("\n")}(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(dy).join("\n")),d=dx(d=d_(d=dS(d),n),n),p=dx(p=d_(p=dS(p),n),n),d=dT(d),p=dT(p),!0!==n.isRawShaderMaterial&&(E="#version 300 es\n",i=[_,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+i,a=["#define varying in",n.glslVersion===nT?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===nT?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+a);let T=E+i+d,A=E+a+p,C=dp(c,c.VERTEX_SHADER,T),R=dp(c,c.FRAGMENT_SHADER,A);function P(t){if(e.debug.checkShaderErrors){let n=c.getProgramInfoLog(w)||"",r=c.getShaderInfoLog(C)||"",s=c.getShaderInfoLog(R)||"",o=n.trim(),l=r.trim(),u=s.trim(),h=!0,d=!0;if(!1===c.getProgramParameter(w,c.LINK_STATUS))if(h=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(c,w,C,R);else{let e=dg(c,C,"vertex"),n=dg(c,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+c.getError()+" - VALIDATE_STATUS "+c.getProgramParameter(w,c.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+o+"\n"+e+"\n"+n)}else""!==o?console.warn("THREE.WebGLProgram: Program Info Log:",o):(""===l||""===u)&&(d=!1);d&&(t.diagnostics={runnable:h,programLog:o,vertexShader:{log:l,prefix:i},fragmentShader:{log:u,prefix:a}})}c.deleteShader(C),c.deleteShader(R),s=new dd(c,w),o=function(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i0,Z=a.clearcoat>0,K=a.dispersion>0,$=a.iridescence>0,Q=a.sheen>0,ee=a.transmission>0,et=J&&!!a.anisotropyMap,en=Z&&!!a.clearcoatMap,er=Z&&!!a.clearcoatNormalMap,ei=Z&&!!a.clearcoatRoughnessMap,ea=$&&!!a.iridescenceMap,es=$&&!!a.iridescenceThicknessMap,eo=Q&&!!a.sheenColorMap,el=Q&&!!a.sheenRoughnessMap,eu=!!a.specularMap,eh=!!a.specularColorMap,ed=!!a.specularIntensityMap,ep=ee&&!!a.transmissionMap,ef=ee&&!!a.thicknessMap,em=!!a.gradientMap,eg=!!a.alphaMap,ev=a.alphaTest>0,ey=!!a.alphaHash,e_=!!a.extensions,ex=ec;a.toneMapped&&(null===D||!0===D.isXRRenderTarget)&&(ex=e.toneMapping);let eb={shaderID:P,shaderType:a.type,shaderName:a.name,vertexShader:y,fragmentShader:_,defines:a.defines,customVertexShaderID:x,customFragmentShaderID:b,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:p,batching:F,batchingColor:F&&null!==v._colorsTexture,instancing:O,instancingColor:O&&null!==v.instanceColor,instancingMorph:O&&null!==v.morphTexture,supportsVertexTextures:d,outputColorSpace:null===D?e.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:tQ,alphaToCoverage:!!a.alphaToCoverage,map:k,matcap:z,envMap:B,envMapMode:B&&A.mapping,envMapCubeUVHeight:R,aoMap:H,lightMap:V,bumpMap:G,normalMap:W,displacementMap:d&&j,emissiveMap:X,normalMapObjectSpace:W&&a.normalMapType===tZ,normalMapTangentSpace:W&&a.normalMapType===tJ,metalnessMap:q,roughnessMap:Y,anisotropy:J,anisotropyMap:et,clearcoat:Z,clearcoatMap:en,clearcoatNormalMap:er,clearcoatRoughnessMap:ei,dispersion:K,iridescence:$,iridescenceMap:ea,iridescenceThicknessMap:es,sheen:Q,sheenColorMap:eo,sheenRoughnessMap:el,specularMap:eu,specularColorMap:eh,specularIntensityMap:ed,transmission:ee,transmissionMap:ep,thicknessMap:ef,gradientMap:em,opaque:!1===a.transparent&&a.blending===C&&!1===a.alphaToCoverage,alphaMap:eg,alphaTest:ev,alphaHash:ey,combine:a.combine,mapUv:k&&m(a.map.channel),aoMapUv:H&&m(a.aoMap.channel),lightMapUv:V&&m(a.lightMap.channel),bumpMapUv:G&&m(a.bumpMap.channel),normalMapUv:W&&m(a.normalMap.channel),displacementMapUv:j&&m(a.displacementMap.channel),emissiveMapUv:X&&m(a.emissiveMap.channel),metalnessMapUv:q&&m(a.metalnessMap.channel),roughnessMapUv:Y&&m(a.roughnessMap.channel),anisotropyMapUv:et&&m(a.anisotropyMap.channel),clearcoatMapUv:en&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:er&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ei&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:ea&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:es&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:eo&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:el&&m(a.sheenRoughnessMap.channel),specularMapUv:eu&&m(a.specularMap.channel),specularColorMapUv:eh&&m(a.specularColorMap.channel),specularIntensityMapUv:ed&&m(a.specularIntensityMap.channel),transmissionMapUv:ep&&m(a.transmissionMap.channel),thicknessMapUv:ef&&m(a.thicknessMap.channel),alphaMapUv:eg&&m(a.alphaMap.channel),vertexTangents:!!M.attributes.tangent&&(W||J),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!M.attributes.color&&4===M.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!M.attributes.uv&&(k||eg),fog:!!S,useFog:!0===a.fog,fogExp2:!!S&&S.isFogExp2,flatShading:!0===a.flatShading&&!1===a.wireframe,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:h,reversedDepthBuffer:U,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==M.morphAttributes.position,morphNormals:void 0!==M.morphAttributes.normal,morphColors:void 0!==M.morphAttributes.color,morphTargetsCount:L,morphTextureStride:N,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:ex,decodeVideoTexture:k&&!0===a.map.isVideoTexture&&n8.getTransfer(a.map.colorSpace)===t1,decodeVideoTextureEmissive:X&&!0===a.emissiveMap.isVideoTexture&&n8.getTransfer(a.emissiveMap.colorSpace)===t1,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===T,flipSided:a.side===E,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:e_&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(e_&&!0===a.extensions.multiDraw||F)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return eb.vertexUv1s=u.has(1),eb.vertexUv2s=u.has(2),eb.vertexUv3s=u.has(3),u.clear(),eb},getProgramCacheKey:function(t){var n,r,i,a;let s=[];if(t.shaderID?s.push(t.shaderID):(s.push(t.customVertexShaderID),s.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)s.push(e),s.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(n=s,r=t,n.push(r.precision),n.push(r.outputColorSpace),n.push(r.envMapMode),n.push(r.envMapCubeUVHeight),n.push(r.mapUv),n.push(r.alphaMapUv),n.push(r.lightMapUv),n.push(r.aoMapUv),n.push(r.bumpMapUv),n.push(r.normalMapUv),n.push(r.displacementMapUv),n.push(r.emissiveMapUv),n.push(r.metalnessMapUv),n.push(r.roughnessMapUv),n.push(r.anisotropyMapUv),n.push(r.clearcoatMapUv),n.push(r.clearcoatNormalMapUv),n.push(r.clearcoatRoughnessMapUv),n.push(r.iridescenceMapUv),n.push(r.iridescenceThicknessMapUv),n.push(r.sheenColorMapUv),n.push(r.sheenRoughnessMapUv),n.push(r.specularMapUv),n.push(r.specularColorMapUv),n.push(r.specularIntensityMapUv),n.push(r.transmissionMapUv),n.push(r.thicknessMapUv),n.push(r.combine),n.push(r.fogExp2),n.push(r.sizeAttenuation),n.push(r.morphTargetsCount),n.push(r.morphAttributeCount),n.push(r.numDirLights),n.push(r.numPointLights),n.push(r.numSpotLights),n.push(r.numSpotLightMaps),n.push(r.numHemiLights),n.push(r.numRectAreaLights),n.push(r.numDirLightShadows),n.push(r.numPointLightShadows),n.push(r.numSpotLightShadows),n.push(r.numSpotLightShadowsWithMaps),n.push(r.numLightProbes),n.push(r.shadowMapType),n.push(r.toneMapping),n.push(r.numClippingPlanes),n.push(r.numClipIntersection),n.push(r.depthPacking),i=s,a=t,o.disableAll(),a.supportsVertexTextures&&o.enable(0),a.instancing&&o.enable(1),a.instancingColor&&o.enable(2),a.instancingMorph&&o.enable(3),a.matcap&&o.enable(4),a.envMap&&o.enable(5),a.normalMapObjectSpace&&o.enable(6),a.normalMapTangentSpace&&o.enable(7),a.clearcoat&&o.enable(8),a.iridescence&&o.enable(9),a.alphaTest&&o.enable(10),a.vertexColors&&o.enable(11),a.vertexAlphas&&o.enable(12),a.vertexUv1s&&o.enable(13),a.vertexUv2s&&o.enable(14),a.vertexUv3s&&o.enable(15),a.vertexTangents&&o.enable(16),a.anisotropy&&o.enable(17),a.alphaHash&&o.enable(18),a.batching&&o.enable(19),a.dispersion&&o.enable(20),a.batchingColor&&o.enable(21),a.gradientMap&&o.enable(22),i.push(o.mask),o.disableAll(),a.fog&&o.enable(0),a.useFog&&o.enable(1),a.flatShading&&o.enable(2),a.logarithmicDepthBuffer&&o.enable(3),a.reversedDepthBuffer&&o.enable(4),a.skinning&&o.enable(5),a.morphTargets&&o.enable(6),a.morphNormals&&o.enable(7),a.morphColors&&o.enable(8),a.premultipliedAlpha&&o.enable(9),a.shadowMapEnabled&&o.enable(10),a.doubleSided&&o.enable(11),a.flipSided&&o.enable(12),a.useDepthPacking&&o.enable(13),a.dithering&&o.enable(14),a.transmission&&o.enable(15),a.sheen&&o.enable(16),a.opaque&&o.enable(17),a.pointsUvs&&o.enable(18),a.decodeVideoTexture&&o.enable(19),a.decodeVideoTextureEmissive&&o.enable(20),a.alphaToCoverage&&o.enable(21),i.push(o.mask),s.push(e.outputColorSpace)),s.push(t.customProgramCacheKey),s.join()},getUniforms:function(e){let t,n=f[e.type];if(n){let e=cY[n];t=al.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,n){let r;for(let e=0,t=c.length;e0?r.push(c):!0===s.transparent?i.push(c):n.push(c)},unshift:function(e,t,s,o,l,u){let c=a(e,t,s,o,l,u);s.transmission>0?r.unshift(c):!0===s.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=t,r=e.length;n1&&n.sort(e||dU),r.length>1&&r.sort(t||dO),i.length>1&&i.sort(t||dO)}}}function dk(){let e=new WeakMap;return{get:function(t,n){let r,i=e.get(t);return void 0===i?(r=new dF,e.set(t,[r])):n>=i.length?(r=new dF,i.push(r)):r=i[n],r},dispose:function(){e=new WeakMap}}}function dz(){let e={};return{get:function(t){let n;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":n={direction:new nX,color:new iE};break;case"SpotLight":n={position:new nX,direction:new nX,color:new iE,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new nX,color:new iE,distance:0,decay:0};break;case"HemisphereLight":n={direction:new nX,skyColor:new iE,groundColor:new iE};break;case"RectAreaLight":n={color:new iE,position:new nX,halfWidth:new nX,halfHeight:new nX}}return e[t.id]=n,n}}}let dB=0;function dH(e,t){return 2*!!t.castShadow-2*!!e.castShadow+ +!!t.map-!!e.map}function dV(e){let t=new dz,n=function(){let e={};return{get:function(t){let n;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nW};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nW,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),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 nX);let i=new nX,a=new rH,s=new rH;return{setup:function(i){let a=0,s=0,o=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,u=0,c=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,y=0;i.sort(dH);for(let e=0,_=i.length;e<_;e++){let _=i[e],x=_.color,b=_.intensity,S=_.distance,M=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)a+=x.r*b,s+=x.g*b,o+=x.b*b;else if(_.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(_.sh.coefficients[e],b);y++}else if(_.isDirectionalLight){let e=t.get(_);if(e.color.copy(_.color).multiplyScalar(_.intensity),_.castShadow){let e=_.shadow,t=n.get(_);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[l]=t,r.directionalShadowMap[l]=M,r.directionalShadowMatrix[l]=_.shadow.matrix,p++}r.directional[l]=e,l++}else if(_.isSpotLight){let e=t.get(_);e.position.setFromMatrixPosition(_.matrixWorld),e.color.copy(x).multiplyScalar(b),e.distance=S,e.coneCos=Math.cos(_.angle),e.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),e.decay=_.decay,r.spot[c]=e;let i=_.shadow;if(_.map&&(r.spotLightMap[g]=_.map,g++,i.updateMatrices(_),_.castShadow&&v++),r.spotLightMatrix[c]=i.matrix,_.castShadow){let e=n.get(_);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[c]=e,r.spotShadowMap[c]=M,m++}c++}else if(_.isRectAreaLight){let e=t.get(_);e.color.copy(x).multiplyScalar(b),e.halfWidth.set(.5*_.width,0,0),e.halfHeight.set(0,.5*_.height,0),r.rectArea[h]=e,h++}else if(_.isPointLight){let e=t.get(_);if(e.color.copy(_.color).multiplyScalar(_.intensity),e.distance=_.distance,e.decay=_.decay,_.castShadow){let e=_.shadow,t=n.get(_);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[u]=t,r.pointShadowMap[u]=M,r.pointShadowMatrix[u]=_.shadow.matrix,f++}r.point[u]=e,u++}else if(_.isHemisphereLight){let e=t.get(_);e.skyColor.copy(_.color).multiplyScalar(b),e.groundColor.copy(_.groundColor).multiplyScalar(b),r.hemi[d]=e,d++}}h>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=cq.LTC_FLOAT_1,r.rectAreaLTC2=cq.LTC_FLOAT_2):(r.rectAreaLTC1=cq.LTC_HALF_1,r.rectAreaLTC2=cq.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=s,r.ambient[2]=o;let _=r.hash;(_.directionalLength!==l||_.pointLength!==u||_.spotLength!==c||_.rectAreaLength!==h||_.hemiLength!==d||_.numDirectionalShadows!==p||_.numPointShadows!==f||_.numSpotShadows!==m||_.numSpotMaps!==g||_.numLightProbes!==y)&&(r.directional.length=l,r.spot.length=c,r.rectArea.length=h,r.point.length=u,r.hemi.length=d,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=f,r.pointShadowMap.length=f,r.spotShadow.length=m,r.spotShadowMap.length=m,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=f,r.spotLightMatrix.length=m+g-v,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=v,r.numLightProbes=y,_.directionalLength=l,_.pointLength=u,_.spotLength=c,_.rectAreaLength=h,_.hemiLength=d,_.numDirectionalShadows=p,_.numPointShadows=f,_.numSpotShadows=m,_.numSpotMaps=g,_.numLightProbes=y,r.version=dB++)},setupView:function(e,t){let n=0,o=0,l=0,u=0,c=0,h=t.matrixWorldInverse;for(let t=0,d=e.length;t1&&void 0!==arguments[1]?arguments[1]:0,a=t.get(n);return void 0===a?(r=new dG(e),t.set(n,[r])):i>=a.length?(r=new dG(e),a.push(r)):r=a[i],r},dispose:function(){t=new WeakMap}}}function dj(e,t,n){let r=new sd,i=new nW,a=new nW,s=new ro,o=new lp({depthPacking:tX}),l=new lf,u={},c=n.maxTextureSize,h={[w]:E,[E]:w,[T]:T},d=new au({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new nW},radius:{value:4}},vertexShader:"void main() {\n gl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;let f=new i0;f.setAttribute("position",new iF(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new an(f,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=b;let v=this.type;function y(t,n,r,i){let a=null,s=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==s)a=s;else if(a=!0===r.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||!0===n.alphaToCoverage){let e=a.uuid,t=n.uuid,r=u[e];void 0===r&&(r={},u[e]=r);let i=r[t];void 0===i&&(i=a.clone(),r[t]=i,n.addEventListener("dispose",_)),a=i}return a.visible=n.visible,a.wireframe=n.wireframe,i===M?a.side=null!==n.shadowSide?n.shadowSide:n.side:a.side=null!==n.shadowSide?n.shadowSide:h[n.side],a.alphaMap=n.alphaMap,a.alphaTest=!0===n.alphaToCoverage?.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,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=r),a}function _(e){for(let t in e.target.removeEventListener("dispose",_),u){let n=u[t],r=e.target.uuid;r in n&&(n[r].dispose(),delete n[r])}}this.render=function(n,o,l){if(!1===g.enabled||!1===g.autoUpdate&&!1===g.needsUpdate||0===n.length)return;let u=e.getRenderTarget(),h=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),_=e.state;_.setBlending(A),!0===_.buffers.depth.getReversed()?_.buffers.color.setClear(0,0,0,0):_.buffers.color.setClear(1,1,1,1),_.buffers.depth.setTest(!0),_.setScissorTest(!1);let x=v!==M&&this.type===M,b=v===M&&this.type!==M;for(let u=0,h=n.length;uc||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/g.x),i.x=a.x*g.x,f.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/g.y),i.y=a.y*g.y,f.mapSize.y=a.y)),null===f.map||!0===x||!0===b){let e=this.type!==M?{minFilter:eR,magFilter:eR}:{};null!==f.map&&f.map.dispose(),f.map=new ru(i.x,i.y,e),f.map.texture.name=h.name+".shadowMap",f.camera.updateProjectionMatrix()}e.setRenderTarget(f.map),e.clear();let v=f.getViewportCount();for(let n=0;n=1:-1!==em.indexOf("OpenGL ES")&&(ef=parseFloat(/^OpenGL ES (\d)/.exec(em)[1])>=2);let eg=null,ev={},ey=e.getParameter(e.SCISSOR_BOX),e_=e.getParameter(e.VIEWPORT),ex=new ro().fromArray(ey),eb=new ro().fromArray(e_);function eS(t,n,r,i){let a=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let s=0;sn||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1)if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);void 0===o&&(o=f(n,a));let s=t?f(n,a):o;return s.width=n,s.height=a,s.getContext("2d").drawImage(e,0,0,n,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+i.width+"x"+i.height+") to ("+n+"x"+a+")."),s}else"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+i.width+"x"+i.height+").");return e}function g(e){return e.generateMipmaps}function v(t){e.generateMipmap(t)}function y(n,r,i,a){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=r;if(r===e.RED&&(i===e.FLOAT&&(o=e.R32F),i===e.HALF_FLOAT&&(o=e.R16F),i===e.UNSIGNED_BYTE&&(o=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.R8UI),i===e.UNSIGNED_SHORT&&(o=e.R16UI),i===e.UNSIGNED_INT&&(o=e.R32UI),i===e.BYTE&&(o=e.R8I),i===e.SHORT&&(o=e.R16I),i===e.INT&&(o=e.R32I)),r===e.RG&&(i===e.FLOAT&&(o=e.RG32F),i===e.HALF_FLOAT&&(o=e.RG16F),i===e.UNSIGNED_BYTE&&(o=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RG8UI),i===e.UNSIGNED_SHORT&&(o=e.RG16UI),i===e.UNSIGNED_INT&&(o=e.RG32UI),i===e.BYTE&&(o=e.RG8I),i===e.SHORT&&(o=e.RG16I),i===e.INT&&(o=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RGB8UI),i===e.UNSIGNED_SHORT&&(o=e.RGB16UI),i===e.UNSIGNED_INT&&(o=e.RGB32UI),i===e.BYTE&&(o=e.RGB8I),i===e.SHORT&&(o=e.RGB16I),i===e.INT&&(o=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(o=e.RGBA16UI),i===e.UNSIGNED_INT&&(o=e.RGBA32UI),i===e.BYTE&&(o=e.RGBA8I),i===e.SHORT&&(o=e.RGBA16I),i===e.INT&&(o=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_INT_5_9_9_9_REV&&(o=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(o=e.R11F_G11F_B10F)),r===e.RGBA){let t=s?t0:n8.getTransfer(a);i===e.FLOAT&&(o=e.RGBA32F),i===e.HALF_FLOAT&&(o=e.RGBA16F),i===e.UNSIGNED_BYTE&&(o=t===t1?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(o=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(o=e.RGB5_A1)}return(o===e.R16F||o===e.R32F||o===e.RG16F||o===e.RG32F||o===e.RGBA16F||o===e.RGBA32F)&&t.get("EXT_color_buffer_float"),o}function _(t,n){let r;return t?null===n||n===eW||n===eJ?r=e.DEPTH24_STENCIL8:n===ej?r=e.DEPTH32F_STENCIL8:n===eV&&(r=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===eW||n===eJ?r=e.DEPTH_COMPONENT24:n===ej?r=e.DEPTH_COMPONENT32F:n===eV&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return!0===g(e)||e.isFramebufferTexture&&e.minFilter!==eR&&e.minFilter!==eD?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function b(e){let t=e.target;t.removeEventListener("dispose",b),function(e){let t=r.get(e);if(void 0===t.__webglInit)return;let n=e.source,i=d.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&M(e),0===Object.keys(i).length&&d.delete(n)}r.remove(e)}(t),t.isVideoTexture&&h.delete(t)}function S(t){let n=t.target;n.removeEventListener("dispose",S),function(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;r0&&a.__version!==t.version){let e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void L(a,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}let T={[eT]:e.REPEAT,[eA]:e.CLAMP_TO_EDGE,[eC]:e.MIRRORED_REPEAT},A={[eR]:e.NEAREST,[eP]:e.NEAREST_MIPMAP_NEAREST,[eL]:e.NEAREST_MIPMAP_LINEAR,[eD]:e.LINEAR,[eU]:e.LINEAR_MIPMAP_NEAREST,[eF]:e.LINEAR_MIPMAP_LINEAR},C={[nl]:e.NEVER,[nm]:e.ALWAYS,[nu]:e.LESS,[nh]:e.LEQUAL,[nc]:e.EQUAL,[nf]:e.GEQUAL,[nd]:e.GREATER,[np]:e.NOTEQUAL};function R(n,a){if((a.type===ej&&!1===t.has("OES_texture_float_linear")&&(a.magFilter===eD||a.magFilter===eU||a.magFilter===eL||a.magFilter===eF||a.minFilter===eD||a.minFilter===eU||a.minFilter===eL||a.minFilter===eF)&&console.warn("THREE.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,T[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,T[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,T[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,A[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,A[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,C[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic"))&&a.magFilter!==eR&&(a.minFilter===eL||a.minFilter===eF)&&(a.type!==ej||!1!==t.has("OES_texture_float_linear"))&&(a.anisotropy>1||r.get(a).__currentAnisotropy)){let s=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}function P(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",b));let i=n.source,a=d.get(i);void 0===a&&(a={},d.set(i,a));let o=function(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()}(n);if(o!==t.__cacheKey){void 0===a[o]&&(a[o]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,r=!0),a[o].usedTimes++;let i=a[t.__cacheKey];void 0!==i&&(a[t.__cacheKey].usedTimes--,0===i.usedTimes&&M(n)),t.__cacheKey=o,t.__webglTexture=a[o].texture}return r}function I(e,t,n){return Math.floor(Math.floor(e/n)/t)}function L(t,s,o){let l=e.TEXTURE_2D;(s.isDataArrayTexture||s.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),s.isData3DTexture&&(l=e.TEXTURE_3D);let u=P(t,s),c=s.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+o);let h=r.get(c);if(c.version!==h.__version||!0===u){let t;n.activeTexture(e.TEXTURE0+o);let r=n8.getPrimaries(n8.workingColorSpace),d=s.colorSpace===tK?null:n8.getPrimaries(s.colorSpace),p=s.colorSpace===tK||r===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);let f=m(s.image,!1,i.maxTextureSize);f=H(s,f);let b=a.convert(s.format,s.colorSpace),S=a.convert(s.type),M=y(s.internalFormat,b,S,s.colorSpace,s.isVideoTexture);R(l,s);let w=s.mipmaps,E=!0!==s.isVideoTexture,T=void 0===h.__version||!0===u,A=c.dataReady,C=x(s,f);if(s.isDepthTexture)M=_(s.format===e2,s.type),T&&(E?n.texStorage2D(e.TEXTURE_2D,1,M,f.width,f.height):n.texImage2D(e.TEXTURE_2D,0,M,f.width,f.height,0,b,S,null));else if(s.isDataTexture)if(w.length>0){E&&T&&n.texStorage2D(e.TEXTURE_2D,C,M,w[0].width,w[0].height);for(let r=0,i=w.length;re.start-t.start);let o=0;for(let e=1;e0){let i=cV(t.width,t.height,s.format,s.type);for(let a of s.layerUpdates){let s=t.data.subarray(a*i/t.data.BYTES_PER_ELEMENT,(a+1)*i/t.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,a,t.width,t.height,1,b,s)}s.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,0,t.width,t.height,f.depth,b,t.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,r,M,t.width,t.height,f.depth,0,t.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else E?A&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,0,t.width,t.height,f.depth,b,S,t.data):n.texImage3D(e.TEXTURE_2D_ARRAY,r,M,t.width,t.height,f.depth,0,b,S,t.data)}else{E&&T&&n.texStorage2D(e.TEXTURE_2D,C,M,w[0].width,w[0].height);for(let r=0,i=w.length;r0){let t=cV(f.width,f.height,s.format,s.type);for(let r of s.layerUpdates){let i=f.data.subarray(r*t/f.data.BYTES_PER_ELEMENT,(r+1)*t/f.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,f.width,f.height,1,b,S,i)}s.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,b,S,f.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,M,f.width,f.height,f.depth,0,b,S,f.data);else if(s.isData3DTexture)E?(T&&n.texStorage3D(e.TEXTURE_3D,C,M,f.width,f.height,f.depth),A&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,b,S,f.data)):n.texImage3D(e.TEXTURE_3D,0,M,f.width,f.height,f.depth,0,b,S,f.data);else if(s.isFramebufferTexture){if(T)if(E)n.texStorage2D(e.TEXTURE_2D,C,M,f.width,f.height);else{let t=f.width,r=f.height;for(let i=0;i>=1,r>>=1}}else if(w.length>0){if(E&&T){let t=V(w[0]);n.texStorage2D(e.TEXTURE_2D,C,M,t.width,t.height)}for(let r=0,i=w.length;r>c),r=Math.max(1,i.height>>c);u===e.TEXTURE_3D||u===e.TEXTURE_2D_ARRAY?n.texImage3D(u,c,p,t,r,i.depth,0,h,d,null):n.texImage2D(u,c,p,t,r,0,h,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),B(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,u,m.__webglTexture,0,z(i)):(u===e.TEXTURE_2D||u>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,u,m.__webglTexture,c),n.bindFramebuffer(e.FRAMEBUFFER,null)}function D(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,s=_(n.stencilBuffer,a),o=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=z(n);B(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,u,s,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,u,s,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,s,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,o,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)throw Error("target.depthTexture not supported in Cube render targets");let e=t.texture.mipmaps;e&&e.length>0?U(i.__webglFramebuffer[0],t):U(i.__webglFramebuffer,t)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),void 0===i.__webglDepthbuffer[r])i.__webglDepthbuffer[r]=e.createRenderbuffer(),D(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),void 0===i.__webglDepthbuffer)i.__webglDepthbuffer=e.createRenderbuffer(),D(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)}let F=[],k=[];function z(e){return Math.min(i.maxSamples,e.samples)}function B(e){let n=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function H(e,t){let n=e.colorSpace,r=e.format,i=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==tQ&&n!==tK&&(n8.getTransfer(n)===t1?(r!==e0||i!==ez)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),t}function V(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){let e=w;return e>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+i.maxTextures),w+=1,e},this.resetTextureUnits=function(){w=0},this.setTexture2D=E,this.setTexture2DArray=function(t,i){let a=r.get(t);if(!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version)return void L(a,t,i);n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){let a=r.get(t);if(!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version)return void L(a,t,i);n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,s){let o=r.get(t);if(t.version>0&&o.__version!==t.version)return void function(t,s,o){if(6!==s.image.length)return;let l=P(t,s),u=s.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+o);let c=r.get(u);if(u.version!==c.__version||!0===l){let t;n.activeTexture(e.TEXTURE0+o);let r=n8.getPrimaries(n8.workingColorSpace),h=s.colorSpace===tK?null:n8.getPrimaries(s.colorSpace),d=s.colorSpace===tK||r===h?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let p=s.isCompressedTexture||s.image[0].isCompressedTexture,f=s.image[0]&&s.image[0].isDataTexture,_=[];for(let e=0;e<6;e++)p||f?_[e]=f?s.image[e].image:s.image[e]:_[e]=m(s.image[e],!0,i.maxCubemapSize),_[e]=H(s,_[e]);let b=_[0],S=a.convert(s.format,s.colorSpace),M=a.convert(s.type),w=y(s.internalFormat,S,M,s.colorSpace),E=!0!==s.isVideoTexture,T=void 0===c.__version||!0===l,A=u.dataReady,C=x(s,b);if(R(e.TEXTURE_CUBE_MAP,s),p){E&&T&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,w,b.width,b.height);for(let r=0;r<6;r++){t=_[r].mipmaps;for(let i=0;i0&&C++;let r=V(_[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,w,r.width,r.height)}for(let r=0;r<6;r++)if(f){E?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,0,0,_[r].width,_[r].height,S,M,_[r].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,w,_[r].width,_[r].height,0,S,M,_[r].data);for(let i=0;i1;if(!h&&(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,s.memory.textures++),c){o.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){o.__webglFramebuffer[t]=[];for(let n=0;n0){o.__webglFramebuffer=[];for(let t=0;t0&&!1===B(t)){o.__webglMultisampledFramebuffer=e.createFramebuffer(),o.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,o.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0){if(!1===B(t)){let i=t.textures,a=t.width,s=t.height,o=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=r.get(t),h=i.length>1;if(h)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:tK,a=n8.getTransfer(i);if(n===ez)return e.UNSIGNED_BYTE;if(n===eq)return e.UNSIGNED_SHORT_4_4_4_4;if(n===eY)return e.UNSIGNED_SHORT_5_5_5_1;if(n===eZ)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===eK)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===eB)return e.BYTE;if(n===eH)return e.SHORT;if(n===eV)return e.UNSIGNED_SHORT;if(n===eG)return e.INT;if(n===eW)return e.UNSIGNED_INT;if(n===ej)return e.FLOAT;if(n===eX)return e.HALF_FLOAT;if(n===e$)return e.ALPHA;if(n===eQ)return e.RGB;if(n===e0)return e.RGBA;if(n===e1)return e.DEPTH_COMPONENT;if(n===e2)return e.DEPTH_STENCIL;if(n===e3)return e.RED;if(n===e4)return e.RED_INTEGER;if(n===e5)return e.RG;if(n===e6)return e.RG_INTEGER;if(n===e9)return e.RGBA_INTEGER;if(n===e7||n===te||n===tt||n===tn)if(a===t1){if(null===(r=t.get("WEBGL_compressed_texture_s3tc_srgb")))return null;if(n===e7)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===te)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===tt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===tn)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(null===(r=t.get("WEBGL_compressed_texture_s3tc")))return null;if(n===e7)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===te)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===tt)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===tn)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===tr||n===ti||n===ta||n===ts){if(null===(r=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(n===tr)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===ti)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===ta)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ts)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===to||n===tl||n===tu){if(null===(r=t.get("WEBGL_compressed_texture_etc")))return null;if(n===to||n===tl)return a===t1?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===tu)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(n===tc||n===th||n===td||n===tp||n===tf||n===tm||n===tg||n===tv||n===ty||n===t_||n===tx||n===tb||n===tS||n===tM){if(null===(r=t.get("WEBGL_compressed_texture_astc")))return null;if(n===tc)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===th)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===td)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===tp)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===tf)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===tm)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===tg)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===tv)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===ty)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===t_)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===tx)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===tb)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===tS)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===tM)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===tw||n===tE||n===tT){if(null===(r=t.get("EXT_texture_compression_bptc")))return null;if(n===tw)return a===t1?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===tE)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===tT)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(n===tA||n===tC||n===tR||n===tP){if(null===(r=t.get("EXT_texture_compression_rgtc")))return null;if(n===tA)return r.COMPRESSED_RED_RGTC1_EXT;if(n===tC)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===tR)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===tP)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===eJ?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}class dZ{init(e,t){if(null===this.texture){let n=new s9(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(null!==this.texture&&null===this.mesh){let t=e.cameras[0].viewport,n=new au({vertexShader:"\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n if ( coord.x >= 1.0 ) {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n } else {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n }\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new an(new o4(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}}class dK extends nL{constructor(e,t){super();let n=this,r=null,i=1,a=null,s="local-floor",o=1,l=null,u=null,c=null,h=null,d=null,p=null,f="undefined"!=typeof XRWebGLBinding,m=new dZ,g={},v=t.getContextAttributes(),y=null,_=null,x=[],b=[],S=new nW,M=null,w=new af;w.viewport=new ro;let E=new af;E.viewport=new ro;let T=[w,E],A=new uS,C=null,R=null;function P(e){let t=b.indexOf(e.inputSource);if(-1===t)return;let n=x[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function I(){r.removeEventListener("select",P),r.removeEventListener("selectstart",P),r.removeEventListener("selectend",P),r.removeEventListener("squeeze",P),r.removeEventListener("squeezestart",P),r.removeEventListener("squeezeend",P),r.removeEventListener("end",I),r.removeEventListener("inputsourceschange",L);for(let e=0;e=0&&(b[r]=null,x[r].disconnect(n))}for(let t=0;t=b.length){b.push(n),r=e;break}else if(null===b[e]){b[e]=n,r=e;break}if(-1===r)break}let i=x[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=x[e];return void 0===t&&(t=new ax,x[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=x[e];return void 0===t&&(t=new ax,x[e]=t),t.getGripSpace()},this.getHand=function(e){let t=x[e];return void 0===t&&(t=new ax,x[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return null===c&&f&&(c=new XRWebGLBinding(r,t)),c},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(u){if(null!==(r=u)){if(y=e.getRenderTarget(),r.addEventListener("select",P),r.addEventListener("selectstart",P),r.addEventListener("selectend",P),r.addEventListener("squeeze",P),r.addEventListener("squeezestart",P),r.addEventListener("squeezeend",P),r.addEventListener("end",I),r.addEventListener("inputsourceschange",L),!0!==v.xrCompatible&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(S),f&&"createProjectionLayer"in XRWebGLBinding.prototype){let n=null,a=null,s=null;v.depth&&(s=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=v.stencil?e2:e1,a=v.stencil?eJ:eW);let o={colorFormat:t.RGBA8,depthFormat:s,scaleFactor:i};h=(c=this.getBinding()).createProjectionLayer(o),r.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),_=new ru(h.textureWidth,h.textureHeight,{format:e0,type:ez,depthTexture:new s8(h.textureWidth,h.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:4*!!v.antialias,resolveDepthBuffer:!1===h.ignoreDepthValues,resolveStencilBuffer:!1===h.ignoreDepthValues})}else{let n={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:i};d=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),_=new ru(d.framebufferWidth,d.framebufferHeight,{format:e0,type:ez,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:!1===d.ignoreDepthValues,resolveStencilBuffer:!1===d.ignoreDepthValues})}_.isXRRenderTarget=!0,this.setFoveation(o),l=null,a=await r.requestReferenceSpace(s),F.setContext(r),F.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};let N=new nX,D=new nX;function U(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){var t,n,i;if(null===r)return;let a=e.near,s=e.far;null!==m.texture&&(m.depthNear>0&&(a=m.depthNear),m.depthFar>0&&(s=m.depthFar)),A.near=E.near=w.near=a,A.far=E.far=w.far=s,(C!==A.near||R!==A.far)&&(r.updateRenderState({depthNear:A.near,depthFar:A.far}),C=A.near,R=A.far),A.layers.mask=6|e.layers.mask,w.layers.mask=3&A.layers.mask,E.layers.mask=5&A.layers.mask;let o=e.parent,l=A.cameras;U(A,o);for(let e=0;e0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,s=i.envMapRotation;a&&(e.envMap.value=a,d$.copy(s),d$.x*=-1,d$.y*=-1,d$.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(d$.y*=-1,d$.z*=-1),e.envMapRotation.value.setFromMatrix4(dQ.makeRotationFromEuler(d$)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-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))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,ao(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,a,s,o){var l,u,c,h,d,p,f,m,g,v,y,_,x,b,S,M,w,T,A,C,R;i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),l=e,(u=i).gradientMap&&(l.gradientMap.value=u.gradientMap)):i.isMeshPhongMaterial?(r(e,i),c=e,h=i,c.specular.value.copy(h.specular),c.shininess.value=Math.max(h.shininess,1e-4)):i.isMeshStandardMaterial?(r(e,i),d=e,p=i,d.metalness.value=p.metalness,p.metalnessMap&&(d.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,d.metalnessMapTransform)),d.roughness.value=p.roughness,p.roughnessMap&&(d.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,d.roughnessMapTransform)),p.envMap&&(d.envMapIntensity.value=p.envMapIntensity),i.isMeshPhysicalMaterial&&(f=e,m=i,g=o,f.ior.value=m.ior,m.sheen>0&&(f.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),f.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(f.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,f.sheenColorMapTransform)),m.sheenRoughnessMap&&(f.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,f.sheenRoughnessMapTransform))),m.clearcoat>0&&(f.clearcoat.value=m.clearcoat,f.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(f.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,f.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(f.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,f.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(f.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,f.clearcoatNormalMapTransform),f.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===E&&f.clearcoatNormalScale.value.negate())),m.dispersion>0&&(f.dispersion.value=m.dispersion),m.iridescence>0&&(f.iridescence.value=m.iridescence,f.iridescenceIOR.value=m.iridescenceIOR,f.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],f.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(f.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,f.iridescenceMapTransform)),m.iridescenceThicknessMap&&(f.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,f.iridescenceThicknessMapTransform))),m.transmission>0&&(f.transmission.value=m.transmission,f.transmissionSamplerMap.value=g.texture,f.transmissionSamplerSize.value.set(g.width,g.height),m.transmissionMap&&(f.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,f.transmissionMapTransform)),f.thickness.value=m.thickness,m.thicknessMap&&(f.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,f.thicknessMapTransform)),f.attenuationDistance.value=m.attenuationDistance,f.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(f.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(f.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,f.anisotropyMapTransform))),f.specularIntensity.value=m.specularIntensity,f.specularColor.value.copy(m.specularColor),m.specularColorMap&&(f.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,f.specularColorMapTransform)),m.specularIntensityMap&&(f.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,f.specularIntensityMapTransform)))):i.isMeshMatcapMaterial?(r(e,i),v=e,(y=i).matcap&&(v.matcap.value=y.matcap)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(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}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(_=e,x=i,_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,x.map&&(_.map.value=x.map,n(x.map,_.mapTransform)),i.isLineDashedMaterial&&(b=e,S=i,b.dashSize.value=S.dashSize,b.totalSize.value=S.dashSize+S.gapSize,b.scale.value=S.scale)):i.isPointsMaterial?(M=e,w=i,T=a,A=s,M.diffuse.value.copy(w.color),M.opacity.value=w.opacity,M.size.value=w.size*T,M.scale.value=.5*A,w.map&&(M.map.value=w.map,n(w.map,M.uvTransform)),w.alphaMap&&(M.alphaMap.value=w.alphaMap,n(w.alphaMap,M.alphaMapTransform)),w.alphaTest>0&&(M.alphaTest.value=w.alphaTest)):i.isSpriteMaterial?(C=e,R=i,C.diffuse.value.copy(R.color),C.opacity.value=R.opacity,C.rotation.value=R.rotation,R.map&&(C.map.value=R.map,n(R.map,C.mapTransform)),R.alphaMap&&(C.alphaMap.value=R.alphaMap,n(R.alphaMap,C.alphaMapTransform)),R.alphaTest>0&&(C.alphaTest.value=R.alphaTest)):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function d1(e,t,n,r){let i={},a={},s=[],o=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e){let t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(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?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){let n=t.target;n.removeEventListener("dispose",u);let r=s.indexOf(n.__bindingPointIndex);s.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}return{bind:function(e,t){let n=t.program;r.uniformBlockBinding(e,n)},update:function(n,c){let h=i[n.id];void 0===h&&(function(e){let t=e.uniforms,n=0;for(let e=0,r=t.length;e0&&(n+=16-r),e.__size=n,e.__cache={}}(n),h=function(t){let n=function(){for(let e=0;e2)||void 0===arguments[2]||arguments[2];if(eT.isPresenting)return void console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");ea=e,es=t,P.width=Math.floor(e*eo),P.height=Math.floor(t*eo),!0===n&&(P.style.width=e+"px",P.style.height=t+"px"),this.setViewport(0,0,e,t)},this.getDrawingBufferSize=function(e){return e.set(ea*eo,es*eo).floor()},this.setDrawingBufferSize=function(e,t,n){ea=e,es=t,eo=n,P.width=Math.floor(e*n),P.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return e.copy(ee)},this.getViewport=function(e){return e.copy(eh)},this.setViewport=function(e,t,n,r){e.isVector4?eh.set(e.x,e.y,e.z,e.w):eh.set(e,t,n,r),i.viewport(ee.copy(eh).multiplyScalar(eo).round())},this.getScissor=function(e){return e.copy(ed)},this.setScissor=function(e,t,n,r){e.isVector4?ed.set(e.x,e.y,e.z,e.w):ed.set(e,t,n,r),i.scissor(et.copy(ed).multiplyScalar(eo).round())},this.getScissorTest=function(){return ep},this.setScissorTest=function(e){i.setScissorTest(ep=e)},this.setOpaqueSort=function(e){el=e},this.setTransparentSort=function(e){eu=e},this.getClearColor=function(e){return e.copy(x.getClearColor())},this.setClearColor=function(){x.setClearColor(...arguments)},this.getClearAlpha=function(){return x.getClearAlpha()},this.setClearAlpha=function(){x.setClearAlpha(...arguments)},this.clear=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=0;if(e){let e=!1;if(null!==K){let t=K.texture.format;e=t===e9||t===e6||t===e4}if(e){let e=K.texture.type,t=e===ez||e===eW||e===eV||e===eJ||e===eq||e===eY,n=x.getClearColor(),r=x.getClearAlpha(),i=n.r,a=n.g,s=n.b;t?(H[0]=i,H[1]=a,H[2]=s,H[3]=r,eM.clearBufferuiv(eM.COLOR,0,H)):(V[0]=i,V[1]=a,V[2]=s,V[3]=r,eM.clearBufferiv(eM.COLOR,0,V))}else r|=eM.COLOR_BUFFER_BIT}t&&(r|=eM.DEPTH_BUFFER_BIT),n&&(r|=eM.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(0xffffffff)),eM.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){P.removeEventListener("webglcontextlost",eA,!1),P.removeEventListener("webglcontextrestored",eC,!1),P.removeEventListener("webglcontextcreationerror",eR,!1),x.dispose(),g.dispose(),v.dispose(),s.dispose(),l.dispose(),u.dispose(),d.dispose(),C.dispose(),R.dispose(),f.dispose(),eT.dispose(),eT.removeEventListener("sessionstart",eN),eT.removeEventListener("sessionend",eD),eU.stop()},this.renderBufferDirect=function(e,t,a,d,p,f){let g;null===t&&(t=ex);let v=p.isMesh&&0>p.matrixWorld.determinant(),_=function(e,t,n,a,c){var h,d;!0!==t.isScene&&(t=ex),o.resetTextureUnits();let p=t.fog,f=a.isMeshStandardMaterial?t.environment:null,g=null===K?q.outputColorSpace:!0===K.isXRRenderTarget?K.texture.colorSpace:tQ,v=(a.isMeshStandardMaterial?u:l).get(a.envMap||f),_=!0===a.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,x=!!n.attributes.tangent&&(!!a.normalMap||a.anisotropy>0),S=!!n.morphAttributes.position,M=!!n.morphAttributes.normal,w=!!n.morphAttributes.color,E=ec;a.toneMapped&&(null===K||!0===K.isXRRenderTarget)&&(E=q.toneMapping);let T=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,A=void 0!==T?T.length:0,C=s.get(a),P=W.state.lights;if(!0===em&&(!0===eg||e!==Q)){let t=e===Q&&a.id===$;y.setState(a,e,t)}let I=!1;a.version===C.__version?C.needsLights&&C.lightsStateVersion!==P.state.version||C.outputColorSpace!==g||c.isBatchedMesh&&!1===C.batching?I=!0:c.isBatchedMesh||!0!==C.batching?c.isBatchedMesh&&!0===C.batchingColor&&null===c.colorTexture||c.isBatchedMesh&&!1===C.batchingColor&&null!==c.colorTexture||c.isInstancedMesh&&!1===C.instancing?I=!0:c.isInstancedMesh||!0!==C.instancing?c.isSkinnedMesh&&!1===C.skinning?I=!0:c.isSkinnedMesh||!0!==C.skinning?c.isInstancedMesh&&!0===C.instancingColor&&null===c.instanceColor||c.isInstancedMesh&&!1===C.instancingColor&&null!==c.instanceColor||c.isInstancedMesh&&!0===C.instancingMorph&&null===c.morphTexture||c.isInstancedMesh&&!1===C.instancingMorph&&null!==c.morphTexture||C.envMap!==v||!0===a.fog&&C.fog!==p||void 0!==C.numClippingPlanes&&(C.numClippingPlanes!==y.numPlanes||C.numIntersection!==y.numIntersection)||C.vertexAlphas!==_||C.vertexTangents!==x||C.morphTargets!==S||C.morphNormals!==M||C.morphColors!==w||C.toneMapping!==E?I=!0:C.morphTargetsCount!==A&&(I=!0):I=!0:I=!0:I=!0:(I=!0,C.__version=a.version);let L=C.currentProgram;!0===I&&(L=ej(a,t,c));let N=!1,D=!1,U=!1,O=L.getUniforms(),F=C.uniforms;if(i.useProgram(L.program)&&(N=!0,D=!0,U=!0),a.id!==$&&($=a.id,D=!0),N||Q!==e){i.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),O.setValue(eM,"projectionMatrix",e.projectionMatrix),O.setValue(eM,"viewMatrix",e.matrixWorldInverse);let t=O.map.cameraPosition;void 0!==t&&t.setValue(eM,ey.setFromMatrixPosition(e.matrixWorld)),r.logarithmicDepthBuffer&&O.setValue(eM,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(a.isMeshPhongMaterial||a.isMeshToonMaterial||a.isMeshLambertMaterial||a.isMeshBasicMaterial||a.isMeshStandardMaterial||a.isShaderMaterial)&&O.setValue(eM,"isOrthographic",!0===e.isOrthographicCamera),Q!==e&&(Q=e,D=!0,U=!0)}if(c.isSkinnedMesh){O.setOptional(eM,c,"bindMatrix"),O.setOptional(eM,c,"bindMatrixInverse");let e=c.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),O.setValue(eM,"boneTexture",e.boneTexture,o))}c.isBatchedMesh&&(O.setOptional(eM,c,"batchingTexture"),O.setValue(eM,"batchingTexture",c._matricesTexture,o),O.setOptional(eM,c,"batchingIdTexture"),O.setValue(eM,"batchingIdTexture",c._indirectTexture,o),O.setOptional(eM,c,"batchingColorTexture"),null!==c._colorsTexture&&O.setValue(eM,"batchingColorTexture",c._colorsTexture,o));let k=n.morphAttributes;if((void 0!==k.position||void 0!==k.normal||void 0!==k.color)&&b.update(c,n,L),(D||C.receiveShadow!==c.receiveShadow)&&(C.receiveShadow=c.receiveShadow,O.setValue(eM,"receiveShadow",c.receiveShadow)),a.isMeshGouraudMaterial&&null!==a.envMap&&(F.envMap.value=v,F.flipEnvMap.value=v.isCubeTexture&&!1===v.isRenderTargetTexture?-1:1),a.isMeshStandardMaterial&&null===a.envMap&&null!==t.environment&&(F.envMapIntensity.value=t.environmentIntensity),D&&(O.setValue(eM,"toneMappingExposure",q.toneMappingExposure),C.needsLights&&(h=F,d=U,h.ambientLightColor.needsUpdate=d,h.lightProbe.needsUpdate=d,h.directionalLights.needsUpdate=d,h.directionalLightShadows.needsUpdate=d,h.pointLights.needsUpdate=d,h.pointLightShadows.needsUpdate=d,h.spotLights.needsUpdate=d,h.spotLightShadows.needsUpdate=d,h.rectAreaLights.needsUpdate=d,h.hemisphereLights.needsUpdate=d),p&&!0===a.fog&&m.refreshFogUniforms(F,p),m.refreshMaterialUniforms(F,a,eo,es,W.state.transmissionRenderTarget[e.id]),dd.upload(eM,eZ(C),F,o)),a.isShaderMaterial&&!0===a.uniformsNeedUpdate&&(dd.upload(eM,eZ(C),F,o),a.uniformsNeedUpdate=!1),a.isSpriteMaterial&&O.setValue(eM,"center",c.center),O.setValue(eM,"modelViewMatrix",c.modelViewMatrix),O.setValue(eM,"normalMatrix",c.normalMatrix),O.setValue(eM,"modelMatrix",c.matrixWorld),a.isShaderMaterial||a.isRawShaderMaterial){let e=a.uniformsGroups;for(let t=0,n=e.length;t2&&void 0!==arguments[2]?arguments[2]:null;null===n&&(n=e),(W=v.get(n)).init(t),X.push(W),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(W.pushLight(e),e.castShadow&&W.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(W.pushLight(e),e.castShadow&&W.pushShadow(e))}),W.setupLights();let r=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t)if(Array.isArray(t))for(let i=0;i2&&void 0!==arguments[2]?arguments[2]:null,i=this.compile(e,t,r);return new Promise(t=>{function r(){if(i.forEach(function(e){s.get(e).currentProgram.isReady()&&i.delete(e)}),0===i.size)return void t(e);setTimeout(r,10)}null!==n.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)})};let eL=null;function eN(){eU.stop()}function eD(){eU.start()}let eU=new cW;function eO(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)W.pushLight(e),e.castShadow&&W.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ef.intersectsSprite(e)){r&&e_.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ev);let t=d.update(e),i=e.material;i.visible&&G.push(e,t,i,n,e_.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ef.intersectsObject(e))){let t=d.update(e),i=e.material;if(r&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),e_.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),e_.copy(t.boundingSphere.center)),e_.applyMatrix4(e.matrixWorld).applyMatrix4(ev)),Array.isArray(i)){let r=t.groups;for(let a=0,s=r.length;a0&&eH(a,t,n),s.length>0&&eH(s,t,n),o.length>0&&eH(o,t,n),i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),i.setPolygonOffset(!1)}function eB(e,t,r,i){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;void 0===W.state.transmissionRenderTarget[i.id]&&(W.state.transmissionRenderTarget[i.id]=new ru(1,1,{generateMipmaps:!0,type:n.has("EXT_color_buffer_half_float")||n.has("EXT_color_buffer_float")?eX:ez,minFilter:eF,samples:4,stencilBuffer:N,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:n8.workingColorSpace}));let a=W.state.transmissionRenderTarget[i.id],s=i.viewport||ee;a.setSize(s.z*q.transmissionResolutionScale,s.w*q.transmissionResolutionScale);let l=q.getRenderTarget(),u=q.getActiveCubeFace(),c=q.getActiveMipmapLevel();q.setRenderTarget(a),q.getClearColor(er),(ei=q.getClearAlpha())<1&&q.setClearColor(0xffffff,.5),q.clear(),eb&&x.render(r);let h=q.toneMapping;q.toneMapping=ec;let d=i.viewport;if(void 0!==i.viewport&&(i.viewport=void 0),W.setupLightsView(i),!0===em&&y.setGlobalState(q.clippingPlanes,i),eH(e,r,i),o.updateMultisampleRenderTarget(a),o.updateRenderTargetMipmap(a),!1===n.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let n=0,a=t.length;n0)for(let t=0,a=n.length;t0&&eB(r,i,e,t),eb&&x.render(e),ek(G,e,t);null!==K&&0===Z&&(o.updateMultisampleRenderTarget(K),o.updateRenderTargetMipmap(K)),!0===e.isScene&&e.onAfterRender(q,e,t),C.resetDefaultState(),$=-1,Q=null,X.pop(),X.length>0?(W=X[X.length-1],!0===em&&y.setGlobalState(q.clippingPlanes,W.state.camera)):W=null,j.pop(),G=j.length>0?j[j.length-1]:null},this.getActiveCubeFace=function(){return J},this.getActiveMipmapLevel=function(){return Z},this.getRenderTarget=function(){return K},this.setRenderTargetTextures=function(e,t,n){let r=s.get(e);r.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===r.__autoAllocateDepthBuffer&&(r.__useRenderToTexture=!1),s.get(e.texture).__webglTexture=t,s.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=s.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t};let e$=eM.createFramebuffer();this.setRenderTarget=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;K=e,J=t,Z=n;let r=!0,a=null,l=!1,u=!1;if(e){let c=s.get(e);if(void 0!==c.__useDefaultFramebuffer)i.bindFramebuffer(eM.FRAMEBUFFER,null),r=!1;else if(void 0===c.__webglFramebuffer)o.setupRenderTarget(e);else if(c.__hasExternalTextures)o.rebindTextures(e,s.get(e.texture).__webglTexture,s.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(c.__boundDepthTexture!==t){if(null!==t&&s.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");o.setupDepthRenderbuffer(e)}}let h=e.texture;(h.isData3DTexture||h.isDataArrayTexture||h.isCompressedArrayTexture)&&(u=!0);let d=s.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(a=Array.isArray(d[t])?d[t][n]:d[t],l=!0):a=e.samples>0&&!1===o.useMultisampledRTT(e)?s.get(e).__webglMultisampledFramebuffer:Array.isArray(d)?d[n]:d,ee.copy(e.viewport),et.copy(e.scissor),en=e.scissorTest}else ee.copy(eh).multiplyScalar(eo).floor(),et.copy(ed).multiplyScalar(eo).floor(),en=ep;if(0!==n&&(a=e$),i.bindFramebuffer(eM.FRAMEBUFFER,a)&&r&&i.drawBuffers(e,a),i.viewport(ee),i.scissor(et),i.setScissorTest(en),l){let r=s.get(e.texture);eM.framebufferTexture2D(eM.FRAMEBUFFER,eM.COLOR_ATTACHMENT0,eM.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(u)for(let r=0;r7&&void 0!==arguments[7]?arguments[7]:0;if(!(e&&e.isWebGLRenderTarget))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let h=s.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==u&&(h=h[u]),h){i.bindFramebuffer(eM.FRAMEBUFFER,h);try{let i=e.textures[c],s=i.format,u=i.type;if(!r.textureFormatReadable(s))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!r.textureTypeReadable(u))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-a&&n>=0&&n<=e.height-o&&(e.textures.length>1&&eM.readBuffer(eM.COLOR_ATTACHMENT0+c),eM.readPixels(t,n,a,o,A.convert(s),A.convert(u),l))}finally{let e=null!==K?s.get(K).__webglFramebuffer:null;i.bindFramebuffer(eM.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,a,o,l,u){let c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;if(!(e&&e.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let h=s.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==u&&(h=h[u]),h)if(t>=0&&t<=e.width-a&&n>=0&&n<=e.height-o){i.bindFramebuffer(eM.FRAMEBUFFER,h);let u=e.textures[c],d=u.format,p=u.type;if(!r.textureFormatReadable(d))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!r.textureTypeReadable(p))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let f=eM.createBuffer();eM.bindBuffer(eM.PIXEL_PACK_BUFFER,f),eM.bufferData(eM.PIXEL_PACK_BUFFER,l.byteLength,eM.STREAM_READ),e.textures.length>1&&eM.readBuffer(eM.COLOR_ATTACHMENT0+c),eM.readPixels(t,n,a,o,A.convert(d),A.convert(p),0);let m=null!==K?s.get(K).__webglFramebuffer:null;i.bindFramebuffer(eM.FRAMEBUFFER,m);let g=eM.fenceSync(eM.SYNC_GPU_COMMANDS_COMPLETE,0);return eM.flush(),await n4(eM,g,4),eM.bindBuffer(eM.PIXEL_PACK_BUFFER,f),eM.getBufferSubData(eM.PIXEL_PACK_BUFFER,0,l),eM.deleteBuffer(f),eM.deleteSync(g),l}else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.pow(2,-n),a=Math.floor(e.image.width*r),s=Math.floor(e.image.height*r),l=null!==t?t.x:0,u=null!==t?t.y:0;o.setTexture2D(e,0),eM.copyTexSubImage2D(eM.TEXTURE_2D,n,0,0,l,u,a,s),i.unbindTexture()};let eQ=eM.createFramebuffer(),e0=eM.createFramebuffer();this.copyTextureToTexture=function(e,t){let n,r,a,l,u,c,h,d,p,f,m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,g=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,v=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,y=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;null===y&&(0!==v?(n3("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),y=v,v=0):y=0);let _=e.isCompressedTexture?e.mipmaps[y]:e.image;if(null!==m)n=m.max.x-m.min.x,r=m.max.y-m.min.y,a=m.isBox3?m.max.z-m.min.z:1,l=m.min.x,u=m.min.y,c=m.isBox3?m.min.z:0;else{let t=Math.pow(2,-v);n=Math.floor(_.width*t),r=Math.floor(_.height*t),a=e.isDataArrayTexture?_.depth:e.isData3DTexture?Math.floor(_.depth*t):1,l=0,u=0,c=0}null!==g?(h=g.x,d=g.y,p=g.z):(h=0,d=0,p=0);let x=A.convert(t.format),b=A.convert(t.type);t.isData3DTexture?(o.setTexture3D(t,0),f=eM.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(o.setTexture2DArray(t,0),f=eM.TEXTURE_2D_ARRAY):(o.setTexture2D(t,0),f=eM.TEXTURE_2D),eM.pixelStorei(eM.UNPACK_FLIP_Y_WEBGL,t.flipY),eM.pixelStorei(eM.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),eM.pixelStorei(eM.UNPACK_ALIGNMENT,t.unpackAlignment);let S=eM.getParameter(eM.UNPACK_ROW_LENGTH),M=eM.getParameter(eM.UNPACK_IMAGE_HEIGHT),w=eM.getParameter(eM.UNPACK_SKIP_PIXELS),E=eM.getParameter(eM.UNPACK_SKIP_ROWS),T=eM.getParameter(eM.UNPACK_SKIP_IMAGES);eM.pixelStorei(eM.UNPACK_ROW_LENGTH,_.width),eM.pixelStorei(eM.UNPACK_IMAGE_HEIGHT,_.height),eM.pixelStorei(eM.UNPACK_SKIP_PIXELS,l),eM.pixelStorei(eM.UNPACK_SKIP_ROWS,u),eM.pixelStorei(eM.UNPACK_SKIP_IMAGES,c);let C=e.isDataArrayTexture||e.isData3DTexture,R=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let o=s.get(e),f=s.get(t),m=s.get(o.__renderTarget),g=s.get(f.__renderTarget);i.bindFramebuffer(eM.READ_FRAMEBUFFER,m.__webglFramebuffer),i.bindFramebuffer(eM.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let i=0;id5],8155);let d4=e=>{let t,n=new Set,r=(e,r)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>s,subscribe:e=>(n.add(e),()=>n.delete(e))},s=t=e(r,i,a);return a},d5=e=>e?d4(e):d4,{useSyncExternalStoreWithSelector:d6}=d3.default,d8=e=>e,d9=(e,t)=>{let n=d5(e),r=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d8,n=arguments.length>2?arguments[2]:void 0,r=d6(e.subscribe,e.getState,e.getInitialState,t,n);return h.default.useDebugValue(r),r}(n,e,r)};return Object.assign(r,n),r},d7=[];function pe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>e===t;if(e===t)return!0;if(!e||!t)return!1;let r=e.length;if(t.length!==r)return!1;for(let i=0;i1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(let i of(null===t&&(t=[e]),d7))if(pe(t,i.keys,i.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(i,"error"))throw i.error;if(Object.prototype.hasOwnProperty.call(i,"response"))return r.lifespan&&r.lifespan>0&&(i.timeout&&clearTimeout(i.timeout),i.timeout=setTimeout(i.remove,r.lifespan)),i.response;if(!n)throw i.promise}let i={keys:t,equal:r.equal,remove:()=>{let e=d7.indexOf(i);-1!==e&&d7.splice(e,1)},promise:("object"==typeof e&&"function"==typeof e.then?e:e(...t)).then(e=>{i.response=e,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(e=>i.error=e)};if(d7.push(i),!n)throw i.promise}var pn=e.i(98133),pr=e.i(95087),pi=e.i(43476);e.s(["FiberProvider",()=>pu,"traverseFiber",()=>ps,"useContextBridge",()=>pp,"useFiber",()=>pc],46791);var pa=h;function ps(e,t,n){if(!e)return;if(!0===n(e))return e;let r=t?e.return:e.child;for(;r;){let e=ps(r,t,n);if(e)return e;r=t?null:r.sibling}}function po(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(t){return e}}(()=>{var e,t;return"undefined"!=typeof window&&((null==(e=window.document)?void 0:e.createElement)||(null==(t=window.navigator)?void 0:t.product)==="ReactNative")})()?pa.useLayoutEffect:pa.useEffect;let pl=po(pa.createContext(null));class pu extends pa.Component{render(){return pa.createElement(pl.Provider,{value:this._reactInternals},this.props.children)}}function pc(){let e=pa.useContext(pl);if(null===e)throw Error("its-fine: useFiber must be called within a !");let t=pa.useId();return pa.useMemo(()=>{for(let n of[e,null==e?void 0:e.alternate]){if(!n)continue;let e=ps(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}let ph=Symbol.for("react.context"),pd=e=>null!==e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===ph;function pp(){let e=function(){let e=pc(),[t]=pa.useState(()=>new Map);t.clear();let n=e;for(;n;){let e=n.type;pd(e)&&e!==pl&&!t.has(e)&&t.set(e,pa.use(po(e))),n=n.return}return t}();return pa.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>pa.createElement(t,null,pa.createElement(n.Provider,{...r,value:e.get(n)})),e=>pa.createElement(pu,{...e})),[e])}function pf(e){let t=e.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}h.act;let pm=e=>e&&e.hasOwnProperty("current"),pg=e=>null!=e&&("string"==typeof e||"number"==typeof e||e.isColor),pv=((e,t)=>"undefined"!=typeof window&&((null==(e=window.document)?void 0:e.createElement)||(null==(t=window.navigator)?void 0:t.product)==="ReactNative"))()?h.useLayoutEffect:h.useEffect;function py(e){let t=h.useRef(e);return pv(()=>void(t.current=e),[e]),t}function p_(){let e=pc(),t=pp();return h.useMemo(()=>n=>{let{children:r}=n,i=ps(e,!0,e=>e.type===h.StrictMode)?h.StrictMode:h.Fragment;return(0,pi.jsx)(i,{children:(0,pi.jsx)(t,{children:r})})},[e,t])}function px(e){let{set:t}=e;return pv(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}let pb=(e=>((e=class extends h.Component{componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}constructor(...e){super(...e),this.state={error:!1}}}).getDerivedStateFromError=()=>({error:!0}),e))();function pS(e){var t;let n="undefined"!=typeof window?null!=(t=window.devicePixelRatio)?t:2:1;return Array.isArray(e)?Math.min(Math.max(e[0],n),e[1]):e}function pM(e){var t;return null==(t=e.__r3f)?void 0:t.root.getState()}let pw={obj:e=>e===Object(e)&&!pw.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,boo:e=>"boolean"==typeof e,und:e=>void 0===e,nul:e=>null===e,arr:e=>Array.isArray(e),equ(e,t){let n,{arrays:r="shallow",objects:i="reference",strict:a=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(typeof e!=typeof t||!!e!=!!t)return!1;if(pw.str(e)||pw.num(e)||pw.boo(e))return e===t;let s=pw.obj(e);if(s&&"reference"===i)return e===t;let o=pw.arr(e);if(o&&"reference"===r)return e===t;if((o||s)&&e===t)return!0;for(n in e)if(!(n in t))return!1;if(s&&"shallow"===r&&"shallow"===i){for(n in a?t:e)if(!pw.equ(e[n],t[n],{strict:a,objects:"reference"}))return!1}else for(n in a?t:e)if(e[n]!==t[n])return!1;if(pw.und(n)){if(o&&0===e.length&&0===t.length||s&&0===Object.keys(e).length&&0===Object.keys(t).length)return!0;if(e!==t)return!1}return!0}},pE=["children","key","ref"];function pT(e,t,n,r){let i=null==e?void 0:e.__r3f;return!i&&(i={root:t,type:n,parent:null,children:[],props:function(e){let t={};for(let n in e)pE.includes(n)||(t[n]=e[n]);return t}(r),object:e,eventCount:0,handlers:{},isHidden:!1},e&&(e.__r3f=i)),i}function pA(e,t){let n=e[t];if(!t.includes("-"))return{root:e,key:t,target:n};for(let i of(n=e,t.split("-"))){var r;t=i,e=n,n=null==(r=n)?void 0:r[t]}return{root:e,key:t,target:n}}let pC=/-\d+$/;function pR(e,t){if(pw.str(t.props.attach)){if(pC.test(t.props.attach)){let n=t.props.attach.replace(pC,""),{root:r,key:i}=pA(e.object,n);Array.isArray(r[i])||(r[i]=[])}let{root:n,key:r}=pA(e.object,t.props.attach);t.previousAttach=n[r],n[r]=t.object}else pw.fun(t.props.attach)&&(t.previousAttach=t.props.attach(e.object,t.object))}function pP(e,t){if(pw.str(t.props.attach)){let{root:n,key:r}=pA(e.object,t.props.attach),i=t.previousAttach;void 0===i?delete n[r]:n[r]=i}else null==t.previousAttach||t.previousAttach(e.object,t.object);delete t.previousAttach}let pI=[...pE,"args","dispose","attach","object","onUpdate","dispose"],pL=new Map,pN=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],pD=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function pU(e,t){var n,r;let i=e.__r3f,a=i&&pf(i).getState(),s=null==i?void 0:i.eventCount;for(let n in t){let s=t[n];if(pI.includes(n))continue;if(i&&pD.test(n)){"function"==typeof s?i.handlers[n]=s:delete i.handlers[n],i.eventCount=Object.keys(i.handlers).length;continue}if(void 0===s)continue;let{root:o,key:l,target:u}=pA(e,n);u instanceof r$&&s instanceof r$?u.mask=s.mask:u instanceof iE&&pg(s)?u.set(s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&"function"==typeof u.copy&&null!=s&&s.constructor&&u.constructor===s.constructor?u.copy(s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&Array.isArray(s)?"function"==typeof u.fromArray?u.fromArray(s):u.set(...s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&"number"==typeof s?"function"==typeof u.setScalar?u.setScalar(s):u.set(s):(o[l]=s,a&&!a.linear&&pN.includes(l)&&null!=(r=o[l])&&r.isTexture&&o[l].format===e0&&o[l].type===ez&&(o[l].colorSpace=t$))}if(null!=i&&i.parent&&null!=a&&a.internal&&null!=(n=i.object)&&n.isObject3D&&s!==i.eventCount){let e=i.object,t=a.internal.interaction.indexOf(e);t>-1&&a.internal.interaction.splice(t,1),i.eventCount&&null!==e.raycast&&a.internal.interaction.push(e)}return i&&void 0===i.props.attach&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&pO(i),e}function pO(e){var t;if(!e.parent)return;null==e.props.onUpdate||e.props.onUpdate(e.object);let n=null==(t=e.root)||null==t.getState?void 0:t.getState();n&&0===n.internal.frames&&n.invalidate()}let pF=e=>null==e?void 0:e.isObject3D;function pk(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function pz(e,t,n,r){let i=n.get(t);i&&(n.delete(t),0===n.size&&(e.delete(r),i.target.releasePointerCapture(r)))}let pB=e=>!!(null!=e&&e.render),pH=h.createContext(null);function pV(){let e=h.useContext(pH);if(!e)throw Error("R3F: Hooks can only be used within the Canvas component!");return e}function pG(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>e,t=arguments.length>1?arguments[1]:void 0;return pV()(e,t)}function pW(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=pV(),r=n.getState().internal.subscribe,i=py(e);return pv(()=>r(i,t,n),[t,r,n]),null}let pj=new WeakMap;function pX(e,t){return function(n){let r;for(var i,a=arguments.length,s=Array(a>1?a-1:0),o=1;onew Promise((n,i)=>r.load(e,e=>{pF(null==e?void 0:e.scene)&&Object.assign(e,function(e){let t={nodes:{},materials:{},meshes:{}};return e&&e.traverse(e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material),e.isMesh&&!t.meshes[e.name]&&(t.meshes[e.name]=e)}),t}(e.scene)),n(e)},t,t=>i(Error("Could not load ".concat(e,": ").concat(null==t?void 0:t.message)))))))}}function pq(e,t,n,r){let i=Array.isArray(t)?t:[t],a=pt(pX(n,r),[e,...i],!1,{equal:pw.equ});return Array.isArray(t)?a:a[0]}pq.preload=function(e,t,n){let r,i=Array.isArray(t)?t:[t];pt(pX(n),[e,...i],!0,r)},pq.clear=function(e,t){var n=[e,...Array.isArray(t)?t:[t]];if(void 0===n||0===n.length)d7.splice(0,d7.length);else{let e=d7.find(e=>pe(n,e.keys,e.equal));e&&e.remove()}};let pY={},pJ=/^three(?=[A-Z])/,pZ=e=>"".concat(e[0].toUpperCase()).concat(e.slice(1)),pK=0;function p$(e){if("function"==typeof e){let t="".concat(pK++);return pY[t]=e,t}Object.assign(pY,e)}function pQ(e,t){let n=pZ(e),r=pY[n];if("primitive"!==e&&!r)throw Error("R3F: ".concat(n," is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively"));if("primitive"===e&&!t.object)throw Error("R3F: Primitives without 'object' are invalid!");if(void 0!==t.args&&!Array.isArray(t.args))throw Error("R3F: The args prop must be an array!")}function p0(e){if(e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?pR(e.parent,e):pF(e.object)&&!1!==e.props.visible&&(e.object.visible=!0),e.isHidden=!1,pO(e)}}function p1(e,t,n){let r=t.root.getState();if(e.parent||e.object===r.scene){if(!t.object){var i,a;let e=pY[pZ(t.type)];t.object=null!=(i=t.props.object)?i:new e(...null!=(a=t.props.args)?a:[]),t.object.__r3f=t}if(pU(t.object,t.props),t.props.attach)pR(e,t);else if(pF(t.object)&&pF(e.object)){let r=e.object.children.indexOf(null==n?void 0:n.object);if(n&&-1!==r){let n=e.object.children.indexOf(t.object);-1!==n?(e.object.children.splice(n,1),e.object.children.splice(n{try{e.dispose()}catch(e){}};"undefined"!=typeof IS_REACT_ACT_ENVIRONMENT?t():(0,pr.unstable_scheduleCallback)(pr.unstable_IdlePriority,t)}}function p5(e,t,n){if(!t)return;t.parent=null;let r=e.children.indexOf(t);-1!==r&&e.children.splice(r,1),t.props.attach?pP(e,t):pF(t.object)&&pF(e.object)&&(e.object.remove(t.object),function(e,t){let{internal:n}=e.getState();n.interaction=n.interaction.filter(e=>e!==t),n.initialHits=n.initialHits.filter(e=>e!==t),n.hovered.forEach((e,r)=>{(e.eventObject===t||e.object===t)&&n.hovered.delete(r)}),n.capturedMap.forEach((e,r)=>{pz(n.capturedMap,t,e,r)})}(pf(t),t.object));let i=null!==t.props.dispose&&!1!==n;for(let e=t.children.length-1;e>=0;e--){let n=t.children[e];p5(t,n,i)}t.children.length=0,delete t.object.__r3f,i&&"primitive"!==t.type&&"Scene"!==t.object.type&&p4(t.object),void 0===n&&pO(t)}let p6=[],p8=()=>{},p9={},p7=0,fe=function(e){let t=(0,pn.default)(e);return t.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:h.version}),t}({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:function(e,t,n){var r;return pQ(e=pZ(e)in pY?e:e.replace(pJ,""),t),"primitive"===e&&null!=(r=t.object)&&r.__r3f&&delete t.object.__r3f,pT(t.object,n,e,t)},removeChild:p5,appendChild:p2,appendInitialChild:p2,insertBefore:p3,appendChildToContainer(e,t){let n=e.getState().scene.__r3f;t&&n&&p2(n,t)},removeChildFromContainer(e,t){let n=e.getState().scene.__r3f;t&&n&&p5(n,t)},insertInContainerBefore(e,t,n){let r=e.getState().scene.__r3f;t&&n&&r&&p3(r,t,n)},getRootHostContext:()=>p9,getChildHostContext:()=>p9,commitUpdate(e,t,n,r,i){var a,s,o;pQ(t,r);let l=!1;if("primitive"===e.type&&n.object!==r.object||(null==(a=r.args)?void 0:a.length)!==(null==(s=n.args)?void 0:s.length)?l=!0:null!=(o=r.args)&&o.some((e,t)=>{var r;return e!==(null==(r=n.args)?void 0:r[t])})&&(l=!0),l)p6.push([e,{...r},i]);else{let t=function(e,t){let n={};for(let r in t)if(!pI.includes(r)&&!pw.equ(t[r],e.props[r]))for(let e in n[r]=t[r],t)e.startsWith("".concat(r,"-"))&&(n[e]=t[e]);for(let r in e.props){if(pI.includes(r)||t.hasOwnProperty(r))continue;let{root:i,key:a}=pA(e.object,r);if(i.constructor&&0===i.constructor.length){let e=function(e){let t=pL.get(e.constructor);try{t||(t=new e.constructor,pL.set(e.constructor,t))}catch(e){}return t}(i);pw.und(e)||(n[a]=e[a])}else n[a]=0}return n}(e,r);Object.keys(t).length&&(Object.assign(e.props,t),pU(e.object,t))}(null===i.sibling||(4&i.flags)==0)&&function(){for(let[e]of p6){let t=e.parent;if(t)for(let n of(e.props.attach?pP(t,e):pF(e.object)&&pF(t.object)&&t.object.remove(e.object),e.children))n.props.attach?pP(e,n):pF(n.object)&&pF(e.object)&&e.object.remove(n.object);e.isHidden&&p0(e),e.object.__r3f&&delete e.object.__r3f,"primitive"!==e.type&&p4(e.object)}for(let[r,i,a]of p6){r.props=i;let s=r.parent;if(s){let i=pY[pZ(r.type)];r.object=null!=(e=r.props.object)?e:new i(...null!=(t=r.props.args)?t:[]),r.object.__r3f=r;var e,t,n=r.object;for(let e of[a,a.alternate])if(null!==e)if("function"==typeof e.ref){null==e.refCleanup||e.refCleanup();let t=e.ref(n);"function"==typeof t&&(e.refCleanup=t)}else e.ref&&(e.ref.current=n);for(let e of(pU(r.object,r.props),r.props.attach?pR(s,r):pF(r.object)&&pF(s.object)&&s.object.add(r.object),r.children))e.props.attach?pR(r,e):pF(e.object)&&pF(r.object)&&r.object.add(e.object);pO(r)}}p6.length=0}()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:e=>null==e?void 0:e.object,prepareForCommit:()=>null,preparePortalMount:e=>pT(e.getState().scene,e,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:function(e){if(!e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?pP(e.parent,e):pF(e.object)&&(e.object.visible=!1),e.isHidden=!0,pO(e)}},unhideInstance:p0,createTextInstance:p8,hideTextInstance:p8,unhideTextInstance:p8,scheduleTimeout:"function"==typeof setTimeout?setTimeout:void 0,cancelTimeout:"function"==typeof clearTimeout?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:h.createContext(null),setCurrentUpdatePriority(e){p7=e},getCurrentUpdatePriority:()=>p7,resolveUpdatePriority(){var e;if(0!==p7)return p7;switch("undefined"!=typeof window&&(null==(e=window.event)?void 0:e.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return d.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return d.ContinuousEventPriority;default:return d.DefaultEventPriority}},resetFormInstance(){}}),ft=new Map,fn={objects:"shallow",strict:!1};function fr(e){let t,n,r=ft.get(e),i=null==r?void 0:r.fiber,a=null==r?void 0:r.store;r&&console.warn("R3F.createRoot should only be called once!");let s="function"==typeof reportError?reportError:console.error,o=a||((e,t)=>{let n,r,i=(n=(n,r)=>{let i,a=new nX,s=new nX,o=new nX;function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r().camera,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r().size,{width:i,height:l,top:u,left:c}=n,h=i/l;t.isVector3?o.copy(t):o.set(...t);let d=e.getWorldPosition(a).distanceTo(o);if(e&&e.isOrthographicCamera)return{width:i/e.zoom,height:l/e.zoom,top:u,left:c,factor:1,distance:d,aspect:h};{let t=2*Math.tan(e.fov*Math.PI/180/2)*d,n=i/l*t;return{width:n,height:t,top:u,left:c,factor:i/n,distance:d,aspect:h}}}let u=e=>n(t=>({performance:{...t.performance,current:e}})),c=new nW;return{set:n,get:r,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return e(r(),t)},advance:(e,n)=>t(e,n,r()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new uM,pointer:c,mouse:c,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=r();i&&clearTimeout(i),e.performance.current!==e.performance.min&&u(e.performance.min),i=setTimeout(()=>u(r().performance.max),e.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:l},setEvents:e=>n(t=>({...t,events:{...t.events,...e}})),setSize:function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=r().camera,u={width:e,height:t,top:i,left:a};n(e=>({size:u,viewport:{...e.viewport,...l(o,s,u)}}))},setDpr:e=>n(t=>{let n=pS(e);return{viewport:{...t.viewport,dpr:n,initialDpr:t.viewport.initialDpr||n}}}),setFrameloop:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always",t=r().clock;t.stop(),t.elapsedTime=0,"never"!==e&&(t.start(),t.elapsedTime=0),n(()=>({frameloop:e}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:h.createRef(),active:!1,frames:0,priority:0,subscribe:(e,t,n)=>{let i=r().internal;return i.priority=i.priority+ +(t>0),i.subscribers.push({ref:e,priority:t,store:n}),i.subscribers=i.subscribers.sort((e,t)=>e.priority-t.priority),()=>{let n=r().internal;null!=n&&n.subscribers&&(n.priority=n.priority-(t>0),n.subscribers=n.subscribers.filter(t=>t.ref!==e))}}}}})?d9(n,r):d9,a=i.getState(),s=a.size,o=a.viewport.dpr,l=a.camera;return i.subscribe(()=>{let{camera:e,size:t,viewport:n,gl:r,set:a}=i.getState();if(t.width!==s.width||t.height!==s.height||n.dpr!==o){s=t,o=n.dpr,function(e,t){!e.manual&&(e&&e.isOrthographicCamera?(e.left=-(t.width/2),e.right=t.width/2,e.top=t.height/2,e.bottom=-(t.height/2)):e.aspect=t.width/t.height,e.updateProjectionMatrix())}(e,t),n.dpr>0&&r.setPixelRatio(n.dpr);let i="undefined"!=typeof HTMLCanvasElement&&r.domElement instanceof HTMLCanvasElement;r.setSize(t.width,t.height,i)}e!==l&&(l=e,a(t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}})))}),i.subscribe(t=>e(t)),i})(fy,f_),l=i||fe.createContainer(o,d.ConcurrentRoot,null,!1,null,"",s,s,s,null);r||ft.set(e,{fiber:l,store:o});let u=!1,c=null;return{async configure(){var r,i;let a,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c=new Promise(e=>a=e);let{gl:l,size:h,scene:d,events:p,onCreated:f,shadows:m=!1,linear:g=!1,flat:v=!1,legacy:y=!1,orthographic:_=!1,frameloop:w="always",dpr:E=[1,2],performance:T,raycaster:A,camera:C,onPointerMissed:R}=s,P=o.getState(),I=P.gl;if(!P.gl){let t={canvas:e,powerPreference:"high-performance",antialias:!0,alpha:!0},n="function"==typeof l?await l(t):l;I=pB(n)?n:new d2({...t,...l}),P.set({gl:I})}let L=P.raycaster;L||P.set({raycaster:L=new u4});let{params:N,...D}=A||{};if(pw.equ(D,L,fn)||pU(L,{...D}),pw.equ(N,L.params,fn)||pU(L,{params:{...L.params,...N}}),!P.camera||P.camera===n&&!pw.equ(n,C,fn)){n=C;let e=null==C?void 0:C.isCamera,t=e?C:_?new l7(0,0,0,0,.1,1e3):new af(75,0,.1,1e3);!e&&(t.position.z=5,C&&(pU(t,C),!t.manual&&("aspect"in C||"left"in C||"right"in C||"bottom"in C||"top"in C)&&(t.manual=!0,t.updateProjectionMatrix())),P.camera||null!=C&&C.rotation||t.lookAt(0,0,0)),P.set({camera:t}),L.camera=t}if(!P.scene){let e;null!=d&&d.isScene?pT(e=d,o,"",{}):(pT(e=new aM,o,"",{}),d&&pU(e,d)),P.set({scene:e})}p&&!P.events.handlers&&P.set({events:p(o)});let U=function(e,t){if(!t&&"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:t,height:n,top:r,left:i}=e.parentElement.getBoundingClientRect();return{width:t,height:n,top:r,left:i}}return!t&&"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0}:{width:0,height:0,top:0,left:0,...t}}(e,h);if(pw.equ(U,P.size,fn)||P.setSize(U.width,U.height,U.top,U.left),E&&P.viewport.dpr!==pS(E)&&P.setDpr(E),P.frameloop!==w&&P.setFrameloop(w),P.onPointerMissed||P.set({onPointerMissed:R}),T&&!pw.equ(T,P.performance,fn)&&P.set(e=>({performance:{...e.performance,...T}})),!P.xr){let e=(e,t)=>{let n=o.getState();"never"!==n.frameloop&&f_(e,!0,n,t)},t=()=>{let t=o.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||fy(t)},n={connect(){let e=o.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){let e=o.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};"function"==typeof(null==(r=I.xr)?void 0:r.addEventListener)&&n.connect(),P.set({xr:n})}if(I.shadowMap){let e=I.shadowMap.enabled,t=I.shadowMap.type;I.shadowMap.enabled=!!m,pw.boo(m)?I.shadowMap.type=S:pw.str(m)?I.shadowMap.type=null!=(i=({basic:x,percentage:b,soft:S,variance:M})[m])?i:S:pw.obj(m)&&Object.assign(I.shadowMap,m),(e!==I.shadowMap.enabled||t!==I.shadowMap.type)&&(I.shadowMap.needsUpdate=!0)}return n8.enabled=!y,u||(I.outputColorSpace=g?tQ:t$,I.toneMapping=v?ec:ef),P.legacy!==y&&P.set(()=>({legacy:y})),P.linear!==g&&P.set(()=>({linear:g})),P.flat!==v&&P.set(()=>({flat:v})),!l||pw.fun(l)||pB(l)||pw.equ(l,I,fn)||pU(I,l),t=f,u=!0,a(),this},render(n){return u||c||this.configure(),c.then(()=>{fe.updateContainer((0,pi.jsx)(fi,{store:o,children:n,onCreated:t,rootElement:e}),l,null,()=>void 0)}),o},unmount(){fa(e)}}}function fi(e){let{store:t,children:n,onCreated:r,rootElement:i}=e;return pv(()=>{let e=t.getState();e.set(e=>({internal:{...e.internal,active:!0}})),r&&r(e),t.getState().events.connected||null==e.events.connect||e.events.connect(i)},[]),(0,pi.jsx)(pH.Provider,{value:t,children:n})}function fa(e,t){let n=ft.get(e),r=null==n?void 0:n.fiber;if(r){let i=null==n?void 0:n.store.getState();i&&(i.internal.active=!1),fe.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{null==i.events.disconnect||i.events.disconnect(),null==(n=i.gl)||null==(r=n.renderLists)||null==r.dispose||r.dispose(),null==(a=i.gl)||null==a.forceContextLoss||a.forceContextLoss(),null!=(s=i.gl)&&s.xr&&i.xr.disconnect();var n,r,a,s,o=i.scene;for(let e in"Scene"!==o.type&&(null==o.dispose||o.dispose()),o){let t=o[e];(null==t?void 0:t.type)!=="Scene"&&(null==t||null==t.dispose||t.dispose())}ft.delete(e),t&&t(e)}catch(e){}},500)})}}function fs(e,t){let n={callback:e};return t.add(n),()=>void t.delete(n)}let fo=new Set,fl=new Set,fu=new Set,fc=e=>fs(e,fo),fh=e=>fs(e,fl);function fd(e,t){if(e.size)for(let{callback:n}of e.values())n(t)}function fp(e,t){switch(e){case"before":return fd(fo,t);case"after":return fd(fl,t);case"tail":return fd(fu,t)}}function ff(e,t,n){let r=t.clock.getDelta();"never"===t.frameloop&&"number"==typeof e&&(r=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),s=t.internal.subscribers;for(let e=0;e0)&&!(null!=(t=c.gl.xr)&&t.isPresenting)&&(l+=ff(e,c))}if(fg=!1,fp("after",e),0===l)return fp("tail",e),fm=!1,cancelAnimationFrame(u)}function fy(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return ft.forEach(e=>fy(e.store.getState(),n));(null==(t=e.gl.xr)||!t.isPresenting)&&e.internal.active&&"never"!==e.frameloop&&(n>1?e.internal.frames=Math.min(60,e.internal.frames+n):fg?e.internal.frames=2:e.internal.frames=1,fm||(fm=!0,requestAnimationFrame(fv)))}function f_(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(t&&fp("before",e),n)ff(e,n,r);else for(let t of ft.values())ff(e,t.store.getState());t&&fp("after",e)}let fx={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function fb(e){let{handlePointer:t}=function(e){function t(e){return e.filter(e=>["Move","Over","Enter","Out","Leave"].some(t=>{var n;return null==(n=e.__r3f)?void 0:n.handlers["onPointer"+t]}))}function n(t){let{internal:n}=e.getState();for(let e of n.hovered.values())if(!t.length||!t.find(t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId)){let r=e.eventObject.__r3f;if(n.hovered.delete(pk(e)),null!=r&&r.eventCount){let n=r.handlers,i={...e,intersections:t};null==n.onPointerOut||n.onPointerOut(i),null==n.onPointerLeave||n.onPointerLeave(i)}}}function r(e,t){for(let n=0;nn([]);case"onLostPointerCapture":return t=>{let{internal:r}=e.getState();"pointerId"in t&&r.capturedMap.has(t.pointerId)&&requestAnimationFrame(()=>{r.capturedMap.has(t.pointerId)&&(r.capturedMap.delete(t.pointerId),n([]))})}}return function(a){let{onPointerMissed:s,internal:o}=e.getState();o.lastEvent.current=a;let l="onPointerMove"===i,u="onClick"===i||"onContextMenu"===i||"onDoubleClick"===i,c=function(t,n){let r=e.getState(),i=new Set,a=[],s=n?n(r.internal.interaction):r.internal.interaction;for(let e=0;e{let n=pM(e.object),r=pM(t.object);return n&&r&&r.events.priority-n.events.priority||e.distance-t.distance}).filter(e=>{let t=pk(e);return!i.has(t)&&(i.add(t),!0)});for(let e of(r.events.filter&&(o=r.events.filter(o,r)),o)){let t=e.object;for(;t;){var l;null!=(l=t.__r3f)&&l.eventCount&&a.push({...e,eventObject:t}),t=t.parent}}if("pointerId"in t&&r.internal.capturedMap.has(t.pointerId))for(let e of r.internal.capturedMap.get(t.pointerId).values())i.has(pk(e.intersection))||a.push(e.intersection);return a}(a,l?t:void 0),h=u?function(t){let{internal:n}=e.getState(),r=t.offsetX-n.initialClick[0],i=t.offsetY-n.initialClick[1];return Math.round(Math.sqrt(r*r+i*i))}(a):0;"onPointerDown"===i&&(o.initialClick=[a.offsetX,a.offsetY],o.initialHits=c.map(e=>e.eventObject)),u&&!c.length&&h<=2&&(r(a,o.interaction),s&&s(a)),l&&n(c),!function(e,t,r,i){if(e.length){let a={stopped:!1};for(let s of e){let o=pM(s.object);if(o||s.object.traverseAncestors(e=>{let t=pM(e);if(t)return o=t,!1}),o){let{raycaster:l,pointer:u,camera:c,internal:h}=o,d=new nX(u.x,u.y,0).unproject(c),p=e=>{var t,n;return null!=(t=null==(n=h.capturedMap.get(e))?void 0:n.has(s.eventObject))&&t},f=e=>{let n={intersection:s,target:t.target};h.capturedMap.has(e)?h.capturedMap.get(e).set(s.eventObject,n):h.capturedMap.set(e,new Map([[s.eventObject,n]])),t.target.setPointerCapture(e)},m=e=>{let t=h.capturedMap.get(e);t&&pz(h.capturedMap,s.eventObject,t,e)},g={};for(let e in t){let n=t[e];"function"!=typeof n&&(g[e]=n)}let v={...s,...g,pointer:u,intersections:e,stopped:a.stopped,delta:r,unprojectedPoint:d,ray:l.ray,camera:c,stopPropagation(){let r="pointerId"in t&&h.capturedMap.get(t.pointerId);(!r||r.has(s.eventObject))&&(v.stopped=a.stopped=!0,h.hovered.size&&Array.from(h.hovered.values()).find(e=>e.eventObject===s.eventObject)&&n([...e.slice(0,e.indexOf(s)),s]))},target:{hasPointerCapture:p,setPointerCapture:f,releasePointerCapture:m},currentTarget:{hasPointerCapture:p,setPointerCapture:f,releasePointerCapture:m},nativeEvent:t};if(i(v),!0===a.stopped)break}}}}(c,a,h,function(e){let t=e.eventObject,n=t.__r3f;if(!(null!=n&&n.eventCount))return;let s=n.handlers;if(l){if(s.onPointerOver||s.onPointerEnter||s.onPointerOut||s.onPointerLeave){let t=pk(e),n=o.hovered.get(t);n?n.stopped&&e.stopPropagation():(o.hovered.set(t,e),null==s.onPointerOver||s.onPointerOver(e),null==s.onPointerEnter||s.onPointerEnter(e))}null==s.onPointerMove||s.onPointerMove(e)}else{let n=s[i];n?(!u||o.initialHits.includes(t))&&(r(a,o.interaction.filter(e=>!o.initialHits.includes(e))),n(e)):u&&o.initialHits.includes(t)&&r(a,o.interaction.filter(e=>!o.initialHits.includes(e)))}})}}}}(e);return{priority:1,enabled:!0,compute(e,t,n){t.pointer.set(e.offsetX/t.size.width*2-1,-(2*(e.offsetY/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(fx).reduce((e,n)=>({...e,[n]:t(n)}),{}),update:()=>{var t;let{events:n,internal:r}=e.getState();null!=(t=r.lastEvent)&&t.current&&n.handlers&&n.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{let{set:n,events:r}=e.getState();if(null==r.disconnect||r.disconnect(),n(e=>({events:{...e.events,connected:t}})),r.handlers)for(let e in r.handlers){let n=r.handlers[e],[i,a]=fx[e];t.addEventListener(i,n,{passive:a})}},disconnect:()=>{let{set:t,events:n}=e.getState();if(n.connected){if(n.handlers)for(let e in n.handlers){let t=n.handlers[e],[r]=fx[e];n.connected.removeEventListener(r,t)}t(e=>({events:{...e.events,connected:void 0}}))}}}}},53487,(e,t,n)=>{"use strict";let r="[^".concat("\\\\/","]"),i="[^/]",a="(?:".concat("\\/","|$)"),s="(?:^|".concat("\\/",")"),o="".concat("\\.","{1,2}").concat(a),l="(?!".concat(s).concat(o,")"),u="(?!".concat("\\.","{0,1}").concat(a,")"),c="(?!".concat(o,")"),h={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:a,DOTS_SLASH:o,NO_DOT:"(?!".concat("\\.",")"),NO_DOTS:l,NO_DOT_SLASH:u,NO_DOTS_SLASH:c,QMARK_NO_DOT:"[^.".concat("\\/","]"),STAR:"".concat(i,"*?"),START_ANCHOR:s,SEP:"/"},d={...h,SLASH_LITERAL:"[".concat("\\\\/","]"),QMARK:r,STAR:"".concat(r,"*?"),DOTS_SLASH:"".concat("\\.","{1,2}(?:[").concat("\\\\/","]|$)"),NO_DOT:"(?!".concat("\\.",")"),NO_DOTS:"(?!(?:^|[".concat("\\\\/","])").concat("\\.","{1,2}(?:[").concat("\\\\/","]|$))"),NO_DOT_SLASH:"(?!".concat("\\.","{0,1}(?:[").concat("\\\\/","]|$))"),NO_DOTS_SLASH:"(?!".concat("\\.","{1,2}(?:[").concat("\\\\/","]|$))"),QMARK_NO_DOT:"[^.".concat("\\\\/","]"),START_ANCHOR:"(?:^|[".concat("\\\\/","])"),END_ANCHOR:"(?:[".concat("\\\\/","]|$)"),SEP:"\\"};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:"))".concat(e.STAR,")")},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?d:h}},19241,(e,t,n)=>{"use strict";var r=e.i(47167);let{REGEX_BACKSLASH:i,REGEX_REMOVE_BACKSLASH:a,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:o}=e.r(53487);n.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),n.hasRegexChars=e=>s.test(e),n.isRegexChar=e=>1===e.length&&n.hasRegexChars(e),n.escapeRegex=e=>e.replace(o,"\\$1"),n.toPosixSlashes=e=>e.replace(i,"/"),n.isWindows=()=>{if("undefined"!=typeof navigator&&navigator.platform){let e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return void 0!==r.default&&!!r.default.platform&&"win32"===r.default.platform},n.removeBackslashes=e=>e.replace(a,e=>"\\"===e?"":e),n.escapeLast=(e,t,r)=>{let i=e.lastIndexOf(t,r);return -1===i?e:"\\"===e[i-1]?n.escapeLast(e,t,i-1):"".concat(e.slice(0,i),"\\").concat(e.slice(i))},n.removePrefix=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},n.wrapOutput=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.contains?"":"^",i=n.contains?"":"$",a="".concat(r,"(?:").concat(e,")").concat(i);return!0===t.negated&&(a="(?:^(?!".concat(a,").*$)")),a},n.basename=function(e){let{windows:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.split(t?/[\\/]/:"/"),r=n[n.length-1];return""===r?n[n.length-2]:r}},26094,(e,t,n)=>{"use strict";let r=e.r(19241),{CHAR_ASTERISK:i,CHAR_AT:a,CHAR_BACKWARD_SLASH:s,CHAR_COMMA:o,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:h,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:p,CHAR_PLUS:f,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:v,CHAR_RIGHT_SQUARE_BRACKET:y}=e.r(53487),_=e=>e===c||e===s,x=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let n,b,S=t||{},M=e.length-1,w=!0===S.parts||!0===S.scanToEnd,E=[],T=[],A=[],C=e,R=-1,P=0,I=0,L=!1,N=!1,D=!1,U=!1,O=!1,F=!1,k=!1,z=!1,B=!1,H=!1,V=0,G={value:"",depth:0,isGlob:!1},W=()=>R>=M,j=()=>C.charCodeAt(R+1),X=()=>(n=b,C.charCodeAt(++R));for(;R0&&(Y=C.slice(0,P),C=C.slice(P),I-=P),q&&!0===D&&I>0?(q=C.slice(0,I),J=C.slice(I)):!0===D?(q="",J=C):q=C,q&&""!==q&&"/"!==q&&q!==C&&_(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),!0===S.unescape&&(J&&(J=r.removeBackslashes(J)),q&&!0===k&&(q=r.removeBackslashes(q)));let Z={prefix:Y,input:e,start:P,base:q,glob:J,isBrace:L,isBracket:N,isGlob:D,isExtglob:U,isGlobstar:O,negated:z,negatedExtglob:B};if(!0===S.tokens&&(Z.maxDepth=0,_(b)||T.push(G),Z.tokens=T),!0===S.parts||!0===S.tokens){let t;for(let n=0;n{"use strict";let r=e.r(53487),i=e.r(19241),{MAX_LENGTH:a,POSIX_REGEX_SOURCE:s,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=r,c=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();let n="[".concat(e.join("-"),"]");try{new RegExp(n)}catch(t){return e.map(e=>i.escapeRegex(e)).join("..")}return n},h=(e,t)=>"Missing ".concat(e,': "').concat(t,'" - use "\\\\').concat(t,'" to match literal characters'),d=(e,t)=>{let n;if("string"!=typeof e)throw TypeError("Expected a string");e=u[e]||e;let p={...t},f="number"==typeof p.maxLength?Math.min(a,p.maxLength):a,m=e.length;if(m>f)throw SyntaxError("Input length: ".concat(m,", exceeds maximum allowed length: ").concat(f));let g={type:"bos",value:"",output:p.prepend||""},v=[g],y=p.capture?"":"?:",_=r.globChars(p.windows),x=r.extglobChars(_),{DOT_LITERAL:b,PLUS_LITERAL:S,SLASH_LITERAL:M,ONE_CHAR:w,DOTS_SLASH:E,NO_DOT:T,NO_DOT_SLASH:A,NO_DOTS_SLASH:C,QMARK:R,QMARK_NO_DOT:P,STAR:I,START_ANCHOR:L}=_,N=e=>"(".concat(y,"(?:(?!").concat(L).concat(e.dot?E:b,").)*?)"),D=p.dot?"":T,U=p.dot?R:P,O=!0===p.bash?N(p):I;p.capture&&(O="(".concat(O,")")),"boolean"==typeof p.noext&&(p.noextglob=p.noext);let F={input:e,index:-1,start:0,dot:!0===p.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:v};m=(e=i.removePrefix(e,F)).length;let k=[],z=[],B=[],H=g,V=()=>F.index===m-1,G=F.peek=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return e[F.index+t]},W=F.advance=()=>e[++F.index]||"",j=()=>e.slice(F.index+1),X=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;F.consumed+=e,F.index+=t},q=e=>{F.output+=null!=e.output?e.output:e.value,X(e.value)},Y=()=>{let e=1;for(;"!"===G()&&("("!==G(2)||"?"===G(3));)W(),F.start++,e++;return e%2!=0&&(F.negated=!0,F.start++,!0)},J=e=>{F[e]++,B.push(e)},Z=e=>{F[e]--,B.pop()},K=e=>{if("globstar"===H.type){let t=F.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||k.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(F.output=F.output.slice(0,-H.output.length),H.type="star",H.value="*",H.output=O,F.output+=H.output)}if(k.length&&"paren"!==e.type&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&q(e),H&&"text"===H.type&&"text"===e.type){H.output=(H.output||H.value)+e.value,H.value+=e.value;return}e.prev=H,v.push(e),H=e},$=(e,t)=>{let n={...x[t],conditions:1,inner:""};n.prev=H,n.parens=F.parens,n.output=F.output;let r=(p.capture?"(":"")+n.open;J("parens"),K({type:e,value:t,output:F.output?"":w}),K({type:"paren",extglob:!0,value:W(),output:r}),k.push(n)},Q=e=>{let r,i=e.close+(p.capture?")":"");if("negate"===e.type){let n=O;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(n=N(p)),(n!==O||V()||/^\)+$/.test(j()))&&(i=e.close=")$))".concat(n)),e.inner.includes("*")&&(r=j())&&/^\.[^\\/.]+$/.test(r)){let a=d(r,{...t,fastpaths:!1}).output;i=e.close=")".concat(a,")").concat(n,")")}"bos"===e.prev.type&&(F.negatedExtglob=!0)}K({type:"paren",extglob:!0,value:n,output:i}),Z("parens")};if(!1!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,r=e.replace(l,(e,t,r,i,a,s)=>"\\"===i?(n=!0,e):"?"===i?t?t+i+(a?R.repeat(a.length):""):0===s?U+(a?R.repeat(a.length):""):R.repeat(r.length):"."===i?b.repeat(r.length):"*"===i?t?t+i+(a?O:""):O:t?e:"\\".concat(e));return(!0===n&&(r=!0===p.unescape?r.replace(/\\/g,""):r.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),r===e&&!0===p.contains)?F.output=e:F.output=i.wrapOutput(r,F,t),F}for(;!V();){if("\0"===(n=W()))continue;if("\\"===n){let e=G();if("/"===e&&!0!==p.bash||"."===e||";"===e)continue;if(!e){K({type:"text",value:n+="\\"});continue}let t=/^\\+/.exec(j()),r=0;if(t&&t[0].length>2&&(r=t[0].length,F.index+=r,r%2!=0&&(n+="\\")),!0===p.unescape?n=W():n+=W(),0===F.brackets){K({type:"text",value:n});continue}}if(F.brackets>0&&("]"!==n||"["===H.value||"[^"===H.value)){if(!1!==p.posix&&":"===n){let e=H.value.slice(1);if(e.includes("[")&&(H.posix=!0,e.includes(":"))){let e=H.value.lastIndexOf("["),t=H.value.slice(0,e),n=s[H.value.slice(e+2)];if(n){H.value=t+n,F.backtrack=!0,W(),g.output||1!==v.indexOf(H)||(g.output=w);continue}}}("["===n&&":"!==G()||"-"===n&&"]"===G())&&(n="\\".concat(n)),"]"===n&&("["===H.value||"[^"===H.value)&&(n="\\".concat(n)),!0===p.posix&&"!"===n&&"["===H.value&&(n="^"),H.value+=n,q({value:n});continue}if(1===F.quotes&&'"'!==n){n=i.escapeRegex(n),H.value+=n,q({value:n});continue}if('"'===n){F.quotes=+(1!==F.quotes),!0===p.keepQuotes&&K({type:"text",value:n});continue}if("("===n){J("parens"),K({type:"paren",value:n});continue}if(")"===n){if(0===F.parens&&!0===p.strictBrackets)throw SyntaxError(h("opening","("));let e=k[k.length-1];if(e&&F.parens===e.parens+1){Q(k.pop());continue}K({type:"paren",value:n,output:F.parens?")":"\\)"}),Z("parens");continue}if("["===n){if(!0!==p.nobracket&&j().includes("]"))J("brackets");else{if(!0!==p.nobracket&&!0===p.strictBrackets)throw SyntaxError(h("closing","]"));n="\\".concat(n)}K({type:"bracket",value:n});continue}if("]"===n){if(!0===p.nobracket||H&&"bracket"===H.type&&1===H.value.length){K({type:"text",value:n,output:"\\".concat(n)});continue}if(0===F.brackets){if(!0===p.strictBrackets)throw SyntaxError(h("opening","["));K({type:"text",value:n,output:"\\".concat(n)});continue}Z("brackets");let e=H.value.slice(1);if(!0===H.posix||"^"!==e[0]||e.includes("/")||(n="/".concat(n)),H.value+=n,q({value:n}),!1===p.literalBrackets||i.hasRegexChars(e))continue;let t=i.escapeRegex(H.value);if(F.output=F.output.slice(0,-H.value.length),!0===p.literalBrackets){F.output+=t,H.value=t;continue}H.value="(".concat(y).concat(t,"|").concat(H.value,")"),F.output+=H.value;continue}if("{"===n&&!0!==p.nobrace){J("braces");let e={type:"brace",value:n,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};z.push(e),K(e);continue}if("}"===n){let e=z[z.length-1];if(!0===p.nobrace||!e){K({type:"text",value:n,output:n});continue}let t=")";if(!0===e.dots){let e=v.slice(),n=[];for(let t=e.length-1;t>=0&&(v.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=c(n,p),F.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){let r=F.output.slice(0,e.outputIndex),i=F.tokens.slice(e.tokensIndex);for(let a of(e.value=e.output="\\{",n=t="\\}",F.output=r,i))F.output+=a.output||a.value}K({type:"brace",value:n,output:t}),Z("braces"),z.pop();continue}if("|"===n){k.length>0&&k[k.length-1].conditions++,K({type:"text",value:n});continue}if(","===n){let e=n,t=z[z.length-1];t&&"braces"===B[B.length-1]&&(t.comma=!0,e="|"),K({type:"comma",value:n,output:e});continue}if("/"===n){if("dot"===H.type&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",v.pop(),H=g;continue}K({type:"slash",value:n,output:M});continue}if("."===n){if(F.braces>0&&"dot"===H.type){"."===H.value&&(H.output=b);let e=z[z.length-1];H.type="dots",H.output+=n,H.value+=n,e.dots=!0;continue}if(F.braces+F.parens===0&&"bos"!==H.type&&"slash"!==H.type){K({type:"text",value:n,output:b});continue}K({type:"dot",value:n,output:b});continue}if("?"===n){if(!(H&&"("===H.value)&&!0!==p.noextglob&&"("===G()&&"?"!==G(2)){$("qmark",n);continue}if(H&&"paren"===H.type){let e=G(),t=n;("("!==H.value||/[!=<:]/.test(e))&&("<"!==e||/<([!=]|\w+>)/.test(j()))||(t="\\".concat(n)),K({type:"text",value:n,output:t});continue}if(!0!==p.dot&&("slash"===H.type||"bos"===H.type)){K({type:"qmark",value:n,output:P});continue}K({type:"qmark",value:n,output:R});continue}if("!"===n){if(!0!==p.noextglob&&"("===G()&&("?"!==G(2)||!/[!=<:]/.test(G(3)))){$("negate",n);continue}if(!0!==p.nonegate&&0===F.index){Y();continue}}if("+"===n){if(!0!==p.noextglob&&"("===G()&&"?"!==G(2)){$("plus",n);continue}if(H&&"("===H.value||!1===p.regex){K({type:"plus",value:n,output:S});continue}if(H&&("bracket"===H.type||"paren"===H.type||"brace"===H.type)||F.parens>0){K({type:"plus",value:n});continue}K({type:"plus",value:S});continue}if("@"===n){if(!0!==p.noextglob&&"("===G()&&"?"!==G(2)){K({type:"at",extglob:!0,value:n,output:""});continue}K({type:"text",value:n});continue}if("*"!==n){("$"===n||"^"===n)&&(n="\\".concat(n));let e=o.exec(j());e&&(n+=e[0],F.index+=e[0].length),K({type:"text",value:n});continue}if(H&&("globstar"===H.type||!0===H.star)){H.type="star",H.star=!0,H.value+=n,H.output=O,F.backtrack=!0,F.globstar=!0,X(n);continue}let t=j();if(!0!==p.noextglob&&/^\([^?]/.test(t)){$("star",n);continue}if("star"===H.type){if(!0===p.noglobstar){X(n);continue}let r=H.prev,i=r.prev,a="slash"===r.type||"bos"===r.type,s=i&&("star"===i.type||"globstar"===i.type);if(!0===p.bash&&(!a||t[0]&&"/"!==t[0])){K({type:"star",value:n,output:""});continue}let o=F.braces>0&&("comma"===r.type||"brace"===r.type),l=k.length&&("pipe"===r.type||"paren"===r.type);if(!a&&"paren"!==r.type&&!o&&!l){K({type:"star",value:n,output:""});continue}for(;"/**"===t.slice(0,3);){let n=e[F.index+4];if(n&&"/"!==n)break;t=t.slice(3),X("/**",3)}if("bos"===r.type&&V()){H.type="globstar",H.value+=n,H.output=N(p),F.output=H.output,F.globstar=!0,X(n);continue}if("slash"===r.type&&"bos"!==r.prev.type&&!s&&V()){F.output=F.output.slice(0,-(r.output+H.output).length),r.output="(?:".concat(r.output),H.type="globstar",H.output=N(p)+(p.strictSlashes?")":"|$)"),H.value+=n,F.globstar=!0,F.output+=r.output+H.output,X(n);continue}if("slash"===r.type&&"bos"!==r.prev.type&&"/"===t[0]){let e=void 0!==t[1]?"|$":"";F.output=F.output.slice(0,-(r.output+H.output).length),r.output="(?:".concat(r.output),H.type="globstar",H.output="".concat(N(p)).concat(M,"|").concat(M).concat(e,")"),H.value+=n,F.output+=r.output+H.output,F.globstar=!0,X(n+W()),K({type:"slash",value:"/",output:""});continue}if("bos"===r.type&&"/"===t[0]){H.type="globstar",H.value+=n,H.output="(?:^|".concat(M,"|").concat(N(p)).concat(M,")"),F.output=H.output,F.globstar=!0,X(n+W()),K({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-H.output.length),H.type="globstar",H.output=N(p),H.value+=n,F.output+=H.output,F.globstar=!0,X(n);continue}let r={type:"star",value:n,output:O};if(!0===p.bash){r.output=".*?",("bos"===H.type||"slash"===H.type)&&(r.output=D+r.output),K(r);continue}if(H&&("bracket"===H.type||"paren"===H.type)&&!0===p.regex){r.output=n,K(r);continue}(F.index===F.start||"slash"===H.type||"dot"===H.type)&&("dot"===H.type?(F.output+=A,H.output+=A):!0===p.dot?(F.output+=C,H.output+=C):(F.output+=D,H.output+=D),"*"!==G()&&(F.output+=w,H.output+=w)),K(r)}for(;F.brackets>0;){if(!0===p.strictBrackets)throw SyntaxError(h("closing","]"));F.output=i.escapeLast(F.output,"["),Z("brackets")}for(;F.parens>0;){if(!0===p.strictBrackets)throw SyntaxError(h("closing",")"));F.output=i.escapeLast(F.output,"("),Z("parens")}for(;F.braces>0;){if(!0===p.strictBrackets)throw SyntaxError(h("closing","}"));F.output=i.escapeLast(F.output,"{"),Z("braces")}if(!0!==p.strictSlashes&&("star"===H.type||"bracket"===H.type)&&K({type:"maybe_slash",value:"",output:"".concat(M,"?")}),!0===F.backtrack)for(let e of(F.output="",F.tokens))F.output+=null!=e.output?e.output:e.value,e.suffix&&(F.output+=e.suffix);return F};d.fastpaths=(e,t)=>{let n={...t},s="number"==typeof n.maxLength?Math.min(a,n.maxLength):a,o=e.length;if(o>s)throw SyntaxError("Input length: ".concat(o,", exceeds maximum allowed length: ").concat(s));e=u[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:h,DOTS_SLASH:d,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:g,START_ANCHOR:v}=r.globChars(n.windows),y=n.dot?f:p,_=n.dot?m:p,x=n.capture?"":"?:",b=!0===n.bash?".*?":g;n.capture&&(b="(".concat(b,")"));let S=e=>!0===e.noglobstar?b:"(".concat(x,"(?:(?!").concat(v).concat(e.dot?d:l,").)*?)"),M=e=>{switch(e){case"*":return"".concat(y).concat(h).concat(b);case".*":return"".concat(l).concat(h).concat(b);case"*.*":return"".concat(y).concat(b).concat(l).concat(h).concat(b);case"*/*":return"".concat(y).concat(b).concat(c).concat(h).concat(_).concat(b);case"**":return y+S(n);case"**/*":return"(?:".concat(y).concat(S(n)).concat(c,")?").concat(_).concat(h).concat(b);case"**/*.*":return"(?:".concat(y).concat(S(n)).concat(c,")?").concat(_).concat(b).concat(l).concat(h).concat(b);case"**/.*":return"(?:".concat(y).concat(S(n)).concat(c,")?").concat(l).concat(h).concat(b);default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=M(t[1]);if(!n)return;return n+l+t[2]}}},w=M(i.removePrefix(e,{negated:!1,prefix:""}));return w&&!0!==n.strictSlashes&&(w+="".concat(c,"?")),w},t.exports=d},53174,(e,t,n)=>{"use strict";let r=e.r(26094),i=e.r(17932),a=e.r(19241),s=e.r(53487),o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Array.isArray(e)){let r=e.map(e=>o(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=e&&"object"==typeof e&&!Array.isArray(e)&&e.tokens&&e.input;if(""===e||"string"!=typeof e&&!r)throw TypeError("Expected pattern to be a non-empty string");let i=t||{},a=i.windows,s=r?o.compileRe(e,t):o.makeRe(e,t,!1,!0),l=s.state;delete s.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=o(i.ignore,e,n)}let c=function(n){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{isMatch:c,match:h,output:d}=o.test(n,s,t,{glob:e,posix:a}),p={glob:e,state:l,regex:s,posix:a,input:n,output:d,match:h,isMatch:c};return("function"==typeof i.onResult&&i.onResult(p),!1===c)?(p.isMatch=!1,!!r&&p):u(n)?("function"==typeof i.onIgnore&&i.onIgnore(p),p.isMatch=!1,!!r&&p):("function"==typeof i.onMatch&&i.onMatch(p),!r||p)};return n&&(c.state=l),c};o.test=function(e,t,n){let{glob:r,posix:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("string"!=typeof e)throw TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};let s=n||{},l=s.format||(i?a.toPosixSlashes:null),u=e===r,c=u&&l?l(e):e;return!1===u&&(u=(c=l?l(e):e)===r),(!1===u||!0===s.capture)&&(u=!0===s.matchBase||!0===s.basename?o.matchBase(e,t,n,i):t.exec(c)),{isMatch:!!u,match:u,output:c}},o.matchBase=(e,t,n)=>(t instanceof RegExp?t:o.makeRe(t,n)).test(a.basename(e)),o.isMatch=(e,t,n)=>o(t,n)(e),o.parse=(e,t)=>Array.isArray(e)?e.map(e=>o.parse(e,t)):i(e,{...t,fastpaths:!1}),o.scan=(e,t)=>r(e,t),o.compileRe=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!0===n)return e.output;let i=t||{},a=i.contains?"":"^",s=i.contains?"":"$",l="".concat(a,"(?:").concat(e.output,")").concat(s);e&&!0===e.negated&&(l="^(?!".concat(l,").*$"));let u=o.toRegex(l,t);return!0===r&&(u.state=e),u},o.makeRe=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||"string"!=typeof e)throw TypeError("Expected a non-empty string");let a={negated:!1,fastpaths:!0};return!1!==t.fastpaths&&("."===e[0]||"*"===e[0])&&(a.output=i.fastpaths(e,t)),a.output||(a=i(e,t)),o.compileRe(a,t,n,r)},o.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},o.constants=s,t.exports=o},54970,(e,t,n)=>{"use strict";let r=e.r(53174),i=e.r(19241);function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t&&(null===t.windows||void 0===t.windows)&&(t={...t,windows:i.isWindows()}),r(e,t,n)}Object.assign(a,r),t.exports=a},98223,71726,91996,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t],98223),e.s(["getActualResourceKey",()=>l,"getMissionInfo",()=>d,"getMissionList",()=>p,"getResourceKey",()=>a,"getResourceList",()=>u,"getResourceMap",()=>s,"getSourceAndPath",()=>o,"getStandardTextureResourceKey",()=>h],91996);var n=e.i(63738);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let i=n.default;function a(e){return r(e).toLowerCase()}function s(){return i.resources}function o(e){let[t,...n]=i.resources[e],[r,a]=n[n.length-1];return[r,null!=a?a:t]}function l(e){let t=a(e);if(i.resources[t])return t;let n=t.replace(/\d+(\.(png))$/i,"$1");if(i.resources[n])return n;throw Error("Resource not found in manifest: ".concat(e))}function u(){return Object.keys(i.resources)}let c=["",".jpg",".png",".gif",".bmp"];function h(e){let t=a(e);for(let e of c){let n="".concat(t).concat(e);if(i.resources[n])return n}return t}function d(e){let t=i.missions[e];if(!t)throw Error("Mission not found: ".concat(e));return t}function p(){return Object.keys(i.missions)}},92552,(e,t,n)=>{"use strict";let r,i;function a(e,t){return t.reduce((e,t)=>{let[n,r]=t;return{type:"BinaryExpression",operator:n,left:e,right:r}},e)}function s(e,t){return{type:"UnaryExpression",operator:e,argument:t}}class o extends SyntaxError{format(e){let t="Error: "+this.message;if(this.location){let n=null,r=e.find(e=>e.source===this.location.source);r&&(n=r.text.split(/\r\n|\n|\r/g));let i=this.location.start,a=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,s=this.location.source+":"+a.line+":"+a.column;if(n){let e=this.location.end,r="".padEnd(a.line.toString().length," "),o=n[i.line-1],l=(i.line===e.line?e.column:o.length+1)-i.column||1;t+="\n --> "+s+"\n"+r+" |\n"+a.line+" | "+o+"\n"+r+" | "+"".padEnd(i.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+s}return t}static buildMessage(e,t){function n(e){return e.codePointAt(0).toString(16).toUpperCase()}let r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function i(e){return r?e.replace(r,e=>"\\u{"+n(e)+"}"):e}function a(e){return i(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+n(e)))}function s(e){return i(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+n(e)))}let o={literal:e=>'"'+a(e.text)+'"',class(e){let t=e.parts.map(e=>Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return o[e.type](e)}return"Expected "+function(e){let t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let n=1;n]/,C=/^[+\-]/,R=/^[%*\/]/,P=/^[!\-~]/,I=/^[a-zA-Z_]/,L=/^[a-zA-Z0-9_]/,N=/^[ \t]/,D=/^[^"\\\n\r]/,U=/^[^'\\\n\r]/,O=/^[0-9a-fA-F]/,F=/^[0-9]/,k=/^[xX]/,z=/^[^\n\r]/,B=/^[\n\r]/,H=/^[ \t\n\r]/,V=tT(";",!1),G=tT("package",!1),W=tT("{",!1),j=tT("}",!1),X=tT("function",!1),q=tT("(",!1),Y=tT(")",!1),J=tT("::",!1),Z=tT(",",!1),K=tT("datablock",!1),$=tT(":",!1),Q=tT("new",!1),ee=tT("[",!1),et=tT("]",!1),en=tT("=",!1),er=tT(".",!1),ei=tT("if",!1),ea=tT("else",!1),es=tT("for",!1),eo=tT("while",!1),el=tT("do",!1),eu=tT("switch$",!1),ec=tT("switch",!1),eh=tT("case",!1),ed=tT("default",!1),ep=tT("or",!1),ef=tT("return",!1),em=tT("break",!1),eg=tT("continue",!1),ev=tT("+=",!1),ey=tT("-=",!1),e_=tT("*=",!1),ex=tT("/=",!1),eb=tT("%=",!1),eS=tT("<<=",!1),eM=tT(">>=",!1),ew=tT("&=",!1),eE=tT("|=",!1),eT=tT("^=",!1),eA=tT("?",!1),eC=tT("||",!1),eR=tT("&&",!1),eP=tT("|",!1),eI=tT("^",!1),eL=tT("&",!1),eN=tT("==",!1),eD=tT("!=",!1),eU=tT("<=",!1),eO=tT(">=",!1),eF=tA(["<",">"],!1,!1,!1),ek=tT("$=",!1),ez=tT("!$=",!1),eB=tT("@",!1),eH=tT("NL",!1),eV=tT("TAB",!1),eG=tT("SPC",!1),eW=tT("<<",!1),ej=tT(">>",!1),eX=tA(["+","-"],!1,!1,!1),eq=tA(["%","*","/"],!1,!1,!1),eY=tA(["!","-","~"],!1,!1,!1),eJ=tT("++",!1),eZ=tT("--",!1),eK=tT("*",!1),e$=tT("%",!1),eQ=tA([["a","z"],["A","Z"],"_"],!1,!1,!1),e0=tA([["a","z"],["A","Z"],["0","9"],"_"],!1,!1,!1),e1=tT("$",!1),e2=tT("parent",!1),e3=tA([" "," "],!1,!1,!1),e4=tT('"',!1),e5=tT("'",!1),e6=tT("\\",!1),e8=tA(['"',"\\","\n","\r"],!0,!1,!1),e9=tA(["'","\\","\n","\r"],!0,!1,!1),e7=tT("n",!1),te=tT("r",!1),tt=tT("t",!1),tn=tT("x",!1),tr=tA([["0","9"],["a","f"],["A","F"]],!1,!1,!1),ti=tT("cr",!1),ta=tT("cp",!1),ts=tT("co",!1),to=tT("c",!1),tl=tA([["0","9"]],!1,!1,!1),tu={type:"any"},tc=tT("0",!1),th=tA(["x","X"],!1,!1,!1),td=tT("-",!1),tp=tT("true",!1),tf=tT("false",!1),tm=tT("//",!1),tg=tA(["\n","\r"],!0,!1,!1),tv=tA(["\n","\r"],!1,!1,!1),ty=tT("/*",!1),t_=tT("*/",!1),tx=tA([" "," ","\n","\r"],!1,!1,!1),tb=0|t.peg$currPos,tS=[{line:1,column:1}],tM=tb,tw=t.peg$maxFailExpected||[],tE=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in c))throw Error("Can't start parsing from rule \""+t.startRule+'".');h=c[t.startRule]}function tT(e,t){return{type:"literal",text:e,ignoreCase:t}}function tA(e,t,n,r){return{type:"class",parts:e,inverted:t,ignoreCase:n,unicode:r}}function tC(t){let n,r=tS[t];if(r)return r;if(t>=tS.length)n=tS.length-1;else for(n=t;!tS[--n];);for(r={line:(r=tS[n]).line,column:r.column};ntM&&(tM=tb,tw=[]),tw.push(e))}function tI(){let e,t,n;for(nh(),e=[],t=tb,(n=nl())===l&&(n=tL()),n!==l?t=n=[n,nh()]:(tb=t,t=l);t!==l;)e.push(t),t=tb,(n=nl())===l&&(n=tL()),n!==l?t=n=[n,nh()]:(tb=t,t=l);return{type:"Program",body:e.map(e=>{let[t]=e;return t}).filter(Boolean),execScriptPaths:Array.from(r),hasDynamicExec:i}}function tL(){let t,n,r,i,a,s,o,u,c,h,f,_,x,w,E,T,A;return(t=function(){let t,n,r,i,a,s,o,u;if(t=tb,e.substr(tb,7)===d?(n=d,tb+=7):(n=l,0===tE&&tP(G)),n!==l)if(nc()!==l)if((r=nr())!==l)if(nu(),123===e.charCodeAt(tb)?(i="{",tb++):(i=l,0===tE&&tP(W)),i!==l){for(nh(),a=[],s=tb,(o=nl())===l&&(o=tL()),o!==l?s=o=[o,u=nh()]:(tb=s,s=l);s!==l;)a.push(s),s=tb,(o=nl())===l&&(o=tL()),o!==l?s=o=[o,u=nh()]:(tb=s,s=l);(125===e.charCodeAt(tb)?(s="}",tb++):(s=l,0===tE&&tP(j)),s!==l)?(o=nu(),59===e.charCodeAt(tb)?(u=";",tb++):(u=l,0===tE&&tP(V)),u===l&&(u=null),t={type:"PackageDeclaration",name:r,body:a.map(e=>{let[t]=e;return t}).filter(Boolean)}):(tb=t,t=l)}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s,o;if(t=tb,e.substr(tb,8)===p?(n=p,tb+=8):(n=l,0===tE&&tP(X)),n!==l)if(nc()!==l)if((r=function(){let t,n,r,i;if(t=tb,(n=nr())!==l)if("::"===e.substr(tb,2)?(r="::",tb+=2):(r=l,0===tE&&tP(J)),r!==l)if((i=nr())!==l)t={type:"MethodName",namespace:n,method:i};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t===l&&(t=nr()),t}())!==l)if(nu(),40===e.charCodeAt(tb)?(i="(",tb++):(i=l,0===tE&&tP(q)),i!==l)if(nu(),(a=function(){let t,n,r,i,a,s,o,u;if(t=tb,(n=nr())!==l){for(r=[],i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=nr())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=nr())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);t=[n,...r.map(e=>{let[,,,t]=e;return t})]}else tb=t,t=l;return t}())===l&&(a=null),nu(),41===e.charCodeAt(tb)?(s=")",tb++):(s=l,0===tE&&tP(Y)),s!==l)if(nu(),(o=tH())!==l)t={type:"FunctionDeclaration",name:r,params:a||[],body:o};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&((r=tb,(i=tN())!==l)?(nu(),59===e.charCodeAt(tb)?(a=";",tb++):(a=l,0===tE&&tP(V)),a===l&&(a=null),nu(),r=i):(tb=r,r=l),(t=r)===l&&((s=tb,(o=tD())!==l)?(nu(),59===e.charCodeAt(tb)?(u=";",tb++):(u=l,0===tE&&tP(V)),u===l&&(u=null),nu(),s=o):(tb=s,s=l),(t=s)===l&&(t=function(){let t,n,r,i,a,s,o,u,c,h,d;if(t=tb,"if"===e.substr(tb,2)?(n="if",tb+=2):(n=l,0===tE&&tP(ei)),n!==l)if(nu(),40===e.charCodeAt(tb)?(r="(",tb++):(r=l,0===tE&&tP(q)),r!==l)if(nu(),(i=tV())!==l)if(nu(),41===e.charCodeAt(tb)?(a=")",tb++):(a=l,0===tE&&tP(Y)),a!==l)if(nu(),(s=tL())!==l){var p;o=tb,u=nu(),e.substr(tb,4)===m?(c=m,tb+=4):(c=l,0===tE&&tP(ea)),c!==l?(h=nu(),(d=tL())!==l?o=u=[u,c,h,d]:(tb=o,o=l)):(tb=o,o=l),o===l&&(o=null),t={type:"IfStatement",test:i,consequent:s,alternate:(p=o)?p[3]:null}}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s,o,u,c,h;if(t=tb,"for"===e.substr(tb,3)?(n="for",tb+=3):(n=l,0===tE&&tP(es)),n!==l)if(nu(),40===e.charCodeAt(tb)?(r="(",tb++):(r=l,0===tE&&tP(q)),r!==l)if(nu(),(i=tV())===l&&(i=null),nu(),59===e.charCodeAt(tb)?(a=";",tb++):(a=l,0===tE&&tP(V)),a!==l)if(nu(),(s=tV())===l&&(s=null),nu(),59===e.charCodeAt(tb)?(o=";",tb++):(o=l,0===tE&&tP(V)),o!==l)if(nu(),(u=tV())===l&&(u=null),nu(),41===e.charCodeAt(tb)?(c=")",tb++):(c=l,0===tE&&tP(Y)),c!==l)if(nu(),(h=tL())!==l){var d,p;d=i,p=s,t={type:"ForStatement",init:d,test:p,update:u,body:h}}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s,o,u;if(t=tb,"do"===e.substr(tb,2)?(n="do",tb+=2):(n=l,0===tE&&tP(el)),n!==l)if(nu(),(r=tL())!==l)if(nu(),e.substr(tb,5)===g?(i=g,tb+=5):(i=l,0===tE&&tP(eo)),i!==l)if(nu(),40===e.charCodeAt(tb)?(a="(",tb++):(a=l,0===tE&&tP(q)),a!==l)if(nu(),(s=tV())!==l)if(nu(),41===e.charCodeAt(tb)?(o=")",tb++):(o=l,0===tE&&tP(Y)),o!==l)nu(),59===e.charCodeAt(tb)?(u=";",tb++):(u=l,0===tE&&tP(V)),u===l&&(u=null),t={type:"DoWhileStatement",test:s,body:r};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s;if(t=tb,e.substr(tb,5)===g?(n=g,tb+=5):(n=l,0===tE&&tP(eo)),n!==l)if(nu(),40===e.charCodeAt(tb)?(r="(",tb++):(r=l,0===tE&&tP(q)),r!==l)if(nu(),(i=tV())!==l)if(nu(),41===e.charCodeAt(tb)?(a=")",tb++):(a=l,0===tE&&tP(Y)),a!==l)if(nu(),(s=tL())!==l)t={type:"WhileStatement",test:i,body:s};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s,o,u,c,h;if(t=tb,e.substr(tb,7)===v?(n=v,tb+=7):(n=l,0===tE&&tP(eu)),n!==l)if(nu(),40===e.charCodeAt(tb)?(r="(",tb++):(r=l,0===tE&&tP(q)),r!==l)if(nu(),(i=tV())!==l)if(nu(),41===e.charCodeAt(tb)?(a=")",tb++):(a=l,0===tE&&tP(Y)),a!==l)if(nu(),123===e.charCodeAt(tb)?(s="{",tb++):(s=l,0===tE&&tP(W)),s!==l){for(nh(),o=[],u=tb,(c=nl())===l&&(c=tB()),c!==l?u=c=[c,h=nh()]:(tb=u,u=l);u!==l;)o.push(u),u=tb,(c=nl())===l&&(c=tB()),c!==l?u=c=[c,h=nh()]:(tb=u,u=l);(125===e.charCodeAt(tb)?(u="}",tb++):(u=l,0===tE&&tP(j)),u!==l)?t={type:"SwitchStatement",stringMode:!0,discriminant:i,cases:o.map(e=>{let[t]=e;return t}).filter(e=>e&&"SwitchCase"===e.type)}:(tb=t,t=l)}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;if(t===l)if(t=tb,e.substr(tb,6)===y?(n=y,tb+=6):(n=l,0===tE&&tP(ec)),n!==l)if(nu(),40===e.charCodeAt(tb)?(r="(",tb++):(r=l,0===tE&&tP(q)),r!==l)if(nu(),(i=tV())!==l)if(nu(),41===e.charCodeAt(tb)?(a=")",tb++):(a=l,0===tE&&tP(Y)),a!==l)if(nu(),123===e.charCodeAt(tb)?(s="{",tb++):(s=l,0===tE&&tP(W)),s!==l){for(nh(),o=[],u=tb,(c=nl())===l&&(c=tB()),c!==l?u=c=[c,h=nh()]:(tb=u,u=l);u!==l;)o.push(u),u=tb,(c=nl())===l&&(c=tB()),c!==l?u=c=[c,h=nh()]:(tb=u,u=l);(125===e.charCodeAt(tb)?(u="}",tb++):(u=l,0===tE&&tP(j)),u!==l)?t={type:"SwitchStatement",stringMode:!1,discriminant:i,cases:o.map(e=>{let[t]=e;return t}).filter(e=>e&&"SwitchCase"===e.type)}:(tb=t,t=l)}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a;if(t=tb,e.substr(tb,6)===b?(n=b,tb+=6):(n=l,0===tE&&tP(ef)),n!==l)if(r=tb,(i=nc())!==l&&(a=tV())!==l?r=i=[i,a]:(tb=r,r=l),r===l&&(r=null),i=nu(),59===e.charCodeAt(tb)?(a=";",tb++):(a=l,0===tE&&tP(V)),a!==l){var s;t={type:"ReturnStatement",value:(s=r)?s[1]:null}}else tb=t,t=l;else tb=t,t=l;return t}())===l&&(c=tb,e.substr(tb,5)===S?(h=S,tb+=5):(h=l,0===tE&&tP(em)),h!==l?(nu(),59===e.charCodeAt(tb)?(f=";",tb++):(f=l,0===tE&&tP(V)),f!==l?c={type:"BreakStatement"}:(tb=c,c=l)):(tb=c,c=l),(t=c)===l&&(_=tb,e.substr(tb,8)===M?(x=M,tb+=8):(x=l,0===tE&&tP(eg)),x!==l?(nu(),59===e.charCodeAt(tb)?(w=";",tb++):(w=l,0===tE&&tP(V)),w!==l?_={type:"ContinueStatement"}:(tb=_,_=l)):(tb=_,_=l),(t=_)===l&&((E=tb,(T=tV())!==l&&(nu(),59===e.charCodeAt(tb)?(A=";",tb++):(A=l,0===tE&&tP(V)),A!==l))?E={type:"ExpressionStatement",expression:T}:(tb=E,E=l),(t=E)===l&&(t=tH())===l&&(t=nl())===l)))))&&(t=tb,nu(),59===e.charCodeAt(tb)?(n=";",tb++):(n=l,0===tE&&tP(V)),n!==l?(nu(),t=null):(tb=t,t=l)),t}function tN(){let t,n,r,i,a,s,o,u,c,h,d,p,m,g;if(t=tb,e.substr(tb,9)===f?(n=f,tb+=9):(n=l,0===tE&&tP(K)),n!==l)if(nc()!==l)if((r=nr())!==l)if(nu(),40===e.charCodeAt(tb)?(i="(",tb++):(i=l,0===tE&&tP(q)),i!==l)if(nu(),(a=tO())===l&&(a=null),nu(),41===e.charCodeAt(tb)?(s=")",tb++):(s=l,0===tE&&tP(Y)),s!==l){var v,y,_;if(nu(),o=tb,58===e.charCodeAt(tb)?(u=":",tb++):(u=l,0===tE&&tP($)),u!==l?(c=nu(),(h=nr())!==l?o=u=[u,c,h]:(tb=o,o=l)):(tb=o,o=l),o===l&&(o=null),u=nu(),c=tb,123===e.charCodeAt(tb)?(h="{",tb++):(h=l,0===tE&&tP(W)),h!==l){for(d=nu(),p=[],m=tU();m!==l;)p.push(m),m=tU();m=nu(),125===e.charCodeAt(tb)?(g="}",tb++):(g=l,0===tE&&tP(j)),g!==l?c=h=[h,d,p,m,g,nu()]:(tb=c,c=l)}else tb=c,c=l;c===l&&(c=null),v=a,y=o,_=c,t={type:"DatablockDeclaration",className:r,instanceName:v,parent:y?y[2]:null,body:_?_[2].filter(Boolean):[]}}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}function tD(){let t,n,r,i,a,s,o,u,c,h,d,p;if(t=tb,"new"===e.substr(tb,3)?(n="new",tb+=3):(n=l,0===tE&&tP(Q)),n!==l)if(nc()!==l)if((r=function(){let t,n,r,i,a,s,o,u,c,h;if((t=tb,40===e.charCodeAt(tb)?(n="(",tb++):(n=l,0===tE&&tP(q)),n!==l&&(r=nu(),(i=tV())!==l&&(a=nu(),41===e.charCodeAt(tb)?(s=")",tb++):(s=l,0===tE&&tP(Y)),s!==l)))?t=i:(tb=t,t=l),t===l)if(t=tb,(n=nr())!==l){var d;for(r=[],i=tb,a=nu(),91===e.charCodeAt(tb)?(s="[",tb++):(s=l,0===tE&&tP(ee)),s!==l?(o=nu(),(u=tz())!==l?(c=nu(),93===e.charCodeAt(tb)?(h="]",tb++):(h=l,0===tE&&tP(et)),h!==l?i=a=[a,s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),91===e.charCodeAt(tb)?(s="[",tb++):(s=l,0===tE&&tP(ee)),s!==l?(o=nu(),(u=tz())!==l?(c=nu(),93===e.charCodeAt(tb)?(h="]",tb++):(h=l,0===tE&&tP(et)),h!==l?i=a=[a,s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);d=n,t=r.reduce((e,t)=>{let[,,,n]=t;return{type:"IndexExpression",object:e,index:n}},d)}else tb=t,t=l;return t}())!==l)if(nu(),40===e.charCodeAt(tb)?(i="(",tb++):(i=l,0===tE&&tP(q)),i!==l)if(nu(),(a=tO())===l&&(a=null),nu(),41===e.charCodeAt(tb)?(s=")",tb++):(s=l,0===tE&&tP(Y)),s!==l){var f;if(nu(),o=tb,123===e.charCodeAt(tb)?(u="{",tb++):(u=l,0===tE&&tP(W)),u!==l){for(c=nu(),h=[],d=tU();d!==l;)h.push(d),d=tU();d=nu(),125===e.charCodeAt(tb)?(p="}",tb++):(p=l,0===tE&&tP(j)),p!==l?o=u=[u,c,h,d,p,nu()]:(tb=o,o=l)}else tb=o,o=l;o===l&&(o=null),t={type:"ObjectDeclaration",className:r,instanceName:a,body:(f=o)?f[2].filter(Boolean):[]}}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}function tU(){let t,n,r;return(t=tb,(n=tD())!==l)?(nu(),59===e.charCodeAt(tb)?(r=";",tb++):(r=l,0===tE&&tP(V)),r===l&&(r=null),nu(),t=n):(tb=t,t=l),t===l&&((t=tb,(n=tN())!==l)?(nu(),59===e.charCodeAt(tb)?(r=";",tb++):(r=l,0===tE&&tP(V)),r===l&&(r=null),nu(),t=n):(tb=t,t=l),t===l&&(t=function(){let t,n,r,i,a;if(t=tb,nu(),(n=tF())!==l)if(nu(),61===e.charCodeAt(tb)?(r="=",tb++):(r=l,0===tE&&tP(en)),r!==l)if(nu(),(i=tV())!==l)nu(),59===e.charCodeAt(tb)?(a=";",tb++):(a=l,0===tE&&tP(V)),a===l&&(a=null),nu(),t={type:"Assignment",target:n,value:i};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=nl())===l&&(t=function(){let t,n;if(t=[],n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx)),n!==l)for(;n!==l;)t.push(n),n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx));else t=l;return t!==l&&(t=null),t}())),t}function tO(){let e;return(e=tQ())===l&&(e=nr())===l&&(e=no()),e}function tF(){let e,t,n,r;if(e=tb,(t=t9())!==l){for(n=[],r=tk();r!==l;)n.push(r),r=tk();e=n.reduce((e,t)=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},t)}else tb=e,e=l;return e}function tk(){let t,n,r,i;return(t=tb,46===e.charCodeAt(tb)?(n=".",tb++):(n=l,0===tE&&tP(er)),n!==l&&(nu(),(r=nr())!==l))?t={type:"property",value:r}:(tb=t,t=l),t===l&&((t=tb,91===e.charCodeAt(tb)?(n="[",tb++):(n=l,0===tE&&tP(ee)),n!==l&&(nu(),(r=tz())!==l&&(nu(),93===e.charCodeAt(tb)?(i="]",tb++):(i=l,0===tE&&tP(et)),i!==l)))?t={type:"index",value:r}:(tb=t,t=l)),t}function tz(){let t,n,r,i,a,s,o,u;if(t=tb,(n=tV())!==l){for(r=[],i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=tV())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=tV())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);t=r.length>0?[n,...r.map(e=>{let[,,,t]=e;return t})]:n}else tb=t,t=l;return t}function tB(){let t,n,r,i,a,s,o,u,c;if(t=tb,e.substr(tb,4)===_?(n=_,tb+=4):(n=l,0===tE&&tP(eh)),n!==l)if(nc()!==l)if((r=function(){let t,n,r,i,a,s,o,u;if(t=tb,(n=t4())!==l){for(r=[],i=tb,a=nu(),"or"===e.substr(tb,2)?(s="or",tb+=2):(s=l,0===tE&&tP(ep)),s!==l&&(o=nc())!==l&&(u=t4())!==l?i=a=[a,s,o,u]:(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),"or"===e.substr(tb,2)?(s="or",tb+=2):(s=l,0===tE&&tP(ep)),s!==l&&(o=nc())!==l&&(u=t4())!==l?i=a=[a,s,o,u]:(tb=i,i=l);t=r.length>0?[n,...r.map(e=>{let[,,,t]=e;return t})]:n}else tb=t,t=l;return t}())!==l)if(nu(),58===e.charCodeAt(tb)?(i=":",tb++):(i=l,0===tE&&tP($)),i!==l){for(a=nh(),s=[],o=tb,(u=nl())===l&&(u=tL()),u!==l?o=u=[u,c=nh()]:(tb=o,o=l);o!==l;)s.push(o),o=tb,(u=nl())===l&&(u=tL()),u!==l?o=u=[u,c=nh()]:(tb=o,o=l);t={type:"SwitchCase",test:r,consequent:s.map(e=>{let[t]=e;return t}).filter(Boolean)}}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;if(t===l)if(t=tb,e.substr(tb,7)===x?(n=x,tb+=7):(n=l,0===tE&&tP(ed)),n!==l)if(nu(),58===e.charCodeAt(tb)?(r=":",tb++):(r=l,0===tE&&tP($)),r!==l){for(nh(),i=[],a=tb,(s=nl())===l&&(s=tL()),s!==l?a=s=[s,o=nh()]:(tb=a,a=l);a!==l;)i.push(a),a=tb,(s=nl())===l&&(s=tL()),s!==l?a=s=[s,o=nh()]:(tb=a,a=l);t={type:"SwitchCase",test:null,consequent:i.map(e=>{let[t]=e;return t}).filter(Boolean)}}else tb=t,t=l;else tb=t,t=l;return t}function tH(){let t,n,r,i,a,s;if(t=tb,123===e.charCodeAt(tb)?(n="{",tb++):(n=l,0===tE&&tP(W)),n!==l){for(nh(),r=[],i=tb,(a=nl())===l&&(a=tL()),a!==l?i=a=[a,s=nh()]:(tb=i,i=l);i!==l;)r.push(i),i=tb,(a=nl())===l&&(a=tL()),a!==l?i=a=[a,s=nh()]:(tb=i,i=l);(125===e.charCodeAt(tb)?(i="}",tb++):(i=l,0===tE&&tP(j)),i!==l)?t={type:"BlockStatement",body:r.map(e=>{let[t]=e;return t}).filter(Boolean)}:(tb=t,t=l)}else tb=t,t=l;return t}function tV(){let t,n,r,i;if(t=tb,(n=tF())!==l)if(nu(),(r=tG())!==l)if(nu(),(i=tV())!==l)t={type:"AssignmentExpression",operator:r,target:n,value:i};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t===l&&(t=function(){let t,n,r,i,a,s;if(t=tb,(n=tW())!==l)if(nu(),63===e.charCodeAt(tb)?(r="?",tb++):(r=l,0===tE&&tP(eA)),r!==l)if(nu(),(i=tV())!==l)if(nu(),58===e.charCodeAt(tb)?(a=":",tb++):(a=l,0===tE&&tP($)),a!==l)if(nu(),(s=tV())!==l)t={type:"ConditionalExpression",test:n,consequent:i,alternate:s};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t===l&&(t=tW()),t}()),t}function tG(){let t;return 61===e.charCodeAt(tb)?(t="=",tb++):(t=l,0===tE&&tP(en)),t===l&&("+="===e.substr(tb,2)?(t="+=",tb+=2):(t=l,0===tE&&tP(ev)),t===l&&("-="===e.substr(tb,2)?(t="-=",tb+=2):(t=l,0===tE&&tP(ey)),t===l&&("*="===e.substr(tb,2)?(t="*=",tb+=2):(t=l,0===tE&&tP(e_)),t===l&&("/="===e.substr(tb,2)?(t="/=",tb+=2):(t=l,0===tE&&tP(ex)),t===l&&("%="===e.substr(tb,2)?(t="%=",tb+=2):(t=l,0===tE&&tP(eb)),t===l&&("<<="===e.substr(tb,3)?(t="<<=",tb+=3):(t=l,0===tE&&tP(eS)),t===l&&(">>="===e.substr(tb,3)?(t=">>=",tb+=3):(t=l,0===tE&&tP(eM)),t===l&&("&="===e.substr(tb,2)?(t="&=",tb+=2):(t=l,0===tE&&tP(ew)),t===l&&("|="===e.substr(tb,2)?(t="|=",tb+=2):(t=l,0===tE&&tP(eE)),t===l&&("^="===e.substr(tb,2)?(t="^=",tb+=2):(t=l,0===tE&&tP(eT)))))))))))),t}function tW(){let t,n,r,i,s,o,u,c;if(t=tb,(n=tj())!==l){for(r=[],i=tb,s=nu(),"||"===e.substr(tb,2)?(o="||",tb+=2):(o=l,0===tE&&tP(eC)),o!==l?(u=nu(),(c=tj())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),"||"===e.substr(tb,2)?(o="||",tb+=2):(o=l,0===tE&&tP(eC)),o!==l?(u=nu(),(c=tj())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function tj(){let t,n,r,i,s,o,u,c;if(t=tb,(n=tX())!==l){for(r=[],i=tb,s=nu(),"&&"===e.substr(tb,2)?(o="&&",tb+=2):(o=l,0===tE&&tP(eR)),o!==l?(u=nu(),(c=tX())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),"&&"===e.substr(tb,2)?(o="&&",tb+=2):(o=l,0===tE&&tP(eR)),o!==l?(u=nu(),(c=tX())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function tX(){let t,n,r,i,s,o,u,c,h;if(t=tb,(n=tq())!==l){for(r=[],i=tb,s=nu(),124===e.charCodeAt(tb)?(o="|",tb++):(o=l,0===tE&&tP(eP)),o!==l?(u=tb,tE++,124===e.charCodeAt(tb)?(c="|",tb++):(c=l,0===tE&&tP(eP)),tE--,c===l?u=void 0:(tb=u,u=l),u!==l?(c=nu(),(h=tq())!==l?i=s=[s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),124===e.charCodeAt(tb)?(o="|",tb++):(o=l,0===tE&&tP(eP)),o!==l?(u=tb,tE++,124===e.charCodeAt(tb)?(c="|",tb++):(c=l,0===tE&&tP(eP)),tE--,c===l?u=void 0:(tb=u,u=l),u!==l?(c=nu(),(h=tq())!==l?i=s=[s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function tq(){let t,n,r,i,s,o,u,c;if(t=tb,(n=tY())!==l){for(r=[],i=tb,s=nu(),94===e.charCodeAt(tb)?(o="^",tb++):(o=l,0===tE&&tP(eI)),o!==l?(u=nu(),(c=tY())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),94===e.charCodeAt(tb)?(o="^",tb++):(o=l,0===tE&&tP(eI)),o!==l?(u=nu(),(c=tY())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function tY(){let t,n,r,i,s,o,u,c,h;if(t=tb,(n=tJ())!==l){for(r=[],i=tb,s=nu(),38===e.charCodeAt(tb)?(o="&",tb++):(o=l,0===tE&&tP(eL)),o!==l?(u=tb,tE++,38===e.charCodeAt(tb)?(c="&",tb++):(c=l,0===tE&&tP(eL)),tE--,c===l?u=void 0:(tb=u,u=l),u!==l?(c=nu(),(h=tJ())!==l?i=s=[s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),38===e.charCodeAt(tb)?(o="&",tb++):(o=l,0===tE&&tP(eL)),o!==l?(u=tb,tE++,38===e.charCodeAt(tb)?(c="&",tb++):(c=l,0===tE&&tP(eL)),tE--,c===l?u=void 0:(tb=u,u=l),u!==l?(c=nu(),(h=tJ())!==l?i=s=[s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function tJ(){let e,t,n,r,i,s,o,u;if(e=tb,(t=tK())!==l){for(n=[],r=tb,i=nu(),(s=tZ())!==l?(o=nu(),(u=tK())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);r!==l;)n.push(r),r=tb,i=nu(),(s=tZ())!==l?(o=nu(),(u=tK())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);e=a(t,n.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=e,e=l;return e}function tZ(){let t;return"=="===e.substr(tb,2)?(t="==",tb+=2):(t=l,0===tE&&tP(eN)),t===l&&("!="===e.substr(tb,2)?(t="!=",tb+=2):(t=l,0===tE&&tP(eD))),t}function tK(){let e,t,n,r,i,s,o,u;if(e=tb,(t=tQ())!==l){for(n=[],r=tb,i=nu(),(s=t$())!==l?(o=nu(),(u=tQ())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);r!==l;)n.push(r),r=tb,i=nu(),(s=t$())!==l?(o=nu(),(u=tQ())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);e=a(t,n.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=e,e=l;return e}function t$(){let t;return"<="===e.substr(tb,2)?(t="<=",tb+=2):(t=l,0===tE&&tP(eU)),t===l&&(">="===e.substr(tb,2)?(t=">=",tb+=2):(t=l,0===tE&&tP(eO)),t===l&&(t=e.charAt(tb),A.test(t)?tb++:(t=l,0===tE&&tP(eF)))),t}function tQ(){let e,t,n,r,i,s,o,u;if(e=tb,(t=t2())!==l){for(n=[],r=tb,i=nu(),(s=t1())!==l?(o=nu(),(u=t0())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);r!==l;)n.push(r),r=tb,i=nu(),(s=t1())!==l?(o=nu(),(u=t0())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);e=a(t,n.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=e,e=l;return e}function t0(){let e,t,n,r;if(e=tb,(t=tF())!==l)if(nu(),(n=tG())!==l)if(nu(),(r=tV())!==l)e={type:"AssignmentExpression",operator:n,target:t,value:r};else tb=e,e=l;else tb=e,e=l;else tb=e,e=l;return e===l&&(e=t2()),e}function t1(){let t;return"$="===e.substr(tb,2)?(t="$=",tb+=2):(t=l,0===tE&&tP(ek)),t===l&&("!$="===e.substr(tb,3)?(t="!$=",tb+=3):(t=l,0===tE&&tP(ez)),t===l&&(64===e.charCodeAt(tb)?(t="@",tb++):(t=l,0===tE&&tP(eB)),t===l&&("NL"===e.substr(tb,2)?(t="NL",tb+=2):(t=l,0===tE&&tP(eH)),t===l&&("TAB"===e.substr(tb,3)?(t="TAB",tb+=3):(t=l,0===tE&&tP(eV)),t===l&&("SPC"===e.substr(tb,3)?(t="SPC",tb+=3):(t=l,0===tE&&tP(eG))))))),t}function t2(){let e,t,n,r,i,s,o,u;if(e=tb,(t=t4())!==l){for(n=[],r=tb,i=nu(),(s=t3())!==l?(o=nu(),(u=t4())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);r!==l;)n.push(r),r=tb,i=nu(),(s=t3())!==l?(o=nu(),(u=t4())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);e=a(t,n.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=e,e=l;return e}function t3(){let t;return"<<"===e.substr(tb,2)?(t="<<",tb+=2):(t=l,0===tE&&tP(eW)),t===l&&(">>"===e.substr(tb,2)?(t=">>",tb+=2):(t=l,0===tE&&tP(ej))),t}function t4(){let t,n,r,i,s,o,u,c;if(t=tb,(n=t5())!==l){for(r=[],i=tb,s=nu(),o=e.charAt(tb),C.test(o)?tb++:(o=l,0===tE&&tP(eX)),o!==l?(u=nu(),(c=t5())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),o=e.charAt(tb),C.test(o)?tb++:(o=l,0===tE&&tP(eX)),o!==l?(u=nu(),(c=t5())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function t5(){let t,n,r,i,s,o,u,c;if(t=tb,(n=t6())!==l){for(r=[],i=tb,s=nu(),o=e.charAt(tb),R.test(o)?tb++:(o=l,0===tE&&tP(eq)),o!==l?(u=nu(),(c=t6())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),o=e.charAt(tb),R.test(o)?tb++:(o=l,0===tE&&tP(eq)),o!==l?(u=nu(),(c=t6())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function t6(){let t,n,r;return(t=tb,n=e.charAt(tb),P.test(n)?tb++:(n=l,0===tE&&tP(eY)),n!==l&&(nu(),(r=t8())!==l))?t=s(n,r):(tb=t,t=l),t===l&&((t=tb,"++"===e.substr(tb,2)?(n="++",tb+=2):(n=l,0===tE&&tP(eJ)),n===l&&("--"===e.substr(tb,2)?(n="--",tb+=2):(n=l,0===tE&&tP(eZ))),n!==l&&(nu(),(r=t8())!==l))?t=s(n,r):(tb=t,t=l),t===l&&((t=tb,42===e.charCodeAt(tb)?(n="*",tb++):(n=l,0===tE&&tP(eK)),n!==l&&(nu(),(r=t8())!==l))?t={type:"TagDereferenceExpression",argument:r}:(tb=t,t=l),t===l&&(t=function(){let t,n,r;if(t=tb,(n=t9())!==l)if(nu(),"++"===e.substr(tb,2)?(r="++",tb+=2):(r=l,0===tE&&tP(eJ)),r===l&&("--"===e.substr(tb,2)?(r="--",tb+=2):(r=l,0===tE&&tP(eZ))),r!==l)t={type:"PostfixExpression",operator:r,argument:n};else tb=t,t=l;else tb=t,t=l;return t===l&&(t=t9()),t}()))),t}function t8(){let e,t,n,r;if(e=tb,(t=tF())!==l)if(nu(),(n=tG())!==l)if(nu(),(r=tV())!==l)e={type:"AssignmentExpression",operator:n,target:t,value:r};else tb=e,e=l;else tb=e,e=l;else tb=e,e=l;return e===l&&(e=t6()),e}function t9(){let t,n,a,s,o,u,c,h,d,p;if(t=tb,(n=function(){let t,n,r,i,a,s,o,u,c,h,d,p,f,m,g,v;if(t=tb,(o=tD())===l&&(o=tN())===l&&(o=function(){let t,n,r,i;if(t=tb,34===e.charCodeAt(tb)?(n='"',tb++):(n=l,0===tE&&tP(e4)),n!==l){for(r=[],i=ni();i!==l;)r.push(i),i=ni();(34===e.charCodeAt(tb)?(i='"',tb++):(i=l,0===tE&&tP(e4)),i!==l)?t={type:"StringLiteral",value:r.join("")}:(tb=t,t=l)}else tb=t,t=l;if(t===l)if(t=tb,39===e.charCodeAt(tb)?(n="'",tb++):(n=l,0===tE&&tP(e5)),n!==l){for(r=[],i=na();i!==l;)r.push(i),i=na();(39===e.charCodeAt(tb)?(i="'",tb++):(i=l,0===tE&&tP(e5)),i!==l)?t={type:"StringLiteral",value:r.join(""),tagged:!0}:(tb=t,t=l)}else tb=t,t=l;return t}())===l&&(o=no())===l&&((u=tb,e.substr(tb,4)===E?(c=E,tb+=4):(c=l,0===tE&&tP(tp)),c===l&&(e.substr(tb,5)===T?(c=T,tb+=5):(c=l,0===tE&&tP(tf))),c!==l&&(h=tb,tE++,d=np(),tE--,d===l?h=void 0:(tb=h,h=l),h!==l))?u={type:"BooleanLiteral",value:"true"===c}:(tb=u,u=l),(o=u)===l&&((p=ne())===l&&(p=nt())===l&&(p=nn()),(o=p)===l))&&((f=tb,40===e.charCodeAt(tb)?(m="(",tb++):(m=l,0===tE&&tP(q)),m!==l&&(nu(),(g=tV())!==l&&(nu(),41===e.charCodeAt(tb)?(v=")",tb++):(v=l,0===tE&&tP(Y)),v!==l)))?f=g:(tb=f,f=l),o=f),(n=o)!==l){for(r=[],i=tb,a=nu(),(s=tk())!==l?i=a=[a,s]:(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),(s=tk())!==l?i=a=[a,s]:(tb=i,i=l);t=r.reduce((e,t)=>{let[,n]=t;return"property"===n.type?{type:"MemberExpression",object:e,property:n.value}:{type:"IndexExpression",object:e,index:n.value}},n)}else tb=t,t=l;return t}())!==l){for(a=[],s=tb,o=nu(),40===e.charCodeAt(tb)?(u="(",tb++):(u=l,0===tE&&tP(q)),u!==l?(c=nu(),(h=t7())===l&&(h=null),d=nu(),41===e.charCodeAt(tb)?(p=")",tb++):(p=l,0===tE&&tP(Y)),p!==l?s=o=[o,u,c,h,d,p]:(tb=s,s=l)):(tb=s,s=l),s===l&&(s=tb,o=nu(),(u=tk())!==l?s=o=[o,u]:(tb=s,s=l));s!==l;)a.push(s),s=tb,o=nu(),40===e.charCodeAt(tb)?(u="(",tb++):(u=l,0===tE&&tP(q)),u!==l?(c=nu(),(h=t7())===l&&(h=null),d=nu(),41===e.charCodeAt(tb)?(p=")",tb++):(p=l,0===tE&&tP(Y)),p!==l?s=o=[o,u,c,h,d,p]:(tb=s,s=l)):(tb=s,s=l),s===l&&(s=tb,o=nu(),(u=tk())!==l?s=o=[o,u]:(tb=s,s=l));t=a.reduce((e,t)=>{if("("===t[1]){var n;let[,,,a]=t;return n=a||[],"Identifier"===e.type&&"exec"===e.name.toLowerCase()&&(n.length>0&&"StringLiteral"===n[0].type?r.add(n[0].value):i=!0),{type:"CallExpression",callee:e,arguments:n}}let a=t[1];return"property"===a.type?{type:"MemberExpression",object:e,property:a.value}:{type:"IndexExpression",object:e,index:a.value}},n)}else tb=t,t=l;return t}function t7(){let t,n,r,i,a,s,o,u;if(t=tb,(n=tV())!==l){for(r=[],i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=tV())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=tV())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);t=[n,...r.map(e=>{let[,,,t]=e;return t})]}else tb=t,t=l;return t}function ne(){let t,n,r,i,a,s,o;if(t=tb,37===e.charCodeAt(tb)?(n="%",tb++):(n=l,0===tE&&tP(e$)),n!==l){if(r=tb,i=tb,a=e.charAt(tb),I.test(a)?tb++:(a=l,0===tE&&tP(eQ)),a!==l){for(s=[],o=e.charAt(tb),L.test(o)?tb++:(o=l,0===tE&&tP(e0));o!==l;)s.push(o),o=e.charAt(tb),L.test(o)?tb++:(o=l,0===tE&&tP(e0));i=a=[a,s]}else tb=i,i=l;(r=i!==l?e.substring(r,tb):i)!==l?t={type:"Variable",scope:"local",name:r}:(tb=t,t=l)}else tb=t,t=l;return t}function nt(){let t,n,r,i,a,s,o,u,c,h,d,p,f;if(t=tb,36===e.charCodeAt(tb)?(n="$",tb++):(n=l,0===tE&&tP(e1)),n!==l){if(r=tb,i=tb,"::"===e.substr(tb,2)?(a="::",tb+=2):(a=l,0===tE&&tP(J)),a===l&&(a=null),s=e.charAt(tb),I.test(s)?tb++:(s=l,0===tE&&tP(eQ)),s!==l){for(o=[],u=e.charAt(tb),L.test(u)?tb++:(u=l,0===tE&&tP(e0));u!==l;)o.push(u),u=e.charAt(tb),L.test(u)?tb++:(u=l,0===tE&&tP(e0));if(u=[],c=tb,"::"===e.substr(tb,2)?(h="::",tb+=2):(h=l,0===tE&&tP(J)),h!==l)if(d=e.charAt(tb),I.test(d)?tb++:(d=l,0===tE&&tP(eQ)),d!==l){for(p=[],f=e.charAt(tb),L.test(f)?tb++:(f=l,0===tE&&tP(e0));f!==l;)p.push(f),f=e.charAt(tb),L.test(f)?tb++:(f=l,0===tE&&tP(e0));c=h=[h,d,p]}else tb=c,c=l;else tb=c,c=l;for(;c!==l;)if(u.push(c),c=tb,"::"===e.substr(tb,2)?(h="::",tb+=2):(h=l,0===tE&&tP(J)),h!==l)if(d=e.charAt(tb),I.test(d)?tb++:(d=l,0===tE&&tP(eQ)),d!==l){for(p=[],f=e.charAt(tb),L.test(f)?tb++:(f=l,0===tE&&tP(e0));f!==l;)p.push(f),f=e.charAt(tb),L.test(f)?tb++:(f=l,0===tE&&tP(e0));c=h=[h,d,p]}else tb=c,c=l;else tb=c,c=l;i=a=[a,s,o,u]}else tb=i,i=l;(r=i!==l?e.substring(r,tb):i)!==l?t={type:"Variable",scope:"global",name:r}:(tb=t,t=l)}else tb=t,t=l;return t}function nn(){let t,n,r,i,a,s,o,u,c,h,d;if(t=tb,n=tb,r=tb,e.substr(tb,6)===w?(i=w,tb+=6):(i=l,0===tE&&tP(e2)),i!==l){for(a=[],s=e.charAt(tb),N.test(s)?tb++:(s=l,0===tE&&tP(e3));s!==l;)a.push(s),s=e.charAt(tb),N.test(s)?tb++:(s=l,0===tE&&tP(e3));if("::"===e.substr(tb,2)?(s="::",tb+=2):(s=l,0===tE&&tP(J)),s!==l){for(o=[],u=e.charAt(tb),N.test(u)?tb++:(u=l,0===tE&&tP(e3));u!==l;)o.push(u),u=e.charAt(tb),N.test(u)?tb++:(u=l,0===tE&&tP(e3));if(u=e.charAt(tb),I.test(u)?tb++:(u=l,0===tE&&tP(eQ)),u!==l){for(c=[],h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));h!==l;)c.push(h),h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));r=i=[i,a,s,o,u,c]}else tb=r,r=l}else tb=r,r=l}else tb=r,r=l;if((n=r!==l?e.substring(n,tb):r)!==l&&(n={type:"Identifier",name:n.replace(/\s+/g,"")}),(t=n)===l){if(t=tb,n=tb,r=tb,e.substr(tb,6)===w?(i=w,tb+=6):(i=l,0===tE&&tP(e2)),i!==l){if(a=[],s=tb,"::"===e.substr(tb,2)?(o="::",tb+=2):(o=l,0===tE&&tP(J)),o!==l)if(u=e.charAt(tb),I.test(u)?tb++:(u=l,0===tE&&tP(eQ)),u!==l){for(c=[],h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));h!==l;)c.push(h),h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));s=o=[o,u,c]}else tb=s,s=l;else tb=s,s=l;if(s!==l)for(;s!==l;)if(a.push(s),s=tb,"::"===e.substr(tb,2)?(o="::",tb+=2):(o=l,0===tE&&tP(J)),o!==l)if(u=e.charAt(tb),I.test(u)?tb++:(u=l,0===tE&&tP(eQ)),u!==l){for(c=[],h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));h!==l;)c.push(h),h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));s=o=[o,u,c]}else tb=s,s=l;else tb=s,s=l;else a=l;a!==l?r=i=[i,a]:(tb=r,r=l)}else tb=r,r=l;if((n=r!==l?e.substring(n,tb):r)!==l&&(n={type:"Identifier",name:n}),(t=n)===l){if(t=tb,n=tb,r=tb,i=e.charAt(tb),I.test(i)?tb++:(i=l,0===tE&&tP(eQ)),i!==l){for(a=[],s=e.charAt(tb),L.test(s)?tb++:(s=l,0===tE&&tP(e0));s!==l;)a.push(s),s=e.charAt(tb),L.test(s)?tb++:(s=l,0===tE&&tP(e0));if(s=[],o=tb,"::"===e.substr(tb,2)?(u="::",tb+=2):(u=l,0===tE&&tP(J)),u!==l)if(c=e.charAt(tb),I.test(c)?tb++:(c=l,0===tE&&tP(eQ)),c!==l){for(h=[],d=e.charAt(tb),L.test(d)?tb++:(d=l,0===tE&&tP(e0));d!==l;)h.push(d),d=e.charAt(tb),L.test(d)?tb++:(d=l,0===tE&&tP(e0));o=u=[u,c,h]}else tb=o,o=l;else tb=o,o=l;for(;o!==l;)if(s.push(o),o=tb,"::"===e.substr(tb,2)?(u="::",tb+=2):(u=l,0===tE&&tP(J)),u!==l)if(c=e.charAt(tb),I.test(c)?tb++:(c=l,0===tE&&tP(eQ)),c!==l){for(h=[],d=e.charAt(tb),L.test(d)?tb++:(d=l,0===tE&&tP(e0));d!==l;)h.push(d),d=e.charAt(tb),L.test(d)?tb++:(d=l,0===tE&&tP(e0));o=u=[u,c,h]}else tb=o,o=l;else tb=o,o=l;r=i=[i,a,s]}else tb=r,r=l;(n=r!==l?e.substring(n,tb):r)!==l&&(n={type:"Identifier",name:n}),t=n}}return t}function nr(){let e;return(e=ne())===l&&(e=nt())===l&&(e=nn()),e}function ni(){let t,n,r;return(t=tb,92===e.charCodeAt(tb)?(n="\\",tb++):(n=l,0===tE&&tP(e6)),n!==l&&(r=ns())!==l)?t=r:(tb=t,t=l),t===l&&(t=e.charAt(tb),D.test(t)?tb++:(t=l,0===tE&&tP(e8))),t}function na(){let t,n,r;return(t=tb,92===e.charCodeAt(tb)?(n="\\",tb++):(n=l,0===tE&&tP(e6)),n!==l&&(r=ns())!==l)?t=r:(tb=t,t=l),t===l&&(t=e.charAt(tb),U.test(t)?tb++:(t=l,0===tE&&tP(e9))),t}function ns(){let t,n,r,i,a,s;return t=tb,110===e.charCodeAt(tb)?(n="n",tb++):(n=l,0===tE&&tP(e7)),n!==l&&(n="\n"),(t=n)===l&&(t=tb,114===e.charCodeAt(tb)?(n="r",tb++):(n=l,0===tE&&tP(te)),n!==l&&(n="\r"),(t=n)===l)&&(t=tb,116===e.charCodeAt(tb)?(n="t",tb++):(n=l,0===tE&&tP(tt)),n!==l&&(n=" "),(t=n)===l)&&((t=tb,120===e.charCodeAt(tb)?(n="x",tb++):(n=l,0===tE&&tP(tn)),n!==l&&(r=tb,i=tb,a=e.charAt(tb),O.test(a)?tb++:(a=l,0===tE&&tP(tr)),a!==l?(s=e.charAt(tb),O.test(s)?tb++:(s=l,0===tE&&tP(tr)),s!==l?i=a=[a,s]:(tb=i,i=l)):(tb=i,i=l),(r=i!==l?e.substring(r,tb):i)!==l))?t=String.fromCharCode(parseInt(r,16)):(tb=t,t=l),t===l&&(t=tb,"cr"===e.substr(tb,2)?(n="cr",tb+=2):(n=l,0===tE&&tP(ti)),n!==l&&(n="\x0f"),(t=n)===l&&(t=tb,"cp"===e.substr(tb,2)?(n="cp",tb+=2):(n=l,0===tE&&tP(ta)),n!==l&&(n="\x10"),(t=n)===l))&&(t=tb,"co"===e.substr(tb,2)?(n="co",tb+=2):(n=l,0===tE&&tP(ts)),n!==l&&(n="\x11"),(t=n)===l)&&((t=tb,99===e.charCodeAt(tb)?(n="c",tb++):(n=l,0===tE&&tP(to)),n!==l&&(r=e.charAt(tb),F.test(r)?tb++:(r=l,0===tE&&tP(tl)),r!==l))?t=String.fromCharCode([2,3,4,5,6,7,8,11,12,14][parseInt(r,10)]):(tb=t,t=l),t===l&&(t=tb,e.length>tb?(n=e.charAt(tb),tb++):(n=l,0===tE&&tP(tu)),t=n))),t}function no(){let t,n,r,i,a,s,o,u,c;if(t=tb,n=tb,r=tb,48===e.charCodeAt(tb)?(i="0",tb++):(i=l,0===tE&&tP(tc)),i!==l)if(a=e.charAt(tb),k.test(a)?tb++:(a=l,0===tE&&tP(th)),a!==l){if(s=[],o=e.charAt(tb),O.test(o)?tb++:(o=l,0===tE&&tP(tr)),o!==l)for(;o!==l;)s.push(o),o=e.charAt(tb),O.test(o)?tb++:(o=l,0===tE&&tP(tr));else s=l;s!==l?r=i=[i,a,s]:(tb=r,r=l)}else tb=r,r=l;else tb=r,r=l;if((n=r!==l?e.substring(n,tb):r)!==l&&(r=tb,tE++,i=np(),tE--,i===l?r=void 0:(tb=r,r=l),r!==l)?t={type:"NumberLiteral",value:parseInt(n,16)}:(tb=t,t=l),t===l){if(t=tb,n=tb,r=tb,45===e.charCodeAt(tb)?(i="-",tb++):(i=l,0===tE&&tP(td)),i===l&&(i=null),a=[],s=e.charAt(tb),F.test(s)?tb++:(s=l,0===tE&&tP(tl)),s!==l)for(;s!==l;)a.push(s),s=e.charAt(tb),F.test(s)?tb++:(s=l,0===tE&&tP(tl));else a=l;if(a!==l){if(s=tb,46===e.charCodeAt(tb)?(o=".",tb++):(o=l,0===tE&&tP(er)),o!==l){if(u=[],c=e.charAt(tb),F.test(c)?tb++:(c=l,0===tE&&tP(tl)),c!==l)for(;c!==l;)u.push(c),c=e.charAt(tb),F.test(c)?tb++:(c=l,0===tE&&tP(tl));else u=l;u!==l?s=o=[o,u]:(tb=s,s=l)}else tb=s,s=l;s===l&&(s=null),r=i=[i,a,s]}else tb=r,r=l;if(r===l)if(r=tb,45===e.charCodeAt(tb)?(i="-",tb++):(i=l,0===tE&&tP(td)),i===l&&(i=null),46===e.charCodeAt(tb)?(a=".",tb++):(a=l,0===tE&&tP(er)),a!==l){if(s=[],o=e.charAt(tb),F.test(o)?tb++:(o=l,0===tE&&tP(tl)),o!==l)for(;o!==l;)s.push(o),o=e.charAt(tb),F.test(o)?tb++:(o=l,0===tE&&tP(tl));else s=l;s!==l?r=i=[i,a,s]:(tb=r,r=l)}else tb=r,r=l;(n=r!==l?e.substring(n,tb):r)!==l&&(r=tb,tE++,i=np(),tE--,i===l?r=void 0:(tb=r,r=l),r!==l)?t={type:"NumberLiteral",value:parseFloat(n)}:(tb=t,t=l)}return t}function nl(){let t;return(t=function(){let t,n,r,i,a;if(t=tb,"//"===e.substr(tb,2)?(n="//",tb+=2):(n=l,0===tE&&tP(tm)),n!==l){for(r=tb,i=[],a=e.charAt(tb),z.test(a)?tb++:(a=l,0===tE&&tP(tg));a!==l;)i.push(a),a=e.charAt(tb),z.test(a)?tb++:(a=l,0===tE&&tP(tg));r=e.substring(r,tb),i=e.charAt(tb),B.test(i)?tb++:(i=l,0===tE&&tP(tv)),i===l&&(i=null),t={type:"Comment",value:r}}else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s,o;if(t=tb,"/*"===e.substr(tb,2)?(n="/*",tb+=2):(n=l,0===tE&&tP(ty)),n!==l){for(r=tb,i=[],a=tb,s=tb,tE++,"*/"===e.substr(tb,2)?(o="*/",tb+=2):(o=l,0===tE&&tP(t_)),tE--,o===l?s=void 0:(tb=s,s=l),s!==l?(e.length>tb?(o=e.charAt(tb),tb++):(o=l,0===tE&&tP(tu)),o!==l?a=s=[s,o]:(tb=a,a=l)):(tb=a,a=l);a!==l;)i.push(a),a=tb,s=tb,tE++,"*/"===e.substr(tb,2)?(o="*/",tb+=2):(o=l,0===tE&&tP(t_)),tE--,o===l?s=void 0:(tb=s,s=l),s!==l?(e.length>tb?(o=e.charAt(tb),tb++):(o=l,0===tE&&tP(tu)),o!==l?a=s=[s,o]:(tb=a,a=l)):(tb=a,a=l);(r=e.substring(r,tb),"*/"===e.substr(tb,2)?(i="*/",tb+=2):(i=l,0===tE&&tP(t_)),i!==l)?t={type:"Comment",value:r}:(tb=t,t=l)}else tb=t,t=l;return t}()),t}function nu(){let t,n;for(t=[],n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx)),n===l&&(n=nd());n!==l;)t.push(n),n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx)),n===l&&(n=nd());return t}function nc(){let t,n,r,i;if(t=tb,n=[],r=e.charAt(tb),H.test(r)?tb++:(r=l,0===tE&&tP(tx)),r!==l)for(;r!==l;)n.push(r),r=e.charAt(tb),H.test(r)?tb++:(r=l,0===tE&&tP(tx));else n=l;if(n!==l){for(r=[],i=e.charAt(tb),H.test(i)?tb++:(i=l,0===tE&&tP(tx)),i===l&&(i=nd());i!==l;)r.push(i),i=e.charAt(tb),H.test(i)?tb++:(i=l,0===tE&&tP(tx)),i===l&&(i=nd());t=n=[n,r]}else tb=t,t=l;return t}function nh(){let t,n;for(t=[],n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx));n!==l;)t.push(n),n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx));return t}function nd(){let t,n,r,i,a,s;if(t=tb,"//"===e.substr(tb,2)?(n="//",tb+=2):(n=l,0===tE&&tP(tm)),n!==l){for(r=[],i=e.charAt(tb),z.test(i)?tb++:(i=l,0===tE&&tP(tg));i!==l;)r.push(i),i=e.charAt(tb),z.test(i)?tb++:(i=l,0===tE&&tP(tg));i=e.charAt(tb),B.test(i)?tb++:(i=l,0===tE&&tP(tv)),i===l&&(i=null),t=n=[n,r,i]}else tb=t,t=l;if(t===l)if(t=tb,"/*"===e.substr(tb,2)?(n="/*",tb+=2):(n=l,0===tE&&tP(ty)),n!==l){for(r=[],i=tb,a=tb,tE++,"*/"===e.substr(tb,2)?(s="*/",tb+=2):(s=l,0===tE&&tP(t_)),tE--,s===l?a=void 0:(tb=a,a=l),a!==l?(e.length>tb?(s=e.charAt(tb),tb++):(s=l,0===tE&&tP(tu)),s!==l?i=a=[a,s]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,a=tb,tE++,"*/"===e.substr(tb,2)?(s="*/",tb+=2):(s=l,0===tE&&tP(t_)),tE--,s===l?a=void 0:(tb=a,a=l),a!==l?(e.length>tb?(s=e.charAt(tb),tb++):(s=l,0===tE&&tP(tu)),s!==l?i=a=[a,s]:(tb=i,i=l)):(tb=i,i=l);"*/"===e.substr(tb,2)?(i="*/",tb+=2):(i=l,0===tE&&tP(t_)),i!==l?t=n=[n,r,i]:(tb=t,t=l)}else tb=t,t=l;return t}function np(){let t;return t=e.charAt(tb),L.test(t)?tb++:(t=l,0===tE&&tP(e0)),t}r=new Set,i=!1;let nf=(n=h())!==l&&tb===e.length;function nm(){var t,r,i;throw n!==l&&tb0&&void 0!==arguments[0]?arguments[0]:tb,n=e.codePointAt(t);return void 0===n?"":String.fromCodePoint(n)}(tM):null,i=tM{"use strict";e.s(["getFloat",()=>D,"getInt",()=>U,"getPosition",()=>O,"getProperty",()=>N,"getRotation",()=>k,"getScale",()=>F,"parseMissionScript",()=>L],62395);var t=e.i(90072);e.s(["parse",()=>A,"runServer",()=>C],86608);var n=e.i(92552);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){let t=e.indexOf("::");return -1===t?null:{namespace:e.slice(0,t),method:e.slice(t+2)}}let a={"+":"$.add","-":"$.sub","*":"$.mul","/":"$.div","<":"$.lt","<=":"$.le",">":"$.gt",">=":"$.ge","==":"$.eq","!=":"$.ne","%":"$.mod","&":"$.bitand","|":"$.bitor","^":"$.bitxor","<<":"$.shl",">>":"$.shr"};class s{getAccessInfo(e){if("Variable"===e.type){let t=JSON.stringify(e.name),n="global"===e.scope?this.globals:this.locals;return{getter:"".concat(n,".get(").concat(t,")"),setter:e=>"".concat(n,".set(").concat(t,", ").concat(e,")"),postIncHelper:"".concat(n,".postInc(").concat(t,")"),postDecHelper:"".concat(n,".postDec(").concat(t,")")}}if("MemberExpression"===e.type){let t=this.expression(e.object),n="Identifier"===e.property.type?JSON.stringify(e.property.name):this.expression(e.property);return{getter:"".concat(this.runtime,".prop(").concat(t,", ").concat(n,")"),setter:e=>"".concat(this.runtime,".setProp(").concat(t,", ").concat(n,", ").concat(e,")"),postIncHelper:"".concat(this.runtime,".propPostInc(").concat(t,", ").concat(n,")"),postDecHelper:"".concat(this.runtime,".propPostDec(").concat(t,", ").concat(n,")")}}if("IndexExpression"===e.type){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let n=JSON.stringify(e.object.name),r="global"===e.object.scope?this.globals:this.locals,i=t.join(", ");return{getter:"".concat(r,".get(").concat(n,", ").concat(i,")"),setter:e=>"".concat(r,".set(").concat(n,", ").concat(i,", ").concat(e,")"),postIncHelper:"".concat(r,".postInc(").concat(n,", ").concat(i,")"),postDecHelper:"".concat(r,".postDec(").concat(n,", ").concat(i,")")}}if("MemberExpression"===e.object.type){let n=e.object,r=this.expression(n.object),i="Identifier"===n.property.type?JSON.stringify(n.property.name):this.expression(n.property),a="".concat(this.runtime,".key(").concat(i,", ").concat(t.join(", "),")");return{getter:"".concat(this.runtime,".prop(").concat(r,", ").concat(a,")"),setter:e=>"".concat(this.runtime,".setProp(").concat(r,", ").concat(a,", ").concat(e,")"),postIncHelper:"".concat(this.runtime,".propPostInc(").concat(r,", ").concat(a,")"),postDecHelper:"".concat(this.runtime,".propPostDec(").concat(r,", ").concat(a,")")}}let n=this.expression(e.object),r=1===t.length?t[0]:"".concat(this.runtime,".key(").concat(t.join(", "),")");return{getter:"".concat(this.runtime,".getIndex(").concat(n,", ").concat(r,")"),setter:e=>"".concat(this.runtime,".setIndex(").concat(n,", ").concat(r,", ").concat(e,")"),postIncHelper:"".concat(this.runtime,".indexPostInc(").concat(n,", ").concat(r,")"),postDecHelper:"".concat(this.runtime,".indexPostDec(").concat(n,", ").concat(r,")")}}return null}generate(e){let t=[];for(let n of e.body){let e=this.statement(n);e&&t.push(e)}return t.join("\n\n")}statement(e){switch(e.type){case"Comment":return"";case"ExpressionStatement":return this.line("".concat(this.expression(e.expression),";"));case"FunctionDeclaration":return this.functionDeclaration(e);case"PackageDeclaration":return this.packageDeclaration(e);case"DatablockDeclaration":return this.datablockDeclaration(e);case"ObjectDeclaration":return this.line("".concat(this.objectDeclaration(e),";"));case"IfStatement":return this.ifStatement(e);case"ForStatement":return this.forStatement(e);case"WhileStatement":return this.whileStatement(e);case"DoWhileStatement":return this.doWhileStatement(e);case"SwitchStatement":return this.switchStatement(e);case"ReturnStatement":return this.returnStatement(e);case"BreakStatement":return this.line("break;");case"ContinueStatement":return this.line("continue;");case"BlockStatement":return this.blockStatement(e);default:throw Error("Unknown statement type: ".concat(e.type))}}functionDeclaration(e){let t=i(e.name.name);if(t){let n=t.namespace,r=t.method;this.currentClass=n.toLowerCase(),this.currentFunction=r.toLowerCase();let i=this.functionBody(e.body,e.params);return this.currentClass=null,this.currentFunction=null,"".concat(this.line("".concat(this.runtime,".registerMethod(").concat(JSON.stringify(n),", ").concat(JSON.stringify(r),", function() {")),"\n").concat(i,"\n").concat(this.line("});"))}{let t=e.name.name;this.currentFunction=t.toLowerCase();let n=this.functionBody(e.body,e.params);return this.currentFunction=null,"".concat(this.line("".concat(this.runtime,".registerFunction(").concat(JSON.stringify(t),", function() {")),"\n").concat(n,"\n").concat(this.line("});"))}}functionBody(e,t){this.indentLevel++;let n=[];n.push(this.line("const ".concat(this.locals," = ").concat(this.runtime,".locals();")));for(let e=0;ethis.statement(e)).join("\n\n");return this.indentLevel--,"".concat(this.line("".concat(this.runtime,".package(").concat(t,", function() {")),"\n").concat(n,"\n").concat(this.line("});"))}datablockDeclaration(e){let t=JSON.stringify(e.className.name),n=e.instanceName?JSON.stringify(e.instanceName.name):"null",r=e.parent?JSON.stringify(e.parent.name):"null",i=this.objectBody(e.body);return this.line("".concat(this.runtime,".datablock(").concat(t,", ").concat(n,", ").concat(r,", ").concat(i,");"))}objectDeclaration(e){let t="Identifier"===e.className.type?JSON.stringify(e.className.name):this.expression(e.className),n=null===e.instanceName?"null":"Identifier"===e.instanceName.type?JSON.stringify(e.instanceName.name):this.expression(e.instanceName),r=[],i=[];for(let t of e.body)"Assignment"===t.type?r.push(t):i.push(t);let a=this.objectBody(r);if(i.length>0){let e=i.map(e=>this.objectDeclaration(e)).join(",\n");return"".concat(this.runtime,".create(").concat(t,", ").concat(n,", ").concat(a,", [\n").concat(e,"\n])")}return"".concat(this.runtime,".create(").concat(t,", ").concat(n,", ").concat(a,")")}objectBody(e){if(0===e.length)return"{}";let t=[];for(let n of e)if("Assignment"===n.type){let e=this.expression(n.value);if("Identifier"===n.target.type){let r=n.target.name;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)?t.push("".concat(r,": ").concat(e)):t.push("[".concat(JSON.stringify(r),"]: ").concat(e))}else if("IndexExpression"===n.target.type){let r=this.objectPropertyKey(n.target);t.push("[".concat(r,"]: ").concat(e))}else{let r=this.expression(n.target);t.push("[".concat(r,"]: ").concat(e))}}if(t.length<=1)return"{ ".concat(t.join(", ")," }");let n=this.indent.repeat(this.indentLevel+1),r=this.indent.repeat(this.indentLevel);return"{\n".concat(n).concat(t.join(",\n"+n),"\n").concat(r,"}")}objectPropertyKey(e){let t="Identifier"===e.object.type?JSON.stringify(e.object.name):this.expression(e.object),n=Array.isArray(e.index)?e.index.map(e=>this.expression(e)).join(", "):this.expression(e.index);return"".concat(this.runtime,".key(").concat(t,", ").concat(n,")")}ifStatement(e){let t=this.expression(e.test),n=this.statementAsBlock(e.consequent);if(e.alternate)if("IfStatement"===e.alternate.type){let r=this.ifStatement(e.alternate).replace(/^\s*/,"");return this.line("if (".concat(t,") ").concat(n," else ").concat(r))}else{let r=this.statementAsBlock(e.alternate);return this.line("if (".concat(t,") ").concat(n," else ").concat(r))}return this.line("if (".concat(t,") ").concat(n))}forStatement(e){let t=e.init?this.expression(e.init):"",n=e.test?this.expression(e.test):"",r=e.update?this.expression(e.update):"",i=this.statementAsBlock(e.body);return this.line("for (".concat(t,"; ").concat(n,"; ").concat(r,") ").concat(i))}whileStatement(e){let t=this.expression(e.test),n=this.statementAsBlock(e.body);return this.line("while (".concat(t,") ").concat(n))}doWhileStatement(e){let t=this.statementAsBlock(e.body),n=this.expression(e.test);return this.line("do ".concat(t," while (").concat(n,");"))}switchStatement(e){if(e.stringMode)return this.switchStringStatement(e);let t=this.expression(e.discriminant);this.indentLevel++;let n=[];for(let t of e.cases)n.push(this.switchCase(t));return this.indentLevel--,"".concat(this.line("switch (".concat(t,") {")),"\n").concat(n.join("\n"),"\n").concat(this.line("}"))}switchCase(e){let t=[];if(null===e.test)t.push(this.line("default:"));else if(Array.isArray(e.test))for(let n of e.test)t.push(this.line("case ".concat(this.expression(n),":")));else t.push(this.line("case ".concat(this.expression(e.test),":")));for(let n of(this.indentLevel++,e.consequent))t.push(this.statement(n));return t.push(this.line("break;")),this.indentLevel--,t.join("\n")}switchStringStatement(e){let t=this.expression(e.discriminant),n=[];for(let t of e.cases)if(null===t.test)n.push("default: () => { ".concat(this.blockContent(t.consequent)," }"));else if(Array.isArray(t.test))for(let e of t.test)n.push("".concat(this.expression(e),": () => { ").concat(this.blockContent(t.consequent)," }"));else n.push("".concat(this.expression(t.test),": () => { ").concat(this.blockContent(t.consequent)," }"));return this.line("".concat(this.runtime,".switchStr(").concat(t,", { ").concat(n.join(", ")," });"))}returnStatement(e){return e.value?this.line("return ".concat(this.expression(e.value),";")):this.line("return;")}blockStatement(e){this.indentLevel++;let t=e.body.map(e=>this.statement(e)).join("\n");return this.indentLevel--,"{\n".concat(t,"\n").concat(this.line("}"))}statementAsBlock(e){if("BlockStatement"===e.type)return this.blockStatement(e);this.indentLevel++;let t=this.statement(e);return this.indentLevel--,"{\n".concat(t,"\n").concat(this.line("}"))}blockContent(e){return e.map(e=>this.statement(e).trim()).join(" ")}expression(e){switch(e.type){case"Identifier":return this.identifier(e);case"Variable":return this.variable(e);case"NumberLiteral":case"BooleanLiteral":return String(e.value);case"StringLiteral":return JSON.stringify(e.value);case"BinaryExpression":return this.binaryExpression(e);case"UnaryExpression":return this.unaryExpression(e);case"PostfixExpression":return this.postfixExpression(e);case"AssignmentExpression":return this.assignmentExpression(e);case"ConditionalExpression":return"(".concat(this.expression(e.test)," ? ").concat(this.expression(e.consequent)," : ").concat(this.expression(e.alternate),")");case"CallExpression":return this.callExpression(e);case"MemberExpression":return this.memberExpression(e);case"IndexExpression":return this.indexExpression(e);case"TagDereferenceExpression":return"".concat(this.runtime,".deref(").concat(this.expression(e.argument),")");case"ObjectDeclaration":return this.objectDeclaration(e);case"DatablockDeclaration":return"".concat(this.runtime,".datablock(").concat(JSON.stringify(e.className.name),", ").concat(e.instanceName?JSON.stringify(e.instanceName.name):"null",", ").concat(e.parent?JSON.stringify(e.parent.name):"null",", ").concat(this.objectBody(e.body),")");default:throw Error("Unknown expression type: ".concat(e.type))}}identifier(e){let t=i(e.name);return t&&"parent"===t.namespace.toLowerCase()?e.name:t?"".concat(this.runtime,".nsRef(").concat(JSON.stringify(t.namespace),", ").concat(JSON.stringify(t.method),")"):JSON.stringify(e.name)}variable(e){return"global"===e.scope?"".concat(this.globals,".get(").concat(JSON.stringify(e.name),")"):"".concat(this.locals,".get(").concat(JSON.stringify(e.name),")")}binaryExpression(e){let t=this.expression(e.left),n=this.expression(e.right),r=e.operator,i=this.concatExpression(t,r,n);if(i)return i;if("$="===r)return"".concat(this.runtime,".streq(").concat(t,", ").concat(n,")");if("!$="===r)return"!".concat(this.runtime,".streq(").concat(t,", ").concat(n,")");if("&&"===r||"||"===r)return"(".concat(t," ").concat(r," ").concat(n,")");let s=a[r];return s?"".concat(s,"(").concat(t,", ").concat(n,")"):"(".concat(t," ").concat(r," ").concat(n,")")}unaryExpression(e){if("++"===e.operator||"--"===e.operator){let t=this.getAccessInfo(e.argument);if(t){let n="++"===e.operator?1:-1;return t.setter("".concat(this.runtime,".add(").concat(t.getter,", ").concat(n,")"))}}let t=this.expression(e.argument);return"~"===e.operator?"".concat(this.runtime,".bitnot(").concat(t,")"):"-"===e.operator?"".concat(this.runtime,".neg(").concat(t,")"):"".concat(e.operator).concat(t)}postfixExpression(e){let t=this.getAccessInfo(e.argument);if(t){let n="++"===e.operator?t.postIncHelper:t.postDecHelper;if(n)return n}return"".concat(this.expression(e.argument)).concat(e.operator)}assignmentExpression(e){let t=this.expression(e.value),n=e.operator,r=this.getAccessInfo(e.target);if(!r)throw Error("Unhandled assignment target type: ".concat(e.target.type));if("="===n)return r.setter(t);{let e=n.slice(0,-1),i=this.compoundAssignmentValue(r.getter,e,t);return r.setter(i)}}callExpression(e){let t=e.arguments.map(e=>this.expression(e)).join(", ");if("Identifier"===e.callee.type){let n=e.callee.name,r=i(n);if(r&&"parent"===r.namespace.toLowerCase())if(this.currentClass)return"".concat(this.runtime,".parent(").concat(JSON.stringify(this.currentClass),", ").concat(JSON.stringify(r.method),", arguments[0]").concat(t?", "+t:"",")");else if(this.currentFunction)return"".concat(this.runtime,".parentFunc(").concat(JSON.stringify(this.currentFunction)).concat(t?", "+t:"",")");else throw Error("Parent:: call outside of function context");return r?"".concat(this.runtime,".nsCall(").concat(JSON.stringify(r.namespace),", ").concat(JSON.stringify(r.method)).concat(t?", "+t:"",")"):"".concat(this.functions,".call(").concat(JSON.stringify(n)).concat(t?", "+t:"",")")}if("MemberExpression"===e.callee.type){let n=this.expression(e.callee.object),r="Identifier"===e.callee.property.type?JSON.stringify(e.callee.property.name):this.expression(e.callee.property);return"".concat(this.runtime,".call(").concat(n,", ").concat(r).concat(t?", "+t:"",")")}let n=this.expression(e.callee);return"".concat(n,"(").concat(t,")")}memberExpression(e){let t=this.expression(e.object);return e.computed||"Identifier"!==e.property.type?"".concat(this.runtime,".prop(").concat(t,", ").concat(this.expression(e.property),")"):"".concat(this.runtime,".prop(").concat(t,", ").concat(JSON.stringify(e.property.name),")")}indexExpression(e){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let n=JSON.stringify(e.object.name),r="global"===e.object.scope?this.globals:this.locals;return"".concat(r,".get(").concat(n,", ").concat(t.join(", "),")")}if("MemberExpression"===e.object.type){let n=e.object,r=this.expression(n.object),i="Identifier"===n.property.type?JSON.stringify(n.property.name):this.expression(n.property),a="".concat(this.runtime,".key(").concat(i,", ").concat(t.join(", "),")");return"".concat(this.runtime,".prop(").concat(r,", ").concat(a,")")}let n=this.expression(e.object);return 1===t.length?"".concat(this.runtime,".getIndex(").concat(n,", ").concat(t[0],")"):"".concat(this.runtime,".getIndex(").concat(n,", ").concat(this.runtime,".key(").concat(t.join(", "),"))")}line(e){return this.indent.repeat(this.indentLevel)+e}concatExpression(e,t,n){switch(t){case"@":return"".concat(this.runtime,".concat(").concat(e,", ").concat(n,")");case"SPC":return"".concat(this.runtime,".concat(").concat(e,', " ", ').concat(n,")");case"TAB":return"".concat(this.runtime,".concat(").concat(e,', "\\t", ').concat(n,")");case"NL":return"".concat(this.runtime,".concat(").concat(e,', "\\n", ').concat(n,")");default:return null}}compoundAssignmentValue(e,t,n){let r=this.concatExpression(e,t,n);if(r)return r;let i=a[t];return i?"".concat(i,"(").concat(e,", ").concat(n,")"):"(".concat(e," ").concat(t," ").concat(n,")")}constructor(e={}){var t,n,i,a,s;r(this,"indent",void 0),r(this,"runtime",void 0),r(this,"functions",void 0),r(this,"globals",void 0),r(this,"locals",void 0),r(this,"indentLevel",0),r(this,"currentClass",null),r(this,"currentFunction",null),this.indent=null!=(t=e.indent)?t:" ",this.runtime=null!=(n=e.runtime)?n:"$",this.functions=null!=(i=e.functions)?i:"$f",this.globals=null!=(a=e.globals)?a:"$g",this.locals=null!=(s=e.locals)?s:"$l"}}e.s(["createRuntime",()=>E,"createScriptCache",()=>b],33870);var o=e.i(54970);class l{get size(){return this.map.size}get(e){let t=this.keyLookup.get(e.toLowerCase());return void 0!==t?this.map.get(t):void 0}set(e,t){let n=e.toLowerCase(),r=this.keyLookup.get(n);return void 0!==r?this.map.set(r,t):(this.keyLookup.set(n,e),this.map.set(e,t)),this}has(e){return this.keyLookup.has(e.toLowerCase())}delete(e){let t=e.toLowerCase(),n=this.keyLookup.get(t);return void 0!==n&&(this.keyLookup.delete(t),this.map.delete(n))}clear(){this.map.clear(),this.keyLookup.clear()}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}[Symbol.iterator](){return this.map[Symbol.iterator]()}forEach(e){for(let[t,n]of this.map)e(n,t,this)}get[Symbol.toStringTag](){return"CaseInsensitiveMap"}getOriginalKey(e){return this.keyLookup.get(e.toLowerCase())}constructor(e){if(r(this,"map",new Map),r(this,"keyLookup",new Map),e)for(let[t,n]of e)this.set(t,n)}}class u{get size(){return this.set.size}add(e){return this.set.add(e.toLowerCase()),this}has(e){return this.set.has(e.toLowerCase())}delete(e){return this.set.delete(e.toLowerCase())}clear(){this.set.clear()}[Symbol.iterator](){return this.set[Symbol.iterator]()}get[Symbol.toStringTag](){return"CaseInsensitiveSet"}constructor(e){if(r(this,"set",new Set),e)for(let t of e)this.add(t)}}function c(e){return e.replace(/\\/g,"/").toLowerCase()}function h(e){return String(null!=e?e:"")}function d(e){return Number(e)||0}function p(e){let t=h(e||"0 0 0").split(" ").map(Number);return[t[0]||0,t[1]||0,t[2]||0]}function f(e,t,n){let r=0;for(;t+r0;){if(r>=e.length)return"";let i=f(e,r,n);if(r+i>=e.length)return"";r+=i+1,t--}let i=f(e,r,n);return 0===i?"":e.substring(r,r+i)}function g(e,t,n,r){let i=0,a=t;for(;a>0;){if(i>=e.length)return"";let t=f(e,i,r);if(i+t>=e.length)return"";i+=t+1,a--}let s=i,o=n-t+1;for(;o>0;){let t=f(e,i,r);if((i+=t)>=e.length)break;i++,o--}let l=i;return l>s&&r.includes(e[l-1])&&l--,e.substring(s,l)}function v(e,t){if(""===e)return 0;let n=0;for(let r=0;rt&&s>=e.length)break}return a.join(i)}function _(e,t,n,r){let i=[],a=0,s=0;for(;a1?n-1:0),i=1;ih(e).replace(/\\([ntr\\])/g,(e,t)=>"n"===t?"\n":"t"===t?" ":"r"===t?"\r":"\\"),expandescape:e=>h(e).replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),export(e,t,n){console.warn("export(".concat(e,"): not implemented"))},quit(){console.warn("quit(): not implemented in browser")},trace(e){},isobject:e=>t().$.isObject(e),nametoid:e=>t().$.nameToId(e),strlen:e=>h(e).length,strchr(e,t){var n;let r=h(e),i=null!=(n=h(t)[0])?n:"",a=r.indexOf(i);return a>=0?r.substring(a):""},strpos:(e,t,n)=>h(e).indexOf(h(t),d(n)),strcmp(e,t){let n=h(e),r=h(t);return nr)},stricmp(e,t){let n=h(e).toLowerCase(),r=h(t).toLowerCase();return nr)},strstr:(e,t)=>h(e).indexOf(h(t)),getsubstr(e,t,n){let r=h(e),i=d(t);return void 0===n?r.substring(i):r.substring(i,i+d(n))},getword:(e,t)=>m(h(e),d(t)," \n"),getwordcount:e=>v(h(e)," \n"),getfield:(e,t)=>m(h(e),d(t)," \n"),getfieldcount:e=>v(h(e)," \n"),setword:(e,t,n)=>y(h(e),d(t),h(n)," \n"," "),setfield:(e,t,n)=>y(h(e),d(t),h(n)," \n"," "),firstword:e=>m(h(e),0," \n"),restwords:e=>g(h(e),1,1e6," \n"),trim:e=>h(e).trim(),ltrim:e=>h(e).replace(/^\s+/,""),rtrim:e=>h(e).replace(/\s+$/,""),strupr:e=>h(e).toUpperCase(),strlwr:e=>h(e).toLowerCase(),strreplace:(e,t,n)=>h(e).split(h(t)).join(h(n)),filterstring:(e,t)=>h(e),stripchars(e,t){let n=h(e),r=new Set(h(t).split(""));return n.split("").filter(e=>!r.has(e)).join("")},getfields(e,t,n){let r=void 0!==n?Number(n):1e6;return g(h(e),d(t),r," \n")},getwords(e,t,n){let r=void 0!==n?Number(n):1e6;return g(h(e),d(t),r," \n")},removeword:(e,t)=>_(h(e),d(t)," \n"," "),removefield:(e,t)=>_(h(e),d(t)," \n"," "),getrecord:(e,t)=>m(h(e),d(t),"\n"),getrecordcount:e=>v(h(e),"\n"),setrecord:(e,t,n)=>y(h(e),d(t),h(n),"\n","\n"),removerecord:(e,t)=>_(h(e),d(t),"\n","\n"),nexttoken(e,t,n){throw Error("nextToken() is not implemented: it requires variable mutation")},strtoplayername:e=>h(e).replace(/[^\w\s-]/g,"").trim(),mabs:e=>Math.abs(d(e)),mfloor:e=>Math.floor(d(e)),mceil:e=>Math.ceil(d(e)),msqrt:e=>Math.sqrt(d(e)),mpow:(e,t)=>Math.pow(d(e),d(t)),msin:e=>Math.sin(d(e)),mcos:e=>Math.cos(d(e)),mtan:e=>Math.tan(d(e)),masin:e=>Math.asin(d(e)),macos:e=>Math.acos(d(e)),matan:(e,t)=>Math.atan2(d(e),d(t)),mlog:e=>Math.log(d(e)),getrandom(e,t){if(void 0===e)return Math.random();if(void 0===t)return Math.floor(Math.random()*(d(e)+1));let n=d(e);return Math.floor(Math.random()*(d(t)-n+1))+n},mdegtorad:e=>d(e)*(Math.PI/180),mradtodeg:e=>d(e)*(180/Math.PI),mfloatlength:(e,t)=>d(e).toFixed(d(t)),getboxcenter(e){let t=h(e).split(" ").map(Number),n=t[0]||0,r=t[1]||0,i=t[2]||0,a=t[3]||0,s=t[4]||0,o=t[5]||0;return"".concat((n+a)/2," ").concat((r+s)/2," ").concat((i+o)/2)},vectoradd(e,t){let[n,r,i]=p(e),[a,s,o]=p(t);return"".concat(n+a," ").concat(r+s," ").concat(i+o)},vectorsub(e,t){let[n,r,i]=p(e),[a,s,o]=p(t);return"".concat(n-a," ").concat(r-s," ").concat(i-o)},vectorscale(e,t){let[n,r,i]=p(e),a=d(t);return"".concat(n*a," ").concat(r*a," ").concat(i*a)},vectordot(e,t){let[n,r,i]=p(e),[a,s,o]=p(t);return n*a+r*s+i*o},vectorcross(e,t){let[n,r,i]=p(e),[a,s,o]=p(t);return"".concat(r*o-i*s," ").concat(i*a-n*o," ").concat(n*s-r*a)},vectorlen(e){let[t,n,r]=p(e);return Math.sqrt(t*t+n*n+r*r)},vectornormalize(e){let[t,n,r]=p(e),i=Math.sqrt(t*t+n*n+r*r);return 0===i?"0 0 0":"".concat(t/i," ").concat(n/i," ").concat(r/i)},vectordist(e,t){let[n,r,i]=p(e),[a,s,o]=p(t),l=n-a,u=r-s,c=i-o;return Math.sqrt(l*l+u*u+c*c)},matrixcreate(e,t){throw Error("MatrixCreate() not implemented: requires axis-angle rotation math")},matrixcreatefromeuler(e){throw Error("MatrixCreateFromEuler() not implemented: requires Euler→Quaternion→AxisAngle conversion")},matrixmultiply(e,t){throw Error("MatrixMultiply() not implemented: requires full 4x4 matrix multiplication")},matrixmulpoint(e,t){throw Error("MatrixMulPoint() not implemented: requires full transform application")},matrixmulvector(e,t){throw Error("MatrixMulVector() not implemented: requires rotation matrix application")},getsimtime:()=>Date.now()-t().state.startTime,getrealtime:()=>Date.now(),schedule(e,n,r){for(var i=arguments.length,a=Array(i>3?i-3:0),s=3;s{l.state.pendingTimeouts.delete(u);try{l.$f.call(String(r),...a)}catch(e){throw console.error("schedule: error calling ".concat(r,":"),e),e}},o);return l.state.pendingTimeouts.add(u),u},cancel(e){clearTimeout(e),t().state.pendingTimeouts.delete(e)},iseventpending:e=>t().state.pendingTimeouts.has(e),exec(e){let n=String(null!=e?e:"");if(console.debug("exec(".concat(JSON.stringify(n),"): preparing to execute…")),!n.includes("."))return console.error("exec: invalid script file name ".concat(JSON.stringify(n),".")),!1;let r=c(n),i=t(),{executedScripts:a,scripts:s}=i.state;if(a.has(r))return console.debug("exec(".concat(JSON.stringify(n),"): skipping (already executed)")),!0;let o=s.get(r);return null==o?(console.warn("exec(".concat(JSON.stringify(n),"): script not found")),!1):(a.add(r),console.debug("exec(".concat(JSON.stringify(n),"): executing!")),i.executeAST(o),!0)},compile(e){throw Error("compile() not implemented: requires DSO bytecode compiler")},isdemo:()=>!1,isfile:e=>n?n.isFile(h(e)):(console.warn("isFile(): no fileSystem handler configured"),!1),fileext(e){let t=h(e),n=t.lastIndexOf(".");return n>=0?t.substring(n):""},filebase(e){let t=h(e),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),r=t.lastIndexOf("."),i=n>=0?n+1:0,a=r>i?r:t.length;return t.substring(i,a)},filepath(e){let t=h(e),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n>=0?t.substring(0,n):""},expandfilename(e){throw Error("expandFilename() not implemented: requires filesystem path expansion")},findfirstfile(e){var t;return n?(a=h(e),r=n.findFiles(a),i=0,null!=(t=r[i++])?t:""):(console.warn("findFirstFile(): no fileSystem handler configured"),"")},findnextfile(e){var t;let s=h(e);if(s!==a){if(!n)return"";a=s,r=n.findFiles(s)}return null!=(t=r[i++])?t:""},getfilecrc:e=>h(e),iswriteablefilename:e=>!1,activatepackage(e){t().$.activatePackage(h(e))},deactivatepackage(e){t().$.deactivatePackage(h(e))},ispackage:e=>t().$.isPackage(h(e)),isactivepackage:e=>t().$.isActivePackage(h(e)),getpackagelist:()=>t().$.getPackageList(),addmessagecallback(e,t){},alxcreatesource(){for(var e=arguments.length,t=Array(e),n=0;n0,alxlistenerf(e,t){},alxplay(){for(var e=arguments.length,t=Array(e),n=0;n!1,lockmouse(e){},addmaterialmapping(e,t){},flushtexturecache(){},getdesktopresolution:()=>"1920 1080 32",getdisplaydevicelist:()=>"OpenGL",getresolutionlist:e=>"640 480 800 600 1024 768 1280 720 1920 1080",getvideodriverinfo:()=>"WebGL",isdevicefullscreenonly:e=>!1,isfullscreen:()=>!1,screenshot(e){},setdisplaydevice:e=>!0,setfov(e){},setinteriorrendermode(e){},setopenglanisotropy(e){},setopenglmipreduction(e){},setopenglskymipreduction(e){},setopengltexturecompressionhint(e){},setscreenmode(e,t,n,r){},setverticalsync(e){},setzoomspeed(e){},togglefullscreen(){},videosetgammacorrection(e){},snaptoggle(){},addtaggedstring:e=>0,buildtaggedstring(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;rh(e),gettag:e=>0,gettaggedstring:e=>"",removetaggedstring(e){},commandtoclient(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i1?t-1:0),r=1;r!0,allowconnections(e){},startheartbeat(){},stopheartbeat(){},gotowebpage(e){},deletedatablocks(){},preloaddatablock:e=>!0,containerboxempty(){for(var e=arguments.length,t=Array(e),n=0;n0,containersearchnext:()=>0,initcontainerradiussearch(){for(var e=arguments.length,t=Array(e),n=0;n0,getcontrolobjectspeed:()=>0,getterrainheight:e=>0,lightscene(){for(var e=arguments.length,t=Array(e),n=0;n>>0}function w(e){if(null==e)return null;if("string"==typeof e)return e||null;if("number"==typeof e)return String(e);throw Error("Invalid instance name type: ".concat(typeof e))}function E(){var e,t,n;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=new l,a=new l,h=new l,d=[],p=new u,f=3,m=1027,g=new Map,v=new l,y=new l,_=new l,E=new l,T=new l;if(r.globals)for(let[e,t]of Object.entries(r.globals)){if(!e.startsWith("$"))throw Error('Global variable "'.concat(e,'" must start with $, e.g. "$').concat(e,'"'));_.set(e.slice(1),t)}let C=new Set,R=new Set,P=r.ignoreScripts&&r.ignoreScripts.length>0?(0,o.default)(r.ignoreScripts,{nocase:!0}):null,I=null!=(e=r.cache)?e:b(),L=I.scripts,N=I.generatedCode,D=new Map;function U(e){let t=D.get(e);return t&&t.length>0?t[t.length-1]:void 0}function O(e,t,n){let r;(r=D.get(e))||(r=[],D.set(e,r)),r.push(t);try{return n()}finally{let t=D.get(e);t&&t.pop()}}function F(e,t){return"".concat(e.toLowerCase(),"::").concat(t.toLowerCase())}function k(e,t){var n,r;return null!=(r=null==(n=i.get(e))?void 0:n.get(t))?r:null}let z=new Set,B=null,H=null,V=(null!=(t=r.builtins)?t:x)({runtime:()=>H,fileSystem:null!=(n=r.fileSystem)?n:null});function G(e){let t=h.get(e);if(!t)return void p.add(e);if(!t.active){for(let[e,n]of(t.active=!0,d.push(t.name),t.methods)){i.has(e)||i.set(e,new l);let t=i.get(e);for(let[e,r]of n)t.has(e)||t.set(e,[]),t.get(e).push(r)}for(let[e,n]of t.functions)a.has(e)||a.set(e,[]),a.get(e).push(n)}}function W(e){var t,n;return null==e||""===e?null:"object"==typeof e&&null!=e._id?e:"string"==typeof e?null!=(t=v.get(e))?t:null:"number"==typeof e&&null!=(n=g.get(e))?n:null}function j(e,t,n){let r=W(e);if(null==r)return 0;let i=J(r[t]);return r[t]=i+n,i}function X(e,t){let n=k(e,t);return n&&n.length>0?n[n.length-1]:null}function q(e,t,n,r){let i=k(e,t);return i&&0!==i.length?{found:!0,result:O(F(e,t),i.length-1,()=>i[i.length-1](n,...r))}:{found:!1}}function Y(e,t,n,r){let i=E.get(e);if(i){let e=i.get(t);if(e)for(let t of e)t(n,...r)}}function J(e){if(null==e||""===e)return 0;let t=Number(e);return isNaN(t)?0:t}function Z(e){if(!e||""===e)return null;e.startsWith("/")&&(e=e.slice(1));let t=e.split("/"),n=null;for(let e=0;e{var n;return(null==(n=t._name)?void 0:n.toLowerCase())===e});n=null!=t?t:null}if(!n)return null}}return n}function K(e){return null==e||""===e?null:Z(String(e))}function $(e){function t(e,t){return e+t.join("_")}return{get(n){for(var r,i=arguments.length,a=Array(i>1?i-1:0),s=1;s1?r-1:0),a=1;a1?r-1:0),a=1;a1?r-1:0),a=1;at.toLowerCase()===e.toLowerCase());for(let[e,r]of(-1!==n&&d.splice(n,1),t.methods)){let t=i.get(e);if(t)for(let[e,n]of r){let r=t.get(e);if(r){let e=r.indexOf(n);-1!==e&&r.splice(e,1)}}}for(let[e,n]of t.functions){let t=a.get(e);if(t){let e=t.indexOf(n);-1!==e&&t.splice(e,1)}}},create:function(e,t,n,r){let i=S(e),a=m++,s={_class:i,_className:e,_id:a};for(let[e,t]of Object.entries(n))s[S(e)]=t;s.superclass&&(s._superClass=S(String(s.superclass)),s.class&&T.set(S(String(s.class)),s._superClass)),g.set(a,s);let o=w(t);if(o&&(s._name=o,v.set(o,s)),r){for(let e of r)e._parent=s;s._children=r}let l=X(e,"onAdd");return l&&l(s),s},datablock:function(e,t,n,r){let i=S(e),a=f++,s={_class:i,_className:e,_id:a,_isDatablock:!0},o=w(n);if(o){let e=y.get(o);if(e){for(let[t,n]of Object.entries(e))t.startsWith("_")||(s[t]=n);s._parent=e}}for(let[e,t]of Object.entries(r))s[S(e)]=t;g.set(a,s);let l=w(t);return l&&(s._name=l,v.set(l,s),y.set(l,s)),s},deleteObject:function e(t){let n;if(null==t||("number"==typeof t?n=g.get(t):"string"==typeof t?n=v.get(t):"object"==typeof t&&t._id&&(n=t),!n))return!1;let r=X(n._className,"onRemove");if(r&&r(n),g.delete(n._id),n._name&&v.delete(n._name),n._isDatablock&&n._name&&y.delete(n._name),n._parent&&n._parent._children){let e=n._parent._children.indexOf(n);-1!==e&&n._parent._children.splice(e,1)}if(n._children)for(let t of[...n._children])e(t);return!0},prop:function(e,t){var n;let r=W(e);return null==r?"":null!=(n=r[S(t)])?n:""},setProp:function(e,t,n){let r=W(e);return null==r||(r[S(t)]=n),n},getIndex:function(e,t){var n;let r=W(e);return null==r?"":null!=(n=r[String(t)])?n:""},setIndex:function(e,t,n){let r=W(e);return null==r||(r[String(t)]=n),n},propPostInc:function(e,t){return j(e,S(t),1)},propPostDec:function(e,t){return j(e,S(t),-1)},indexPostInc:function(e,t){return j(e,String(t),1)},indexPostDec:function(e,t){return j(e,String(t),-1)},key:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r2?n-2:0),i=2;i2?n-2:0),i=2;io(...r)),u=r[0];return u&&"object"==typeof u&&Y(e,t,u,r.slice(1)),l},nsRef:function(e,t){let n=k(e,t);if(!n||0===n.length)return null;let r=F(e,t),i=n[n.length-1];return function(){for(var e=arguments.length,t=Array(e),a=0;ai(...t))}},parent:function(e,t,n){for(var r=arguments.length,i=Array(r>3?r-3:0),a=3;a=1){let r=l-1,a=O(o,r,()=>s[r](n,...i));return n&&"object"==typeof n&&Y(e,t,n,i),a}let u=T.get(e);for(;u;){let e=k(u,t);if(e&&e.length>0){let r=O(F(u,t),e.length-1,()=>e[e.length-1](n,...i));return n&&"object"==typeof n&&Y(u,t,n,i),r}u=T.get(u)}return""},parentFunc:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;ri[l](...n))},add:function(e,t){return J(e)+J(t)},sub:function(e,t){return J(e)-J(t)},mul:function(e,t){return J(e)*J(t)},div:function(e,t){return J(e)/J(t)},neg:function(e){return-J(e)},lt:function(e,t){return J(e)J(t)},ge:function(e,t){return J(e)>=J(t)},eq:function(e,t){return J(e)===J(t)},ne:function(e,t){return J(e)!==J(t)},mod:function(e,t){let n=0|Number(t);return 0===n?0:(0|Number(e))%n},bitand:function(e,t){return M(e)&M(t)},bitor:function(e,t){return M(e)|M(t)},bitxor:function(e,t){return M(e)^M(t)},shl:function(e,t){return M(M(e)<<(31&M(t)))},shr:function(e,t){return M(e)>>>(31&M(t))},bitnot:function(e){return~M(e)>>>0},concat:function(){for(var e=arguments.length,t=Array(e),n=0;nString(null!=e?e:"")).join("")},streq:function(e,t){return String(null!=e?e:"").toLowerCase()===String(null!=t?t:"").toLowerCase()},switchStr:function(e,t){let n=String(null!=e?e:"").toLowerCase();for(let[e,r]of Object.entries(t))if("default"!==e&&S(e)===n)return void r();t.default&&t.default()},deref:K,nameToId:function(e){let t=Z(e);return t?t._id:-1},isObject:function(e){return null!=e&&("object"==typeof e&&!!e._id||("number"==typeof e?g.has(e):"string"==typeof e&&v.has(e)))},isFunction:function(e){return a.has(e)||e.toLowerCase()in V},isPackage:function(e){return h.has(e)},isActivePackage:function(e){var t;let n=h.get(e);return null!=(t=null==n?void 0:n.active)&&t},getPackageList:function(){return d.join(" ")},locals:Q,onMethodCalled(e,t,n){let r=E.get(e);r||(r=new l,E.set(e,r));let i=r.get(t);i||(i=[],r.set(t,i)),i.push(n)}},et={call(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r0)return O(e.toLowerCase(),i.length-1,()=>i[i.length-1](...n));let s=V[e.toLowerCase()];return s?s(...n):(console.warn("Unknown function: ".concat(e,"(").concat(n.map(e=>JSON.stringify(e)).join(", "),")")),"")}},en=$(_),er={methods:i,functions:a,packages:h,activePackages:d,objectsById:g,objectsByName:v,datablocks:y,globals:_,executedScripts:C,failedScripts:R,scripts:L,generatedCode:N,pendingTimeouts:z,startTime:Date.now()};function ei(e){let t=function(e){let t=N.get(e);null==t&&(t=new s(void 0).generate(e),N.set(e,t));return t}(e),n=Q();Function("$","$f","$g","$l",t)(ee,et,en,n)}function ea(e,t){return{execute(){if(t){let e=c(t);er.executedScripts.add(e)}ei(e)}}}async function es(e,t,n){let i=r.loadScript;if(!i){e.length>0&&console.warn("Script has exec() calls but no loadScript provided:",e);return}async function a(e){var a,s;null==(a=r.signal)||a.throwIfAborted();let o=c(e);if(er.scripts.has(o)||er.failedScripts.has(o))return;if(P&&P(o)){console.warn("Ignoring script: ".concat(e)),er.failedScripts.add(o);return}if(n.has(o))return;let l=t.get(o);if(l)return void await l;null==(s=r.progress)||s.addItem(e);let u=(async()=>{var a,s,l;let u,c=await i(e);if(null==c){console.warn("Script not found: ".concat(e)),er.failedScripts.add(o),null==(s=r.progress)||s.completeItem();return}try{u=A(c,{filename:e})}catch(t){console.warn("Failed to parse script: ".concat(e),t),er.failedScripts.add(o),null==(l=r.progress)||l.completeItem();return}let h=new Set(n);h.add(o),await es(u.execScriptPaths,t,h),er.scripts.set(o,u),null==(a=r.progress)||a.completeItem()})();t.set(o,u),await u}await Promise.all(e.map(a))}async function eo(e){var t,n,i;let a=r.loadScript;if(!a)throw Error("loadFromPath requires loadScript option to be set");let s=c(e);if(er.scripts.has(s))return ea(er.scripts.get(s),e);null==(t=r.progress)||t.addItem(e);let o=await a(e);if(null==o)throw null==(i=r.progress)||i.completeItem(),Error("Script not found: ".concat(e));let l=await el(o,{path:e});return null==(n=r.progress)||n.completeItem(),l}async function el(e,t){if(null==t?void 0:t.path){let e=c(t.path);if(er.scripts.has(e))return ea(er.scripts.get(e),t.path)}return eu(A(e,{filename:null==t?void 0:t.path}),t)}async function eu(e,t){var n;let i=new Map,a=new Set;if(null==t?void 0:t.path){let n=c(t.path);er.scripts.set(n,e),a.add(n)}let s=[...e.execScriptPaths,...null!=(n=r.preloadScripts)?n:[]];return await es(s,i,a),ea(e,null==t?void 0:t.path)}return H={$:ee,$f:et,$g:en,state:er,destroy:function(){for(let e of er.pendingTimeouts)clearTimeout(e);er.pendingTimeouts.clear()},executeAST:ei,loadFromPath:eo,loadFromSource:el,loadFromAST:eu,call:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;rv.get(e)}}function T(){let e=new Set,t=0,n=0,r=null;function i(){for(let t of e)t()}return{get total(){return t},get loaded(){return n},get current(){return r},get progress(){return 0===t?0:n/t},on(t,n){e.add(n)},off(t,n){e.delete(n)},addItem(e){t++,r=e,i()},completeItem(){n++,r=null,i()},setCurrent(e){r=e,i()}}}function A(e,t){try{return n.default.parse(e)}catch(e){if((null==t?void 0:t.filename)&&e.location)throw Error("".concat(t.filename,":").concat(e.location.start.line,":").concat(e.location.start.column,": ").concat(e.message),{cause:e});throw e}}function C(e){let{missionName:t,missionType:n,runtimeOptions:r,onMissionLoadDone:i}=e,{signal:a,fileSystem:s}=null!=r?r:{},o=E({...r,globals:{...null==r?void 0:r.globals,"$Host::Map":t,"$Host::MissionType":n}}),l="".concat(n,"Game"),u="scripts/".concat(l,".cs"),c=async function(){try{let e=await o.loadFromPath("scripts/server.cs");null==a||a.throwIfAborted(),await o.loadFromPath("scripts/DefaultGame.cs"),null==a||a.throwIfAborted();try{await o.loadFromPath(u)}catch(e){}null==a||a.throwIfAborted(),await o.loadFromPath("missions/".concat(t,".mis")),null==a||a.throwIfAborted(),e.execute(),i&&o.$.onMethodCalled("DefaultGame","missionLoadDone",i);let n=await o.loadFromSource("CreateServer($Host::Map, $Host::MissionType);");null==a||a.throwIfAborted(),n.execute()}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}}();return{runtime:o,ready:c}}e.s(["createProgressTracker",()=>T],38433);let R=/^[ \t]*(DisplayName|MissionTypes|BriefingWAV|Bitmap|PlanetName)[ \t]*=[ \t]*(.+)$/i,P=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+BEGIN[ \t]*-+$/i,I=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+END[ \t]*-+$/i;function L(e){var t,n,r,i,a,s;let o=A(e),{pragma:l,sections:u}=function(e){let t={},n=[],r={name:null,comments:[]};for(let i of e.body)if("Comment"===i.type){let e=function(e){let t;return(t=e.match(P))?{type:"sectionBegin",name:t[1]}:(t=e.match(I))?{type:"sectionEnd",name:t[1]}:(t=e.match(R))?{type:"definition",identifier:t[1],value:t[2]}:null}(i.value);if(e)switch(e.type){case"definition":null===r.name?t[e.identifier.toLowerCase()]=e.value:r.comments.push(i.value);break;case"sectionBegin":(null!==r.name||r.comments.length>0)&&n.push(r),r={name:e.name.toUpperCase(),comments:[]};break;case"sectionEnd":null!==r.name&&n.push(r),r={name:null,comments:[]}}else r.comments.push(i.value)}return(null!==r.name||r.comments.length>0)&&n.push(r),{pragma:t,sections:n}}(o);function c(e){var t,n;return null!=(n=null==(t=u.find(t=>t.name===e))?void 0:t.comments.map(e=>e.trimStart()).join("\n"))?n:null}return{displayName:null!=(n=l.displayname)?n:null,missionTypes:null!=(r=null==(t=l.missiontypes)?void 0:t.split(/\s+/).filter(Boolean))?r:[],missionBriefing:c("MISSION BRIEFING"),briefingWav:null!=(i=l.briefingwav)?i:null,bitmap:null!=(a=l.bitmap)?a:null,planetName:null!=(s=l.planetname)?s:null,missionBlurb:c("MISSION BLURB"),missionQuote:c("MISSION QUOTE"),missionString:c("MISSION STRING"),execScriptPaths:o.execScriptPaths,hasDynamicExec:o.hasDynamicExec,ast:o}}function N(e,t){if(e)return e[t.toLowerCase()]}function D(e,t){let n=e[t.toLowerCase()];return null==n?n:parseFloat(n)}function U(e,t){let n=e[t.toLowerCase()];return null==n?n:parseInt(n,10)}function O(e){var t;let[n,r,i]=(null!=(t=e.position)?t:"0 0 0").split(" ").map(e=>parseFloat(e));return[r||0,i||0,n||0]}function F(e){var t;let[n,r,i]=(null!=(t=e.scale)?t:"1 1 1").split(" ").map(e=>parseFloat(e));return[r||0,i||0,n||0]}function k(e){var n;let[r,i,a,s]=(null!=(n=e.rotation)?n:"1 0 0 0").split(" ").map(e=>parseFloat(e)),o=new t.Vector3(i,a,r).normalize(),l=-(Math.PI/180*s);return new t.Quaternion().setFromAxisAngle(o,l)}},12979,e=>{"use strict";e.s(["BASE_URL",()=>a,"FALLBACK_TEXTURE_URL",()=>o,"audioToUrl",()=>f,"getUrlForPath",()=>l,"iflTextureToUrl",()=>d,"interiorToUrl",()=>u,"loadDetailMapList",()=>m,"loadImageFrameList",()=>y,"loadMission",()=>g,"loadTerrain",()=>v,"shapeToUrl",()=>c,"terrainTextureToUrl",()=>h,"textureToUrl",()=>p],12979);var t=e.i(98223),n=e.i(91996),r=e.i(62395),i=e.i(71726);let a="/t2-mapper",s="".concat(a,"/base/"),o="".concat(a,"/magenta.png");function l(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(n){if(t)return console.warn('Resource "'.concat(e,'" not found - rendering fallback.')),t;throw n}let[i,a]=(0,n.getSourceAndPath)(r);return i?"".concat(s,"@vl2/").concat(i,"/").concat(a):"".concat(s).concat(a)}function u(e){return l("interiors/".concat(e)).replace(/\.dif$/i,".glb")}function c(e){return l("shapes/".concat(e)).replace(/\.dts$/i,".glb")}function h(e){return e=e.replace(/^terrain\./,""),l((0,n.getStandardTextureResourceKey)("textures/terrain/".concat(e)),o)}function d(e,t){let r=(0,i.normalizePath)(t).split("/"),a=r.length>1?r.slice(0,-1).join("/")+"/":"",s="".concat(a).concat(e);return l((0,n.getStandardTextureResourceKey)(s),o)}function p(e){return l((0,n.getStandardTextureResourceKey)("textures/".concat(e)),o)}function f(e){return l("audio/".concat(e))}async function m(e){let t=l("textures/".concat(e)),n=await fetch(t);return(await n.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function g(e){let t=(0,n.getMissionInfo)(e),i=await fetch(l(t.resourcePath)),a=await i.text();return(0,r.parseMissionScript)(a)}async function v(e){let t=await fetch(l("terrains/".concat(e)));return function(e){let t=new DataView(e),n=0,r=t.getUint8(n++),i=new Uint16Array(65536),a=[],s=e=>{let r="";for(let i=0;i0&&a.push(i)}let o=[];for(let e of a){let e=new Uint8Array(65536);for(let r=0;r<65536;r++){var l=t.getUint8(n++);e[r]=l}o.push(e)}return{version:r,textureNames:a,heightMap:i,alphaMaps:o}}(await t.arrayBuffer())}async function y(e){let n=l(e),r=await fetch(n),i=await r.text();return(0,t.parseImageFileList)(i)}},5230,e=>{"use strict";e.s(["useFrame",()=>t.D]);var t=e.i(46712)},16096,e=>{"use strict";e.s(["useThree",()=>t.C]);var t=e.i(46712)},79123,e=>{"use strict";e.s(["SettingsProvider",()=>u,"useControls",()=>l,"useDebug",()=>o,"useSettings",()=>s]);var t=e.i(43476),n=e.i(71645);let r=(0,n.createContext)(null),i=(0,n.createContext)(null),a=(0,n.createContext)(null);function s(){return(0,n.useContext)(r)}function o(){return(0,n.useContext)(i)}function l(){return(0,n.useContext)(a)}function u(e){let{children:s}=e,[o,l]=(0,n.useState)(!0),[u,c]=(0,n.useState)(!1),[h,d]=(0,n.useState)(1),[p,f]=(0,n.useState)(90),[m,g]=(0,n.useState)(!1),[v,y]=(0,n.useState)(!0),[_,x]=(0,n.useState)(!1),b=(0,n.useMemo)(()=>({fogEnabled:o,setFogEnabled:l,highQualityFog:u,setHighQualityFog:c,fov:p,setFov:f,audioEnabled:m,setAudioEnabled:g,animationEnabled:v,setAnimationEnabled:y}),[o,u,p,m,v]),S=(0,n.useMemo)(()=>({debugMode:_,setDebugMode:x}),[_,x]),M=(0,n.useMemo)(()=>({speedMultiplier:h,setSpeedMultiplier:d}),[h,d]);(0,n.useEffect)(()=>{let e={};try{e=JSON.parse(localStorage.getItem("settings"))||{}}catch(e){}null!=e.debugMode&&x(e.debugMode),null!=e.audioEnabled&&g(e.audioEnabled),null!=e.animationEnabled&&y(e.animationEnabled),null!=e.fogEnabled&&l(e.fogEnabled),null!=e.highQualityFog&&c(e.highQualityFog),null!=e.speedMultiplier&&d(e.speedMultiplier),null!=e.fov&&f(e.fov)},[]);let w=(0,n.useRef)(null);return(0,n.useEffect)(()=>(w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{try{localStorage.setItem("settings",JSON.stringify({fogEnabled:o,highQualityFog:u,speedMultiplier:h,fov:p,audioEnabled:m,animationEnabled:v,debugMode:_}))}catch(e){}},500),()=>{w.current&&clearTimeout(w.current)}),[o,u,h,p,m,v,_]),(0,t.jsx)(r.Provider,{value:b,children:(0,t.jsx)(i.Provider,{value:S,children:(0,t.jsx)(a.Provider,{value:M,children:s})})})}}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24478,(e,t,n)=>{"use strict";n.ConcurrentRoot=1,n.ContinuousEventPriority=8,n.DefaultEventPriority=32,n.DiscreteEventPriority=2,n.IdleEventPriority=0x10000000,n.LegacyRoot=0,n.NoEventPriority=0},39695,(e,t,n)=>{"use strict";t.exports=e.r(24478)},55838,(e,t,n)=>{"use strict";var r=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,s=r.useEffect,o=r.useLayoutEffect,l=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,c=r[1];return o(function(){i.value=n,i.getSnapshot=t,u(i)&&c({inst:i})},[e,n,t]),s(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),l(n),n};n.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},2239,(e,t,n)=>{"use strict";t.exports=e.r(55838)},52822,(e,t,n)=>{"use strict";var r=e.r(71645),i=e.r(2239),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=i.useSyncExternalStore,o=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;n.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var h=o(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;var p=s(e,(h=u(function(){function e(e){if(!l){if(l=!0,s=e,e=r(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return o=t}return o=e}if(t=o,a(s,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(s=e,t):(s=e,o=n)}var s,o,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,n,r,i]))[0],h[1]);return l(function(){d.hasValue=!0,d.value=p},[p]),c(p),p}},30224,(e,t,n)=>{"use strict";t.exports=e.r(52822)},29779,(e,t,n)=>{"use strict";function r(e,t){var n=e.length;for(e.push(t);0>>1,i=e[r];if(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[o]=n,r=o);else if(us(c,n))e[r]=c,e[u]=n,r=u;else break}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(n.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();n.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,f=null,m=3,g=!1,v=!1,y=!1,_="function"==typeof setTimeout?setTimeout:null,x="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=i(d);null!==t;){if(null===t.callback)a(d);else if(t.startTime<=e)a(d),t.sortIndex=t.expirationTime,r(h,t);else break;t=i(d)}}function M(e){if(y=!1,S(e),!v)if(null!==i(h))v=!0,L();else{var t=i(d);null!==t&&N(M,t.startTime-e)}}var w=!1,E=-1,T=5,A=-1;function C(){return!(n.unstable_now()-Ae&&C());){var s=f.callback;if("function"==typeof s){f.callback=null,m=f.priorityLevel;var l=s(f.expirationTime<=e);if(e=n.unstable_now(),"function"==typeof l){f.callback=l,S(e),t=!0;break t}f===i(h)&&a(h),S(e)}else a(h);f=i(h)}if(null!==f)t=!0;else{var u=i(d);null!==u&&N(M,u.startTime-e),t=!1}}break e}finally{f=null,m=r,g=!1}}}finally{t?o():w=!1}}}if("function"==typeof b)o=function(){b(R)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,I=P.port2;P.port1.onmessage=R,o=function(){I.postMessage(null)}}else o=function(){_(R,0)};function L(){w||(w=!0,o())}function N(e,t){E=_(function(){e(n.unstable_now())},t)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(e){e.callback=null},n.unstable_continueExecution=function(){v||g||(v=!0,L())},n.unstable_forceFrameRate=function(e){0>e||125s?(e.sortIndex=a,r(d,e),null===i(h)&&e===i(d)&&(y?(x(E),E=-1):y=!0,N(M,a-s))):(e.sortIndex=o,r(h,e),v||g||(v=!0,L())),e},n.unstable_shouldYield=C,n.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}},51849,(e,t,n)=>{"use strict";t.exports=e.r(29779)},40336,(e,t,n)=>{"use strict";var r=e.i(47167);t.exports=function(t){function n(e,t,n,r){return new rP(e,t,n,r)}function i(){}function a(e){var t="https://react.dev/errors/"+e;if(1)":-1i||u[r]!==c[i]){var h="\n"+u[r].replace(" at new "," at ");return e.displayName&&h.includes("")&&(h=h.replace("",e.displayName)),h}while(1<=r&&0<=i)break}}}finally{io=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?l(n):""}function c(e){try{var t="";do t+=function(e){switch(e.tag){case 26:case 27:case 5:return l(e.type);case 16:return l("Lazy");case 13:return l("Suspense");case 19:return l("SuspenseList");case 0:case 15:return u(e.type,!1);case 11:return u(e.type.render,!1);case 1:return u(e.type,!0);default:return""}}(e),e=e.return;while(e)return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}function h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do 0!=(4098&(t=e).flags)&&(n=t.return),e=t.return;while(e)}return 3===t.tag?n:null}function d(e){if(h(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(null===(t=h(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(r=i.return)){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return d(i),e;if(s===r)return d(i),t;s=s.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){return{current:e}}function m(e){0>a4||(e.current=a3[a4],a3[a4]=null,a4--)}function g(e,t){a3[++a4]=e.current,e.current=t}function v(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194176&e;case 4194304:case 8388608:case 0x1000000:case 0x2000000:return 0x3c00000&e;case 0x4000000:return 0x4000000;case 0x8000000:return 0x8000000;case 0x10000000:return 0x10000000;case 0x20000000:return 0x20000000;case 0x40000000:return 0;default:return e}}function y(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,s=e.warmLanes;e=0!==e.finishedLanes;var o=0x7ffffff&n;return 0!==o?0!=(n=o&~i)?r=v(n):0!=(a&=o)?r=v(a):e||0!=(s=o&~s)&&(r=v(s)):0!=(o=n&~i)?r=v(o):0!==a?r=v(a):e||0!=(s=n&~s)&&(r=v(s)),0===r?0:0!==t&&t!==r&&0==(t&i)&&((i=r&-r)>=(s=t&-t)||32===i&&0!=(4194176&s))?t:r}function _(e,t){return 0==(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function x(){var e=a7;return 0==(4194176&(a7<<=1))&&(a7=128),e}function b(){var e=se;return 0==(0x3c00000&(se<<=1))&&(se=4194304),e}function S(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function M(e,t){e.pendingLanes|=t,0x10000000!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function w(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-a6(t);e.entangledLanes|=t,e.entanglements[r]=0x40000000|e.entanglements[r]|4194218&n}function E(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-a6(n),i=1<>=s,i-=s,sb=1<<32-a6(t)+i|n<d?(p=h,h=null):p=h.sibling;var v=m(n,h,s[d],o);if(null===v){null===h&&(h=p);break}e&&h&&null===v.alternate&&t(n,h),a=l(v,a,d),null===c?u=v:c.sibling=v,c=v,h=p}if(d===s.length)return r(n,h),sR&&C(n,d),u;if(null===h){for(;dp?(v=d,d=null):v=d.sibling;var _=m(n,d,y.value,u);if(null===_){null===d&&(d=v);break}e&&d&&null===_.alternate&&t(n,d),s=l(_,s,p),null===h?c=_:h.sibling=_,h=_,d=v}if(y.done)return r(n,d),sR&&C(n,p),c;if(null===d){for(;!y.done;p++,y=o.next())null!==(y=f(n,y.value,u))&&(s=l(y,s,p),null===h?c=y:h.sibling=y,h=y);return sR&&C(n,p),c}for(d=i(d);!y.done;p++,y=o.next())null!==(y=g(d,n,p,y.value,u))&&(e&&null!==y.alternate&&d.delete(null===y.key?p:y.key),s=l(y,s,p),null===h?c=y:h.sibling=y,h=y);return e&&d.forEach(function(e){return t(n,e)}),sR&&C(n,p),c}(c,h,d=v.call(d),p)}if("function"==typeof d.then)return n(c,h,ev(d),p);if(d.$$typeof===r3)return n(c,h,nl(c,d),p);e_(c,d)}return"string"==typeof d&&""!==d||"number"==typeof d||"bigint"==typeof d?(d=""+d,null!==h&&6===h.tag?(r(c,h.sibling),(p=o(h,d)).return=c):(r(c,h),(p=rF(d,c.mode,p)).return=c),u(c=p)):r(c,h)}(c,h,d,p);return sQ=null,v}catch(e){if(e===sJ)throw e;var y=n(29,e,null,c.mode);return y.lanes=p,y.return=c,y}finally{}}}function eS(e,t){g(s4,e=o1),g(s3,t),o1=e|t.baseLanes}function eM(){g(s4,o1),g(s3,s3.current)}function ew(){o1=s4.current,m(s3),m(s4)}function eE(e){var t=e.alternate;g(s8,1&s8.current),g(s5,e),null===s6&&(null===t||null!==s3.current?s6=e:null!==t.memoizedState&&(s6=e))}function eT(e){if(22===e.tag){if(g(s8,s8.current),g(s5,e),null===s6){var t=e.alternate;null!==t&&null!==t.memoizedState&&(s6=e)}}else eA(e)}function eA(){g(s8,s8.current),g(s5,s5.current)}function eC(e){m(s5),s6===e&&(s6=null),m(s8)}function eR(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||ap(n)||af(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function eP(){throw Error(a(321))}function eI(e,t){if(null===t)return!1;for(var n=0;na?a:8);var s=is.T,o={};is.T=o,tC(e,!1,t,n);try{var l=i(),u=is.S;if(null!==u&&u(o,l),null!==l&&"object"==typeof l&&"function"==typeof l.then){var c,h,d=(c=[],h={status:"pending",value:null,reason:null,then:function(e){c.push(e)}},l.then(function(){h.status="fulfilled",h.value=r;for(var e=0;e";case oB:return":has("+(n6(e)||"")+")";case oH:return'[role="'+e.value+'"]';case oG:return'"'+e.value+'"';case oV:return'[data-testname="'+e.value+'"]';default:throw Error(a(365))}}function n8(e,t){var n=[];e=[e,0];for(var r=0;rln&&(t.flags|=128,r=!0,nM(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=eR(s))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,nS(t,e),nM(i,!0),null===i.tail&&"hidden"===i.tailMode&&!s.alternate&&!sR)return nw(t),null}else 2*sa()-i.renderingStartTime>ln&&0x20000000!==n&&(t.flags|=128,r=!0,nM(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=i.last)?e.sibling=s:t.child=s,i.last=s)}if(null!==i.tail)return t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=sa(),t.sibling=null,e=s8.current,g(s8,r?1&e|2:1&e),t;return nw(t),null;case 22:case 23:return eC(t),ew(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?0!=(0x20000000&n)&&0==(128&t.flags)&&(nw(t),6&t.subtreeFlags&&(t.flags|=8192)):nw(t),null!==(n=t.updateQueue)&&nS(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&m(oA),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),nt(oE),nw(t),null;case 25:return null}throw Error(a(156,t.tag))}(t.alternate,t,o1);if(null!==n){oY=n;return}if(null!==(t=t.sibling)){oY=t;return}oY=t=e}while(null!==t)0===o2&&(o2=5)}function r_(e,t){do{var n=function(e,t){switch(I(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return nt(oE),N(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return U(t),null;case 13:if(eC(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));B()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return m(s8),null;case 4:return N(),null;case 10:return nt(t.type),null;case 22:case 23:return eC(t),ew(),null!==e&&m(oA),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return nt(oE),null;default:return null}}(e.alternate,e);if(null!==n){n.flags&=32767,oY=n;return}if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling)){oY=e;return}oY=e=n}while(null!==e)o2=6,oY=null}function rx(e,t,n,r,i,s,o,l,u,c){var h=is.T,d=iN();try{iL(2),is.T=null,function(e,t,n,r,i,s,o,l){do rS();while(null!==ls)if(0!=(6&oX))throw Error(a(327));var u,c,h=e.finishedWork;if(r=e.finishedLanes,null!==h){if(e.finishedWork=null,e.finishedLanes=0,h===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var d=h.lanes|h.childLanes;!function(e,t,n,r,i,a){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=s&~n;0n?32:n;n=is.T;var i=iN();try{if(iL(r),is.T=null,null===ls)var s=!1;else{r=lu,lu=null;var o=ls,l=lo;if(ls=null,lo=0,0!=(6&oX))throw Error(a(331));var u=oX;if(oX|=4,n2(o.current),nZ(o,o.current,l,r),oX=u,J(0,!1),sh&&"function"==typeof sh.onPostCommitFiberRoot)try{sh.onPostCommitFiberRoot(sc,o)}catch(e){}s=!0}return s}finally{iL(i),is.T=n,rb(e,t)}}return!1}function rM(e,t,n){t=A(n,t),t=tk(e.stateNode,t,2),null!==(e=ea(e,t,2))&&(M(e,2),Y(e))}function rw(e,t,n){if(3===e.tag)rM(e,e,n);else for(;null!==t;){if(3===t.tag){rM(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===li||!li.has(r))){e=A(n,e),null!==(r=ea(t,n=tz(2),2))&&(tB(n,r,t,e),M(r,2),Y(r));break}}t=t.return}}function rE(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new oj;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(o0=!0,i.add(n),e=rT.bind(null,e,t,n),t.then(e,e))}function rT(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,oq===e&&(oJ&n)===n&&(4===o2||3===o2&&(0x3c00000&oJ)===oJ&&300>sa()-lt?0==(2&oX)&&rl(e,0):o5|=n,o8===oJ&&(o8=0)),Y(e)}function rA(e,t){0===t&&(t=b()),null!==(e=j(e,t))&&(M(e,t),Y(e))}function rC(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),rA(e,n)}function rR(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}null!==r&&r.delete(t),rA(e,n)}function rP(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rI(e){return!(!(e=e.prototype)||!e.isReactComponent)}function rL(e,t){var r=e.alternate;return null===r?((r=n(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=0x1e00000&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function rN(e,t){e.flags&=0x1e00002;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,e.dependencies=null===(t=n.dependencies)?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function rD(e,t,r,i,s,o){var l=0;if(i=e,"function"==typeof e)rI(e)&&(l=1);else if("string"==typeof e)l=aF&&aK?ak(e,r,sM.current)?26:a2(e)?27:5:aF?ak(e,r,sM.current)?26:5:aK&&a2(e)?27:5;else e:switch(e){case r$:return rU(r.children,s,o,t);case rQ:l=8,s|=24;break;case r0:return(e=n(12,r,t,2|s)).elementType=r0,e.lanes=o,e;case r5:return(e=n(13,r,t,s)).elementType=r5,e.lanes=o,e;case r6:return(e=n(19,r,t,s)).elementType=r6,e.lanes=o,e;case r7:return rO(r,s,o,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case r1:case r3:l=10;break e;case r2:l=9;break e;case r4:l=11;break e;case r8:l=14;break e;case r9:l=16,i=null;break e}l=29,r=Error(a(130,null===e?"null":typeof e,"")),i=null}return(t=n(l,r,t,s)).elementType=e,t.type=i,t.lanes=o,t}function rU(e,t,r,i){return(e=n(7,e,i,t)).lanes=r,e}function rO(e,t,r,i){(e=n(22,e,i,t)).elementType=r7,e.lanes=r;var s={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var e=s._current;if(null===e)throw Error(a(456));if(0==(2&s._pendingVisibility)){var t=j(e,2);null!==t&&(s._pendingVisibility|=2,rt(t,e,2))}},attach:function(){var e=s._current;if(null===e)throw Error(a(456));if(0!=(2&s._pendingVisibility)){var t=j(e,2);null!==t&&(s._pendingVisibility&=-3,rt(t,e,2))}}};return e.stateNode=s,e}function rF(e,t,r){return(e=n(6,e,null,t)).lanes=r,e}function rk(e,t,r){return(t=n(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rz(e,t,n,r,i,a,s,o){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=iE,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=S(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=S(0),this.hiddenUpdates=S(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function rB(e,t,r,i,a,s,o,l,u,c,h,d){return e=new rz(e,t,r,o,l,u,c,d),t=1,!0===s&&(t|=24),s=n(3,null,null,t),e.current=s,s.stateNode=e,t=nc(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:i,isDehydrated:r,cache:t},en(s),e}function rH(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw Error(a(268,e=Object.keys(e).join(",")))}return null===(e=null!==(e=p(t))?function e(t){var n=t.tag;if(5===n||26===n||27===n||6===n)return t;for(t=t.child;null!==t;){if(null!==(n=e(t)))return n;t=t.sibling}return null}(e):null)?null:id(e.stateNode)}function rV(e,t,n,r,i,a){i=i?a5:a5,null===r.context?r.context=i:r.pendingContext=i,(r=ei(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(r.callback=a),null!==(n=ea(e,r,t))&&(rt(n,e,t),es(n,e,t))}function rG(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n>>=0)?32:31-(a8(e)/a9|0)|0},a8=Math.log,a9=Math.LN2,a7=128,se=4194304,st=rq.unstable_scheduleCallback,sn=rq.unstable_cancelCallback,sr=rq.unstable_shouldYield,si=rq.unstable_requestPaint,sa=rq.unstable_now,ss=rq.unstable_ImmediatePriority,so=rq.unstable_UserBlockingPriority,sl=rq.unstable_NormalPriority,su=rq.unstable_IdlePriority,sc=(rq.log,rq.unstable_setDisableYieldValue,null),sh=null,sd="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},sp=new WeakMap,sf=[],sm=0,sg=null,sv=0,sy=[],s_=0,sx=null,sb=1,sS="",sM=f(null),sw=f(null),sE=f(null),sT=f(null),sA=null,sC=null,sR=!1,sP=null,sI=!1,sL=Error(a(519)),sN=[],sD=0,sU=0,sO=null,sF=null,sk=!1,sz=!1,sB=!1,sH=0,sV=null,sG=0,sW=0,sj=null,sX=!1,sq=!1,sY=Object.prototype.hasOwnProperty,sJ=Error(a(460)),sZ=Error(a(474)),sK={then:function(){}},s$=null,sQ=null,s0=0,s1=eb(!0),s2=eb(!1),s3=f(null),s4=f(0),s5=f(null),s6=null,s8=f(0),s9=0,s7=null,oe=null,ot=null,on=!1,or=!1,oi=!1,oa=0,os=0,oo=null,ol=0,ou=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},oc={readContext:no,use:eV,useCallback:eP,useContext:eP,useEffect:eP,useImperativeHandle:eP,useLayoutEffect:eP,useInsertionEffect:eP,useMemo:eP,useReducer:eP,useRef:eP,useState:eP,useDebugValue:eP,useDeferredValue:eP,useTransition:eP,useSyncExternalStore:eP,useId:eP};oc.useCacheRefresh=eP,oc.useMemoCache=eP,oc.useHostTransitionStatus=eP,oc.useFormState=eP,oc.useActionState=eP,oc.useOptimistic=eP;var oh={readContext:no,use:eV,useCallback:function(e,t){return ez().memoizedState=[e,void 0===t?null:t],e},useContext:no,useEffect:tl,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,ts(4194308,4,td.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=ez();t=void 0===t?null:t;var r=e();return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ez();if(void 0!==n)var i=n(t);else i=t;return r.memoizedState=r.baseState=i,r.queue=e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},e=e.dispatch=tE.bind(null,s7,e),[r.memoizedState,e]},useRef:function(e){return ez().memoizedState={current:e}},useState:function(e){var t=(e=e0(e)).queue,n=tT.bind(null,s7,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:tf,useDeferredValue:function(e,t){return tv(ez(),e,t)},useTransition:function(){var e=e0(!1);return e=t_.bind(null,s7,e.queue,!0,!1),ez().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=s7,i=ez();if(sR){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===oq)throw Error(a(349));0!=(60&oJ)||eJ(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,tl(eK.bind(null,r,s,e),[e]),r.flags|=2048,ti(9,eZ.bind(null,r,s,n,t),{destroy:void 0},null),n},useId:function(){var e=ez(),t=oq.identifierPrefix;if(sR){var n=sS,r=sb;t=":"+t+"R"+(n=(r&~(1<<32-a6(r)-1)).toString(32)+n),0<(n=oa++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ol++).toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return ez().memoizedState=tw.bind(null,s7)}};oh.useMemoCache=eG,oh.useHostTransitionStatus=tb,oh.useFormState=e7,oh.useActionState=e7,oh.useOptimistic=function(e){var t=ez();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=tC.bind(null,s7,!0,n),n.dispatch=t,[e,t]};var od={readContext:no,use:eV,useCallback:tm,useContext:no,useEffect:tu,useImperativeHandle:tp,useInsertionEffect:tc,useLayoutEffect:th,useMemo:tg,useReducer:ej,useRef:ta,useState:function(){return ej(eW)},useDebugValue:tf,useDeferredValue:function(e,t){return ty(eB(),oe.memoizedState,e,t)},useTransition:function(){var e=ej(eW)[0],t=eB().memoizedState;return["boolean"==typeof e?e:eH(e),t]},useSyncExternalStore:eY,useId:tS};od.useCacheRefresh=tM,od.useMemoCache=eG,od.useHostTransitionStatus=tb,od.useFormState=te,od.useActionState=te,od.useOptimistic=function(e,t){return e1(eB(),oe,e,t)};var op={readContext:no,use:eV,useCallback:tm,useContext:no,useEffect:tu,useImperativeHandle:tp,useInsertionEffect:tc,useLayoutEffect:th,useMemo:tg,useReducer:eq,useRef:ta,useState:function(){return eq(eW)},useDebugValue:tf,useDeferredValue:function(e,t){var n=eB();return null===oe?tv(n,e,t):ty(n,oe.memoizedState,e,t)},useTransition:function(){var e=eq(eW)[0],t=eB().memoizedState;return["boolean"==typeof e?e:eH(e),t]},useSyncExternalStore:eY,useId:tS};op.useCacheRefresh=tM,op.useMemoCache=eG,op.useHostTransitionStatus=tb,op.useFormState=tr,op.useActionState=tr,op.useOptimistic=function(e,t){var n=eB();return null!==oe?e1(n,oe,e,t):(n.baseState=e,[e,n.queue.dispatch])};var of={isMounted:function(e){return!!(e=e._reactInternals)&&h(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=n7(),i=ei(r);i.payload=t,null!=n&&(i.callback=n),null!==(t=ea(e,i,r))&&(rt(t,e,r),es(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=n7(),i=ei(r);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=ea(e,i,r))&&(rt(t,e,r),es(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=n7(),r=ei(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=ea(e,r,n))&&(rt(t,e,n),es(t,e,n))}},om="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof r.default&&"function"==typeof r.default.emit)return void r.default.emit("uncaughtException",e);console.error(e)},og=Error(a(461)),ov=!1,oy={dehydrated:null,treeContext:null,retryLane:0},o_=f(null),ox=null,ob=null,oS="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},oM=rq.unstable_scheduleCallback,ow=rq.unstable_NormalPriority,oE={$$typeof:r3,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},oT=is.S;is.S=function(e,t){"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===sV){var n=sV=[];sG=0,sW=ee(),sj={status:"pending",value:void 0,then:function(e){n.push(e)}}}sG++,t.then(et,et)}(0,t),null!==oT&&oT(e,t)};var oA=f(null),oC=!1,oR=!1,oP=!1,oI="function"==typeof WeakSet?WeakSet:Set,oL=null,oN=!1,oD=null,oU=!1,oO=null,oF=8192,ok={getCacheForType:function(e){var t=no(oE),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n}},oz=0,oB=1,oH=2,oV=3,oG=4;if("function"==typeof Symbol&&Symbol.for){var oW=Symbol.for;oz=oW("selector.component"),oB=oW("selector.has_pseudo_class"),oH=oW("selector.role"),oV=oW("selector.test_id"),oG=oW("selector.text")}var oj="function"==typeof WeakMap?WeakMap:Map,oX=0,oq=null,oY=null,oJ=0,oZ=0,oK=null,o$=!1,oQ=!1,o0=!1,o1=0,o2=0,o3=0,o4=0,o5=0,o6=0,o8=0,o9=null,o7=null,le=!1,lt=0,ln=1/0,lr=null,li=null,la=!1,ls=null,lo=0,ll=0,lu=null,lc=0,lh=null;return rj.attemptContinuousHydration=function(e){if(13===e.tag){var t=j(e,0x4000000);null!==t&&rt(t,e,0x4000000),rW(e,0x4000000)}},rj.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag){var t=n7(),n=j(e,t);null!==n&&rt(n,e,t),rW(e,t)}},rj.attemptSynchronousHydration=function(e){switch(e.tag){case 3:if((e=e.stateNode).current.memoizedState.isDehydrated){var t=v(e.pendingLanes);if(0!==t){for(e.pendingLanes|=2,e.entangledLanes|=2;t;){var n=1<<31-a6(t);e.entanglements[1]|=n,t&=~n}Y(e),0==(6&oX)&&(ln=sa()+500,J(0,!1))}}break;case 13:null!==(t=j(e,2))&&rt(t,e,2),rs(),rW(e,2)}},rj.batchedUpdates=function(e,t){return e(t)},rj.createComponentSelector=function(e){return{$$typeof:oz,value:e}},rj.createContainer=function(e,t,n,r,i,a,s,o,l,u){return rB(e,t,!1,null,n,r,a,s,o,l,u,null)},rj.createHasPseudoClassSelector=function(e){return{$$typeof:oB,value:e}},rj.createHydrationContainer=function(e,t,n,r,i,a,s,o,l,u,c,h,d){var p;return(e=rB(n,r,!0,e,i,a,o,l,u,c,h,d)).context=(p=null,a5),n=e.current,(i=ei(r=n7())).callback=null!=t?t:null,ea(n,i,r),e.current.lanes=r,M(e,r),Y(e),e},rj.createPortal=function(e,t,n){var r=3=c&&s>=d&&i<=h&&o<=p){e.splice(t,1);break}if(r!==c||n.width!==u.width||po){if(!(s!==d||n.height!==u.height||hi)){c>r&&(u.width+=c-r,u.x=r),hs&&(u.height+=d-s,u.y=s),pn&&(n=l)),l ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},rj.getPublicRootInstance=function(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 27:case 5:return id(e.child.stateNode);default:return e.child.stateNode}},rj.injectIntoDevTools=function(){var e={bundleType:0,version:iu,rendererPackageName:ic,currentDispatcherRef:is,findFiberByHostInstance:iP,reconcilerVersion:"19.0.0"};if(null!==ih&&(e.rendererConfig=ih),"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{sc=t.inject(e),sh=t}catch(e){}e=!!t.checkDCE}}return e},rj.isAlreadyRendering=function(){return!1},rj.observeVisibleRects=function(e,t,n,r){if(!iq)throw Error(a(363));var i=i0(e=n9(e,t),n,r).disconnect;return{disconnect:function(){i()}}},rj.shouldError=function(){return null},rj.shouldSuspend=function(){return!1},rj.startHostTransition=function(e,t,n,r){if(5!==e.tag)throw Error(a(476));var s=tx(e).queue;t_(e,s,t,iV,null===n?i:function(){var t=tx(e).next.queue;return tA(e,t,{},n7()),n(r)})},rj.updateContainer=function(e,t,n,r){var i=t.current,a=n7();return rV(i,a,e,t,n,r),a},rj.updateContainerSync=function(e,t,n,r){return 0===t.tag&&rS(),rV(t.current,2,e,t,n,r),2},rj},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})},98133,(e,t,n)=>{"use strict";t.exports=e.r(40336)},45015,(e,t,n)=>{"use strict";function r(e,t){var n=e.length;for(e.push(t);0>>1,i=e[r];if(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[o]=n,r=o);else if(us(c,n))e[r]=c,e[u]=n,r=u;else break}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(n.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();n.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,f=null,m=3,g=!1,v=!1,y=!1,_="function"==typeof setTimeout?setTimeout:null,x="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=i(d);null!==t;){if(null===t.callback)a(d);else if(t.startTime<=e)a(d),t.sortIndex=t.expirationTime,r(h,t);else break;t=i(d)}}function M(e){if(y=!1,S(e),!v)if(null!==i(h))v=!0,L();else{var t=i(d);null!==t&&N(M,t.startTime-e)}}var w=!1,E=-1,T=5,A=-1;function C(){return!(n.unstable_now()-Ae&&C());){var s=f.callback;if("function"==typeof s){f.callback=null,m=f.priorityLevel;var l=s(f.expirationTime<=e);if(e=n.unstable_now(),"function"==typeof l){f.callback=l,S(e),t=!0;break t}f===i(h)&&a(h),S(e)}else a(h);f=i(h)}if(null!==f)t=!0;else{var u=i(d);null!==u&&N(M,u.startTime-e),t=!1}}break e}finally{f=null,m=r,g=!1}}}finally{t?o():w=!1}}}if("function"==typeof b)o=function(){b(R)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,I=P.port2;P.port1.onmessage=R,o=function(){I.postMessage(null)}}else o=function(){_(R,0)};function L(){w||(w=!0,o())}function N(e,t){E=_(function(){e(n.unstable_now())},t)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(e){e.callback=null},n.unstable_continueExecution=function(){v||g||(v=!0,L())},n.unstable_forceFrameRate=function(e){0>e||125s?(e.sortIndex=a,r(d,e),null===i(h)&&e===i(d)&&(y?(x(E),E=-1):y=!0,N(M,a-s))):(e.sortIndex=o,r(h,e),v||g||(v=!0,L())),e},n.unstable_shouldYield=C,n.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}},95087,(e,t,n)=>{"use strict";t.exports=e.r(45015)},46712,90072,8560,8155,46791,e=>{"use strict";let t,n,r,i,a,s,o,l,u,c;e.s(["B",()=>px,"C",()=>pG,"D",()=>pW,"E",()=>pb,"G",()=>pq,"a",()=>py,"b",()=>pv,"c",()=>fr,"d",()=>fa,"e",()=>p$,"f",()=>fb,"i",()=>pm,"j",()=>fc,"k",()=>fh,"u",()=>p_],46712),e.i(47167);var h=e.i(71645),d=e.i(39695);e.s(["ACESFilmicToneMapping",()=>ef,"AddEquation",()=>N,"AddOperation",()=>eu,"AdditiveAnimationBlendMode",()=>tH,"AdditiveBlending",()=>R,"AgXToneMapping",()=>eg,"AlphaFormat",()=>e$,"AlwaysCompare",()=>nm,"AlwaysDepth",()=>ee,"AlwaysStencilFunc",()=>no,"AmbientLight",()=>un,"AnimationAction",()=>uY,"AnimationClip",()=>lU,"AnimationLoader",()=>lG,"AnimationMixer",()=>uZ,"AnimationObjectGroup",()=>uq,"AnimationUtils",()=>lS,"ArcCurve",()=>od,"ArrayCamera",()=>uS,"ArrowHelper",()=>ck,"AttachedBindMode",()=>ey,"Audio",()=>uP,"AudioAnalyser",()=>uO,"AudioContext",()=>ug,"AudioListener",()=>uR,"AudioLoader",()=>uv,"AxesHelper",()=>cz,"BackSide",()=>E,"BasicDepthPacking",()=>tj,"BasicShadowMap",()=>x,"BatchedMesh",()=>sL,"Bone",()=>a1,"BooleanKeyframeTrack",()=>lC,"Box2",()=>cr,"Box3",()=>rf,"Box3Helper",()=>cU,"BoxGeometry",()=>ai,"BoxHelper",()=>cD,"BufferAttribute",()=>iF,"BufferGeometry",()=>i0,"BufferGeometryLoader",()=>uu,"ByteType",()=>eB,"Cache",()=>lO,"Camera",()=>ac,"CameraHelper",()=>cI,"CanvasTexture",()=>s6,"CapsuleGeometry",()=>s7,"CatmullRomCurve3",()=>oy,"CineonToneMapping",()=>ep,"CircleGeometry",()=>oe,"ClampToEdgeWrapping",()=>eA,"Clock",()=>uM,"Color",()=>iE,"ColorKeyframeTrack",()=>lR,"ColorManagement",()=>n8,"CompressedArrayTexture",()=>s4,"CompressedCubeTexture",()=>s5,"CompressedTexture",()=>s3,"CompressedTextureLoader",()=>lW,"ConeGeometry",()=>on,"ConstantAlphaFactor",()=>K,"ConstantColorFactor",()=>J,"Controls",()=>cH,"CubeCamera",()=>am,"CubeReflectionMapping",()=>eb,"CubeRefractionMapping",()=>eS,"CubeTexture",()=>ag,"CubeTextureLoader",()=>lq,"CubeUVReflectionMapping",()=>eE,"CubicBezierCurve",()=>oS,"CubicBezierCurve3",()=>oM,"CubicInterpolant",()=>lw,"CullFaceBack",()=>v,"CullFaceFront",()=>y,"CullFaceFrontBack",()=>_,"CullFaceNone",()=>g,"Curve",()=>oc,"CurvePath",()=>oP,"CustomBlending",()=>L,"CustomToneMapping",()=>em,"CylinderGeometry",()=>ot,"Cylindrical",()=>ce,"Data3DTexture",()=>rd,"DataArrayTexture",()=>rc,"DataTexture",()=>a2,"DataTextureLoader",()=>lY,"DataUtils",()=>iN,"DecrementStencilOp",()=>t6,"DecrementWrapStencilOp",()=>t9,"DefaultLoadingManager",()=>lk,"DepthFormat",()=>e1,"DepthStencilFormat",()=>e2,"DepthTexture",()=>s8,"DetachedBindMode",()=>e_,"DirectionalLight",()=>ut,"DirectionalLightHelper",()=>cC,"DiscreteInterpolant",()=>lT,"DodecahedronGeometry",()=>oi,"DoubleSide",()=>T,"DstAlphaFactor",()=>W,"DstColorFactor",()=>X,"DynamicCopyUsage",()=>nM,"DynamicDrawUsage",()=>nv,"DynamicReadUsage",()=>nx,"EdgesGeometry",()=>ou,"EllipseCurve",()=>oh,"EqualCompare",()=>nc,"EqualDepth",()=>er,"EqualStencilFunc",()=>nn,"EquirectangularReflectionMapping",()=>eM,"EquirectangularRefractionMapping",()=>ew,"Euler",()=>rK,"EventDispatcher",()=>nL,"ExternalTexture",()=>s9,"ExtrudeGeometry",()=>oQ,"FileLoader",()=>lV,"Float16BufferAttribute",()=>ij,"Float32BufferAttribute",()=>iX,"FloatType",()=>ej,"Fog",()=>aS,"FogExp2",()=>ab,"FramebufferTexture",()=>s2,"FrontSide",()=>w,"Frustum",()=>sd,"FrustumArray",()=>sm,"GLBufferAttribute",()=>u2,"GLSL1",()=>nE,"GLSL3",()=>nT,"GreaterCompare",()=>nd,"GreaterDepth",()=>ea,"GreaterEqualCompare",()=>nf,"GreaterEqualDepth",()=>ei,"GreaterEqualStencilFunc",()=>ns,"GreaterStencilFunc",()=>ni,"GridHelper",()=>cM,"Group",()=>ay,"HalfFloatType",()=>eX,"HemisphereLight",()=>lK,"HemisphereLightHelper",()=>cS,"IcosahedronGeometry",()=>o1,"ImageBitmapLoader",()=>um,"ImageLoader",()=>lX,"ImageUtils",()=>re,"IncrementStencilOp",()=>t5,"IncrementWrapStencilOp",()=>t8,"InstancedBufferAttribute",()=>a6,"InstancedBufferGeometry",()=>ul,"InstancedInterleavedBuffer",()=>u1,"InstancedMesh",()=>si,"Int16BufferAttribute",()=>iH,"Int32BufferAttribute",()=>iG,"Int8BufferAttribute",()=>ik,"IntType",()=>eG,"InterleavedBuffer",()=>aw,"InterleavedBufferAttribute",()=>aT,"Interpolant",()=>lM,"InterpolateDiscrete",()=>tD,"InterpolateLinear",()=>tU,"InterpolateSmooth",()=>tO,"InterpolationSamplingMode",()=>nI,"InterpolationSamplingType",()=>nP,"InvertStencilOp",()=>t7,"KeepStencilOp",()=>t3,"KeyframeTrack",()=>lA,"LOD",()=>aW,"LatheGeometry",()=>o2,"Layers",()=>r$,"LessCompare",()=>nu,"LessDepth",()=>et,"LessEqualCompare",()=>nh,"LessEqualDepth",()=>en,"LessEqualStencilFunc",()=>nr,"LessStencilFunc",()=>nt,"Light",()=>lZ,"LightProbe",()=>ua,"Line",()=>sH,"Line3",()=>ch,"LineBasicMaterial",()=>sN,"LineCurve",()=>ow,"LineCurve3",()=>oE,"LineDashedMaterial",()=>lg,"LineLoop",()=>sX,"LineSegments",()=>sj,"LinearFilter",()=>eD,"LinearInterpolant",()=>lE,"LinearMipMapLinearFilter",()=>ek,"LinearMipMapNearestFilter",()=>eO,"LinearMipmapLinearFilter",()=>eF,"LinearMipmapNearestFilter",()=>eU,"LinearSRGBColorSpace",()=>tQ,"LinearToneMapping",()=>eh,"LinearTransfer",()=>t0,"Loader",()=>lz,"LoaderUtils",()=>uo,"LoadingManager",()=>lF,"LoopOnce",()=>tI,"LoopPingPong",()=>tN,"LoopRepeat",()=>tL,"MOUSE",()=>f,"Material",()=>iC,"MaterialLoader",()=>us,"MathUtils",()=>nG,"Matrix2",()=>ct,"Matrix3",()=>nJ,"Matrix4",()=>rH,"MaxEquation",()=>F,"Mesh",()=>an,"MeshBasicMaterial",()=>iR,"MeshDepthMaterial",()=>lp,"MeshDistanceMaterial",()=>lf,"MeshLambertMaterial",()=>ld,"MeshMatcapMaterial",()=>lm,"MeshNormalMaterial",()=>lh,"MeshPhongMaterial",()=>lu,"MeshPhysicalMaterial",()=>ll,"MeshStandardMaterial",()=>lo,"MeshToonMaterial",()=>lc,"MinEquation",()=>O,"MirroredRepeatWrapping",()=>eC,"MixOperation",()=>el,"MultiplyBlending",()=>I,"MultiplyOperation",()=>eo,"NearestFilter",()=>eR,"NearestMipMapLinearFilter",()=>eN,"NearestMipMapNearestFilter",()=>eI,"NearestMipmapLinearFilter",()=>eL,"NearestMipmapNearestFilter",()=>eP,"NeutralToneMapping",()=>ev,"NeverCompare",()=>nl,"NeverDepth",()=>Q,"NeverStencilFunc",()=>ne,"NoBlending",()=>A,"NoColorSpace",()=>tK,"NoToneMapping",()=>ec,"NormalAnimationBlendMode",()=>tB,"NormalBlending",()=>C,"NotEqualCompare",()=>np,"NotEqualDepth",()=>es,"NotEqualStencilFunc",()=>na,"NumberKeyframeTrack",()=>lP,"Object3D",()=>ia,"ObjectLoader",()=>uc,"ObjectSpaceNormalMap",()=>tZ,"OctahedronGeometry",()=>o3,"OneFactor",()=>z,"OneMinusConstantAlphaFactor",()=>$,"OneMinusConstantColorFactor",()=>Z,"OneMinusDstAlphaFactor",()=>j,"OneMinusDstColorFactor",()=>q,"OneMinusSrcAlphaFactor",()=>G,"OneMinusSrcColorFactor",()=>H,"OrthographicCamera",()=>l7,"PCFShadowMap",()=>b,"PCFSoftShadowMap",()=>S,"Path",()=>oI,"PerspectiveCamera",()=>af,"Plane",()=>sl,"PlaneGeometry",()=>o4,"PlaneHelper",()=>cO,"PointLight",()=>l9,"PointLightHelper",()=>cy,"Points",()=>s$,"PointsMaterial",()=>sq,"PolarGridHelper",()=>cw,"PolyhedronGeometry",()=>or,"PositionalAudio",()=>uU,"PropertyBinding",()=>uX,"PropertyMixer",()=>uF,"QuadraticBezierCurve",()=>oT,"QuadraticBezierCurve3",()=>oA,"Quaternion",()=>nj,"QuaternionKeyframeTrack",()=>lL,"QuaternionLinearInterpolant",()=>lI,"RAD2DEG",()=>nO,"RED_GREEN_RGTC2_Format",()=>tR,"RED_RGTC1_Format",()=>tA,"REVISION",()=>p,"RGBADepthPacking",()=>tX,"RGBAFormat",()=>e0,"RGBAIntegerFormat",()=>e9,"RGBA_ASTC_10x10_Format",()=>tb,"RGBA_ASTC_10x5_Format",()=>ty,"RGBA_ASTC_10x6_Format",()=>t_,"RGBA_ASTC_10x8_Format",()=>tx,"RGBA_ASTC_12x10_Format",()=>tS,"RGBA_ASTC_12x12_Format",()=>tM,"RGBA_ASTC_4x4_Format",()=>tc,"RGBA_ASTC_5x4_Format",()=>th,"RGBA_ASTC_5x5_Format",()=>td,"RGBA_ASTC_6x5_Format",()=>tp,"RGBA_ASTC_6x6_Format",()=>tf,"RGBA_ASTC_8x5_Format",()=>tm,"RGBA_ASTC_8x6_Format",()=>tg,"RGBA_ASTC_8x8_Format",()=>tv,"RGBA_BPTC_Format",()=>tw,"RGBA_ETC2_EAC_Format",()=>tu,"RGBA_PVRTC_2BPPV1_Format",()=>ts,"RGBA_PVRTC_4BPPV1_Format",()=>ta,"RGBA_S3TC_DXT1_Format",()=>te,"RGBA_S3TC_DXT3_Format",()=>tt,"RGBA_S3TC_DXT5_Format",()=>tn,"RGBDepthPacking",()=>tq,"RGBFormat",()=>eQ,"RGBIntegerFormat",()=>e8,"RGB_BPTC_SIGNED_Format",()=>tE,"RGB_BPTC_UNSIGNED_Format",()=>tT,"RGB_ETC1_Format",()=>to,"RGB_ETC2_Format",()=>tl,"RGB_PVRTC_2BPPV1_Format",()=>ti,"RGB_PVRTC_4BPPV1_Format",()=>tr,"RGB_S3TC_DXT1_Format",()=>e7,"RGDepthPacking",()=>tY,"RGFormat",()=>e5,"RGIntegerFormat",()=>e6,"RawShaderMaterial",()=>ls,"Ray",()=>rB,"Raycaster",()=>u4,"RectAreaLight",()=>ur,"RedFormat",()=>e3,"RedIntegerFormat",()=>e4,"ReinhardToneMapping",()=>ed,"RenderTarget",()=>rl,"RenderTarget3D",()=>uK,"RepeatWrapping",()=>eT,"ReplaceStencilOp",()=>t4,"ReverseSubtractEquation",()=>U,"RingGeometry",()=>o5,"SIGNED_RED_GREEN_RGTC2_Format",()=>tP,"SIGNED_RED_RGTC1_Format",()=>tC,"SRGBColorSpace",()=>t$,"SRGBTransfer",()=>t1,"Scene",()=>aM,"ShaderMaterial",()=>au,"ShadowMaterial",()=>la,"Shape",()=>oL,"ShapeGeometry",()=>o6,"ShapePath",()=>cB,"ShapeUtils",()=>oZ,"ShortType",()=>eH,"Skeleton",()=>a5,"SkeletonHelper",()=>cv,"SkinnedMesh",()=>a0,"Source",()=>rn,"Sphere",()=>rL,"SphereGeometry",()=>o8,"Spherical",()=>u7,"SphericalHarmonics3",()=>ui,"SplineCurve",()=>oC,"SpotLight",()=>l3,"SpotLightHelper",()=>cp,"Sprite",()=>aB,"SpriteMaterial",()=>aA,"SrcAlphaFactor",()=>V,"SrcAlphaSaturateFactor",()=>Y,"SrcColorFactor",()=>B,"StaticCopyUsage",()=>nS,"StaticDrawUsage",()=>ng,"StaticReadUsage",()=>n_,"StereoCamera",()=>ub,"StreamCopyUsage",()=>nw,"StreamDrawUsage",()=>ny,"StreamReadUsage",()=>nb,"StringKeyframeTrack",()=>lN,"SubtractEquation",()=>D,"SubtractiveBlending",()=>P,"TOUCH",()=>m,"TangentSpaceNormalMap",()=>tJ,"TetrahedronGeometry",()=>o9,"Texture",()=>rs,"TextureLoader",()=>lJ,"TextureUtils",()=>cG,"Timer",()=>u8,"TimestampQuery",()=>nR,"TorusGeometry",()=>o7,"TorusKnotGeometry",()=>le,"Triangle",()=>ix,"TriangleFanDrawMode",()=>tW,"TriangleStripDrawMode",()=>tG,"TrianglesDrawMode",()=>tV,"TubeGeometry",()=>lt,"UVMapping",()=>ex,"Uint16BufferAttribute",()=>iV,"Uint32BufferAttribute",()=>iW,"Uint8BufferAttribute",()=>iz,"Uint8ClampedBufferAttribute",()=>iB,"Uniform",()=>u$,"UniformsGroup",()=>u0,"UniformsUtils",()=>al,"UnsignedByteType",()=>ez,"UnsignedInt101111Type",()=>eK,"UnsignedInt248Type",()=>eJ,"UnsignedInt5999Type",()=>eZ,"UnsignedIntType",()=>eW,"UnsignedShort4444Type",()=>eq,"UnsignedShort5551Type",()=>eY,"UnsignedShortType",()=>eV,"VSMShadowMap",()=>M,"Vector2",()=>nW,"Vector3",()=>nX,"Vector4",()=>ro,"VectorKeyframeTrack",()=>lD,"VideoFrameTexture",()=>s1,"VideoTexture",()=>s0,"WebGL3DRenderTarget",()=>rp,"WebGLArrayRenderTarget",()=>rh,"WebGLCoordinateSystem",()=>nA,"WebGLCubeRenderTarget",()=>av,"WebGLRenderTarget",()=>ru,"WebGPUCoordinateSystem",()=>nC,"WebXRController",()=>ax,"WireframeGeometry",()=>ln,"WrapAroundEnding",()=>tz,"ZeroCurvatureEnding",()=>tF,"ZeroFactor",()=>k,"ZeroSlopeEnding",()=>tk,"ZeroStencilOp",()=>t2,"arrayNeedsUint32",()=>nK,"cloneUniforms",()=>aa,"createCanvasElement",()=>n1,"createElementNS",()=>n0,"getByteLength",()=>cV,"getUnlitUniformColorSpace",()=>ao,"mergeUniforms",()=>as,"probeAsync",()=>n4,"warnOnce",()=>n3],90072);let p="180",f={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},m={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},g=0,v=1,y=2,_=3,x=0,b=1,S=2,M=3,w=0,E=1,T=2,A=0,C=1,R=2,P=3,I=4,L=5,N=100,D=101,U=102,O=103,F=104,k=200,z=201,B=202,H=203,V=204,G=205,W=206,j=207,X=208,q=209,Y=210,J=211,Z=212,K=213,$=214,Q=0,ee=1,et=2,en=3,er=4,ei=5,ea=6,es=7,eo=0,el=1,eu=2,ec=0,eh=1,ed=2,ep=3,ef=4,em=5,eg=6,ev=7,ey="attached",e_="detached",ex=300,eb=301,eS=302,eM=303,ew=304,eE=306,eT=1e3,eA=1001,eC=1002,eR=1003,eP=1004,eI=1004,eL=1005,eN=1005,eD=1006,eU=1007,eO=1007,eF=1008,ek=1008,ez=1009,eB=1010,eH=1011,eV=1012,eG=1013,eW=1014,ej=1015,eX=1016,eq=1017,eY=1018,eJ=1020,eZ=35902,eK=35899,e$=1021,eQ=1022,e0=1023,e1=1026,e2=1027,e3=1028,e4=1029,e5=1030,e6=1031,e8=1032,e9=1033,e7=33776,te=33777,tt=33778,tn=33779,tr=35840,ti=35841,ta=35842,ts=35843,to=36196,tl=37492,tu=37496,tc=37808,th=37809,td=37810,tp=37811,tf=37812,tm=37813,tg=37814,tv=37815,ty=37816,t_=37817,tx=37818,tb=37819,tS=37820,tM=37821,tw=36492,tE=36494,tT=36495,tA=36283,tC=36284,tR=36285,tP=36286,tI=2200,tL=2201,tN=2202,tD=2300,tU=2301,tO=2302,tF=2400,tk=2401,tz=2402,tB=2500,tH=2501,tV=0,tG=1,tW=2,tj=3200,tX=3201,tq=3202,tY=3203,tJ=0,tZ=1,tK="",t$="srgb",tQ="srgb-linear",t0="linear",t1="srgb",t2=0,t3=7680,t4=7681,t5=7682,t6=7683,t8=34055,t9=34056,t7=5386,ne=512,nt=513,nn=514,nr=515,ni=516,na=517,ns=518,no=519,nl=512,nu=513,nc=514,nh=515,nd=516,np=517,nf=518,nm=519,ng=35044,nv=35048,ny=35040,n_=35045,nx=35049,nb=35041,nS=35046,nM=35050,nw=35042,nE="100",nT="300 es",nA=2e3,nC=2001,nR={COMPUTE:"compute",RENDER:"render"},nP={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},nI={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};class nL{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return void 0!==n&&void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){let n=this._listeners;if(void 0===n)return;let r=n[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(void 0===t)return;let n=t[e.type];if(void 0!==n){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+nN[e>>16&255]+nN[e>>24&255]+"-"+nN[255&t]+nN[t>>8&255]+"-"+nN[t>>16&15|64]+nN[t>>24&255]+"-"+nN[63&n|128]+nN[n>>8&255]+"-"+nN[n>>16&255]+nN[n>>24&255]+nN[255&r]+nN[r>>8&255]+nN[r>>16&255]+nN[r>>24&255]).toLowerCase()}function nk(e,t,n){return Math.max(t,Math.min(n,e))}function nz(e,t){return(e%t+t)%t}function nB(e,t,n){return(1-n)*e+n*t}function nH(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/0xffffffff;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/0x7fffffff,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function nV(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(0xffffffff*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(0x7fffffff*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let nG={DEG2RAD:nU,RAD2DEG:nO,generateUUID:nF,clamp:nk,euclideanModulo:nz,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:nB,damp:function(e,t,n,r){return nB(e,t,1-Math.exp(-n*r))},pingpong:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t-Math.abs(nz(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(nD=e);let t=nD+=0x6d2b79f5;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/0x100000000},degToRad:function(e){return e*nU},radToDeg:function(e){return e*nO},isPowerOfTwo:function(e){return(e&e-1)==0&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){let a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),u=a((t+r)/2),c=s((t+r)/2),h=a((t-r)/2),d=s((t-r)/2),p=a((r-t)/2),f=s((r-t)/2);switch(i){case"XYX":e.set(o*c,l*h,l*d,o*u);break;case"YZY":e.set(l*d,o*c,l*h,o*u);break;case"ZXZ":e.set(l*h,l*d,o*c,o*u);break;case"XZX":e.set(o*c,l*f,l*p,o*u);break;case"YXY":e.set(l*p,o*c,l*f,o*u);break;case"ZYZ":e.set(l*f,l*p,o*c,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:nV,denormalize:nH};class nW{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=nk(this.x,e.x,t.x),this.y=nk(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=nk(this.x,e,t),this.y=nk(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(nk(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());return 0===t?Math.PI/2:Math.acos(nk(this.dot(e)/t,-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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}constructor(e=0,t=0){nW.prototype.isVector2=!0,this.x=e,this.y=t}}class nj{static slerpFlat(e,t,n,r,i,a,s){let o=n[r+0],l=n[r+1],u=n[r+2],c=n[r+3],h=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(0===s){e[t+0]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c;return}if(1===s){e[t+0]=h,e[t+1]=d,e[t+2]=p,e[t+3]=f;return}if(c!==f||o!==h||l!==d||u!==p){let e=1-s,t=o*h+l*d+u*p+c*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){let i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,s=Math.sin(s*a)/i}let i=s*n;if(o=o*e+h*i,l=l*e+d*i,u=u*e+p*i,c=c*e+f*i,e===1-s){let e=1/Math.sqrt(o*o+l*l+u*u+c*c);o*=e,l*=e,u*=e,c*=e}}e[t]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c}static multiplyQuaternionsFlat(e,t,n,r,i,a){let s=n[r],o=n[r+1],l=n[r+2],u=n[r+3],c=i[a],h=i[a+1],d=i[a+2],p=i[a+3];return e[t]=s*p+u*c+o*d-l*h,e[t+1]=o*p+u*h+l*c-s*d,e[t+2]=l*p+u*d+s*h-o*c,e[t+3]=u*p-s*c-o*h-l*d,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){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=e._x,r=e._y,i=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(n/2),u=s(r/2),c=s(i/2),h=o(n/2),d=o(r/2),p=o(i/2);switch(a){case"XYZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"YXZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"ZXY":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"ZYX":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"YZX":this._x=h*u*c+l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c-h*d*p;break;case"XZY":this._x=h*u*c-l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&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],s=t[5],o=t[9],l=t[2],u=t[6],c=t[10],h=n+s+c;if(h>0){let e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(u-o)*e,this._y=(i-l)*e,this._z=(a-r)*e}else if(n>s&&n>c){let e=2*Math.sqrt(1+n-s-c);this._w=(u-o)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+l)/e}else if(s>c){let e=2*Math.sqrt(1+s-n-c);this._w=(i-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(o+u)/e}else{let e=2*Math.sqrt(1+c-n-s);this._w=(a-r)/e,this._x=(i+l)/e,this._y=(o+u)/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._x=0,this._y=-e.z,this._z=e.y)):(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(nk(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(0===n)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 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=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,s=t._x,o=t._y,l=t._z,u=t._w;return this._x=n*u+a*s+r*l-i*o,this._y=r*u+a*o+i*s-n*l,this._z=i*u+a*l+n*o-r*s,this._w=a*u-n*s-r*o-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);let n=this._x,r=this._y,i=this._z,a=this._w,s=a*e._w+n*e._x+r*e._y+i*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;let o=1-s*s;if(o<=Number.EPSILON){let e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}let l=Math.sqrt(o),u=Math.atan2(l,s),c=Math.sin((1-t)*u)/l,h=Math.sin(t*u)/l;return this._w=a*c+this._w*h,this._x=n*c+this._x*h,this._y=r*c+this._y*h,this._z=i*c+this._z*h,this._onChangeCallback(),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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}}class nX{set(e,t,n){return void 0===n&&(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(nY.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(nY.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,s=e.z,o=e.w,l=2*(a*r-s*n),u=2*(s*t-i*r),c=2*(i*n-a*t);return this.x=t+o*l+a*c-s*u,this.y=n+o*u+s*l-i*c,this.z=r+o*c+i*u-a*l,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=nk(this.x,e.x,t.x),this.y=nk(this.y,e.y,t.y),this.z=nk(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=nk(this.x,e,t),this.y=nk(this.y,e,t),this.z=nk(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(nk(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,s=t.y,o=t.z;return this.x=r*o-i*s,this.y=i*a-n*o,this.z=n*s-r*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return nq.copy(this).projectOnVector(e),this.sub(nq)}reflect(e){return this.sub(nq.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(nk(this.dot(e)/t,-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,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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=2*Math.random()-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}constructor(e=0,t=0,n=0){nX.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}}let nq=new nX,nY=new nj;class nJ{set(e,t,n,r,i,a,s,o,l){let u=this.elements;return u[0]=e,u[1]=r,u[2]=s,u[3]=t,u[4]=i,u[5]=o,u[6]=n,u[7]=a,u[8]=l,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],s=n[3],o=n[6],l=n[1],u=n[4],c=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],_=r[7],x=r[2],b=r[5],S=r[8];return i[0]=a*f+s*v+o*x,i[3]=a*m+s*y+o*b,i[6]=a*g+s*_+o*S,i[1]=l*f+u*v+c*x,i[4]=l*m+u*y+c*b,i[7]=l*g+u*_+c*S,i[2]=h*f+d*v+p*x,i[5]=h*m+d*y+p*b,i[8]=h*g+d*_+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],s=e[5],o=e[6],l=e[7],u=e[8];return t*a*u-t*s*l-n*i*u+n*s*o+r*i*l-r*a*o}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=u*a-s*l,h=s*o-u*i,d=l*i-a*o,p=t*c+n*h+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=c*f,e[1]=(r*l-u*n)*f,e[2]=(s*n-r*a)*f,e[3]=h*f,e[4]=(u*t-r*o)*f,e[5]=(r*i-s*t)*f,e[6]=d*f,e[7]=(n*o-l*t)*f,e[8]=(a*t-n*i)*f,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,s){let o=Math.cos(i),l=Math.sin(i);return this.set(n*o,n*l,-n*(o*a+l*s)+a+e,-r*l,r*o,-r*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(nZ.makeScale(e,t)),this}rotate(e){return this.premultiply(nZ.makeRotation(-e)),this}translate(e,t){return this.premultiply(nZ.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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,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)}constructor(e,t,n,r,i,a,s,o,l){nJ.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,a,s,o,l)}}let nZ=new nJ;function nK(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}let n$={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function nQ(e,t){return new n$[e](t)}function n0(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function n1(){let e=n0("canvas");return e.style.display="block",e}let n2={};function n3(e){e in n2||(n2[e]=!0,console.warn(e))}function n4(e,t,n){return new Promise(function(r,i){setTimeout(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()}},n)})}let n5=new nJ().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),n6=new nJ().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),n8=function(){let e={enabled:!0,workingColorSpace:tQ,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n&&(this.spaces[t].transfer===t1&&(e.r=n9(e.r),e.g=n9(e.g),e.b=n9(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===t1&&(e.r=n7(e.r),e.g=n7(e.g),e.b=n7(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===tK?t0:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.workingColorSpace;return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return n3("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return n3("THREE.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({[tQ]:{primaries:t,whitePoint:r,transfer:t0,toXYZ:n5,fromXYZ:n6,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:t$},outputColorSpaceConfig:{drawingBufferColorSpace:t$}},[t$]:{primaries:t,whitePoint:r,transfer:t1,toXYZ:n5,fromXYZ:n6,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:t$}}}),e}();function n9(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function n7(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class re{static getDataURL(e){let n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)n=e;else{void 0===t&&(t=n0("canvas")),t.width=e.width,t.height=e.height;let r=t.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=t}return n.toDataURL(r)}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let t=n0("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;e0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ex)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case eT:e.x=e.x-Math.floor(e.x);break;case eA:e.x=e.x<0?0:1;break;case eC:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case eT:e.y=e.y-Math.floor(e.y);break;case eA:e.y=e.y<0?0:1;break;case eC:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}constructor(e=rs.DEFAULT_IMAGE,t=rs.DEFAULT_MAPPING,n=eA,r=eA,i=eD,a=eF,s=e0,o=ez,l=rs.DEFAULT_ANISOTROPY,u=tK){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ri++}),this.uuid=nF(),this.name="",this.source=new rn(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new nW(0,0),this.repeat=new nW(1,1),this.center=new nW(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new nJ,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!e&&!!e.depth&&e.depth>1,this.pmremVersion=0}}rs.DEFAULT_IMAGE=null,rs.DEFAULT_MAPPING=ex,rs.DEFAULT_ANISOTROPY=1;class ro{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=void 0!==e.w?e.w:1,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=e.elements,s=a[0],o=a[4],l=a[8],u=a[1],c=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(o-u)&&.01>Math.abs(l-d)&&.01>Math.abs(h-p)){if(.1>Math.abs(o+u)&&.1>Math.abs(l+d)&&.1>Math.abs(h+p)&&.1>Math.abs(s+c+f-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(c+1)/2,m=(f+1)/2,g=(o+u)/4,v=(l+d)/4,y=(h+p)/4;return e>a&&e>m?e<.01?(n=0,r=.707106781,i=.707106781):(r=g/(n=Math.sqrt(e)),i=v/n):a>m?a<.01?(n=.707106781,r=0,i=.707106781):(n=g/(r=Math.sqrt(a)),i=y/r):m<.01?(n=.707106781,r=.707106781,i=0):(n=v/(i=Math.sqrt(m)),r=y/i),this.set(n,r,i,t),this}let m=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(u-o)*(u-o));return .001>Math.abs(m)&&(m=1),this.x=(p-h)/m,this.y=(l-d)/m,this.z=(u-o)/m,this.w=Math.acos((s+c+f-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}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.w=Math.min(this.w,e.w),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.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=nk(this.x,e.x,t.x),this.y=nk(this.y,e.y,t.y),this.z=nk(this.z,e.z,t.z),this.w=nk(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=nk(this.x,e,t),this.y=nk(this.y,e,t),this.z=nk(this.z,e,t),this.w=nk(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(nk(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,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)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}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.w+=(e.w-this.w)*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.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}constructor(e=0,t=0,n=0,r=1){ro.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}}class rl extends nL{_setTextureOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={minFilter:eD,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(t.mapping=e.mapping),void 0!==e.wrapS&&(t.wrapS=e.wrapS),void 0!==e.wrapT&&(t.wrapT=e.wrapT),void 0!==e.wrapR&&(t.wrapR=e.wrapR),void 0!==e.magFilter&&(t.magFilter=e.magFilter),void 0!==e.minFilter&&(t.minFilter=e.minFilter),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.anisotropy&&(t.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(t.internalFormat=e.internalFormat);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r1;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;t1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);let n=e.geometry;if(void 0!==n){let r=n.getAttribute("position");if(!0===t&&void 0!==r&&!0!==e.isInstancedMesh)for(let t=0,n=r.count;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,rg),rg.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(rw),rE.subVectors(this.max,rw),ry.subVectors(e.a,rw),r_.subVectors(e.b,rw),rx.subVectors(e.c,rw),rb.subVectors(r_,ry),rS.subVectors(rx,r_),rM.subVectors(ry,rx);let t=[0,-rb.z,rb.y,0,-rS.z,rS.y,0,-rM.z,rM.y,rb.z,0,-rb.x,rS.z,0,-rS.x,rM.z,0,-rM.x,-rb.y,rb.x,0,-rS.y,rS.x,0,-rM.y,rM.x,0];return!!rC(t,ry,r_,rx,rE)&&!!rC(t=[1,0,0,0,1,0,0,0,1],ry,r_,rx,rE)&&(rT.crossVectors(rb,rS),rC(t=[rT.x,rT.y,rT.z],ry,r_,rx,rE))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,rg).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(rg).length()),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()||(rm[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),rm[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),rm[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),rm[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),rm[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),rm[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),rm[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),rm[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(rm)),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}constructor(e=new nX(Infinity,Infinity,Infinity),t=new nX(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}}let rm=[new nX,new nX,new nX,new nX,new nX,new nX,new nX,new nX],rg=new nX,rv=new rf,ry=new nX,r_=new nX,rx=new nX,rb=new nX,rS=new nX,rM=new nX,rw=new nX,rE=new nX,rT=new nX,rA=new nX;function rC(e,t,n,r,i){for(let a=0,s=e.length-3;a<=s;a+=3){rA.fromArray(e,a);let s=i.x*Math.abs(rA.x)+i.y*Math.abs(rA.y)+i.z*Math.abs(rA.z),o=t.dot(rA),l=n.dot(rA),u=r.dot(rA);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>s)return!1}return!0}let rR=new rf,rP=new nX,rI=new nX;class rL{set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;void 0!==t?n.copy(t):rR.setFromPoints(e).getCenter(n);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.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=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;rP.subVectors(e,this.center);let t=rP.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(rP,n/e),this.radius+=n}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(rI.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(rP.copy(e.center).add(rI)),this.expandByPoint(rP.copy(e.center).sub(rI)))),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}constructor(e=new nX,t=-1){this.isSphere=!0,this.center=e,this.radius=t}}let rN=new nX,rD=new nX,rU=new nX,rO=new nX,rF=new nX,rk=new nX,rz=new nX;class rB{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,rN)),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=rN.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(rN.copy(this.origin).addScaledVector(this.direction,t),rN.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){let i,a,s,o;rD.copy(e).add(t).multiplyScalar(.5),rU.copy(t).sub(e).normalize(),rO.copy(this.origin).sub(rD);let l=.5*e.distanceTo(t),u=-this.direction.dot(rU),c=rO.dot(this.direction),h=-rO.dot(rU),d=rO.lengthSq(),p=Math.abs(1-u*u);if(p>0)if(i=u*h-c,a=u*c-h,o=l*p,i>=0)if(a>=-o)if(a<=o){let e=1/p;i*=e,a*=e,s=i*(i+u*a+2*c)+a*(u*i+a+2*h)+d}else s=-(i=Math.max(0,-(u*(a=l)+c)))*i+a*(a+2*h)+d;else s=-(i=Math.max(0,-(u*(a=-l)+c)))*i+a*(a+2*h)+d;else a<=-o?(a=(i=Math.max(0,-(-u*l+c)))>0?-l:Math.min(Math.max(-l,-h),l),s=-i*i+a*(a+2*h)+d):a<=o?(i=0,s=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):(a=(i=Math.max(0,-(u*l+c)))>0?l:Math.min(Math.max(-l,-h),l),s=-i*i+a*(a+2*h)+d);else a=u>0?-l:l,s=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,i),r&&r.copy(rD).addScaledVector(rU,a),s}intersectSphere(e,t){rN.subVectors(e.center,this.origin);let n=rN.dot(this.direction),r=rN.dot(rN)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),s=n-a,o=n+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?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 null===n?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let n,r,i,a,s,o,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return(l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),u>=0?(i=(e.min.y-h.y)*u,a=(e.max.y-h.y)*u):(i=(e.max.y-h.y)*u,a=(e.min.y-h.y)*u),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a=0?(s=(e.min.z-h.z)*c,o=(e.max.z-h.z)*c):(s=(e.max.z-h.z)*c,o=(e.min.z-h.z)*c),n>o||s>r||((s>n||n!=n)&&(n=s),(o=0?n:r,t)}intersectsBox(e){return null!==this.intersectBox(e,rN)}intersectTriangle(e,t,n,r,i){let a;rF.subVectors(t,e),rk.subVectors(n,e),rz.crossVectors(rF,rk);let s=this.direction.dot(rz);if(s>0){if(r)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}rO.subVectors(this.origin,e);let o=a*this.direction.dot(rk.crossVectors(rO,rk));if(o<0)return null;let l=a*this.direction.dot(rF.cross(rO));if(l<0||o+l>s)return null;let u=-a*rO.dot(rz);return u<0?null:this.at(u/s,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)}constructor(e=new nX,t=new nX(0,0,-1)){this.origin=e,this.direction=t}}class rH{set(e,t,n,r,i,a,s,o,l,u,c,h,d,p,f,m){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]=s,g[13]=o,g[2]=l,g[6]=u,g[10]=c,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 rH().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 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){let t=this.elements,n=e.elements,r=1/rV.setFromMatrixColumn(e,0).length(),i=1/rV.setFromMatrixColumn(e,1).length(),a=1/rV.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),s=Math.sin(n),o=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){let e=a*u,n=a*c,r=s*u,i=s*c;t[0]=o*u,t[4]=-o*c,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-s*o,t[2]=i-e*l,t[6]=r+n*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*u,n=o*c,r=l*u,i=l*c;t[0]=e+i*s,t[4]=r*s-n,t[8]=a*l,t[1]=a*c,t[5]=a*u,t[9]=-s,t[2]=n*s-r,t[6]=i+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*u,n=o*c,r=l*u,i=l*c;t[0]=e-i*s,t[4]=-a*c,t[8]=r+n*s,t[1]=n+r*s,t[5]=a*u,t[9]=i-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*u,n=a*c,r=s*u,i=s*c;t[0]=o*u,t[4]=r*l-n,t[8]=e*l+i,t[1]=o*c,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,n=a*l,r=s*o,i=s*l;t[0]=o*u,t[4]=i-e*c,t[8]=r*c+n,t[1]=c,t[5]=a*u,t[9]=-s*u,t[2]=-l*u,t[6]=n*c+r,t[10]=e-i*c}else if("XZY"===e.order){let e=a*o,n=a*l,r=s*o,i=s*l;t[0]=o*u,t[4]=-c,t[8]=l*u,t[1]=e*c+i,t[5]=a*u,t[9]=n*c-r,t[2]=r*c-n,t[6]=s*u,t[10]=i*c+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(rW,e,rj)}lookAt(e,t,n){let r=this.elements;return rY.subVectors(e,t),0===rY.lengthSq()&&(rY.z=1),rY.normalize(),rX.crossVectors(n,rY),0===rX.lengthSq()&&(1===Math.abs(n.z)?rY.x+=1e-4:rY.z+=1e-4,rY.normalize(),rX.crossVectors(n,rY)),rX.normalize(),rq.crossVectors(rY,rX),r[0]=rX.x,r[4]=rq.x,r[8]=rY.x,r[1]=rX.y,r[5]=rq.y,r[9]=rY.y,r[2]=rX.z,r[6]=rq.z,r[10]=rY.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],s=n[4],o=n[8],l=n[12],u=n[1],c=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],_=n[11],x=n[15],b=r[0],S=r[4],M=r[8],w=r[12],E=r[1],T=r[5],A=r[9],C=r[13],R=r[2],P=r[6],I=r[10],L=r[14],N=r[3],D=r[7],U=r[11],O=r[15];return i[0]=a*b+s*E+o*R+l*N,i[4]=a*S+s*T+o*P+l*D,i[8]=a*M+s*A+o*I+l*U,i[12]=a*w+s*C+o*L+l*O,i[1]=u*b+c*E+h*R+d*N,i[5]=u*S+c*T+h*P+d*D,i[9]=u*M+c*A+h*I+d*U,i[13]=u*w+c*C+h*L+d*O,i[2]=p*b+f*E+m*R+g*N,i[6]=p*S+f*T+m*P+g*D,i[10]=p*M+f*A+m*I+g*U,i[14]=p*w+f*C+m*L+g*O,i[3]=v*b+y*E+_*R+x*N,i[7]=v*S+y*T+_*P+x*D,i[11]=v*M+y*A+_*I+x*U,i[15]=v*w+y*C+_*L+x*O,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],s=e[5],o=e[9],l=e[13],u=e[2],c=e[6],h=e[10],d=e[14],p=e[3],f=e[7];return p*(i*o*c-r*l*c-i*s*h+n*l*h+r*s*d-n*o*d)+f*(t*o*d-t*l*h+i*a*h-r*a*d+r*l*u-i*o*u)+e[11]*(t*l*c-t*s*d-i*a*c+n*a*d+i*s*u-n*l*u)+e[15]*(-r*s*u-t*o*c+t*s*h+r*a*c-n*a*h+n*o*u)}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,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],s=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=c*m*l-f*h*l+f*o*d-s*m*d-c*o*g+s*h*g,y=p*h*l-u*m*l-p*o*d+a*m*d+u*o*g-a*h*g,_=u*f*l-p*c*l+p*s*d-a*f*d-u*s*g+a*c*g,x=p*c*o-u*f*o-p*s*h+a*f*h+u*s*m-a*c*m,b=t*v+n*y+r*_+i*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/b;return e[0]=v*S,e[1]=(f*h*i-c*m*i-f*r*d+n*m*d+c*r*g-n*h*g)*S,e[2]=(s*m*i-f*o*i+f*r*l-n*m*l-s*r*g+n*o*g)*S,e[3]=(c*o*i-s*h*i-c*r*l+n*h*l+s*r*d-n*o*d)*S,e[4]=y*S,e[5]=(u*m*i-p*h*i+p*r*d-t*m*d-u*r*g+t*h*g)*S,e[6]=(p*o*i-a*m*i-p*r*l+t*m*l+a*r*g-t*o*g)*S,e[7]=(a*h*i-u*o*i+u*r*l-t*h*l-a*r*d+t*o*d)*S,e[8]=_*S,e[9]=(p*c*i-u*f*i-p*n*d+t*f*d+u*n*g-t*c*g)*S,e[10]=(a*f*i-p*s*i+p*n*l-t*f*l-a*n*g+t*s*g)*S,e[11]=(u*s*i-a*c*i-u*n*l+t*c*l+a*n*d-t*s*d)*S,e[12]=x*S,e[13]=(u*f*r-p*c*r+p*n*h-t*f*h-u*n*m+t*c*m)*S,e[14]=(p*s*r-a*f*r-p*n*o+t*f*o+a*n*m-t*s*m)*S,e[15]=(a*c*r-u*s*r+u*n*o-t*c*o-a*n*h+t*s*h)*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];return Math.sqrt(Math.max(t,e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}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,s=e.y,o=e.z,l=i*a,u=i*s;return this.set(l*a+n,l*s-r*o,l*o+r*s,0,l*s+r*o,u*s+n,u*o-r*a,0,l*o-r*s,u*o+r*a,i*o*o+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,s=t._z,o=t._w,l=i+i,u=a+a,c=s+s,h=i*l,d=i*u,p=i*c,f=a*u,m=a*c,g=s*c,v=o*l,y=o*u,_=o*c,x=n.x,b=n.y,S=n.z;return r[0]=(1-(f+g))*x,r[1]=(d+_)*x,r[2]=(p-y)*x,r[3]=0,r[4]=(d-_)*b,r[5]=(1-(h+g))*b,r[6]=(m+v)*b,r[7]=0,r[8]=(p+y)*S,r[9]=(m-v)*S,r[10]=(1-(h+f))*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,i=rV.set(r[0],r[1],r[2]).length(),a=rV.set(r[4],r[5],r[6]).length(),s=rV.set(r[8],r[9],r[10]).length();0>this.determinant()&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],rG.copy(this);let o=1/i,l=1/a,u=1/s;return rG.elements[0]*=o,rG.elements[1]*=o,rG.elements[2]*=o,rG.elements[4]*=l,rG.elements[5]*=l,rG.elements[6]*=l,rG.elements[8]*=u,rG.elements[9]*=u,rG.elements[10]*=u,t.setFromRotationMatrix(rG),n.x=i,n.y=a,n.z=s,this}makePerspective(e,t,n,r,i,a){let s,o,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:nA,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=this.elements;if(u)s=i/(a-i),o=a*i/(a-i);else if(l===nA)s=-(a+i)/(a-i),o=-2*a*i/(a-i);else if(l===nC)s=-a/(a-i),o=-a*i/(a-i);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return c[0]=2*i/(t-e),c[4]=0,c[8]=(t+e)/(t-e),c[12]=0,c[1]=0,c[5]=2*i/(n-r),c[9]=(n+r)/(n-r),c[13]=0,c[2]=0,c[6]=0,c[10]=s,c[14]=o,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a){let s,o,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:nA,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=this.elements;if(u)s=1/(a-i),o=a/(a-i);else if(l===nA)s=-2/(a-i),o=-(a+i)/(a-i);else if(l===nC)s=-1/(a-i),o=-i/(a-i);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return c[0]=2/(t-e),c[4]=0,c[8]=0,c[12]=-(t+e)/(t-e),c[1]=0,c[5]=2/(n-r),c[9]=0,c[13]=-(n+r)/(n-r),c[2]=0,c[6]=0,c[10]=s,c[14]=o,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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,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}constructor(e,t,n,r,i,a,s,o,l,u,c,h,d,p,f,m){rH.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,a,s,o,l,u,c,h,d,p,f,m)}}let rV=new nX,rG=new rH,rW=new nX(0,0,0),rj=new nX(1,1,1),rX=new nX,rq=new nX,rY=new nX,rJ=new rH,rZ=new nj;class rK{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){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]: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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=e.elements,i=r[0],a=r[4],s=r[8],o=r[1],l=r[5],u=r[9],c=r[2],h=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(nk(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-nk(u,-1,1)),.9999999>Math.abs(u)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(nk(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,i));break;case"ZYX":this._y=Math.asin(-nk(c,-1,1)),.9999999>Math.abs(c)?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,i)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(nk(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-nk(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,i)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return rJ.makeRotationFromQuaternion(e),this.setFromRotationMatrix(rJ,t,n)}setFromVector3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}reorder(e){return rZ.setFromEuler(this),this.setFromQuaternion(rZ,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],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}constructor(e=0,t=0,n=0,r=rK.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}}rK.DEFAULT_ORDER="XYZ";class r${set(e){this.mask=1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:[];this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(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),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(r.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(r.boundingBox=this.boundingBox.toJSON())),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&&!0!==this.environment.isRenderTargetTexture&&(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(void 0!==t&&void 0!==t.shapes){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),s.length>0&&(n.images=s),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),c.length>0&&(n.nodes=c)}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){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];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)),!0===t)for(let t=0;t0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){is.subVectors(r,t),io.subVectors(n,t),il.subVectors(e,t);let a=is.dot(is),s=is.dot(io),o=is.dot(il),l=io.dot(io),u=io.dot(il),c=a*l-s*s;if(0===c)return i.set(0,0,0),null;let h=1/c,d=(l*o-s*u)*h,p=(a*u-s*o)*h;return i.set(1-d-p,p,d)}static containsPoint(e,t,n,r){return null!==this.getBarycoord(e,t,n,r,iu)&&iu.x>=0&&iu.y>=0&&iu.x+iu.y<=1}static getInterpolation(e,t,n,r,i,a,s,o){return null===this.getBarycoord(e,t,n,r,iu)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(i,iu.x),o.addScaledVector(a,iu.y),o.addScaledVector(s,iu.z),o)}static getInterpolatedAttribute(e,t,n,r,i,a){return iv.setScalar(0),iy.setScalar(0),i_.setScalar(0),iv.fromBufferAttribute(e,t),iy.fromBufferAttribute(e,n),i_.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(iv,i.x),a.addScaledVector(iy,i.y),a.addScaledVector(i_,i.z),a}static isFrontFacing(e,t,n,r){return is.subVectors(n,t),io.subVectors(e,t),0>is.cross(io).dot(r)}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 is.subVectors(this.c,this.b),io.subVectors(this.a,this.b),.5*is.cross(io).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ix.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ix.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,i){return ix.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return ix.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ix.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n,r,i=this.a,a=this.b,s=this.c;ic.subVectors(a,i),ih.subVectors(s,i),ip.subVectors(e,i);let o=ic.dot(ip),l=ih.dot(ip);if(o<=0&&l<=0)return t.copy(i);im.subVectors(e,a);let u=ic.dot(im),c=ih.dot(im);if(u>=0&&c<=u)return t.copy(a);let h=o*c-u*l;if(h<=0&&o>=0&&u<=0)return n=o/(o-u),t.copy(i).addScaledVector(ic,n);ig.subVectors(e,s);let d=ic.dot(ig),p=ih.dot(ig);if(p>=0&&d<=p)return t.copy(s);let f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return r=l/(l-p),t.copy(i).addScaledVector(ih,r);let m=u*p-d*c;if(m<=0&&c-u>=0&&d-p>=0)return id.subVectors(s,a),r=(c-u)/(c-u+(d-p)),t.copy(a).addScaledVector(id,r);let g=1/(m+f+h);return n=f*g,r=h*g,t.copy(i).addScaledVector(ic,n).addScaledVector(ih,r)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}constructor(e=new nX,t=new nX,n=new nX){this.a=e,this.b=t,this.c=n}}let ib={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},iS={h:0,s:0,l:0},iM={h:0,s:0,l:0};function iw(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*6*(2/3-n):e}class iE{set(e,t,n){return void 0===t&&void 0===n?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,n),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t$;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,n8.colorSpaceToWorking(this,t),this}setRGB(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n8.workingColorSpace;return this.r=e,this.g=t,this.b=n,n8.colorSpaceToWorking(this,r),this}setHSL(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n8.workingColorSpace;if(e=nz(e,1),t=nk(t,0,1),n=nk(n,0,1),0===t)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=iw(i,r,e+1/3),this.g=iw(i,r,e),this.b=iw(i,r,e-1/3)}return n8.colorSpaceToWorking(this,r),this}setStyle(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t$;function r(t){void 0!==t&&1>parseFloat(t)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=t[1],s=t[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(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,n);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(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,n);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=t[1],i=r.length;if(3===i)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,n);if(6===i)return this.setHex(parseInt(r,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t$,n=ib[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),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=n9(e.r),this.g=n9(e.g),this.b=n9(e.b),this}copyLinearToSRGB(e){return this.r=n7(e.r),this.g=n7(e.g),this.b=n7(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t$;return n8.workingToColorSpace(iT.copy(this),e),65536*Math.round(nk(255*iT.r,0,255))+256*Math.round(nk(255*iT.g,0,255))+Math.round(nk(255*iT.b,0,255))}getHexString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t$;return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n8.workingColorSpace;n8.workingToColorSpace(iT.copy(this),r);let i=iT.r,a=iT.g,s=iT.b,o=Math.max(i,a,s),l=Math.min(i,a,s),u=(l+o)/2;if(l===o)t=0,n=0;else{let e=o-l;switch(n=u<=.5?e/(o+l):e/(2-o-l),o){case i:t=(a-s)/e+6*(a1&&void 0!==arguments[1]?arguments[1]:n8.workingColorSpace;return n8.workingToColorSpace(iT.copy(this),t),e.r=iT.r,e.g=iT.g,e.b=iT.b,e}getStyle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t$;n8.workingToColorSpace(iT.copy(this),e);let t=iT.r,n=iT.g,r=iT.b;return e!==t$?"color(".concat(e," ").concat(t.toFixed(3)," ").concat(n.toFixed(3)," ").concat(r.toFixed(3),")"):"rgb(".concat(Math.round(255*t),",").concat(Math.round(255*n),",").concat(Math.round(255*r),")")}offsetHSL(e,t,n){return this.getHSL(iS),this.setHSL(iS.h+e,iS.s+t,iS.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(iS),e.getHSL(iM);let n=nB(iS.h,iM.h,t),r=nB(iS.s,iM.s,t),i=nB(iS.l,iM.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}}let iT=new iE;iE.NAMES=ib;let iA=0;class iC extends nL{get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let n=e[t];if(void 0===n){console.warn("THREE.Material: parameter '".concat(t,"' has value of undefined."));continue}let r=this[t];if(void 0===r){console.warn("THREE.Material: '".concat(t,"' is not a property of THREE.").concat(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=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(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),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(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),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(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,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==C&&(n.blending=this.blending),this.side!==w&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==V&&(n.blendSrc=this.blendSrc),this.blendDst!==G&&(n.blendDst=this.blendDst),this.blendEquation!==N&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==en&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==no&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==t3&&(n.stencilFail=this.stencilFail),this.stencilZFail!==t3&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==t3&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),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(null!==t){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.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:iA++}),this.uuid=nF(),this.name="",this.type="Material",this.blending=C,this.side=w,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=V,this.blendDst=G,this.blendEquation=N,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new iE(0,0,0),this.blendAlpha=0,this.depthFunc=en,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=no,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=t3,this.stencilZFail=t3,this.stencilZPass=t3,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}}class iR extends iC{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}constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new iE(0xffffff),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 rK,this.combine=eo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}}let iP=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,i[e]=24,i[256|e]=24):(r[e]=31744,r[256|e]=64512,i[e]=13,i[256|e]=13)}let a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;(8388608&t)==0;)t<<=1,n-=8388608;t&=-8388609,n+=0x38800000,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=0x38000000+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=0x47800000,s[32]=0x80000000;for(let e=33;e<63;++e)s[e]=0x80000000+(e-32<<23);s[63]=0xc7800000;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:s,offsetTable:o}}();function iI(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=nk(e,-65504,65504),iP.floatView[0]=e;let t=iP.uint32View[0],n=t>>23&511;return iP.baseTable[n]+((8388607&t)>>iP.shiftTable[n])}function iL(e){let t=e>>10;return iP.uint32View[0]=iP.mantissaTable[iP.offsetTable[t]+(1023&e)]+iP.exponentTable[t],iP.floatView[0]}class iN{static toHalfFloat(e){return iI(e)}static fromHalfFloat(e){return iL(e)}}let iD=new nX,iU=new nW,iO=0;class iF{onUploadCallback(){}set needsUpdate(e){!0===e&&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;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=nH(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=nV(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=nH(t,this.array)),t}setX(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=nH(t,this.array)),t}setY(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=nH(t,this.array)),t}setZ(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=nH(t,this.array)),t}setW(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array),r=nV(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array),r=nV(r,this.array),i=nV(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==ng&&(e.usage=this.usage),e}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:iO++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=ng,this.updateRanges=[],this.gpuType=ej,this.version=0}}class ik extends iF{constructor(e,t,n){super(new Int8Array(e),t,n)}}class iz extends iF{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class iB extends iF{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class iH extends iF{constructor(e,t,n){super(new Int16Array(e),t,n)}}class iV extends iF{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class iG extends iF{constructor(e,t,n){super(new Int32Array(e),t,n)}}class iW extends iF{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class ij extends iF{getX(e){let t=iL(this.array[e*this.itemSize]);return this.normalized&&(t=nH(t,this.array)),t}setX(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize]=iI(t),this}getY(e){let t=iL(this.array[e*this.itemSize+1]);return this.normalized&&(t=nH(t,this.array)),t}setY(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+1]=iI(t),this}getZ(e){let t=iL(this.array[e*this.itemSize+2]);return this.normalized&&(t=nH(t,this.array)),t}setZ(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+2]=iI(t),this}getW(e){let t=iL(this.array[e*this.itemSize+3]);return this.normalized&&(t=nH(t,this.array)),t}setW(e,t){return this.normalized&&(t=nV(t,this.array)),this.array[e*this.itemSize+3]=iI(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array)),this.array[e+0]=iI(t),this.array[e+1]=iI(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array),r=nV(r,this.array)),this.array[e+0]=iI(t),this.array[e+1]=iI(n),this.array[e+2]=iI(r),this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=nV(t,this.array),n=nV(n,this.array),r=nV(r,this.array),i=nV(i,this.array)),this.array[e+0]=iI(t),this.array[e+1]=iI(n),this.array[e+2]=iI(r),this.array[e+3]=iI(i),this}constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}}class iX extends iF{constructor(e,t,n){super(new Float32Array(e),t,n)}}let iq=0,iY=new rH,iJ=new ia,iZ=new nX,iK=new rf,i$=new rf,iQ=new nX;class i0 extends nL{getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(nK(e)?iW:iV)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(void 0!==n){let t=new nJ().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return iY.makeRotationFromQuaternion(e),this.applyMatrix4(iY),this}rotateX(e){return iY.makeRotationX(e),this.applyMatrix4(iY),this}rotateY(e){return iY.makeRotationY(e),this.applyMatrix4(iY),this}rotateZ(e){return iY.makeRotationZ(e),this.applyMatrix4(iY),this}translate(e,t,n){return iY.makeTranslation(e,t,n),this.applyMatrix4(iY),this}scale(e,t,n){return iY.makeScale(e,t,n),this.applyMatrix4(iY),this}lookAt(e){return iJ.lookAt(e),iJ.updateMatrix(),this.applyMatrix4(iJ.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(iZ).negate(),this.translate(iZ.x,iZ.y,iZ.z),this}setFromPoints(e){let t=this.getAttribute("position");if(void 0===t){let t=[];for(let n=0,r=e.length;nt.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new rf);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new nX(-1/0,-1/0,-1/0),new nX(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(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 s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.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;null!==n&&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(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2)||(i1.copy(i).invert(),i2.copy(e.ray).applyMatrix4(i1),(null===n.boundingBox||!1!==i2.intersectsBox(n.boundingBox))&&this._computeIntersections(e,t,i2))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,s=i.index,o=i.attributes.position,l=i.attributes.uv,u=i.attributes.uv1,c=i.attributes.normal,h=i.groups,d=i.drawRange;if(null!==s)if(Array.isArray(a))for(let i=0,o=h.length;in.far?null:{distance:l,point:at.clone(),object:e}}(e,t,n,r,i5,i6,i8,ae);if(c){let e=new nX;ix.getBarycoord(ae,i5,i6,i8,e),i&&(c.uv=ix.getInterpolatedAttribute(i,o,l,u,e,new nW)),a&&(c.uv1=ix.getInterpolatedAttribute(a,o,l,u,e,new nW)),s&&(c.normal=ix.getInterpolatedAttribute(s,o,l,u,e,new nX),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));let t={a:o,b:l,c:u,normal:new nX,materialIndex:0};ix.getNormal(i5,i6,i8,t.normal),c.face=t,c.barycoord=e}return c}class ai extends i0{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ai(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}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 s=this;r=Math.floor(r),i=Math.floor(i);let o=[],l=[],u=[],c=[],h=0,d=0;function p(e,t,n,r,i,a,p,f,m,g,v){let y=a/m,_=p/g,x=a/2,b=p/2,S=f/2,M=m+1,w=g+1,E=0,T=0,A=new nX;for(let a=0;a0?1:-1,u.push(A.x,A.y,A.z),c.push(o/m),c.push(1-a/g),E+=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)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}}class ac extends ia{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)}constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new rH,this.projectionMatrix=new rH,this.projectionMatrixInverse=new rH,this.coordinateSystem=nA,this._reversedDepth=!1}}let ah=new nX,ad=new nW,ap=new nW;class af extends ac{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=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*nO*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*nU*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*nO*Math.atan(Math.tan(.5*nU*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){ah.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ah.x,ah.y).multiplyScalar(-e/ah.z),ah.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ah.x,ah.y).multiplyScalar(-e/ah.z)}getViewSize(e,t){return this.getViewBounds(e,ad,ap),t.subVectors(ap,ad)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(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(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*nU*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/s,r*=a.width/e,n*=a.height/s}let s=this.filmOffset;0!==s&&(i+=e*s/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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}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()}}class am extends ia{updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,s,o]=t;for(let e of t)this.remove(e);if(e===nA)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),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(e===nC)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),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.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){null===this.parent&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,s,o,l,u]=this.children,c=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let f=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,s),e.setRenderTarget(n,3,r),e.render(t,o),e.setRenderTarget(n,4,r),e.render(t,l),n.texture.generateMipmaps=f,e.setRenderTarget(n,5,r),e.render(t,u),e.setRenderTarget(c,h,d),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new af(-90,1,e,t);r.layers=this.layers,this.add(r);let i=new af(-90,1,e,t);i.layers=this.layers,this.add(i);let a=new af(-90,1,e,t);a.layers=this.layers,this.add(a);let s=new af(-90,1,e,t);s.layers=this.layers,this.add(s);let o=new af(-90,1,e,t);o.layers=this.layers,this.add(o);let l=new af(-90,1,e,t);l.layers=this.layers,this.add(l)}}class ag extends rs{get images(){return this.image}set images(e){this.image=e}constructor(e=[],t=eb,n,r,i,a,s,o,l,u){super(e,t,n,r,i,a,s,o,l,u),this.isCubeTexture=!0,this.flipY=!1}}class av extends ru{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=new ai(5,5,5),r=new au({name:"CubemapFromEquirect",uniforms:aa({tEquirect:{value:null}}),vertexShader:"\n\n varying vec3 vWorldDirection;\n\n vec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n }\n\n void main() {\n\n vWorldDirection = transformDirection( position, modelMatrix );\n\n #include \n #include \n\n }\n ",fragmentShader:"\n\n uniform sampler2D tEquirect;\n\n varying vec3 vWorldDirection;\n\n #include \n\n void main() {\n\n vec3 direction = normalize( vWorldDirection );\n\n vec2 sampleUV = equirectUv( direction );\n\n gl_FragColor = texture2D( tEquirect, sampleUV );\n\n }\n ",side:E,blending:A});r.uniforms.tEquirect.value=t;let i=new an(n,r),a=t.minFilter;return t.minFilter===eF&&(t.minFilter=eD),new am(1,10,this).update(e,i),t.minFilter=a,i.geometry.dispose(),i.material.dispose(),this}clear(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1};this.texture=new ag([n,n,n,n,n,n]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}}class ay extends ia{constructor(){super(),this.isGroup=!0,this.type="Group"}}let a_={type:"move"};class ax{getHandSpace(){return null===this._hand&&(this._hand=new ay,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ay,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new nX,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new nX),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ay,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new nX,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new nX),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&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}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let r of(a=!0,e.hand.values())){let e=t.getJointPose(r,n),i=this._getHandJoint(l,r);null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=null!==e}let r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],s=r.position.distanceTo(i.position);l.inputState.pinching&&s>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&null!==(i=t.getPose(e.gripSpace,n))&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1);null!==s&&(null===(r=t.getPose(e.targetRaySpace,n))&&null!==i&&(r=i),null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,r.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(r.linearVelocity)):s.hasLinearVelocity=!1,r.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(r.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(a_)))}return null!==s&&(s.visible=null!==r),null!==o&&(o.visible=null!==i),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let n=new ay;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}constructor(){this._targetRay=null,this._grip=null,this._hand=null}}class ab{clone(){return new ab(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new iE(e),this.density=t}}class aS{clone(){return new aS(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new iE(e),this.near=t,this.far=n}}class aM extends ia{copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(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),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}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 rK,this.environmentIntensity=1,this.environmentRotation=new rK,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}class aw{onUploadCallback(){}set needsUpdate(e){!0===e&&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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=nF()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=nF()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=ng,this.updateRanges=[],this.version=0,this.uuid=nF()}}let aE=new nX;class aT{get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;te.far||t.push({distance:o,point:aC.clone(),uv:ix.getInterpolation(aC,aD,aU,aO,aF,ak,az,new nW),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}constructor(e=new aA){if(super(),this.isSprite=!0,this.type="Sprite",void 0===n){n=new i0;let e=new aw(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);n.setIndex([0,1,2,0,2,3]),n.setAttribute("position",new aT(e,3,0,!1)),n.setAttribute("uv",new aT(e,2,3,!1))}this.geometry=n,this.material=e,this.center=new nW(.5,.5),this.count=1}}function aH(e,t,n,r,i,a){aI.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(aL.x=a*aI.x-i*aI.y,aL.y=i*aI.x+a*aI.y):aL.copy(aI),e.copy(t),e.x+=aL.x,e.y+=aL.y,e.applyMatrix4(aN)}let aV=new nX,aG=new nX;class aW extends ia{copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,n=t.length;e1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n=Math.abs(n);let i=this.levels;for(t=0;t0){let n,r;for(n=1,r=t.length;n0){aV.setFromMatrixPosition(this.matrixWorld);let n=e.ray.origin.distanceTo(aV);this.getObjectForDistance(n).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){let n,r;aV.setFromMatrixPosition(e.matrixWorld),aG.setFromMatrixPosition(this.matrixWorld);let i=aV.distanceTo(aG)/e.zoom;for(n=1,t[0].object.visible=!0,r=t.length;n=e)t[n-1].object.visible=!1,t[n].object.visible=!0;else break}for(this._currentLevel=n-1;n1?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||so.getNormalMatrix(e),r=this.coplanarPoint(sa).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)}constructor(e=new nX(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}}let su=new rL,sc=new nW(.5,.5),sh=new nX;class sd{set(e,t,n,r,i,a){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(r),s[4].copy(i),s[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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nA,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.planes,i=e.elements,a=i[0],s=i[1],o=i[2],l=i[3],u=i[4],c=i[5],h=i[6],d=i[7],p=i[8],f=i[9],m=i[10],g=i[11],v=i[12],y=i[13],_=i[14],x=i[15];if(r[0].setComponents(l-a,d-u,g-p,x-v).normalize(),r[1].setComponents(l+a,d+u,g+p,x+v).normalize(),r[2].setComponents(l+s,d+c,g+f,x+y).normalize(),r[3].setComponents(l-s,d-c,g-f,x-y).normalize(),n)r[4].setComponents(o,h,m,_).normalize(),r[5].setComponents(l-o,d-h,g-m,x-_).normalize();else if(r[4].setComponents(l-o,d-h,g-m,x-_).normalize(),t===nA)r[5].setComponents(l+o,d+h,g+m,x+_).normalize();else if(t===nC)r[5].setComponents(o,h,m,_).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),su.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),su.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(su)}intersectsSprite(e){return su.center.set(0,0,0),su.radius=.7071067811865476+sc.distanceTo(e.center),su.applyMatrix4(e.matrixWorld),this.intersectsSphere(su)}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,sh.y=r.normal.y>0?e.max.y:e.min.y,sh.z=r.normal.z>0?e.max.z:e.min.z,0>r.distanceToPoint(sh))return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(0>t[n].distanceToPoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}constructor(e=new sl,t=new sl,n=new sl,r=new sl,i=new sl,a=new sl){this.planes=[e,t,n,r,i,a]}}let sp=new rH,sf=new sd;class sm{intersectsObject(e,t){if(!t.isArrayCamera||0===t.cameras.length)return!1;for(let n=0;n=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});let s=i[this.index];a.push(s),this.index++,s.start=e,s.count=t,s.z=n,s.index=r}reset(){this.list.length=0,this.index=0}constructor(){this.index=0,this.pool=[],this.list=[]}},sR=new an,sP=[];function sI(e,t){if(e.constructor!==t.constructor){let n=Math.min(e.length,t.length);for(let r=0;r65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new iF(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let n in t.attributes){if(!e.hasAttribute(n))throw Error('THREE.BatchedMesh: Added geometry missing "'.concat(n,'". All geometries must have consistent attributes.'));let r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||!1===t[e].active)throw Error("THREE.BatchedMesh: Invalid instanceId ".concat(e,". Instance is either out of range or has been deleted."))}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||!1===t[e].active)throw Error("THREE.BatchedMesh: Invalid geometryId ".concat(e,". Geometry is either out of range or has been deleted."))}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new rf);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let t={visible:!0,active:!0,geometryIndex:e},n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(sg),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=t):(n=this._instanceInfo.length,this._instanceInfo.push(t));let r=this._matricesTexture;s_.identity().toArray(r.image.data,16*n),r.needsUpdate=!0;let i=this._colorsTexture;return i&&(sx.toArray(i.image.data,4*n),i.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this._initializeGeometry(e),this._validateGeometry(e);let i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=-1===n?e.getAttribute("position").count:n;let s=e.getIndex();if(null!==s&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=-1===r?s.count:r),-1!==i.indexStart&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(sg),a[t=this._availableGeometryIds.shift()]=i):(t=this._geometryCount,this._geometryCount++,a.push(i)),this.setGeometryAt(t,e),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,t}setGeometryAt(e,t){if(e>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);let n=this.geometry,r=null!==n.getIndex(),i=n.getIndex(),a=t.getIndex(),s=this._geometryInfo[e];if(r&&a.count>s.reservedIndexCount||t.attributes.position.count>s.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let o=s.vertexStart,l=s.reservedVertexCount;for(let e in s.vertexCount=t.getAttribute("position").count,n.attributes){let r=t.getAttribute(e),i=n.getAttribute(e);!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){let i=e.count;for(let a=0;a=t.length||!1===t[e].active)return this;let n=this._instanceInfo;for(let t=0,r=n.length;tt).sort((e,t)=>n[e].vertexStart-n[t].vertexStart),i=this.geometry;for(let a=0,s=n.length;a=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(null===r.boundingBox){let e=new rf,t=n.index,i=n.attributes.position;for(let n=r.start,a=r.start+r.count;n=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(null===r.boundingSphere){let t=new rL;this.getBoundingBoxAt(e,sM),sM.getCenter(t.center);let i=n.index,a=n.attributes.position,s=0;for(let e=r.start,n=r.start+r.count;e1&&void 0!==arguments[1]?arguments[1]:{};this.validateGeometryId(e);let n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){let t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(sg);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(ee.active);if(Math.max(...n.map(e=>e.vertexStart+e.reservedVertexCount))>e)throw Error("BatchedMesh: Geometry vertex values are being used outside the range ".concat(t,". Cannot shrink further."));if(this.geometry.index&&Math.max(...n.map(e=>e.indexStart+e.reservedIndexCount))>t)throw Error("BatchedMesh: Geometry index values are being used outside the range ".concat(t,". Cannot shrink further."));let r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new i0,this._initializeGeometry(r));let i=this.geometry;for(let e in r.index&&sI(r.index.array,i.index.array),r.attributes)sI(r.attributes[e].array,i.attributes[e].array)}raycast(e,t){let n=this._instanceInfo,r=this._geometryInfo,i=this.matrixWorld,a=this.geometry;sR.material=this.material,sR.geometry.index=a.index,sR.geometry.attributes=a.attributes,null===sR.geometry.boundingBox&&(sR.geometry.boundingBox=new rf),null===sR.geometry.boundingSphere&&(sR.geometry.boundingSphere=new rL);for(let a=0,s=n.length;a({...e,boundingBox:null!==e.boundingBox?e.boundingBox.clone():null,boundingSphere:null!==e.boundingSphere?e.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(e=>({...e})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,r,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let a=r.getIndex(),s=null===a?1:a.array.BYTES_PER_ELEMENT,o=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,c=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data,f=n.isArrayCamera?sS:sb;h&&!n.isArrayCamera&&(s_.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),sb.setFromProjectionMatrix(s_,n.coordinateSystem,n.reversedDepth));let m=0;if(this.sortObjects){s_.copy(this.matrixWorld).invert(),sE.setFromMatrixPosition(n.matrixWorld).applyMatrix4(s_),sT.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(s_);for(let e=0,t=o.length;e0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;er)return;sz.applyMatrix4(e.matrixWorld);let l=t.ray.origin.distanceTo(sz);if(!(lt.far))return{distance:l,point:sB.clone().applyMatrix4(e.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:e}}let sG=new nX,sW=new nX;class sj extends sH{computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;ei.far)return;a.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:s})}}class s0 extends rs{clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),super.dispose()}constructor(e,t,n,r,i=eD,a=eD,s,o,l){super(e,t,n,r,i,a,s,o,l),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;let u=this;"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(function t(){u.needsUpdate=!0,u._requestVideoFrameCallbackId=e.requestVideoFrameCallback(t)}))}}class s1 extends s0{update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}constructor(e,t,n,r,i,a,s,o){super({},e,t,n,r,i,a,s,o),this.isVideoFrameTexture=!0}}class s2 extends rs{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=eR,this.minFilter=eR,this.generateMipmaps=!1,this.needsUpdate=!0}}class s3 extends rs{constructor(e,t,n,r,i,a,s,o,l,u,c,h){super(null,a,s,o,l,u,r,i,c,h),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class s4 extends s3{addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}constructor(e,t,n,r,i,a){super(e,t,n,i,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=eA,this.layerUpdates=new Set}}class s5 extends s3{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,eb),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class s6 extends rs{constructor(e,t,n,r,i,a,s,o,l){super(e,t,n,r,i,a,s,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class s8 extends rs{copy(e){return super.copy(e),this.source=new rn(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}constructor(e,t,n=eW,r,i,a,s=eR,o=eR,l,u=e1,c=1){if(u!==e1&&u!==e2)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:c},r,i,a,s,o,u,n,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}}class s9 extends rs{copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}}class s7 extends i0{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new s7(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}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));let a=[],s=[],o=[],l=[],u=t/2,c=Math.PI/2*e,h=t,d=2*c+h,p=2*n+(i=Math.max(1,Math.floor(i))),f=r+1,m=new nX,g=new nX;for(let v=0;v<=p;v++){let y=0,_=0,x=0,b=0;if(v<=n){let t=v/n,r=t*Math.PI/2;_=-u-e*Math.cos(r),x=e*Math.sin(r),b=-e*Math.cos(r),y=t*c}else if(v<=n+i){let r=(v-n)/i;_=-u+r*t,x=e,b=0,y=c+r*h}else{let t=(v-n-i)/n,r=t*Math.PI/2;_=u+e*Math.sin(r),x=e*Math.cos(r),b=e*Math.sin(r),y=c+h+t*c}let S=Math.max(0,Math.min(1,y/d)),M=0;0===v?M=.5/r:v===p&&(M=-.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=-x*a,g.y=_,g.z=x*i,s.push(g.x,g.y,g.z),m.set(-x*a,b,x*i),m.normalize(),o.push(m.x,m.y,m.z),l.push(t+M,S)}if(v>0){let e=(v-1)*f;for(let t=0;t0||0!==r)&&(u.push(a,s,l),y+=3),(t>0||r!==i-1)&&(u.push(s,o,l),y+=3)}l.addGroup(g,y,0),g+=y})(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(u),this.setAttribute("position",new iX(c,3)),this.setAttribute("normal",new iX(h,3)),this.setAttribute("uv",new iX(d,2))}}class on extends ot{static fromJSON(e){return new on(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}constructor(e=1,t=1,n=32,r=1,i=!1,a=0,s=2*Math.PI){super(0,e,t,n,r,i,a,s),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:s}}}class or extends i0{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new or(e.vertices,e.indices,e.radius,e.details)}constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};let i=[],a=[];function s(e){i.push(e.x,e.y,e.z)}function o(t,n){let r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function l(e,t,n,r){r<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}(function(e){let n=new nX,r=new nX,i=new nX;for(let a=0;a.9&&s<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new iX(i,3)),this.setAttribute("normal",new iX(i.slice(),3)),this.setAttribute("uv",new iX(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}}class oi extends or{static fromJSON(e){return new oi(e.radius,e.detail)}constructor(e=1,t=0){let n=(1+Math.sqrt(5))/2,r=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}}let oa=new nX,os=new nX,oo=new nX,ol=new ix;class ou extends i0{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){let n=Math.cos(nU*t),r=e.getIndex(),i=e.getAttribute("position"),a=r?r.count:i.count,s=[0,0,0],o=["a","b","c"],l=[,,,],u={},c=[];for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:5,t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],n,r=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)t.push(i+=(n=this.getPoint(a/e)).distanceTo(r)),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getLengths(),i=0,a=r.length;t=n||e*r[a-1];let s=0,o=a-1,l;for(;s<=o;)if((l=r[i=Math.floor(s+(o-s)/2)]-t)<0)s=i+1;else if(l>0)o=i-1;else{o=i;break}if(r[i=o]===t)return i/(a-1);let u=r[i],c=r[i+1];return(i+(t-u)/(c-u))/(a-1)}getTangent(e,t){let n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);let i=this.getPoint(n),a=this.getPoint(r),s=t||(i.isVector2?new nW:new nX);return s.copy(a).sub(i).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new nX,r=[],i=[],a=[],s=new nX,o=new rH;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new nX)}i[0]=new nX,a[0]=new nX;let l=Number.MAX_VALUE,u=Math.abs(r[0].x),c=Math.abs(r[0].y),h=Math.abs(r[0].z);u<=l&&(l=u,n.set(1,0,0)),c<=l&&(l=c,n.set(0,1,0)),h<=l&&n.set(0,0,1),s.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],s),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(),s.crossVectors(r[t-1],r[t]),s.length()>Number.EPSILON){s.normalize();let e=Math.acos(nk(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(o.makeRotationAxis(s,e))}a[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(nk(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(s.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(o.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}constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}}class oh extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nW,n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,i=Math.abs(r)n;)r-=n;r1&&void 0!==arguments[1]?arguments[1]:new nX,i=this.points,a=i.length,s=(a-!this.closed)*e,o=Math.floor(s),l=s-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:0===l&&o===a-1&&(o=a-2,l=1),this.closed||o>0?t=i[(o-1)%a]:(of.subVectors(i[0],i[1]).add(i[0]),t=of);let u=i[o%a],c=i[(o+1)%a];if(this.closed||o+21&&void 0!==arguments[1]?arguments[1]:new nW,n=this.v0,r=this.v1,i=this.v2,a=this.v3;return t.set(ob(e,n.x,r.x,i.x,a.x),ob(e,n.y,r.y,i.y,a.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}constructor(e=new nW,t=new nW,n=new nW,r=new nW){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}}class oM extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nX,n=this.v0,r=this.v1,i=this.v2,a=this.v3;return t.set(ob(e,n.x,r.x,i.x,a.x),ob(e,n.y,r.y,i.y,a.y),ob(e,n.z,r.z,i.z,a.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}constructor(e=new nX,t=new nX,n=new nX,r=new nX){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}}class ow extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nW;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nW;return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new nW,t=new nW){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}}class oE extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nX;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nX;return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new nX,t=new nX){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}}class oT extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nW,n=this.v0,r=this.v1,i=this.v2;return t.set(ox(e,n.x,r.x,i.x),ox(e,n.y,r.y,i.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new nW,t=new nW,n=new nW){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}}class oA extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nX,n=this.v0,r=this.v1,i=this.v2;return t.set(ox(e,n.x,r.x,i.x),ox(e,n.y,r.y,i.y),ox(e,n.z,r.z,i.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new nX,t=new nX,n=new nX){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}}class oC extends oc{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nW,n=this.points,r=(n.length-1)*e,i=Math.floor(r),a=r-i,s=n[0===i?i:i-1],o=n[i],l=n[i>n.length-2?n.length-1:i+1],u=n[i>n.length-3?n.length-1:i+2];return t.set(o_(a,s.x,o.x,l.x,u.x),o_(a,s.y,o.y,l.y,u.y)),t}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],s=a.getLength(),o=0===s?0:1-e/s;return a.getPointAt(o,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;n0&&void 0!==arguments[0]?arguments[0]:40,t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=[];for(let r=0,i=this.curves;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);let u=l.getPoint(1);return this.currentPoint.copy(u),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}constructor(e){super(),this.type="Path",this.currentPoint=new nW,e&&this.setFromPoints(e)}}class oL extends oI{getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n0)for(let i=t;i=t;i-=r)a=oX(i/r|0,e[i],e[i+1],a);return a&&oB(a,a.next)&&(oq(a),a=a.next),a}function oD(e,t){if(!e)return e;t||(t=e);let n=e,r;do if(r=!1,!n.steiner&&(oB(n,n.next)||0===oz(n.prev,n,n.next))){if(oq(n),(n=t=n.prev)===n.next)break;r=!0}else n=n.next;while(r||n!==t)return t}function oU(e,t){let n=e.x-t.x;return 0===n&&0==(n=e.y-t.y)&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),n}function oO(e,t,n,r,i){return(e=((e=((e=((e=((e=(e-n)*i|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-r)*i|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function oF(e,t,n,r,i,a,s,o){return(i-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(r-o)>=(n-s)*(t-o)&&(n-s)*(a-o)>=(i-s)*(r-o)}function ok(e,t,n,r,i,a,s,o){return(e!==s||t!==o)&&oF(e,t,n,r,i,a,s,o)}function oz(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function oB(e,t){return e.x===t.x&&e.y===t.y}function oH(e,t,n,r){let i=oG(oz(e,t,n)),a=oG(oz(e,t,r)),s=oG(oz(n,r,e)),o=oG(oz(n,r,t));return!!(i!==a&&s!==o||0===i&&oV(e,n,t)||0===a&&oV(e,r,t)||0===s&&oV(n,e,r)||0===o&&oV(n,t,r))}function oV(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 oG(e){return e>0?1:e<0?-1:0}function oW(e,t){return 0>oz(e.prev,e,e.next)?oz(e,t,e.next)>=0&&oz(e,e.prev,t)>=0:0>oz(e,t,e.prev)||0>oz(e,e.next,t)}function oj(e,t){let n=oY(e.i,e.x,e.y),r=oY(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 oX(e,t,n,r){let i=oY(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 oq(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 oY(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class oJ{static triangulate(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return function(e,t){let n,r,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,s=t&&t.length,o=s?t[0]*a:e.length,l=oN(e,0,o,a,!0),u=[];if(!l||l.next===l.prev)return u;if(s&&(l=function(e,t,n,r){let i=[];for(let n=0,a=t.length;n=r.next.y&&r.next.y!==r.y){let e=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=i&&e>s&&(s=e,n=r.x=r.x&&r.x>=l&&i!==r.x&&oF(an.x||r.x===n.x&&(h=n,d=r,0>oz(h.prev,h,d.prev)&&0>oz(d.next,h,h.next))))&&(n=r,c=t)}r=r.next}while(r!==o)return n}(e,t);if(!n)return t;let r=oj(n,e);return oD(r,r.next),oD(n,n.next)}(i[e],n);return n}(e,t,l,a)),e.length>80*a){n=1/0,r=1/0;let t=-1/0,s=-1/0;for(let i=a;it&&(t=a),o>s&&(s=o)}i=0!==(i=Math.max(t-n,s-r))?32767/i:0}return function e(t,n,r,i,a,s,o){if(!t)return;!o&&s&&function(e,t,n,r){let i=e;do 0===i.z&&(i.z=oO(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,function(e){let t,n=1;do{let r,i=e;e=null;let a=null;for(t=0;i;){t++;let s=i,o=0;for(let e=0;e0||l>0&&s;)0!==o&&(0===l||!s||i.z<=s.z)?(r=i,i=i.nextZ,o--):(r=s,s=s.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;i=s}a.nextZ=null,n*=2}while(t>1)}(i)}(t,i,a,s);let l=t;for(;t.prev!==t.next;){let u=t.prev,c=t.next;if(s?function(e,t,n,r){let i=e.prev,a=e.next;if(oz(i,e,a)>=0)return!1;let s=i.x,o=e.x,l=a.x,u=i.y,c=e.y,h=a.y,d=Math.min(s,o,l),p=Math.min(u,c,h),f=Math.max(s,o,l),m=Math.max(u,c,h),g=oO(d,p,t,n,r),v=oO(f,m,t,n,r),y=e.prevZ,_=e.nextZ;for(;y&&y.z>=g&&_&&_.z<=v;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&ok(s,u,o,c,l,h,y.x,y.y)&&oz(y.prev,y,y.next)>=0||(y=y.prevZ,_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==i&&_!==a&&ok(s,u,o,c,l,h,_.x,_.y)&&oz(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;y&&y.z>=g;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&ok(s,u,o,c,l,h,y.x,y.y)&&oz(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;_&&_.z<=v;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==i&&_!==a&&ok(s,u,o,c,l,h,_.x,_.y)&&oz(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}(t,i,a,s):function(e){let t=e.prev,n=e.next;if(oz(t,e,n)>=0)return!1;let r=t.x,i=e.x,a=n.x,s=t.y,o=e.y,l=n.y,u=Math.min(r,i,a),c=Math.min(s,o,l),h=Math.max(r,i,a),d=Math.max(s,o,l),p=n.next;for(;p!==t;){if(p.x>=u&&p.x<=h&&p.y>=c&&p.y<=d&&ok(r,s,i,o,a,l,p.x,p.y)&&oz(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(t)){n.push(u.i,t.i,c.i),oq(t),t=c.next,l=c.next;continue}if((t=c)===l){o?1===o?e(t=function(e,t){let n=e;do{let r=n.prev,i=n.next.next;!oB(r,i)&&oH(r,n,n.next,i)&&oW(r,i)&&oW(i,r)&&(t.push(r.i,n.i,i.i),oq(n),oq(n.next),n=e=i),n=n.next}while(n!==e)return oD(n)}(oD(t),n),n,r,i,a,s,2):2===o&&function(t,n,r,i,a,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){var l,u;if(o.i!==t.i&&(l=o,u=t,l.next.i!==u.i&&l.prev.i!==u.i&&!function(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&&oH(n,n.next,e,t))return!0;n=n.next}while(n!==e)return!1}(l,u)&&(oW(l,u)&&oW(u,l)&&function(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}(l,u)&&(oz(l.prev,l,u.prev)||oz(l,u.prev,u))||oB(l,u)&&oz(l.prev,l,l.next)>0&&oz(u.prev,u,u.next)>0))){let l=oj(o,t);o=oD(o,o.next),l=oD(l,l.next),e(o,n,r,i,a,s,0),e(l,n,r,i,a,s,0);return}t=t.next}o=o.next}while(o!==t)}(t,n,r,i,a,s):e(oD(t),n,r,i,a,s,1);break}}}(l,u,a,n,r,i,0),u}(e,t,n)}}class oZ{static area(e){let t=e.length,n=0;for(let r=t-1,i=0;ioZ.area(e)}static triangulateShape(e,t){let n=[],r=[],i=[];oK(e),o$(n,e);let a=e.length;t.forEach(oK);for(let e=0;e2&&e[t-1].equals(e[0])&&e.pop()}function o$(e,t){for(let n=0;nNumber.EPSILON){let h=Math.sqrt(c),d=Math.sqrt(l*l+u*u),p=t.x-o/h,f=t.y+s/h,m=((n.x-u/d-p)*u-(n.y+l/d-f)*l)/(s*u-o*l),g=(r=p+s*m-e.x)*r+(i=f+o*m-e.y)*i;if(g<=2)return new nW(r,i);a=Math.sqrt(g/2)}else{let e=!1;s>Number.EPSILON?l>Number.EPSILON&&(e=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(u)&&(e=!0),e?(r=-o,i=s,a=Math.sqrt(c)):(r=s,i=o,a=Math.sqrt(c/2))}return new nW(r/a,i/a)}let L=[];for(let e=0,t=C.length,n=t-1,r=e+1;e=0;e--){let t=e/y,n=m*Math.cos(t*Math.PI/2),r=g*Math.sin(t*Math.PI/2)+v;for(let e=0,t=C.length;e=0;){let a=i,s=i-1;s<0&&(s=e.length-1);for(let e=0,i=d+2*y;e0)&&d.push(t,i,l),(e!==n-1||o0!=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}constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new nW(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return nk(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new iE(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new iE(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new iE(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}}class lu extends iC{copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,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.flatShading=e.flatShading,this.fog=e.fog,this}constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new iE(0xffffff),this.specular=new iE(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new iE(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tJ,this.normalScale=new nW(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rK,this.combine=eo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}}class lc extends iC{copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new iE(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new iE(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tJ,this.normalScale=new nW(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}}class lh extends iC{copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tJ,this.normalScale=new nW(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}}class ld extends iC{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.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,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.flatShading=e.flatShading,this.fog=e.fog,this}constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new iE(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new iE(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tJ,this.normalScale=new nW(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rK,this.combine=eo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}}class lp extends iC{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}constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=tj,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}}class lf extends iC{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}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)}}class lm extends iC{copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new iE(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tJ,this.normalScale=new nW(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}}class lg extends sN{copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}}function lv(e,t){return e&&e.constructor!==t?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}function ly(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function l_(e){let t=e.length,n=Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort(function(t,n){return e[t]-e[n]}),n}function lx(e,t,n){let r=e.length,i=new e.constructor(r);for(let a=0,s=0;s!==r;++a){let r=n[a]*t;for(let n=0;n!==t;++n)i[s++]=e[r+n]}return i}function lb(e,t,n,r){let i=1,a=e[0];for(;void 0!==a&&void 0===a[r];)a=e[i++];if(void 0===a)return;let s=a[r];if(void 0!==s)if(Array.isArray(s))do void 0!==(s=a[r])&&(t.push(a.time),n.push(...s)),a=e[i++];while(void 0!==a)else if(void 0!==s.toArray)do void 0!==(s=a[r])&&(t.push(a.time),s.toArray(n,n.length)),a=e[i++];while(void 0!==a)else do void 0!==(s=a[r])&&(t.push(a.time),n.push(s)),a=e[i++];while(void 0!==a)}class lS{static convertArray(e,t){return lv(e,t)}static isTypedArray(e){return ly(e)}static getKeyframeOrder(e){return l_(e)}static sortedArray(e,t,n){return lx(e,t,n)}static flattenJSON(e,t,n,r){lb(e,t,n,r)}static subclip(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30;return function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30,a=e.clone();a.name=t;let s=[];for(let e=0;e=r)){l.push(t.times[e]);for(let n=0;na.tracks[e].times[0]&&(o=a.tracks[e].times[0]);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;r<=0&&(r=30);let i=n.tracks.length,a=t/r;for(let t=0;t=i.times[d]){let e=d*u+l,t=e+u-l;r=i.values.slice(e,t)}else{let e=i.createInterpolant(),t=l,n=u-l;e.evaluate(a),r=e.resultBuffer.slice(t,n)}"quaternion"===s&&new nj().fromArray(r).normalize().conjugate().toArray(r);let p=o.times.length;for(let e=0;e=i)){let s=t[1];e=(i=t[--n-1]))break r}a=n,n=0;break i}break n}for(;n>>1;et;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-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&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==a&&a>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,a),e=!1;break}a=r}if(void 0!==r&&ly(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){console.error("THREE.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()===tO,i=e.length-1,a=1;for(let s=1;s0){e[a]=e[i];for(let e=i*n,r=a*n,s=0;s!==n;++s)t[r+s]=t[e+s];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}constructor(e,t,n,r){if(void 0===e)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=lv(t,this.TimeBufferType),this.values=lv(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}}lA.prototype.ValueTypeName="",lA.prototype.TimeBufferType=Float32Array,lA.prototype.ValueBufferType=Float32Array,lA.prototype.DefaultInterpolation=tU;class lC extends lA{constructor(e,t,n){super(e,t,n)}}lC.prototype.ValueTypeName="bool",lC.prototype.ValueBufferType=Array,lC.prototype.DefaultInterpolation=tD,lC.prototype.InterpolantFactoryMethodLinear=void 0,lC.prototype.InterpolantFactoryMethodSmooth=void 0;class lR extends lA{constructor(e,t,n,r){super(e,t,n,r)}}lR.prototype.ValueTypeName="color";class lP extends lA{constructor(e,t,n,r){super(e,t,n,r)}}lP.prototype.ValueTypeName="number";class lI extends lM{interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(n-t)/(r-t),l=e*s;for(let e=l+s;l!==e;l+=4)nj.slerpFlat(i,0,a,l-s,a,l,o);return i}constructor(e,t,n,r){super(e,t,n,r)}}class lL extends lA{InterpolantFactoryMethodLinear(e){return new lI(this.times,this.values,this.getValueSize(),e)}constructor(e,t,n,r){super(e,t,n,r)}}lL.prototype.ValueTypeName="quaternion",lL.prototype.InterpolantFactoryMethodSmooth=void 0;class lN extends lA{constructor(e,t,n){super(e,t,n)}}lN.prototype.ValueTypeName="string",lN.prototype.ValueBufferType=Array,lN.prototype.DefaultInterpolation=tD,lN.prototype.InterpolantFactoryMethodLinear=void 0,lN.prototype.InterpolantFactoryMethodSmooth=void 0;class lD extends lA{constructor(e,t,n,r){super(e,t,n,r)}}lD.prototype.ValueTypeName="vector";class lU{static parse(e){let t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push((function(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return lP;case"vector":case"vector2":case"vector3":case"vector4":return lD;case"color":return lR;case"quaternion":return lL;case"bool":case"boolean":return lC;case"string":return lN}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){let t=[],n=[];lb(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)})(n[e]).scale(r));let i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i.userData=JSON.parse(e.userData||"{}"),i}static toJSON(e){let t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,r=n.length;e!==r;++e)t.push(lA.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){let i=t.length,a=[];for(let e=0;e1){let e=a[1],t=r[e];t||(r[e]=t=[]),t.push(n)}}let a=[];for(let e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(e,t,n,r,i){if(0!==n.length){let a=[],s=[];lb(n,a,s,r),0!==a.length&&i.push(new e(t,a,s))}},r=[],i=e.name||"default",a=e.fps||30,s=e.blendMode,o=e.length||-1,l=e.hierarchy||[];for(let e=0;e{t&&t(i),this.manager.itemEnd(e)},0),i;if(void 0!==lB[e])return void lB[e].push({onLoad:t,onProgress:n,onError:r});lB[e]=[],lB[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:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),s=this.mimeType,o=this.responseType;fetch(a).then(t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;let n=lB[e],r=t.body.getReader(),i=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),a=i?parseInt(i):0,s=0!==a,o=0;return new Response(new ReadableStream({start(e){!function t(){r.read().then(r=>{let{done:i,value:l}=r;if(i)e.close();else{let r=new ProgressEvent("progress",{lengthComputable:s,loaded:o+=l.byteLength,total:a});for(let e=0,t=n.length;e{e.error(t)})}()}}))}throw new lH('fetch for "'.concat(t.url,'" responded with ').concat(t.status,": ").concat(t.statusText),t)}).then(e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>new DOMParser().parseFromString(e,s));case"json":return e.json();default:if(""===s)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(s),n=new TextDecoder(t&&t[1]?t[1].toLowerCase():void 0);return e.arrayBuffer().then(e=>n.decode(e))}}}).then(t=>{lO.add("file:".concat(e),t);let n=lB[e];delete lB[e];for(let e=0,r=n.length;e{let n=lB[e];if(void 0===n)throw this.manager.itemError(e),t;delete lB[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}constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}}class lG extends lz{load(e,t,n,r){let i=this,a=new lV(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}parse(e){let t=[];for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),l5.setFromMatrixPosition(e.matrixWorld),n.position.copy(l5),l6.copy(n.position),l6.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(l6),n.updateMatrixWorld(),r.makeTranslation(-l5.x,-l5.y,-l5.z),l4.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(l4,n.coordinateSystem,n.reversedDepth)}constructor(){super(new af(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new nW(4,2),this._viewportCount=6,this._viewports=[new ro(2,1,1,1),new ro(0,1,1,1),new ro(3,1,1,1),new ro(1,1,1,1),new ro(3,0,1,1),new ro(1,0,1,1)],this._cubeDirections=[new nX(1,0,0),new nX(-1,0,0),new nX(0,0,1),new nX(0,0,-1),new nX(0,1,0),new nX(0,-1,0)],this._cubeUps=[new nX(0,1,0),new nX(0,1,0),new nX(0,1,0),new nX(0,1,0),new nX(0,0,1),new nX(0,0,-1)]}}class l9 extends lZ{get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}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}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 l8}}class l7 extends ac{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=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){null===this.view&&(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(){null!==this.view&&(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,s=r+t,o=r-t;if(null!==this.view&&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,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,s,o,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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}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()}}class ue extends l1{constructor(){super(new l7(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ut extends lZ{dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ia.DEFAULT_UP),this.updateMatrix(),this.target=new ia,this.shadow=new ue}}class un extends lZ{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class ur extends lZ{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}constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}}class ui{set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){let n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){let n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){let n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new nX)}}class ua extends lZ{copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}constructor(e=new ui,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}}class us extends lz{load(e,t,n,r){let i=this,a=new lV(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}parse(e){let t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}let r=this.createMaterialFromType(e.type);if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=e.sheen),void 0!==e.sheenColor&&(r.sheenColor=new iE().setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(r.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.specularIntensity&&(r.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.dispersion&&(r.dispersion=e.dispersion),void 0!==e.iridescence&&(r.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(r.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(r.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(r.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(r.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(r.depthFunc=e.depthFunc),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(r.blendSrc=e.blendSrc),void 0!==e.blendDst&&(r.blendDst=e.blendDst),void 0!==e.blendEquation&&(r.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(r.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(r.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(r.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==r.blendColor&&r.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(r.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),void 0!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(r.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(let t in e.uniforms){let i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case"t":r.uniforms[t].value=n(i.value);break;case"c":r.uniforms[t].value=new iE().setHex(i.value);break;case"v2":r.uniforms[t].value=new nW().fromArray(i.value);break;case"v3":r.uniforms[t].value=new nX().fromArray(i.value);break;case"v4":r.uniforms[t].value=new ro().fromArray(i.value);break;case"m3":r.uniforms[t].value=new nJ().fromArray(i.value);break;case"m4":r.uniforms[t].value=new rH().fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(r.glslVersion=e.glslVersion),void 0!==e.extensions)for(let t in e.extensions)r.extensions[t]=e.extensions[t];if(void 0!==e.lights&&(r.lights=e.lights),void 0!==e.clipping&&(r.clipping=e.clipping),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=new nW().fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(r.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(r.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapRotation&&r.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=new nW().fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(r.iridescenceMap=n(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=n(e.thicknessMap)),void 0!==e.anisotropyMap&&(r.anisotropyMap=n(e.anisotropyMap)),void 0!==e.sheenColorMap&&(r.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return us.createMaterialFromType(e)}static createMaterialFromType(e){return new({ShadowMaterial:la,SpriteMaterial:aA,RawShaderMaterial:ls,ShaderMaterial:au,PointsMaterial:sq,MeshPhysicalMaterial:ll,MeshStandardMaterial:lo,MeshPhongMaterial:lu,MeshToonMaterial:lc,MeshNormalMaterial:lh,MeshLambertMaterial:ld,MeshDepthMaterial:lp,MeshDistanceMaterial:lf,MeshBasicMaterial:iR,MeshMatcapMaterial:lm,LineDashedMaterial:lg,LineBasicMaterial:sN,Material:iC})[e]}constructor(e){super(e),this.textures={}}}class uo{static extractUrlBase(e){let t=e.lastIndexOf("/");return -1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e))?e:t+e}}class ul extends i0{copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}}class uu extends lz{load(e,t,n,r){let i=this,a=new lV(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}parse(e){let t={},n={};function r(e,r){if(void 0!==t[r])return t[r];let i=e.interleavedBuffers[r],a=function(e,t){if(void 0!==n[t])return n[t];let r=new Uint32Array(e.arrayBuffers[t]).buffer;return n[t]=r,r}(e,i.buffer),s=new aw(nQ(i.type,a),i.stride);return s.uuid=i.uuid,t[r]=s,s}let i=e.isInstancedBufferGeometry?new ul:new i0,a=e.data.index;if(void 0!==a){let e=nQ(a.type,a.array);i.setIndex(new iF(e,1))}let s=e.data.attributes;for(let t in s){let n,a=s[t];if(a.isInterleavedBufferAttribute)n=new aT(r(e.data,a.data),a.itemSize,a.offset,a.normalized);else{let e=nQ(a.type,a.array);n=new(a.isInstancedBufferAttribute?a6:iF)(e,a.itemSize,a.normalized)}void 0!==a.name&&(n.name=a.name),void 0!==a.usage&&n.setUsage(a.usage),i.setAttribute(t,n)}let o=e.data.morphAttributes;if(o)for(let t in o){let n=o[t],a=[];for(let t=0,i=n.length;t0){(n=new lX(new lF(t))).setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t0){(t=new lX(this.manager)).setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t{let t=null,n=null;return void 0!==e.boundingBox&&(t=new rf().fromJSON(e.boundingBox)),void 0!==e.boundingSphere&&(n=new rL().fromJSON(e.boundingSphere)),{...e,boundingBox:t,boundingSphere:n}}),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),void 0!==e.colorsTexture&&(a._colorsTexture=c(e.colorsTexture.uuid)),void 0!==e.boundingSphere&&(a.boundingSphere=new rL().fromJSON(e.boundingSphere)),void 0!==e.boundingBox&&(a.boundingBox=new rf().fromJSON(e.boundingBox));break;case"LOD":a=new aW;break;case"Line":a=new sH(l(e.geometry),u(e.material));break;case"LineLoop":a=new sX(l(e.geometry),u(e.material));break;case"LineSegments":a=new sj(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":a=new s$(l(e.geometry),u(e.material));break;case"Sprite":a=new aB(u(e.material));break;case"Group":a=new ay;break;case"Bone":a=new a1;break;default:a=new ia}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.up&&a.up.fromArray(e.up),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.intensity&&(a.shadow.intensity=e.shadow.intensity),void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(a.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children){let s=e.children;for(let e=0;e{if(!0!==uf.has(a))return t&&t(n),i.manager.itemEnd(e),n;r&&r(uf.get(a)),i.manager.itemError(e),i.manager.itemEnd(e)}):(setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a);let s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,s.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let o=fetch(e,s).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))}).then(function(n){return lO.add("image-bitmap:".concat(e),n),t&&t(n),i.manager.itemEnd(e),n}).catch(function(t){r&&r(t),uf.set(o,t),lO.remove("image-bitmap:".concat(e)),i.manager.itemError(e),i.manager.itemEnd(e)});lO.add("image-bitmap:".concat(e),o),i.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}}class ug{static getContext(){return void 0===r&&(r=new(window.AudioContext||window.webkitAudioContext)),r}static setContext(e){r=e}}class uv extends lz{load(e,t,n,r){let i=this,a=new lV(this.manager);function s(t){r?r(t):console.error(t),i.manager.itemError(e)}a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(e){try{let n=e.slice(0);ug.getContext().decodeAudioData(n,function(e){t(e)}).catch(s)}catch(e){s(e)}},n,r)}constructor(e){super(e)}}let uy=new rH,u_=new rH,ux=new rH;class ub{update(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){let n,r;t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,ux.copy(e.projectionMatrix);let i=t.eyeSep/2,a=i*t.near/t.focus,s=t.near*Math.tan(nU*t.fov*.5)/t.zoom;u_.elements[12]=-i,uy.elements[12]=i,n=-s*t.aspect+a,r=s*t.aspect+a,ux.elements[0]=2*t.near/(r-n),ux.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(ux),n=-s*t.aspect-a,r=s*t.aspect-a,ux.elements[0]=2*t.near/(r-n),ux.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(ux)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(u_),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(uy)}constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new af,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new af,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}}class uS extends af{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class uM{start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}}let uw=new nX,uE=new nj,uT=new nX,uA=new nX,uC=new nX;class uR extends ia{getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(uw,uE,uT),uA.set(0,0,-1).applyQuaternion(uE),uC.set(0,1,0).applyQuaternion(uE),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(uw.x,e),t.positionY.linearRampToValueAtTime(uw.y,e),t.positionZ.linearRampToValueAtTime(uw.z,e),t.forwardX.linearRampToValueAtTime(uA.x,e),t.forwardY.linearRampToValueAtTime(uA.y,e),t.forwardZ.linearRampToValueAtTime(uA.z,e),t.upX.linearRampToValueAtTime(uC.x,e),t.upY.linearRampToValueAtTime(uC.y,e),t.upZ.linearRampToValueAtTime(uC.z,e)}else t.setPosition(uw.x,uw.y,uw.z),t.setOrientation(uA.x,uA.y,uA.z,uC.x,uC.y,uC.z)}constructor(){super(),this.type="AudioListener",this.context=ug.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new uM}}class uP extends ia{getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this)}stop(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this)}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){s.setValue(n,r);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n;e!==r;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){nj.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){let a=this._workIndex*i;nj.multiplyQuaternionsFlat(e,a,e,t,e,n),nj.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,i){let a=1-r;for(let s=0;s!==i;++s){let i=t+s;e[i]=e[i]*a+e[n+s]*r}}_lerpAdditive(e,t,n,r,i){for(let a=0;a!==i;++a){let i=t+a;e[i]=e[i]+e[n+a]*r}}constructor(e,t,n){let r,i,a;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}}let uk="\\[\\]\\.:\\/",uz=RegExp("["+uk+"]","g"),uB="[^"+uk+"]",uH="[^"+uk.replace("\\.","")+"]",uV=/((?:WC+[\/:])*)/.source.replace("WC",uB),uG=/(WCOD+)?/.source.replace("WCOD",uH),uW=RegExp("^"+uV+uG+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",uB)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",uB)+"$"),uj=["material","materials","bones","map"];class uX{static create(e,t,n){return e&&e.isAnimationObjectGroup?new uX.Composite(e,t,n):new uX(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(uz,"")}static parseTrackName(e){let t=uW.exec(e);if(null===t)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(void 0!==r&&-1!==r){let e=n.nodeName.substring(r+1);-1!==uj.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){let n=function(e){for(let r=0;r=i){let a=i++,u=e[a];t[u.uuid]=l,e[l]=u,t[o]=a,e[a]=s;for(let e=0;e!==r;++e){let t=n[e],r=t[a],i=t[l];t[l]=r,t[a]=i}}}this.nCachedObjects_=i}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=e.length;for(let s=0,o=arguments.length;s!==o;++s){let o=arguments[s],l=o.uuid,u=t[l];if(void 0!==u)if(delete t[l],u0&&(t[s.uuid]=u),e[u]=s,e.pop();for(let e=0;e!==r;++e){let t=n[e];t[u]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){let n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];let a=this._paths,s=this._parsedPaths,o=this._objects,l=o.length,u=this.nCachedObjects_,c=Array(l);r=i.length,n[e]=r,a.push(e),s.push(t),i.push(c);for(let n=u,r=o.length;n!==r;++n){let r=o[n];c[n]=new uX(r,e,t)}return c}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){let r=this._paths,i=this._parsedPaths,a=this._bindings,s=a.length-1,o=a[s];t[e[s]]=n,a[n]=o,a.pop(),i[n]=i[s],i.pop(),r[n]=r[s],r.pop()}}constructor(){this.isAnimationObjectGroup=!0,this.uuid=nF(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let e={};this._indicesByUUID=e;for(let t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}}class uY{play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.fadeOut(t),this.fadeIn(t),!0===n){let n=this._clip.duration,r=e._clip.duration;e.warp(1,r/n,t),this.warp(n/r,1,t)}return this}crossFadeTo(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let r=this._mixer,i=r.time,a=this.timeScale,s=this._timeScaleInterpolant;null===s&&(s=r._lendControlInterpolant(),this._timeScaleInterpolant=s);let o=s.parameterPositions,l=s.sampleValues;return o[0]=i,o[1]=i+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);let i=this._startTime;if(null!==i){let r=(e-i)*n;r<0||0===n?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);let a=this._updateTime(t),s=this._updateWeight(e);if(s>0){let e=this._interpolants,t=this._propertyBindings;if(this.blendMode===tH)for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(s);else for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(null!==n){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,a=n===tN;if(0===e)return -1===i?r:a&&(1&i)==1?t-r:r;if(n===tI){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));s:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break s}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){let n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);let s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(a&&(1&i)==1)return t-r}return r}_setEndings(e,t,n){let r=this._interpolantSettings;n?(r.endingStart=tk,r.endingEnd=tk):(e?r.endingStart=this.zeroSlopeAtStart?tk:tF:r.endingStart=tz,t?r.endingEnd=this.zeroSlopeAtEnd?tk:tF:r.endingEnd=tz)}_scheduleFading(e,t,n){let r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);let s=a.parameterPositions,o=a.sampleValues;return s[0]=i,o[0]=t,s[1]=i+e,o[1]=n,this}constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;let i=t.tracks,a=i.length,s=Array(a),o={endingStart:tF,endingEnd:tF};for(let e=0;e!==a;++e){let t=i[e].createInterpolant(null);s[e]=t,t.settings=o}this._interpolantSettings=o,this._interpolants=s,this._propertyBindings=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=tL,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}}let uJ=new Float32Array(1);class uZ extends nL{_bindAction(e,t){let n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,s=e._interpolants,o=n.uuid,l=this._bindingsByRootAndName,u=l[o];void 0===u&&(u={},l[o]=u);for(let e=0;e!==i;++e){let i=r[e],l=i.name,c=u[l];if(void 0!==c)++c.referenceCount,a[e]=c;else{if(void 0!==(c=a[e])){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,o,l));continue}let r=t&&t._propertyBindings[e].binding.parsedPath;c=new uF(uX.create(n,l,r),i.ValueTypeName,i.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,o,l),a[e]=c}s[e].resultBuffer=c.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){let t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return null!==t&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let s=0;s!==n;++s)t[s]._update(r,e,i,a);let s=this._bindings,o=this._nActiveBindings;for(let e=0;e!==o;++e)s[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e1)||void 0===arguments[1]||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return u6(e,this,n,t),n.sort(u5),n}intersectObjects(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let r=0,i=e.length;r1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){let i=this.elements;return i[0]=e,i[2]=t,i[1]=n,i[3]=r,this}constructor(e,t,n,r){ct.prototype.isMatrix2=!0,this.elements=[1,0,0,1],void 0!==e&&this.set(e,t,n,r)}}let cn=new nW;class cr{set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}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}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))}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}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,cn).distanceTo(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}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)}constructor(e=new nW(Infinity,Infinity),t=new nW(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}}let ci=new nX,ca=new nX,cs=new nX,co=new nX,cl=new nX,cu=new nX,cc=new nX;class ch{set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){ci.subVectors(e,this.start),ca.subVectors(this.end,this.start);let n=ca.dot(ca),r=ca.dot(ci)/n;return t&&(r=nk(r,0,1)),r}closestPointToPoint(e,t,n){let r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}distanceSqToLine3(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cu,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:cc,a=1e-8*1e-8,s=this.start,o=e.start,l=this.end,u=e.end;cs.subVectors(l,s),co.subVectors(u,o),cl.subVectors(s,o);let c=cs.dot(cs),h=co.dot(co),d=co.dot(cl);if(c<=a&&h<=a)return r.copy(s),i.copy(o),r.sub(i),r.dot(r);if(c<=a)t=0,n=nk(n=d/h,0,1);else{let e=cs.dot(cl);if(h<=a)n=0,t=nk(-e/c,0,1);else{let r=cs.dot(co),i=c*h-r*r;t=0!==i?nk((r*d-e*h)/i,0,1):0,(n=(r*t+d)/h)<0?(n=0,t=nk(-e/c,0,1)):n>1&&(n=1,t=nk((r-e)/c,0,1))}}return r.copy(s).add(cs.multiplyScalar(t)),i.copy(o).add(co.multiplyScalar(n)),r.sub(i),r.dot(r)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}constructor(e=new nX,t=new nX){this.start=e,this.end=t}}let cd=new nX;class cp extends ia{dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),cd.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(cd),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";let n=new i0,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1;e<32;e++,t++){let n=e/32*Math.PI*2,i=t/32*Math.PI*2;r.push(Math.cos(n),Math.sin(n),1,Math.cos(i),Math.sin(i),1)}n.setAttribute("position",new iX(r,3));let i=new sN({fog:!1,toneMapped:!1});this.cone=new sj(n,i),this.add(this.cone),this.update()}}let cf=new nX,cm=new rH,cg=new rH;class cv extends sj{updateMatrixWorld(e){let t=this.bones,n=this.geometry,r=n.getAttribute("position");cg.copy(this.root.matrixWorld).invert();for(let e=0,n=0;e1)for(let n=0;n.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{cF.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(cF,t)}}setLength(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2*e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.2*t;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()}constructor(e=new nX(0,0,1),t=new nX(0,0,0),n=1,r=0xffff00,s=.2*n,o=.2*s){super(),this.type="ArrowHelper",void 0===i&&((i=new i0).setAttribute("position",new iX([0,0,0,0,1,0],3)),(a=new on(.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new sH(i,new sN({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new an(a,new iR({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,s,o)}}class cz extends sj{setColors(e,t,n){let r=new iE,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()}constructor(e=1){let t=new i0;t.setAttribute("position",new iX([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],3)),t.setAttribute("color",new iX([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(t,new sN({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}}class cB{moveTo(e,t){return this.currentPath=new oI,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){let t,n,r,i,a,s=oZ.isClockWise,o=this.subPaths;if(0===o.length)return[];let l=[];if(1===o.length)return n=o[0],(r=new oL).curves=n.curves,l.push(r),l;let u=!s(o[0].getPoints());u=e?!u:u;let c=[],h=[],d=[],p=0;h[0]=void 0,d[p]=[];for(let r=0,a=o.length;r1){let e=!1,t=0;for(let e=0,t=h.length;eNumber.EPSILON){if(l<0&&(n=t[a],o=-o,s=t[i],l=-l),e.ys.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=l*(e.x-n.x)-o*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(s.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=s.x)return!0}}return r})(a.p,h[r].p)&&(n!==r&&t++,s?(s=!1,c[r].push(a)):e=!0);s&&c[n].push(a)}}t>0&&!1===e&&(d=c)}for(let e=0,t=h.length;et?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}static cover(e,t){let n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}static fill(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}static getByteLength(e,t,n,r){return cV(e,t,n,r)}}function cW(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function cj(e){let t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))},update:function(n,r){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){let e=t.get(n);(!e||e.versione.start-t.start);let t=0;for(let e=1;eha,"ShaderChunk",()=>cX,"ShaderLib",()=>cY,"UniformsLib",()=>cq,"WebGLRenderer",()=>d2,"WebGLUtils",()=>dJ],8560);let cX={alphahash_fragment:"#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif",batching_vertex:"#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n 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 );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n 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 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",fog_vertex:"#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid 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 ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid 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 ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid 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 ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid 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 ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n 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 ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return saturate(v);\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColor;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid 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 ) {\n#else\nvoid 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 ) {\n#endif\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n 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 ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid 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 ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n float depth = unpackRGBAToDepth( texture2D( depths, uv ) );\n #ifdef USE_REVERSED_DEPTH_BUFFER\n return step( depth, compare );\n #else\n return step( compare, depth );\n #endif\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow( sampler2D shadow, vec2 uv, float compare ) {\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float hard_shadow = step( distribution.x, compare );\n #else\n float hard_shadow = step( compare, distribution.x );\n #endif\n if ( hard_shadow != 1.0 ) {\n float distance = compare - distribution.x;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n \n float lightToPositionLength = length( lightToPosition );\n if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n shadow = (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n 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 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include \n #include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include \n #include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include \n #include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n #include \n #ifdef USE_REVERSED_DEPTH_BUFFER\n float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n #else\n float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n #endif\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #include \n #include \n #include \n #include \n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include \n #include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vLineDistance = scale * lineDistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include \n #include \n #include \n #include \n #include \n #include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include \n #include \n #include \n #include \n gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include \n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include \n #include \n #include \n #include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include \n #include \n #include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include \n #include \n #include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n}"},cq={common:{diffuse:{value:new iE(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new nJ},alphaMap:{value:null},alphaMapTransform:{value:new nJ},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new nJ}},envmap:{envMap:{value:null},envMapRotation:{value:new nJ},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new nJ}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new nJ}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new nJ},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new nJ},normalScale:{value:new nW(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new nJ},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new nJ}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new nJ}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new nJ}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new iE(0xffffff)}},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 iE(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new nJ},alphaTest:{value:0},uvTransform:{value:new nJ}},sprite:{diffuse:{value:new iE(0xffffff)},opacity:{value:1},center:{value:new nW(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new nJ},alphaMap:{value:null},alphaMapTransform:{value:new nJ},alphaTest:{value:0}}},cY={basic:{uniforms:as([cq.common,cq.specularmap,cq.envmap,cq.aomap,cq.lightmap,cq.fog]),vertexShader:cX.meshbasic_vert,fragmentShader:cX.meshbasic_frag},lambert:{uniforms:as([cq.common,cq.specularmap,cq.envmap,cq.aomap,cq.lightmap,cq.emissivemap,cq.bumpmap,cq.normalmap,cq.displacementmap,cq.fog,cq.lights,{emissive:{value:new iE(0)}}]),vertexShader:cX.meshlambert_vert,fragmentShader:cX.meshlambert_frag},phong:{uniforms:as([cq.common,cq.specularmap,cq.envmap,cq.aomap,cq.lightmap,cq.emissivemap,cq.bumpmap,cq.normalmap,cq.displacementmap,cq.fog,cq.lights,{emissive:{value:new iE(0)},specular:{value:new iE(1118481)},shininess:{value:30}}]),vertexShader:cX.meshphong_vert,fragmentShader:cX.meshphong_frag},standard:{uniforms:as([cq.common,cq.envmap,cq.aomap,cq.lightmap,cq.emissivemap,cq.bumpmap,cq.normalmap,cq.displacementmap,cq.roughnessmap,cq.metalnessmap,cq.fog,cq.lights,{emissive:{value:new iE(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:cX.meshphysical_vert,fragmentShader:cX.meshphysical_frag},toon:{uniforms:as([cq.common,cq.aomap,cq.lightmap,cq.emissivemap,cq.bumpmap,cq.normalmap,cq.displacementmap,cq.gradientmap,cq.fog,cq.lights,{emissive:{value:new iE(0)}}]),vertexShader:cX.meshtoon_vert,fragmentShader:cX.meshtoon_frag},matcap:{uniforms:as([cq.common,cq.bumpmap,cq.normalmap,cq.displacementmap,cq.fog,{matcap:{value:null}}]),vertexShader:cX.meshmatcap_vert,fragmentShader:cX.meshmatcap_frag},points:{uniforms:as([cq.points,cq.fog]),vertexShader:cX.points_vert,fragmentShader:cX.points_frag},dashed:{uniforms:as([cq.common,cq.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:cX.linedashed_vert,fragmentShader:cX.linedashed_frag},depth:{uniforms:as([cq.common,cq.displacementmap]),vertexShader:cX.depth_vert,fragmentShader:cX.depth_frag},normal:{uniforms:as([cq.common,cq.bumpmap,cq.normalmap,cq.displacementmap,{opacity:{value:1}}]),vertexShader:cX.meshnormal_vert,fragmentShader:cX.meshnormal_frag},sprite:{uniforms:as([cq.sprite,cq.fog]),vertexShader:cX.sprite_vert,fragmentShader:cX.sprite_frag},background:{uniforms:{uvTransform:{value:new nJ},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:cX.background_vert,fragmentShader:cX.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new nJ}},vertexShader:cX.backgroundCube_vert,fragmentShader:cX.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:cX.cube_vert,fragmentShader:cX.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:cX.equirect_vert,fragmentShader:cX.equirect_frag},distanceRGBA:{uniforms:as([cq.common,cq.displacementmap,{referencePosition:{value:new nX},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:cX.distanceRGBA_vert,fragmentShader:cX.distanceRGBA_frag},shadow:{uniforms:as([cq.lights,cq.fog,{color:{value:new iE(0)},opacity:{value:1}}]),vertexShader:cX.shadow_vert,fragmentShader:cX.shadow_frag}};cY.physical={uniforms:as([cY.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new nJ},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new nJ},clearcoatNormalScale:{value:new nW(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new nJ},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new nJ},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new nJ},sheen:{value:0},sheenColor:{value:new iE(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new nJ},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new nJ},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new nJ},transmissionSamplerSize:{value:new nW},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new nJ},attenuationDistance:{value:0},attenuationColor:{value:new iE(0)},specularColor:{value:new iE(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new nJ},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new nJ},anisotropyVector:{value:new nW},anisotropyMap:{value:null},anisotropyMapTransform:{value:new nJ}}]),vertexShader:cX.meshphysical_vert,fragmentShader:cX.meshphysical_frag};let cJ={r:0,b:0,g:0},cZ=new rK,cK=new rH;function c$(e,t,n,r,i,a,s){let o,l,u=new iE(0),c=+(!0!==a),h=null,d=0,p=null;function f(e){let r=!0===e.isScene?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?n:t).get(r)),r}function m(t,n){t.getRGB(cJ,ao(e)),r.buffers.color.setClear(cJ.r,cJ.g,cJ.b,n,s)}return{getClearColor:function(){return u},setClearColor:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;u.set(e),m(u,c=t)},getClearAlpha:function(){return c},setClearAlpha:function(e){m(u,c=e)},render:function(t){let n=!1,i=f(t);null===i?m(u,c):i&&i.isColor&&(m(i,1),n=!0);let a=e.xr.getEnvironmentBlendMode();"additive"===a?r.buffers.color.setClear(0,0,0,1,s):"alpha-blend"===a&&r.buffers.color.setClear(0,0,0,0,s),(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))},addToRenderList:function(t,n){let r=f(n);r&&(r.isCubeTexture||r.mapping===eE)?(void 0===l&&((l=new an(new ai(1,1,1),new au({name:"BackgroundCubeMaterial",uniforms:aa(cY.backgroundCube.uniforms),vertexShader:cY.backgroundCube.vertexShader,fragmentShader:cY.backgroundCube.fragmentShader,side:E,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),cZ.copy(n.backgroundRotation),cZ.x*=-1,cZ.y*=-1,cZ.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(cZ.y*=-1,cZ.z*=-1),l.material.uniforms.envMap.value=r,l.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(cK.makeRotationFromEuler(cZ)),l.material.toneMapped=n8.getTransfer(r.colorSpace)!==t1,(h!==r||d!==r.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,h=r,d=r.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):r&&r.isTexture&&(void 0===o&&((o=new an(new o4(2,2),new au({name:"BackgroundMaterial",uniforms:aa(cY.background.uniforms),vertexShader:cY.background.vertexShader,fragmentShader:cY.background.fragmentShader,side:w,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(o)),o.material.uniforms.t2D.value=r,o.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,o.material.toneMapped=n8.getTransfer(r.colorSpace)!==t1,!0===r.matrixAutoUpdate&&r.updateMatrix(),o.material.uniforms.uvTransform.value.copy(r.matrix),(h!==r||d!==r.version||p!==e.toneMapping)&&(o.material.needsUpdate=!0,h=r,d=r.version,p=e.toneMapping),o.layers.enableAll(),t.unshift(o,o.geometry,o.material,0,0,null))},dispose:function(){void 0!==l&&(l.geometry.dispose(),l.material.dispose(),l=void 0),void 0!==o&&(o.geometry.dispose(),o.material.dispose(),o=void 0)}}}function cQ(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=u(null),a=i,s=!1;function o(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function u(e){let t=[],r=[],i=[];for(let e=0;e=0){let n=i[t],r=s[t];if(void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor)),void 0===n||n.attribute!==r||r&&n.data!==r.data)return!0;o++}return a.attributesNum!==o||a.index!==r}(n,m,l,g))&&function(e,t,n,r){let i={},s=t.attributes,o=0,l=n.getAttributes();for(let t in l)if(l[t].location>=0){let n=s[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,o++}a.attributes=i,a.attributesNum=o,a.index=r}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(v||s)&&(s=!1,function(n,r,i,a){c();let s=a.attributes,o=i.getAttributes(),l=r.defaultAttributeValues;for(let r in o){let i=o[r];if(i.location>=0){let o=s[r];if(void 0===o&&("instanceMatrix"===r&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===r&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){let r=o.normalized,s=o.itemSize,l=t.get(o);if(void 0===l)continue;let u=l.buffer,c=l.type,p=l.bytesPerElement,m=c===e.INT||c===e.UNSIGNED_INT||o.gpuType===eG;if(o.isInterleavedBufferAttribute){let t=o.data,l=t.stride,g=o.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let s=void 0!==n.precision?n.precision:"highp",o=a(s);o!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",o,"instead."),s=o);let l=!0===n.logarithmicDepthBuffer,u=!0===n.reversedDepthBuffer&&t.has("EXT_clip_control"),c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),m=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),g=e.getParameter(e.MAX_VARYING_VECTORS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){let n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:a,textureFormatReadable:function(t){return t===e0||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){let i=n===eX&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return n===ez||r.convert(n)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)||n===ej||!!i},precision:s,logarithmicDepthBuffer:l,reversedDepthBuffer:u,maxTextures:c,maxVertexTextures:h,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:h>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function c2(e){let t=this,n=null,r=0,i=!1,a=!1,s=new sl,o=new nJ,l={value:null,needsUpdate:!1};function u(e,n,r,i){let a=null!==e?e.length:0,u=null;if(0!==a){if(u=l.value,!0!==i||null===u){let t=r+4*a,i=n.matrixWorldInverse;o.getNormalMatrix(i),(null===u||u.length0),t.numPlanes=r,t.numIntersection=0)}}function c3(e){let t=new WeakMap;function n(e,t){return t===eM?e.mapping=eb:t===ew&&(e.mapping=eS),e}function r(e){let n=e.target;n.removeEventListener("dispose",r);let i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){let a=i.mapping;if(a===eM||a===ew)if(t.has(i))return n(t.get(i).texture,i.mapping);else{let a=i.image;if(!a||!(a.height>0))return null;{let s=new av(a.height);return s.fromEquirectangularTexture(e,i),t.set(i,s),i.addEventListener("dispose",r),n(s.texture,i.mapping)}}}return i},dispose:function(){t=new WeakMap}}}let c4=[.125,.215,.35,.446,.526,.582],c5=new l7,c6=new iE,c8=null,c9=0,c7=0,he=!1,ht=(1+Math.sqrt(5))/2,hn=1/ht,hr=[new nX(-ht,hn,0),new nX(ht,hn,0),new nX(-hn,0,ht),new nX(hn,0,ht),new nX(0,ht,-hn),new nX(0,ht,hn),new nX(-1,1,-1),new nX(1,1,-1),new nX(-1,1,1),new nX(1,1,1)],hi=new nX;class ha{fromScene(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},{size:a=256,position:s=hi}=i;c8=this._renderer.getRenderTarget(),c9=this._renderer.getActiveCubeFace(),c7=this._renderer.getActiveMipmapLevel(),he=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,n,r,o,s),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}fromCubemap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=hu(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=hl(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?o=c4[s-e+4-1]:0===s&&(o=0),r.push(o);let l=1/(a-2),u=-l,c=1+l,h=[u,u,c,u,c,c,u,u,c,c,u,c],d=new Float32Array(108),p=new Float32Array(72),f=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];d.set(r,18*e),p.set(h,12*e);let i=[e,e,e,e,e,e];f.set(i,6*e)}let m=new i0;m.setAttribute("position",new iF(d,3)),m.setAttribute("uv",new iF(p,2)),m.setAttribute("faceIndex",new iF(f,1)),t.push(m),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){let r=new Float32Array(20),i=new nX(0,1,0);return new au({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:"".concat(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:hc(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n uniform int samples;\n uniform float weights[ n ];\n uniform bool latitudinal;\n uniform float dTheta;\n uniform float mipInt;\n uniform vec3 poleAxis;\n\n #define ENVMAP_TYPE_CUBE_UV\n #include \n\n vec3 getSample( float theta, vec3 axis ) {\n\n float cosTheta = cos( theta );\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross( axis, vOutputDirection ) * sin( theta )\n + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n return bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n }\n\n void main() {\n\n vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n if ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n }\n\n axis = normalize( axis );\n\n gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n for ( int i = 1; i < n; i++ ) {\n\n if ( i >= samples ) {\n\n break;\n\n }\n\n float theta = dTheta * float( i );\n gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n }\n\n }\n ",blending:A,depthTest:!1,depthWrite:!1})}(r,e,t)}return r}_compileMaterial(e){let t=new an(this._lodPlanes[0],e);this._renderer.compile(t,c5)}_sceneToCubeUV(e,t,n,r,i){let a=new af(90,1,t,n),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,u=l.autoClear,c=l.toneMapping;l.getClearColor(c6),l.toneMapping=ec,l.autoClear=!1,l.state.buffers.depth.getReversed()&&(l.setRenderTarget(r),l.clearDepth(),l.setRenderTarget(null));let h=new iR({name:"PMREM.Background",side:E,depthWrite:!1,depthTest:!1}),d=new an(new ai,h),p=!1,f=e.background;f?f.isColor&&(h.color.copy(f),e.background=null,p=!0):(h.color.copy(c6),p=!0);for(let t=0;t<6;t++){let n=t%3;0===n?(a.up.set(0,s[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x+o[t],i.y,i.z)):1===n?(a.up.set(0,0,s[t]),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y+o[t],i.z)):(a.up.set(0,s[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y,i.z+o[t]));let u=this._cubeSize;ho(r,n*u,t>2?u:0,u,u),l.setRenderTarget(r),p&&l.render(d,a),l.render(e,a)}d.geometry.dispose(),d.material.dispose(),l.toneMapping=c,l.autoClear=u,e.background=f}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===eb||e.mapping===eS;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=hu()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=hl());let i=r?this._cubemapMaterial:this._equirectMaterial,a=new an(this._lodPlanes[0],i);i.uniforms.envMap.value=e;let s=this._cubeSize;ho(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,c5)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodPlanes.length;for(let t=1;t20&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(f," samples when the maximum is set to ").concat(20));let m=[],g=0;for(let e=0;e<20;++e){let t=e/p,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:ev-4?r-v+4:0),_,3*y,2*y),o.setRenderTarget(t),o.render(u,c5)}constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}}function hs(e,t,n){let r=new ru(e,t,n);return r.texture.mapping=eE,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function ho(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function hl(){return new au({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:hc(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n\n #include \n\n void main() {\n\n vec3 outputDirection = normalize( vOutputDirection );\n vec2 uv = equirectUv( outputDirection );\n\n gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n }\n ",blending:A,depthTest:!1,depthWrite:!1})}function hu(){return new au({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:hc(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n uniform float flipEnvMap;\n\n varying vec3 vOutputDirection;\n\n uniform samplerCube envMap;\n\n void main() {\n\n gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n }\n ",blending:A,depthTest:!1,depthWrite:!1})}function hc(){return"\n\n precision mediump float;\n precision mediump int;\n\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position, 1.0 );\n\n }\n "}function hh(e){let t=new WeakMap,n=null;function r(e){let n=e.target;n.removeEventListener("dispose",r);let i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){let a=i.mapping,s=a===eM||a===ew,o=a===eb||a===eS;if(s||o){let a=t.get(i),l=void 0!==a?a.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==l)return null===n&&(n=new ha(e)),(a=s?n.fromEquirectangular(i,a):n.fromCubemap(i,a)).texture.pmremVersion=i.pmremVersion,t.set(i,a),a.texture;{if(void 0!==a)return a.texture;let l=i.image;return s&&l&&l.height>0||o&&l&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(l)?(null===n&&(n=new ha(e)),(a=s?n.fromEquirectangular(i):n.fromCubemap(i)).texture.pmremVersion=i.pmremVersion,t.set(i,a),i.addEventListener("dispose",r),a.texture):null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function hd(e){let t={};function n(n){let r;if(void 0!==t[n])return t[n];switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},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 null===t&&n3("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function hp(e,t,n,r){let i={},a=new WeakMap;function s(e){let o=e.target;for(let e in null!==o.index&&t.remove(o.index),o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",s),delete i[o.id];let l=a.get(o);l&&(t.remove(l),a.delete(o)),r.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){let n=[],r=e.index,i=e.attributes.position,s=0;if(null!==r){let e=r.array;s=r.version;for(let t=0,r=e.length;tt.maxTextureSize&&(f=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let m=new Float32Array(p*f*4*c),g=new rc(m,p,f,c);g.type=ej,g.needsUpdate=!0;let v=4*d;for(let t=0;t0)return e;let i=t*n,a=hM[i];if(void 0===a&&(a=new Float32Array(i),hM[i]=a),0!==t){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function hR(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n":" "," ").concat(i,": ").concat(n[e]))}return r.join("\n")}(e.getShaderSource(t),r)}}let dv=new nX;function dy(e){return""!==e}function d_(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function dx(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}let db=/^[ \t]*#include +<([\w\d./]+)>/gm;function dS(e){return e.replace(db,dw)}let dM=new Map;function dw(e,t){let n=cX[t];if(void 0===n){let e=dM.get(t);if(void 0!==e)n=cX[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e);else throw Error("Can not resolve #include <"+t+">")}return dS(n)}let dE=/#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 dT(e){return e.replace(dE,dA)}function dA(e,t,n,r){let i="";for(let e=parseInt(t);e0&&(i+="\n"),(a=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(dy).join("\n")).length>0&&(a+="\n")):(i=[dC(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,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 "+g:"",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&&!1===n.flatShading?"#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&&!1===n.flatShading?"#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 "+f:"",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","\n"].filter(dy).join("\n"),a=[dC(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,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 "+m:"",n.envMap?"#define "+g:"",n.envMap?"#define "+v:"",y?"#define CUBEUV_TEXEL_WIDTH "+y.texelWidth:"",y?"#define CUBEUV_TEXEL_HEIGHT "+y.texelHeight:"",y?"#define CUBEUV_MAX_MIP "+y.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&&!1===n.flatShading?"#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 "+f:"",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!==ec?"#define TONE_MAPPING":"",n.toneMapping!==ec?cX.tonemapping_pars_fragment:"",n.toneMapping!==ec?function(e,t){let n;switch(t){case eh:n="Linear";break;case ed:n="Reinhard";break;case ep:n="Cineon";break;case ef:n="ACESFilmic";break;case eg:n="AgX";break;case ev:n="Neutral";break;case em:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",cX.colorspace_pars_fragment,function(e,t){let n=function(e){n8._getMatrix(dm,n8.workingColorSpace,e);let t="mat3( ".concat(dm.elements.map(e=>e.toFixed(4))," )");switch(n8.getTransfer(e)){case t0:return[t,"LinearTransferOETF"];case t1:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}(t);return["vec4 ".concat(e,"( vec4 value ) {")," return ".concat(n[1],"( vec4( value.rgb * ").concat(n[0],", value.a ) );"),"}"].join("\n")}("linearToOutputTexel",n.outputColorSpace),function(){n8.getLuminanceCoefficients(dv);let e=dv.x.toFixed(4),t=dv.y.toFixed(4),n=dv.z.toFixed(4);return["float luminance( const in vec3 rgb ) {"," const vec3 weights = vec3( ".concat(e,", ").concat(t,", ").concat(n," );")," return dot( weights, rgb );\n}"].join("\n")}(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(dy).join("\n")),d=dx(d=d_(d=dS(d),n),n),p=dx(p=d_(p=dS(p),n),n),d=dT(d),p=dT(p),!0!==n.isRawShaderMaterial&&(E="#version 300 es\n",i=[_,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+i,a=["#define varying in",n.glslVersion===nT?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===nT?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+a);let T=E+i+d,A=E+a+p,C=dp(c,c.VERTEX_SHADER,T),R=dp(c,c.FRAGMENT_SHADER,A);function P(t){if(e.debug.checkShaderErrors){let n=c.getProgramInfoLog(w)||"",r=c.getShaderInfoLog(C)||"",s=c.getShaderInfoLog(R)||"",o=n.trim(),l=r.trim(),u=s.trim(),h=!0,d=!0;if(!1===c.getProgramParameter(w,c.LINK_STATUS))if(h=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(c,w,C,R);else{let e=dg(c,C,"vertex"),n=dg(c,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+c.getError()+" - VALIDATE_STATUS "+c.getProgramParameter(w,c.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+o+"\n"+e+"\n"+n)}else""!==o?console.warn("THREE.WebGLProgram: Program Info Log:",o):(""===l||""===u)&&(d=!1);d&&(t.diagnostics={runnable:h,programLog:o,vertexShader:{log:l,prefix:i},fragmentShader:{log:u,prefix:a}})}c.deleteShader(C),c.deleteShader(R),s=new dd(c,w),o=function(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i0,Z=a.clearcoat>0,K=a.dispersion>0,$=a.iridescence>0,Q=a.sheen>0,ee=a.transmission>0,et=J&&!!a.anisotropyMap,en=Z&&!!a.clearcoatMap,er=Z&&!!a.clearcoatNormalMap,ei=Z&&!!a.clearcoatRoughnessMap,ea=$&&!!a.iridescenceMap,es=$&&!!a.iridescenceThicknessMap,eo=Q&&!!a.sheenColorMap,el=Q&&!!a.sheenRoughnessMap,eu=!!a.specularMap,eh=!!a.specularColorMap,ed=!!a.specularIntensityMap,ep=ee&&!!a.transmissionMap,ef=ee&&!!a.thicknessMap,em=!!a.gradientMap,eg=!!a.alphaMap,ev=a.alphaTest>0,ey=!!a.alphaHash,e_=!!a.extensions,ex=ec;a.toneMapped&&(null===D||!0===D.isXRRenderTarget)&&(ex=e.toneMapping);let eb={shaderID:P,shaderType:a.type,shaderName:a.name,vertexShader:y,fragmentShader:_,defines:a.defines,customVertexShaderID:x,customFragmentShaderID:b,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:p,batching:F,batchingColor:F&&null!==v._colorsTexture,instancing:O,instancingColor:O&&null!==v.instanceColor,instancingMorph:O&&null!==v.morphTexture,supportsVertexTextures:d,outputColorSpace:null===D?e.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:tQ,alphaToCoverage:!!a.alphaToCoverage,map:k,matcap:z,envMap:B,envMapMode:B&&A.mapping,envMapCubeUVHeight:R,aoMap:H,lightMap:V,bumpMap:G,normalMap:W,displacementMap:d&&j,emissiveMap:X,normalMapObjectSpace:W&&a.normalMapType===tZ,normalMapTangentSpace:W&&a.normalMapType===tJ,metalnessMap:q,roughnessMap:Y,anisotropy:J,anisotropyMap:et,clearcoat:Z,clearcoatMap:en,clearcoatNormalMap:er,clearcoatRoughnessMap:ei,dispersion:K,iridescence:$,iridescenceMap:ea,iridescenceThicknessMap:es,sheen:Q,sheenColorMap:eo,sheenRoughnessMap:el,specularMap:eu,specularColorMap:eh,specularIntensityMap:ed,transmission:ee,transmissionMap:ep,thicknessMap:ef,gradientMap:em,opaque:!1===a.transparent&&a.blending===C&&!1===a.alphaToCoverage,alphaMap:eg,alphaTest:ev,alphaHash:ey,combine:a.combine,mapUv:k&&m(a.map.channel),aoMapUv:H&&m(a.aoMap.channel),lightMapUv:V&&m(a.lightMap.channel),bumpMapUv:G&&m(a.bumpMap.channel),normalMapUv:W&&m(a.normalMap.channel),displacementMapUv:j&&m(a.displacementMap.channel),emissiveMapUv:X&&m(a.emissiveMap.channel),metalnessMapUv:q&&m(a.metalnessMap.channel),roughnessMapUv:Y&&m(a.roughnessMap.channel),anisotropyMapUv:et&&m(a.anisotropyMap.channel),clearcoatMapUv:en&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:er&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ei&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:ea&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:es&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:eo&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:el&&m(a.sheenRoughnessMap.channel),specularMapUv:eu&&m(a.specularMap.channel),specularColorMapUv:eh&&m(a.specularColorMap.channel),specularIntensityMapUv:ed&&m(a.specularIntensityMap.channel),transmissionMapUv:ep&&m(a.transmissionMap.channel),thicknessMapUv:ef&&m(a.thicknessMap.channel),alphaMapUv:eg&&m(a.alphaMap.channel),vertexTangents:!!M.attributes.tangent&&(W||J),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!M.attributes.color&&4===M.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!M.attributes.uv&&(k||eg),fog:!!S,useFog:!0===a.fog,fogExp2:!!S&&S.isFogExp2,flatShading:!0===a.flatShading&&!1===a.wireframe,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:h,reversedDepthBuffer:U,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==M.morphAttributes.position,morphNormals:void 0!==M.morphAttributes.normal,morphColors:void 0!==M.morphAttributes.color,morphTargetsCount:L,morphTextureStride:N,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:ex,decodeVideoTexture:k&&!0===a.map.isVideoTexture&&n8.getTransfer(a.map.colorSpace)===t1,decodeVideoTextureEmissive:X&&!0===a.emissiveMap.isVideoTexture&&n8.getTransfer(a.emissiveMap.colorSpace)===t1,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===T,flipSided:a.side===E,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:e_&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(e_&&!0===a.extensions.multiDraw||F)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return eb.vertexUv1s=u.has(1),eb.vertexUv2s=u.has(2),eb.vertexUv3s=u.has(3),u.clear(),eb},getProgramCacheKey:function(t){var n,r,i,a;let s=[];if(t.shaderID?s.push(t.shaderID):(s.push(t.customVertexShaderID),s.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)s.push(e),s.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(n=s,r=t,n.push(r.precision),n.push(r.outputColorSpace),n.push(r.envMapMode),n.push(r.envMapCubeUVHeight),n.push(r.mapUv),n.push(r.alphaMapUv),n.push(r.lightMapUv),n.push(r.aoMapUv),n.push(r.bumpMapUv),n.push(r.normalMapUv),n.push(r.displacementMapUv),n.push(r.emissiveMapUv),n.push(r.metalnessMapUv),n.push(r.roughnessMapUv),n.push(r.anisotropyMapUv),n.push(r.clearcoatMapUv),n.push(r.clearcoatNormalMapUv),n.push(r.clearcoatRoughnessMapUv),n.push(r.iridescenceMapUv),n.push(r.iridescenceThicknessMapUv),n.push(r.sheenColorMapUv),n.push(r.sheenRoughnessMapUv),n.push(r.specularMapUv),n.push(r.specularColorMapUv),n.push(r.specularIntensityMapUv),n.push(r.transmissionMapUv),n.push(r.thicknessMapUv),n.push(r.combine),n.push(r.fogExp2),n.push(r.sizeAttenuation),n.push(r.morphTargetsCount),n.push(r.morphAttributeCount),n.push(r.numDirLights),n.push(r.numPointLights),n.push(r.numSpotLights),n.push(r.numSpotLightMaps),n.push(r.numHemiLights),n.push(r.numRectAreaLights),n.push(r.numDirLightShadows),n.push(r.numPointLightShadows),n.push(r.numSpotLightShadows),n.push(r.numSpotLightShadowsWithMaps),n.push(r.numLightProbes),n.push(r.shadowMapType),n.push(r.toneMapping),n.push(r.numClippingPlanes),n.push(r.numClipIntersection),n.push(r.depthPacking),i=s,a=t,o.disableAll(),a.supportsVertexTextures&&o.enable(0),a.instancing&&o.enable(1),a.instancingColor&&o.enable(2),a.instancingMorph&&o.enable(3),a.matcap&&o.enable(4),a.envMap&&o.enable(5),a.normalMapObjectSpace&&o.enable(6),a.normalMapTangentSpace&&o.enable(7),a.clearcoat&&o.enable(8),a.iridescence&&o.enable(9),a.alphaTest&&o.enable(10),a.vertexColors&&o.enable(11),a.vertexAlphas&&o.enable(12),a.vertexUv1s&&o.enable(13),a.vertexUv2s&&o.enable(14),a.vertexUv3s&&o.enable(15),a.vertexTangents&&o.enable(16),a.anisotropy&&o.enable(17),a.alphaHash&&o.enable(18),a.batching&&o.enable(19),a.dispersion&&o.enable(20),a.batchingColor&&o.enable(21),a.gradientMap&&o.enable(22),i.push(o.mask),o.disableAll(),a.fog&&o.enable(0),a.useFog&&o.enable(1),a.flatShading&&o.enable(2),a.logarithmicDepthBuffer&&o.enable(3),a.reversedDepthBuffer&&o.enable(4),a.skinning&&o.enable(5),a.morphTargets&&o.enable(6),a.morphNormals&&o.enable(7),a.morphColors&&o.enable(8),a.premultipliedAlpha&&o.enable(9),a.shadowMapEnabled&&o.enable(10),a.doubleSided&&o.enable(11),a.flipSided&&o.enable(12),a.useDepthPacking&&o.enable(13),a.dithering&&o.enable(14),a.transmission&&o.enable(15),a.sheen&&o.enable(16),a.opaque&&o.enable(17),a.pointsUvs&&o.enable(18),a.decodeVideoTexture&&o.enable(19),a.decodeVideoTextureEmissive&&o.enable(20),a.alphaToCoverage&&o.enable(21),i.push(o.mask),s.push(e.outputColorSpace)),s.push(t.customProgramCacheKey),s.join()},getUniforms:function(e){let t,n=f[e.type];if(n){let e=cY[n];t=al.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,n){let r;for(let e=0,t=c.length;e0?r.push(c):!0===s.transparent?i.push(c):n.push(c)},unshift:function(e,t,s,o,l,u){let c=a(e,t,s,o,l,u);s.transmission>0?r.unshift(c):!0===s.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=t,r=e.length;n1&&n.sort(e||dU),r.length>1&&r.sort(t||dO),i.length>1&&i.sort(t||dO)}}}function dk(){let e=new WeakMap;return{get:function(t,n){let r,i=e.get(t);return void 0===i?(r=new dF,e.set(t,[r])):n>=i.length?(r=new dF,i.push(r)):r=i[n],r},dispose:function(){e=new WeakMap}}}function dz(){let e={};return{get:function(t){let n;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":n={direction:new nX,color:new iE};break;case"SpotLight":n={position:new nX,direction:new nX,color:new iE,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new nX,color:new iE,distance:0,decay:0};break;case"HemisphereLight":n={direction:new nX,skyColor:new iE,groundColor:new iE};break;case"RectAreaLight":n={color:new iE,position:new nX,halfWidth:new nX,halfHeight:new nX}}return e[t.id]=n,n}}}let dB=0;function dH(e,t){return 2*!!t.castShadow-2*!!e.castShadow+ +!!t.map-!!e.map}function dV(e){let t=new dz,n=function(){let e={};return{get:function(t){let n;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nW};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nW,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),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 nX);let i=new nX,a=new rH,s=new rH;return{setup:function(i){let a=0,s=0,o=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,u=0,c=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,y=0;i.sort(dH);for(let e=0,_=i.length;e<_;e++){let _=i[e],x=_.color,b=_.intensity,S=_.distance,M=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)a+=x.r*b,s+=x.g*b,o+=x.b*b;else if(_.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(_.sh.coefficients[e],b);y++}else if(_.isDirectionalLight){let e=t.get(_);if(e.color.copy(_.color).multiplyScalar(_.intensity),_.castShadow){let e=_.shadow,t=n.get(_);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[l]=t,r.directionalShadowMap[l]=M,r.directionalShadowMatrix[l]=_.shadow.matrix,p++}r.directional[l]=e,l++}else if(_.isSpotLight){let e=t.get(_);e.position.setFromMatrixPosition(_.matrixWorld),e.color.copy(x).multiplyScalar(b),e.distance=S,e.coneCos=Math.cos(_.angle),e.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),e.decay=_.decay,r.spot[c]=e;let i=_.shadow;if(_.map&&(r.spotLightMap[g]=_.map,g++,i.updateMatrices(_),_.castShadow&&v++),r.spotLightMatrix[c]=i.matrix,_.castShadow){let e=n.get(_);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[c]=e,r.spotShadowMap[c]=M,m++}c++}else if(_.isRectAreaLight){let e=t.get(_);e.color.copy(x).multiplyScalar(b),e.halfWidth.set(.5*_.width,0,0),e.halfHeight.set(0,.5*_.height,0),r.rectArea[h]=e,h++}else if(_.isPointLight){let e=t.get(_);if(e.color.copy(_.color).multiplyScalar(_.intensity),e.distance=_.distance,e.decay=_.decay,_.castShadow){let e=_.shadow,t=n.get(_);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[u]=t,r.pointShadowMap[u]=M,r.pointShadowMatrix[u]=_.shadow.matrix,f++}r.point[u]=e,u++}else if(_.isHemisphereLight){let e=t.get(_);e.skyColor.copy(_.color).multiplyScalar(b),e.groundColor.copy(_.groundColor).multiplyScalar(b),r.hemi[d]=e,d++}}h>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=cq.LTC_FLOAT_1,r.rectAreaLTC2=cq.LTC_FLOAT_2):(r.rectAreaLTC1=cq.LTC_HALF_1,r.rectAreaLTC2=cq.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=s,r.ambient[2]=o;let _=r.hash;(_.directionalLength!==l||_.pointLength!==u||_.spotLength!==c||_.rectAreaLength!==h||_.hemiLength!==d||_.numDirectionalShadows!==p||_.numPointShadows!==f||_.numSpotShadows!==m||_.numSpotMaps!==g||_.numLightProbes!==y)&&(r.directional.length=l,r.spot.length=c,r.rectArea.length=h,r.point.length=u,r.hemi.length=d,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=f,r.pointShadowMap.length=f,r.spotShadow.length=m,r.spotShadowMap.length=m,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=f,r.spotLightMatrix.length=m+g-v,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=v,r.numLightProbes=y,_.directionalLength=l,_.pointLength=u,_.spotLength=c,_.rectAreaLength=h,_.hemiLength=d,_.numDirectionalShadows=p,_.numPointShadows=f,_.numSpotShadows=m,_.numSpotMaps=g,_.numLightProbes=y,r.version=dB++)},setupView:function(e,t){let n=0,o=0,l=0,u=0,c=0,h=t.matrixWorldInverse;for(let t=0,d=e.length;t1&&void 0!==arguments[1]?arguments[1]:0,a=t.get(n);return void 0===a?(r=new dG(e),t.set(n,[r])):i>=a.length?(r=new dG(e),a.push(r)):r=a[i],r},dispose:function(){t=new WeakMap}}}function dj(e,t,n){let r=new sd,i=new nW,a=new nW,s=new ro,o=new lp({depthPacking:tX}),l=new lf,u={},c=n.maxTextureSize,h={[w]:E,[E]:w,[T]:T},d=new au({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new nW},radius:{value:4}},vertexShader:"void main() {\n gl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;let f=new i0;f.setAttribute("position",new iF(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new an(f,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=b;let v=this.type;function y(t,n,r,i){let a=null,s=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==s)a=s;else if(a=!0===r.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||!0===n.alphaToCoverage){let e=a.uuid,t=n.uuid,r=u[e];void 0===r&&(r={},u[e]=r);let i=r[t];void 0===i&&(i=a.clone(),r[t]=i,n.addEventListener("dispose",_)),a=i}return a.visible=n.visible,a.wireframe=n.wireframe,i===M?a.side=null!==n.shadowSide?n.shadowSide:n.side:a.side=null!==n.shadowSide?n.shadowSide:h[n.side],a.alphaMap=n.alphaMap,a.alphaTest=!0===n.alphaToCoverage?.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,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=r),a}function _(e){for(let t in e.target.removeEventListener("dispose",_),u){let n=u[t],r=e.target.uuid;r in n&&(n[r].dispose(),delete n[r])}}this.render=function(n,o,l){if(!1===g.enabled||!1===g.autoUpdate&&!1===g.needsUpdate||0===n.length)return;let u=e.getRenderTarget(),h=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),_=e.state;_.setBlending(A),!0===_.buffers.depth.getReversed()?_.buffers.color.setClear(0,0,0,0):_.buffers.color.setClear(1,1,1,1),_.buffers.depth.setTest(!0),_.setScissorTest(!1);let x=v!==M&&this.type===M,b=v===M&&this.type!==M;for(let u=0,h=n.length;uc||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/g.x),i.x=a.x*g.x,f.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/g.y),i.y=a.y*g.y,f.mapSize.y=a.y)),null===f.map||!0===x||!0===b){let e=this.type!==M?{minFilter:eR,magFilter:eR}:{};null!==f.map&&f.map.dispose(),f.map=new ru(i.x,i.y,e),f.map.texture.name=h.name+".shadowMap",f.camera.updateProjectionMatrix()}e.setRenderTarget(f.map),e.clear();let v=f.getViewportCount();for(let n=0;n=1:-1!==em.indexOf("OpenGL ES")&&(ef=parseFloat(/^OpenGL ES (\d)/.exec(em)[1])>=2);let eg=null,ev={},ey=e.getParameter(e.SCISSOR_BOX),e_=e.getParameter(e.VIEWPORT),ex=new ro().fromArray(ey),eb=new ro().fromArray(e_);function eS(t,n,r,i){let a=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let s=0;sn||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1)if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);void 0===o&&(o=f(n,a));let s=t?f(n,a):o;return s.width=n,s.height=a,s.getContext("2d").drawImage(e,0,0,n,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+i.width+"x"+i.height+") to ("+n+"x"+a+")."),s}else"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+i.width+"x"+i.height+").");return e}function g(e){return e.generateMipmaps}function v(t){e.generateMipmap(t)}function y(n,r,i,a){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=r;if(r===e.RED&&(i===e.FLOAT&&(o=e.R32F),i===e.HALF_FLOAT&&(o=e.R16F),i===e.UNSIGNED_BYTE&&(o=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.R8UI),i===e.UNSIGNED_SHORT&&(o=e.R16UI),i===e.UNSIGNED_INT&&(o=e.R32UI),i===e.BYTE&&(o=e.R8I),i===e.SHORT&&(o=e.R16I),i===e.INT&&(o=e.R32I)),r===e.RG&&(i===e.FLOAT&&(o=e.RG32F),i===e.HALF_FLOAT&&(o=e.RG16F),i===e.UNSIGNED_BYTE&&(o=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RG8UI),i===e.UNSIGNED_SHORT&&(o=e.RG16UI),i===e.UNSIGNED_INT&&(o=e.RG32UI),i===e.BYTE&&(o=e.RG8I),i===e.SHORT&&(o=e.RG16I),i===e.INT&&(o=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RGB8UI),i===e.UNSIGNED_SHORT&&(o=e.RGB16UI),i===e.UNSIGNED_INT&&(o=e.RGB32UI),i===e.BYTE&&(o=e.RGB8I),i===e.SHORT&&(o=e.RGB16I),i===e.INT&&(o=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(o=e.RGBA16UI),i===e.UNSIGNED_INT&&(o=e.RGBA32UI),i===e.BYTE&&(o=e.RGBA8I),i===e.SHORT&&(o=e.RGBA16I),i===e.INT&&(o=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_INT_5_9_9_9_REV&&(o=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(o=e.R11F_G11F_B10F)),r===e.RGBA){let t=s?t0:n8.getTransfer(a);i===e.FLOAT&&(o=e.RGBA32F),i===e.HALF_FLOAT&&(o=e.RGBA16F),i===e.UNSIGNED_BYTE&&(o=t===t1?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(o=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(o=e.RGB5_A1)}return(o===e.R16F||o===e.R32F||o===e.RG16F||o===e.RG32F||o===e.RGBA16F||o===e.RGBA32F)&&t.get("EXT_color_buffer_float"),o}function _(t,n){let r;return t?null===n||n===eW||n===eJ?r=e.DEPTH24_STENCIL8:n===ej?r=e.DEPTH32F_STENCIL8:n===eV&&(r=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===eW||n===eJ?r=e.DEPTH_COMPONENT24:n===ej?r=e.DEPTH_COMPONENT32F:n===eV&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return!0===g(e)||e.isFramebufferTexture&&e.minFilter!==eR&&e.minFilter!==eD?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function b(e){let t=e.target;t.removeEventListener("dispose",b),function(e){let t=r.get(e);if(void 0===t.__webglInit)return;let n=e.source,i=d.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&M(e),0===Object.keys(i).length&&d.delete(n)}r.remove(e)}(t),t.isVideoTexture&&h.delete(t)}function S(t){let n=t.target;n.removeEventListener("dispose",S),function(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;r0&&a.__version!==t.version){let e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void L(a,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}let T={[eT]:e.REPEAT,[eA]:e.CLAMP_TO_EDGE,[eC]:e.MIRRORED_REPEAT},A={[eR]:e.NEAREST,[eP]:e.NEAREST_MIPMAP_NEAREST,[eL]:e.NEAREST_MIPMAP_LINEAR,[eD]:e.LINEAR,[eU]:e.LINEAR_MIPMAP_NEAREST,[eF]:e.LINEAR_MIPMAP_LINEAR},C={[nl]:e.NEVER,[nm]:e.ALWAYS,[nu]:e.LESS,[nh]:e.LEQUAL,[nc]:e.EQUAL,[nf]:e.GEQUAL,[nd]:e.GREATER,[np]:e.NOTEQUAL};function R(n,a){if((a.type===ej&&!1===t.has("OES_texture_float_linear")&&(a.magFilter===eD||a.magFilter===eU||a.magFilter===eL||a.magFilter===eF||a.minFilter===eD||a.minFilter===eU||a.minFilter===eL||a.minFilter===eF)&&console.warn("THREE.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,T[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,T[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,T[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,A[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,A[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,C[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic"))&&a.magFilter!==eR&&(a.minFilter===eL||a.minFilter===eF)&&(a.type!==ej||!1!==t.has("OES_texture_float_linear"))&&(a.anisotropy>1||r.get(a).__currentAnisotropy)){let s=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}function P(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",b));let i=n.source,a=d.get(i);void 0===a&&(a={},d.set(i,a));let o=function(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()}(n);if(o!==t.__cacheKey){void 0===a[o]&&(a[o]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,r=!0),a[o].usedTimes++;let i=a[t.__cacheKey];void 0!==i&&(a[t.__cacheKey].usedTimes--,0===i.usedTimes&&M(n)),t.__cacheKey=o,t.__webglTexture=a[o].texture}return r}function I(e,t,n){return Math.floor(Math.floor(e/n)/t)}function L(t,s,o){let l=e.TEXTURE_2D;(s.isDataArrayTexture||s.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),s.isData3DTexture&&(l=e.TEXTURE_3D);let u=P(t,s),c=s.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+o);let h=r.get(c);if(c.version!==h.__version||!0===u){let t;n.activeTexture(e.TEXTURE0+o);let r=n8.getPrimaries(n8.workingColorSpace),d=s.colorSpace===tK?null:n8.getPrimaries(s.colorSpace),p=s.colorSpace===tK||r===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);let f=m(s.image,!1,i.maxTextureSize);f=H(s,f);let b=a.convert(s.format,s.colorSpace),S=a.convert(s.type),M=y(s.internalFormat,b,S,s.colorSpace,s.isVideoTexture);R(l,s);let w=s.mipmaps,E=!0!==s.isVideoTexture,T=void 0===h.__version||!0===u,A=c.dataReady,C=x(s,f);if(s.isDepthTexture)M=_(s.format===e2,s.type),T&&(E?n.texStorage2D(e.TEXTURE_2D,1,M,f.width,f.height):n.texImage2D(e.TEXTURE_2D,0,M,f.width,f.height,0,b,S,null));else if(s.isDataTexture)if(w.length>0){E&&T&&n.texStorage2D(e.TEXTURE_2D,C,M,w[0].width,w[0].height);for(let r=0,i=w.length;re.start-t.start);let o=0;for(let e=1;e0){let i=cV(t.width,t.height,s.format,s.type);for(let a of s.layerUpdates){let s=t.data.subarray(a*i/t.data.BYTES_PER_ELEMENT,(a+1)*i/t.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,a,t.width,t.height,1,b,s)}s.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,0,t.width,t.height,f.depth,b,t.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,r,M,t.width,t.height,f.depth,0,t.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else E?A&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,0,t.width,t.height,f.depth,b,S,t.data):n.texImage3D(e.TEXTURE_2D_ARRAY,r,M,t.width,t.height,f.depth,0,b,S,t.data)}else{E&&T&&n.texStorage2D(e.TEXTURE_2D,C,M,w[0].width,w[0].height);for(let r=0,i=w.length;r0){let t=cV(f.width,f.height,s.format,s.type);for(let r of s.layerUpdates){let i=f.data.subarray(r*t/f.data.BYTES_PER_ELEMENT,(r+1)*t/f.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,f.width,f.height,1,b,S,i)}s.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,b,S,f.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,M,f.width,f.height,f.depth,0,b,S,f.data);else if(s.isData3DTexture)E?(T&&n.texStorage3D(e.TEXTURE_3D,C,M,f.width,f.height,f.depth),A&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,b,S,f.data)):n.texImage3D(e.TEXTURE_3D,0,M,f.width,f.height,f.depth,0,b,S,f.data);else if(s.isFramebufferTexture){if(T)if(E)n.texStorage2D(e.TEXTURE_2D,C,M,f.width,f.height);else{let t=f.width,r=f.height;for(let i=0;i>=1,r>>=1}}else if(w.length>0){if(E&&T){let t=V(w[0]);n.texStorage2D(e.TEXTURE_2D,C,M,t.width,t.height)}for(let r=0,i=w.length;r>c),r=Math.max(1,i.height>>c);u===e.TEXTURE_3D||u===e.TEXTURE_2D_ARRAY?n.texImage3D(u,c,p,t,r,i.depth,0,h,d,null):n.texImage2D(u,c,p,t,r,0,h,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),B(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,u,m.__webglTexture,0,z(i)):(u===e.TEXTURE_2D||u>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,u,m.__webglTexture,c),n.bindFramebuffer(e.FRAMEBUFFER,null)}function D(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,s=_(n.stencilBuffer,a),o=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=z(n);B(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,u,s,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,u,s,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,s,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,o,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)throw Error("target.depthTexture not supported in Cube render targets");let e=t.texture.mipmaps;e&&e.length>0?U(i.__webglFramebuffer[0],t):U(i.__webglFramebuffer,t)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),void 0===i.__webglDepthbuffer[r])i.__webglDepthbuffer[r]=e.createRenderbuffer(),D(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),void 0===i.__webglDepthbuffer)i.__webglDepthbuffer=e.createRenderbuffer(),D(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)}let F=[],k=[];function z(e){return Math.min(i.maxSamples,e.samples)}function B(e){let n=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function H(e,t){let n=e.colorSpace,r=e.format,i=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==tQ&&n!==tK&&(n8.getTransfer(n)===t1?(r!==e0||i!==ez)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),t}function V(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){let e=w;return e>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+i.maxTextures),w+=1,e},this.resetTextureUnits=function(){w=0},this.setTexture2D=E,this.setTexture2DArray=function(t,i){let a=r.get(t);if(!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version)return void L(a,t,i);n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){let a=r.get(t);if(!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version)return void L(a,t,i);n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,s){let o=r.get(t);if(t.version>0&&o.__version!==t.version)return void function(t,s,o){if(6!==s.image.length)return;let l=P(t,s),u=s.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+o);let c=r.get(u);if(u.version!==c.__version||!0===l){let t;n.activeTexture(e.TEXTURE0+o);let r=n8.getPrimaries(n8.workingColorSpace),h=s.colorSpace===tK?null:n8.getPrimaries(s.colorSpace),d=s.colorSpace===tK||r===h?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let p=s.isCompressedTexture||s.image[0].isCompressedTexture,f=s.image[0]&&s.image[0].isDataTexture,_=[];for(let e=0;e<6;e++)p||f?_[e]=f?s.image[e].image:s.image[e]:_[e]=m(s.image[e],!0,i.maxCubemapSize),_[e]=H(s,_[e]);let b=_[0],S=a.convert(s.format,s.colorSpace),M=a.convert(s.type),w=y(s.internalFormat,S,M,s.colorSpace),E=!0!==s.isVideoTexture,T=void 0===c.__version||!0===l,A=u.dataReady,C=x(s,b);if(R(e.TEXTURE_CUBE_MAP,s),p){E&&T&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,w,b.width,b.height);for(let r=0;r<6;r++){t=_[r].mipmaps;for(let i=0;i0&&C++;let r=V(_[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,w,r.width,r.height)}for(let r=0;r<6;r++)if(f){E?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,0,0,_[r].width,_[r].height,S,M,_[r].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,w,_[r].width,_[r].height,0,S,M,_[r].data);for(let i=0;i1;if(!h&&(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,s.memory.textures++),c){o.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){o.__webglFramebuffer[t]=[];for(let n=0;n0){o.__webglFramebuffer=[];for(let t=0;t0&&!1===B(t)){o.__webglMultisampledFramebuffer=e.createFramebuffer(),o.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,o.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0){if(!1===B(t)){let i=t.textures,a=t.width,s=t.height,o=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=r.get(t),h=i.length>1;if(h)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:tK,a=n8.getTransfer(i);if(n===ez)return e.UNSIGNED_BYTE;if(n===eq)return e.UNSIGNED_SHORT_4_4_4_4;if(n===eY)return e.UNSIGNED_SHORT_5_5_5_1;if(n===eZ)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===eK)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===eB)return e.BYTE;if(n===eH)return e.SHORT;if(n===eV)return e.UNSIGNED_SHORT;if(n===eG)return e.INT;if(n===eW)return e.UNSIGNED_INT;if(n===ej)return e.FLOAT;if(n===eX)return e.HALF_FLOAT;if(n===e$)return e.ALPHA;if(n===eQ)return e.RGB;if(n===e0)return e.RGBA;if(n===e1)return e.DEPTH_COMPONENT;if(n===e2)return e.DEPTH_STENCIL;if(n===e3)return e.RED;if(n===e4)return e.RED_INTEGER;if(n===e5)return e.RG;if(n===e6)return e.RG_INTEGER;if(n===e9)return e.RGBA_INTEGER;if(n===e7||n===te||n===tt||n===tn)if(a===t1){if(null===(r=t.get("WEBGL_compressed_texture_s3tc_srgb")))return null;if(n===e7)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===te)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===tt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===tn)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(null===(r=t.get("WEBGL_compressed_texture_s3tc")))return null;if(n===e7)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===te)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===tt)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===tn)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===tr||n===ti||n===ta||n===ts){if(null===(r=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(n===tr)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===ti)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===ta)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ts)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===to||n===tl||n===tu){if(null===(r=t.get("WEBGL_compressed_texture_etc")))return null;if(n===to||n===tl)return a===t1?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===tu)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(n===tc||n===th||n===td||n===tp||n===tf||n===tm||n===tg||n===tv||n===ty||n===t_||n===tx||n===tb||n===tS||n===tM){if(null===(r=t.get("WEBGL_compressed_texture_astc")))return null;if(n===tc)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===th)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===td)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===tp)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===tf)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===tm)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===tg)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===tv)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===ty)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===t_)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===tx)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===tb)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===tS)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===tM)return a===t1?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===tw||n===tE||n===tT){if(null===(r=t.get("EXT_texture_compression_bptc")))return null;if(n===tw)return a===t1?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===tE)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===tT)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(n===tA||n===tC||n===tR||n===tP){if(null===(r=t.get("EXT_texture_compression_rgtc")))return null;if(n===tA)return r.COMPRESSED_RED_RGTC1_EXT;if(n===tC)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===tR)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===tP)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===eJ?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}class dZ{init(e,t){if(null===this.texture){let n=new s9(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(null!==this.texture&&null===this.mesh){let t=e.cameras[0].viewport,n=new au({vertexShader:"\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n if ( coord.x >= 1.0 ) {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n } else {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n }\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new an(new o4(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}}class dK extends nL{constructor(e,t){super();let n=this,r=null,i=1,a=null,s="local-floor",o=1,l=null,u=null,c=null,h=null,d=null,p=null,f="undefined"!=typeof XRWebGLBinding,m=new dZ,g={},v=t.getContextAttributes(),y=null,_=null,x=[],b=[],S=new nW,M=null,w=new af;w.viewport=new ro;let E=new af;E.viewport=new ro;let T=[w,E],A=new uS,C=null,R=null;function P(e){let t=b.indexOf(e.inputSource);if(-1===t)return;let n=x[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function I(){r.removeEventListener("select",P),r.removeEventListener("selectstart",P),r.removeEventListener("selectend",P),r.removeEventListener("squeeze",P),r.removeEventListener("squeezestart",P),r.removeEventListener("squeezeend",P),r.removeEventListener("end",I),r.removeEventListener("inputsourceschange",L);for(let e=0;e=0&&(b[r]=null,x[r].disconnect(n))}for(let t=0;t=b.length){b.push(n),r=e;break}else if(null===b[e]){b[e]=n,r=e;break}if(-1===r)break}let i=x[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=x[e];return void 0===t&&(t=new ax,x[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=x[e];return void 0===t&&(t=new ax,x[e]=t),t.getGripSpace()},this.getHand=function(e){let t=x[e];return void 0===t&&(t=new ax,x[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return null===c&&f&&(c=new XRWebGLBinding(r,t)),c},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(u){if(null!==(r=u)){if(y=e.getRenderTarget(),r.addEventListener("select",P),r.addEventListener("selectstart",P),r.addEventListener("selectend",P),r.addEventListener("squeeze",P),r.addEventListener("squeezestart",P),r.addEventListener("squeezeend",P),r.addEventListener("end",I),r.addEventListener("inputsourceschange",L),!0!==v.xrCompatible&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(S),f&&"createProjectionLayer"in XRWebGLBinding.prototype){let n=null,a=null,s=null;v.depth&&(s=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=v.stencil?e2:e1,a=v.stencil?eJ:eW);let o={colorFormat:t.RGBA8,depthFormat:s,scaleFactor:i};h=(c=this.getBinding()).createProjectionLayer(o),r.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),_=new ru(h.textureWidth,h.textureHeight,{format:e0,type:ez,depthTexture:new s8(h.textureWidth,h.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:4*!!v.antialias,resolveDepthBuffer:!1===h.ignoreDepthValues,resolveStencilBuffer:!1===h.ignoreDepthValues})}else{let n={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:i};d=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),_=new ru(d.framebufferWidth,d.framebufferHeight,{format:e0,type:ez,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:!1===d.ignoreDepthValues,resolveStencilBuffer:!1===d.ignoreDepthValues})}_.isXRRenderTarget=!0,this.setFoveation(o),l=null,a=await r.requestReferenceSpace(s),F.setContext(r),F.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};let N=new nX,D=new nX;function U(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){var t,n,i;if(null===r)return;let a=e.near,s=e.far;null!==m.texture&&(m.depthNear>0&&(a=m.depthNear),m.depthFar>0&&(s=m.depthFar)),A.near=E.near=w.near=a,A.far=E.far=w.far=s,(C!==A.near||R!==A.far)&&(r.updateRenderState({depthNear:A.near,depthFar:A.far}),C=A.near,R=A.far),A.layers.mask=6|e.layers.mask,w.layers.mask=3&A.layers.mask,E.layers.mask=5&A.layers.mask;let o=e.parent,l=A.cameras;U(A,o);for(let e=0;e0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,s=i.envMapRotation;a&&(e.envMap.value=a,d$.copy(s),d$.x*=-1,d$.y*=-1,d$.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(d$.y*=-1,d$.z*=-1),e.envMapRotation.value.setFromMatrix4(dQ.makeRotationFromEuler(d$)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-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))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,ao(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,a,s,o){var l,u,c,h,d,p,f,m,g,v,y,_,x,b,S,M,w,T,A,C,R;i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),l=e,(u=i).gradientMap&&(l.gradientMap.value=u.gradientMap)):i.isMeshPhongMaterial?(r(e,i),c=e,h=i,c.specular.value.copy(h.specular),c.shininess.value=Math.max(h.shininess,1e-4)):i.isMeshStandardMaterial?(r(e,i),d=e,p=i,d.metalness.value=p.metalness,p.metalnessMap&&(d.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,d.metalnessMapTransform)),d.roughness.value=p.roughness,p.roughnessMap&&(d.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,d.roughnessMapTransform)),p.envMap&&(d.envMapIntensity.value=p.envMapIntensity),i.isMeshPhysicalMaterial&&(f=e,m=i,g=o,f.ior.value=m.ior,m.sheen>0&&(f.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),f.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(f.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,f.sheenColorMapTransform)),m.sheenRoughnessMap&&(f.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,f.sheenRoughnessMapTransform))),m.clearcoat>0&&(f.clearcoat.value=m.clearcoat,f.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(f.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,f.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(f.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,f.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(f.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,f.clearcoatNormalMapTransform),f.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===E&&f.clearcoatNormalScale.value.negate())),m.dispersion>0&&(f.dispersion.value=m.dispersion),m.iridescence>0&&(f.iridescence.value=m.iridescence,f.iridescenceIOR.value=m.iridescenceIOR,f.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],f.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(f.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,f.iridescenceMapTransform)),m.iridescenceThicknessMap&&(f.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,f.iridescenceThicknessMapTransform))),m.transmission>0&&(f.transmission.value=m.transmission,f.transmissionSamplerMap.value=g.texture,f.transmissionSamplerSize.value.set(g.width,g.height),m.transmissionMap&&(f.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,f.transmissionMapTransform)),f.thickness.value=m.thickness,m.thicknessMap&&(f.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,f.thicknessMapTransform)),f.attenuationDistance.value=m.attenuationDistance,f.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(f.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(f.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,f.anisotropyMapTransform))),f.specularIntensity.value=m.specularIntensity,f.specularColor.value.copy(m.specularColor),m.specularColorMap&&(f.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,f.specularColorMapTransform)),m.specularIntensityMap&&(f.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,f.specularIntensityMapTransform)))):i.isMeshMatcapMaterial?(r(e,i),v=e,(y=i).matcap&&(v.matcap.value=y.matcap)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(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}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(_=e,x=i,_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,x.map&&(_.map.value=x.map,n(x.map,_.mapTransform)),i.isLineDashedMaterial&&(b=e,S=i,b.dashSize.value=S.dashSize,b.totalSize.value=S.dashSize+S.gapSize,b.scale.value=S.scale)):i.isPointsMaterial?(M=e,w=i,T=a,A=s,M.diffuse.value.copy(w.color),M.opacity.value=w.opacity,M.size.value=w.size*T,M.scale.value=.5*A,w.map&&(M.map.value=w.map,n(w.map,M.uvTransform)),w.alphaMap&&(M.alphaMap.value=w.alphaMap,n(w.alphaMap,M.alphaMapTransform)),w.alphaTest>0&&(M.alphaTest.value=w.alphaTest)):i.isSpriteMaterial?(C=e,R=i,C.diffuse.value.copy(R.color),C.opacity.value=R.opacity,C.rotation.value=R.rotation,R.map&&(C.map.value=R.map,n(R.map,C.mapTransform)),R.alphaMap&&(C.alphaMap.value=R.alphaMap,n(R.alphaMap,C.alphaMapTransform)),R.alphaTest>0&&(C.alphaTest.value=R.alphaTest)):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function d1(e,t,n,r){let i={},a={},s=[],o=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e){let t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(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?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){let n=t.target;n.removeEventListener("dispose",u);let r=s.indexOf(n.__bindingPointIndex);s.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}return{bind:function(e,t){let n=t.program;r.uniformBlockBinding(e,n)},update:function(n,c){let h=i[n.id];void 0===h&&(function(e){let t=e.uniforms,n=0;for(let e=0,r=t.length;e0&&(n+=16-r),e.__size=n,e.__cache={}}(n),h=function(t){let n=function(){for(let e=0;e2)||void 0===arguments[2]||arguments[2];if(eT.isPresenting)return void console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");ea=e,es=t,P.width=Math.floor(e*eo),P.height=Math.floor(t*eo),!0===n&&(P.style.width=e+"px",P.style.height=t+"px"),this.setViewport(0,0,e,t)},this.getDrawingBufferSize=function(e){return e.set(ea*eo,es*eo).floor()},this.setDrawingBufferSize=function(e,t,n){ea=e,es=t,eo=n,P.width=Math.floor(e*n),P.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return e.copy(ee)},this.getViewport=function(e){return e.copy(eh)},this.setViewport=function(e,t,n,r){e.isVector4?eh.set(e.x,e.y,e.z,e.w):eh.set(e,t,n,r),i.viewport(ee.copy(eh).multiplyScalar(eo).round())},this.getScissor=function(e){return e.copy(ed)},this.setScissor=function(e,t,n,r){e.isVector4?ed.set(e.x,e.y,e.z,e.w):ed.set(e,t,n,r),i.scissor(et.copy(ed).multiplyScalar(eo).round())},this.getScissorTest=function(){return ep},this.setScissorTest=function(e){i.setScissorTest(ep=e)},this.setOpaqueSort=function(e){el=e},this.setTransparentSort=function(e){eu=e},this.getClearColor=function(e){return e.copy(x.getClearColor())},this.setClearColor=function(){x.setClearColor(...arguments)},this.getClearAlpha=function(){return x.getClearAlpha()},this.setClearAlpha=function(){x.setClearAlpha(...arguments)},this.clear=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=0;if(e){let e=!1;if(null!==K){let t=K.texture.format;e=t===e9||t===e6||t===e4}if(e){let e=K.texture.type,t=e===ez||e===eW||e===eV||e===eJ||e===eq||e===eY,n=x.getClearColor(),r=x.getClearAlpha(),i=n.r,a=n.g,s=n.b;t?(H[0]=i,H[1]=a,H[2]=s,H[3]=r,eM.clearBufferuiv(eM.COLOR,0,H)):(V[0]=i,V[1]=a,V[2]=s,V[3]=r,eM.clearBufferiv(eM.COLOR,0,V))}else r|=eM.COLOR_BUFFER_BIT}t&&(r|=eM.DEPTH_BUFFER_BIT),n&&(r|=eM.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(0xffffffff)),eM.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){P.removeEventListener("webglcontextlost",eA,!1),P.removeEventListener("webglcontextrestored",eC,!1),P.removeEventListener("webglcontextcreationerror",eR,!1),x.dispose(),g.dispose(),v.dispose(),s.dispose(),l.dispose(),u.dispose(),d.dispose(),C.dispose(),R.dispose(),f.dispose(),eT.dispose(),eT.removeEventListener("sessionstart",eN),eT.removeEventListener("sessionend",eD),eU.stop()},this.renderBufferDirect=function(e,t,a,d,p,f){let g;null===t&&(t=ex);let v=p.isMesh&&0>p.matrixWorld.determinant(),_=function(e,t,n,a,c){var h,d;!0!==t.isScene&&(t=ex),o.resetTextureUnits();let p=t.fog,f=a.isMeshStandardMaterial?t.environment:null,g=null===K?q.outputColorSpace:!0===K.isXRRenderTarget?K.texture.colorSpace:tQ,v=(a.isMeshStandardMaterial?u:l).get(a.envMap||f),_=!0===a.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,x=!!n.attributes.tangent&&(!!a.normalMap||a.anisotropy>0),S=!!n.morphAttributes.position,M=!!n.morphAttributes.normal,w=!!n.morphAttributes.color,E=ec;a.toneMapped&&(null===K||!0===K.isXRRenderTarget)&&(E=q.toneMapping);let T=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,A=void 0!==T?T.length:0,C=s.get(a),P=W.state.lights;if(!0===em&&(!0===eg||e!==Q)){let t=e===Q&&a.id===$;y.setState(a,e,t)}let I=!1;a.version===C.__version?C.needsLights&&C.lightsStateVersion!==P.state.version||C.outputColorSpace!==g||c.isBatchedMesh&&!1===C.batching?I=!0:c.isBatchedMesh||!0!==C.batching?c.isBatchedMesh&&!0===C.batchingColor&&null===c.colorTexture||c.isBatchedMesh&&!1===C.batchingColor&&null!==c.colorTexture||c.isInstancedMesh&&!1===C.instancing?I=!0:c.isInstancedMesh||!0!==C.instancing?c.isSkinnedMesh&&!1===C.skinning?I=!0:c.isSkinnedMesh||!0!==C.skinning?c.isInstancedMesh&&!0===C.instancingColor&&null===c.instanceColor||c.isInstancedMesh&&!1===C.instancingColor&&null!==c.instanceColor||c.isInstancedMesh&&!0===C.instancingMorph&&null===c.morphTexture||c.isInstancedMesh&&!1===C.instancingMorph&&null!==c.morphTexture||C.envMap!==v||!0===a.fog&&C.fog!==p||void 0!==C.numClippingPlanes&&(C.numClippingPlanes!==y.numPlanes||C.numIntersection!==y.numIntersection)||C.vertexAlphas!==_||C.vertexTangents!==x||C.morphTargets!==S||C.morphNormals!==M||C.morphColors!==w||C.toneMapping!==E?I=!0:C.morphTargetsCount!==A&&(I=!0):I=!0:I=!0:I=!0:(I=!0,C.__version=a.version);let L=C.currentProgram;!0===I&&(L=ej(a,t,c));let N=!1,D=!1,U=!1,O=L.getUniforms(),F=C.uniforms;if(i.useProgram(L.program)&&(N=!0,D=!0,U=!0),a.id!==$&&($=a.id,D=!0),N||Q!==e){i.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),O.setValue(eM,"projectionMatrix",e.projectionMatrix),O.setValue(eM,"viewMatrix",e.matrixWorldInverse);let t=O.map.cameraPosition;void 0!==t&&t.setValue(eM,ey.setFromMatrixPosition(e.matrixWorld)),r.logarithmicDepthBuffer&&O.setValue(eM,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(a.isMeshPhongMaterial||a.isMeshToonMaterial||a.isMeshLambertMaterial||a.isMeshBasicMaterial||a.isMeshStandardMaterial||a.isShaderMaterial)&&O.setValue(eM,"isOrthographic",!0===e.isOrthographicCamera),Q!==e&&(Q=e,D=!0,U=!0)}if(c.isSkinnedMesh){O.setOptional(eM,c,"bindMatrix"),O.setOptional(eM,c,"bindMatrixInverse");let e=c.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),O.setValue(eM,"boneTexture",e.boneTexture,o))}c.isBatchedMesh&&(O.setOptional(eM,c,"batchingTexture"),O.setValue(eM,"batchingTexture",c._matricesTexture,o),O.setOptional(eM,c,"batchingIdTexture"),O.setValue(eM,"batchingIdTexture",c._indirectTexture,o),O.setOptional(eM,c,"batchingColorTexture"),null!==c._colorsTexture&&O.setValue(eM,"batchingColorTexture",c._colorsTexture,o));let k=n.morphAttributes;if((void 0!==k.position||void 0!==k.normal||void 0!==k.color)&&b.update(c,n,L),(D||C.receiveShadow!==c.receiveShadow)&&(C.receiveShadow=c.receiveShadow,O.setValue(eM,"receiveShadow",c.receiveShadow)),a.isMeshGouraudMaterial&&null!==a.envMap&&(F.envMap.value=v,F.flipEnvMap.value=v.isCubeTexture&&!1===v.isRenderTargetTexture?-1:1),a.isMeshStandardMaterial&&null===a.envMap&&null!==t.environment&&(F.envMapIntensity.value=t.environmentIntensity),D&&(O.setValue(eM,"toneMappingExposure",q.toneMappingExposure),C.needsLights&&(h=F,d=U,h.ambientLightColor.needsUpdate=d,h.lightProbe.needsUpdate=d,h.directionalLights.needsUpdate=d,h.directionalLightShadows.needsUpdate=d,h.pointLights.needsUpdate=d,h.pointLightShadows.needsUpdate=d,h.spotLights.needsUpdate=d,h.spotLightShadows.needsUpdate=d,h.rectAreaLights.needsUpdate=d,h.hemisphereLights.needsUpdate=d),p&&!0===a.fog&&m.refreshFogUniforms(F,p),m.refreshMaterialUniforms(F,a,eo,es,W.state.transmissionRenderTarget[e.id]),dd.upload(eM,eZ(C),F,o)),a.isShaderMaterial&&!0===a.uniformsNeedUpdate&&(dd.upload(eM,eZ(C),F,o),a.uniformsNeedUpdate=!1),a.isSpriteMaterial&&O.setValue(eM,"center",c.center),O.setValue(eM,"modelViewMatrix",c.modelViewMatrix),O.setValue(eM,"normalMatrix",c.normalMatrix),O.setValue(eM,"modelMatrix",c.matrixWorld),a.isShaderMaterial||a.isRawShaderMaterial){let e=a.uniformsGroups;for(let t=0,n=e.length;t2&&void 0!==arguments[2]?arguments[2]:null;null===n&&(n=e),(W=v.get(n)).init(t),X.push(W),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(W.pushLight(e),e.castShadow&&W.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(W.pushLight(e),e.castShadow&&W.pushShadow(e))}),W.setupLights();let r=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t)if(Array.isArray(t))for(let i=0;i2&&void 0!==arguments[2]?arguments[2]:null,i=this.compile(e,t,r);return new Promise(t=>{function r(){if(i.forEach(function(e){s.get(e).currentProgram.isReady()&&i.delete(e)}),0===i.size)return void t(e);setTimeout(r,10)}null!==n.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)})};let eL=null;function eN(){eU.stop()}function eD(){eU.start()}let eU=new cW;function eO(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)W.pushLight(e),e.castShadow&&W.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ef.intersectsSprite(e)){r&&e_.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ev);let t=d.update(e),i=e.material;i.visible&&G.push(e,t,i,n,e_.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ef.intersectsObject(e))){let t=d.update(e),i=e.material;if(r&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),e_.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),e_.copy(t.boundingSphere.center)),e_.applyMatrix4(e.matrixWorld).applyMatrix4(ev)),Array.isArray(i)){let r=t.groups;for(let a=0,s=r.length;a0&&eH(a,t,n),s.length>0&&eH(s,t,n),o.length>0&&eH(o,t,n),i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),i.setPolygonOffset(!1)}function eB(e,t,r,i){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;void 0===W.state.transmissionRenderTarget[i.id]&&(W.state.transmissionRenderTarget[i.id]=new ru(1,1,{generateMipmaps:!0,type:n.has("EXT_color_buffer_half_float")||n.has("EXT_color_buffer_float")?eX:ez,minFilter:eF,samples:4,stencilBuffer:N,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:n8.workingColorSpace}));let a=W.state.transmissionRenderTarget[i.id],s=i.viewport||ee;a.setSize(s.z*q.transmissionResolutionScale,s.w*q.transmissionResolutionScale);let l=q.getRenderTarget(),u=q.getActiveCubeFace(),c=q.getActiveMipmapLevel();q.setRenderTarget(a),q.getClearColor(er),(ei=q.getClearAlpha())<1&&q.setClearColor(0xffffff,.5),q.clear(),eb&&x.render(r);let h=q.toneMapping;q.toneMapping=ec;let d=i.viewport;if(void 0!==i.viewport&&(i.viewport=void 0),W.setupLightsView(i),!0===em&&y.setGlobalState(q.clippingPlanes,i),eH(e,r,i),o.updateMultisampleRenderTarget(a),o.updateRenderTargetMipmap(a),!1===n.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let n=0,a=t.length;n0)for(let t=0,a=n.length;t0&&eB(r,i,e,t),eb&&x.render(e),ek(G,e,t);null!==K&&0===Z&&(o.updateMultisampleRenderTarget(K),o.updateRenderTargetMipmap(K)),!0===e.isScene&&e.onAfterRender(q,e,t),C.resetDefaultState(),$=-1,Q=null,X.pop(),X.length>0?(W=X[X.length-1],!0===em&&y.setGlobalState(q.clippingPlanes,W.state.camera)):W=null,j.pop(),G=j.length>0?j[j.length-1]:null},this.getActiveCubeFace=function(){return J},this.getActiveMipmapLevel=function(){return Z},this.getRenderTarget=function(){return K},this.setRenderTargetTextures=function(e,t,n){let r=s.get(e);r.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===r.__autoAllocateDepthBuffer&&(r.__useRenderToTexture=!1),s.get(e.texture).__webglTexture=t,s.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=s.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t};let e$=eM.createFramebuffer();this.setRenderTarget=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;K=e,J=t,Z=n;let r=!0,a=null,l=!1,u=!1;if(e){let c=s.get(e);if(void 0!==c.__useDefaultFramebuffer)i.bindFramebuffer(eM.FRAMEBUFFER,null),r=!1;else if(void 0===c.__webglFramebuffer)o.setupRenderTarget(e);else if(c.__hasExternalTextures)o.rebindTextures(e,s.get(e.texture).__webglTexture,s.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(c.__boundDepthTexture!==t){if(null!==t&&s.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");o.setupDepthRenderbuffer(e)}}let h=e.texture;(h.isData3DTexture||h.isDataArrayTexture||h.isCompressedArrayTexture)&&(u=!0);let d=s.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(a=Array.isArray(d[t])?d[t][n]:d[t],l=!0):a=e.samples>0&&!1===o.useMultisampledRTT(e)?s.get(e).__webglMultisampledFramebuffer:Array.isArray(d)?d[n]:d,ee.copy(e.viewport),et.copy(e.scissor),en=e.scissorTest}else ee.copy(eh).multiplyScalar(eo).floor(),et.copy(ed).multiplyScalar(eo).floor(),en=ep;if(0!==n&&(a=e$),i.bindFramebuffer(eM.FRAMEBUFFER,a)&&r&&i.drawBuffers(e,a),i.viewport(ee),i.scissor(et),i.setScissorTest(en),l){let r=s.get(e.texture);eM.framebufferTexture2D(eM.FRAMEBUFFER,eM.COLOR_ATTACHMENT0,eM.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(u)for(let r=0;r7&&void 0!==arguments[7]?arguments[7]:0;if(!(e&&e.isWebGLRenderTarget))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let h=s.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==u&&(h=h[u]),h){i.bindFramebuffer(eM.FRAMEBUFFER,h);try{let i=e.textures[c],s=i.format,u=i.type;if(!r.textureFormatReadable(s))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!r.textureTypeReadable(u))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-a&&n>=0&&n<=e.height-o&&(e.textures.length>1&&eM.readBuffer(eM.COLOR_ATTACHMENT0+c),eM.readPixels(t,n,a,o,A.convert(s),A.convert(u),l))}finally{let e=null!==K?s.get(K).__webglFramebuffer:null;i.bindFramebuffer(eM.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,a,o,l,u){let c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;if(!(e&&e.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let h=s.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==u&&(h=h[u]),h)if(t>=0&&t<=e.width-a&&n>=0&&n<=e.height-o){i.bindFramebuffer(eM.FRAMEBUFFER,h);let u=e.textures[c],d=u.format,p=u.type;if(!r.textureFormatReadable(d))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!r.textureTypeReadable(p))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let f=eM.createBuffer();eM.bindBuffer(eM.PIXEL_PACK_BUFFER,f),eM.bufferData(eM.PIXEL_PACK_BUFFER,l.byteLength,eM.STREAM_READ),e.textures.length>1&&eM.readBuffer(eM.COLOR_ATTACHMENT0+c),eM.readPixels(t,n,a,o,A.convert(d),A.convert(p),0);let m=null!==K?s.get(K).__webglFramebuffer:null;i.bindFramebuffer(eM.FRAMEBUFFER,m);let g=eM.fenceSync(eM.SYNC_GPU_COMMANDS_COMPLETE,0);return eM.flush(),await n4(eM,g,4),eM.bindBuffer(eM.PIXEL_PACK_BUFFER,f),eM.getBufferSubData(eM.PIXEL_PACK_BUFFER,0,l),eM.deleteBuffer(f),eM.deleteSync(g),l}else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.pow(2,-n),a=Math.floor(e.image.width*r),s=Math.floor(e.image.height*r),l=null!==t?t.x:0,u=null!==t?t.y:0;o.setTexture2D(e,0),eM.copyTexSubImage2D(eM.TEXTURE_2D,n,0,0,l,u,a,s),i.unbindTexture()};let eQ=eM.createFramebuffer(),e0=eM.createFramebuffer();this.copyTextureToTexture=function(e,t){let n,r,a,l,u,c,h,d,p,f,m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,g=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,v=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,y=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;null===y&&(0!==v?(n3("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),y=v,v=0):y=0);let _=e.isCompressedTexture?e.mipmaps[y]:e.image;if(null!==m)n=m.max.x-m.min.x,r=m.max.y-m.min.y,a=m.isBox3?m.max.z-m.min.z:1,l=m.min.x,u=m.min.y,c=m.isBox3?m.min.z:0;else{let t=Math.pow(2,-v);n=Math.floor(_.width*t),r=Math.floor(_.height*t),a=e.isDataArrayTexture?_.depth:e.isData3DTexture?Math.floor(_.depth*t):1,l=0,u=0,c=0}null!==g?(h=g.x,d=g.y,p=g.z):(h=0,d=0,p=0);let x=A.convert(t.format),b=A.convert(t.type);t.isData3DTexture?(o.setTexture3D(t,0),f=eM.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(o.setTexture2DArray(t,0),f=eM.TEXTURE_2D_ARRAY):(o.setTexture2D(t,0),f=eM.TEXTURE_2D),eM.pixelStorei(eM.UNPACK_FLIP_Y_WEBGL,t.flipY),eM.pixelStorei(eM.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),eM.pixelStorei(eM.UNPACK_ALIGNMENT,t.unpackAlignment);let S=eM.getParameter(eM.UNPACK_ROW_LENGTH),M=eM.getParameter(eM.UNPACK_IMAGE_HEIGHT),w=eM.getParameter(eM.UNPACK_SKIP_PIXELS),E=eM.getParameter(eM.UNPACK_SKIP_ROWS),T=eM.getParameter(eM.UNPACK_SKIP_IMAGES);eM.pixelStorei(eM.UNPACK_ROW_LENGTH,_.width),eM.pixelStorei(eM.UNPACK_IMAGE_HEIGHT,_.height),eM.pixelStorei(eM.UNPACK_SKIP_PIXELS,l),eM.pixelStorei(eM.UNPACK_SKIP_ROWS,u),eM.pixelStorei(eM.UNPACK_SKIP_IMAGES,c);let C=e.isDataArrayTexture||e.isData3DTexture,R=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let o=s.get(e),f=s.get(t),m=s.get(o.__renderTarget),g=s.get(f.__renderTarget);i.bindFramebuffer(eM.READ_FRAMEBUFFER,m.__webglFramebuffer),i.bindFramebuffer(eM.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let i=0;id5],8155);let d4=e=>{let t,n=new Set,r=(e,r)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>s,subscribe:e=>(n.add(e),()=>n.delete(e))},s=t=e(r,i,a);return a},d5=e=>e?d4(e):d4,{useSyncExternalStoreWithSelector:d6}=d3.default,d8=e=>e,d9=(e,t)=>{let n=d5(e),r=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d8,n=arguments.length>2?arguments[2]:void 0,r=d6(e.subscribe,e.getState,e.getInitialState,t,n);return h.default.useDebugValue(r),r}(n,e,r)};return Object.assign(r,n),r},d7=[];function pe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>e===t;if(e===t)return!0;if(!e||!t)return!1;let r=e.length;if(t.length!==r)return!1;for(let i=0;i1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(let i of(null===t&&(t=[e]),d7))if(pe(t,i.keys,i.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(i,"error"))throw i.error;if(Object.prototype.hasOwnProperty.call(i,"response"))return r.lifespan&&r.lifespan>0&&(i.timeout&&clearTimeout(i.timeout),i.timeout=setTimeout(i.remove,r.lifespan)),i.response;if(!n)throw i.promise}let i={keys:t,equal:r.equal,remove:()=>{let e=d7.indexOf(i);-1!==e&&d7.splice(e,1)},promise:("object"==typeof e&&"function"==typeof e.then?e:e(...t)).then(e=>{i.response=e,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(e=>i.error=e)};if(d7.push(i),!n)throw i.promise}var pn=e.i(98133),pr=e.i(95087),pi=e.i(43476);e.s(["FiberProvider",()=>pu,"traverseFiber",()=>ps,"useContextBridge",()=>pp,"useFiber",()=>pc],46791);var pa=h;function ps(e,t,n){if(!e)return;if(!0===n(e))return e;let r=t?e.return:e.child;for(;r;){let e=ps(r,t,n);if(e)return e;r=t?null:r.sibling}}function po(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(t){return e}}(()=>{var e,t;return"undefined"!=typeof window&&((null==(e=window.document)?void 0:e.createElement)||(null==(t=window.navigator)?void 0:t.product)==="ReactNative")})()?pa.useLayoutEffect:pa.useEffect;let pl=po(pa.createContext(null));class pu extends pa.Component{render(){return pa.createElement(pl.Provider,{value:this._reactInternals},this.props.children)}}function pc(){let e=pa.useContext(pl);if(null===e)throw Error("its-fine: useFiber must be called within a !");let t=pa.useId();return pa.useMemo(()=>{for(let n of[e,null==e?void 0:e.alternate]){if(!n)continue;let e=ps(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}let ph=Symbol.for("react.context"),pd=e=>null!==e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===ph;function pp(){let e=function(){let e=pc(),[t]=pa.useState(()=>new Map);t.clear();let n=e;for(;n;){let e=n.type;pd(e)&&e!==pl&&!t.has(e)&&t.set(e,pa.use(po(e))),n=n.return}return t}();return pa.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>pa.createElement(t,null,pa.createElement(n.Provider,{...r,value:e.get(n)})),e=>pa.createElement(pu,{...e})),[e])}function pf(e){let t=e.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}h.act;let pm=e=>e&&e.hasOwnProperty("current"),pg=e=>null!=e&&("string"==typeof e||"number"==typeof e||e.isColor),pv=((e,t)=>"undefined"!=typeof window&&((null==(e=window.document)?void 0:e.createElement)||(null==(t=window.navigator)?void 0:t.product)==="ReactNative"))()?h.useLayoutEffect:h.useEffect;function py(e){let t=h.useRef(e);return pv(()=>void(t.current=e),[e]),t}function p_(){let e=pc(),t=pp();return h.useMemo(()=>n=>{let{children:r}=n,i=ps(e,!0,e=>e.type===h.StrictMode)?h.StrictMode:h.Fragment;return(0,pi.jsx)(i,{children:(0,pi.jsx)(t,{children:r})})},[e,t])}function px(e){let{set:t}=e;return pv(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}let pb=(e=>((e=class extends h.Component{componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}constructor(...e){super(...e),this.state={error:!1}}}).getDerivedStateFromError=()=>({error:!0}),e))();function pS(e){var t;let n="undefined"!=typeof window?null!=(t=window.devicePixelRatio)?t:2:1;return Array.isArray(e)?Math.min(Math.max(e[0],n),e[1]):e}function pM(e){var t;return null==(t=e.__r3f)?void 0:t.root.getState()}let pw={obj:e=>e===Object(e)&&!pw.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,boo:e=>"boolean"==typeof e,und:e=>void 0===e,nul:e=>null===e,arr:e=>Array.isArray(e),equ(e,t){let n,{arrays:r="shallow",objects:i="reference",strict:a=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(typeof e!=typeof t||!!e!=!!t)return!1;if(pw.str(e)||pw.num(e)||pw.boo(e))return e===t;let s=pw.obj(e);if(s&&"reference"===i)return e===t;let o=pw.arr(e);if(o&&"reference"===r)return e===t;if((o||s)&&e===t)return!0;for(n in e)if(!(n in t))return!1;if(s&&"shallow"===r&&"shallow"===i){for(n in a?t:e)if(!pw.equ(e[n],t[n],{strict:a,objects:"reference"}))return!1}else for(n in a?t:e)if(e[n]!==t[n])return!1;if(pw.und(n)){if(o&&0===e.length&&0===t.length||s&&0===Object.keys(e).length&&0===Object.keys(t).length)return!0;if(e!==t)return!1}return!0}},pE=["children","key","ref"];function pT(e,t,n,r){let i=null==e?void 0:e.__r3f;return!i&&(i={root:t,type:n,parent:null,children:[],props:function(e){let t={};for(let n in e)pE.includes(n)||(t[n]=e[n]);return t}(r),object:e,eventCount:0,handlers:{},isHidden:!1},e&&(e.__r3f=i)),i}function pA(e,t){let n=e[t];if(!t.includes("-"))return{root:e,key:t,target:n};for(let i of(n=e,t.split("-"))){var r;t=i,e=n,n=null==(r=n)?void 0:r[t]}return{root:e,key:t,target:n}}let pC=/-\d+$/;function pR(e,t){if(pw.str(t.props.attach)){if(pC.test(t.props.attach)){let n=t.props.attach.replace(pC,""),{root:r,key:i}=pA(e.object,n);Array.isArray(r[i])||(r[i]=[])}let{root:n,key:r}=pA(e.object,t.props.attach);t.previousAttach=n[r],n[r]=t.object}else pw.fun(t.props.attach)&&(t.previousAttach=t.props.attach(e.object,t.object))}function pP(e,t){if(pw.str(t.props.attach)){let{root:n,key:r}=pA(e.object,t.props.attach),i=t.previousAttach;void 0===i?delete n[r]:n[r]=i}else null==t.previousAttach||t.previousAttach(e.object,t.object);delete t.previousAttach}let pI=[...pE,"args","dispose","attach","object","onUpdate","dispose"],pL=new Map,pN=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],pD=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function pU(e,t){var n,r;let i=e.__r3f,a=i&&pf(i).getState(),s=null==i?void 0:i.eventCount;for(let n in t){let s=t[n];if(pI.includes(n))continue;if(i&&pD.test(n)){"function"==typeof s?i.handlers[n]=s:delete i.handlers[n],i.eventCount=Object.keys(i.handlers).length;continue}if(void 0===s)continue;let{root:o,key:l,target:u}=pA(e,n);u instanceof r$&&s instanceof r$?u.mask=s.mask:u instanceof iE&&pg(s)?u.set(s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&"function"==typeof u.copy&&null!=s&&s.constructor&&u.constructor===s.constructor?u.copy(s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&Array.isArray(s)?"function"==typeof u.fromArray?u.fromArray(s):u.set(...s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&"number"==typeof s?"function"==typeof u.setScalar?u.setScalar(s):u.set(s):(o[l]=s,a&&!a.linear&&pN.includes(l)&&null!=(r=o[l])&&r.isTexture&&o[l].format===e0&&o[l].type===ez&&(o[l].colorSpace=t$))}if(null!=i&&i.parent&&null!=a&&a.internal&&null!=(n=i.object)&&n.isObject3D&&s!==i.eventCount){let e=i.object,t=a.internal.interaction.indexOf(e);t>-1&&a.internal.interaction.splice(t,1),i.eventCount&&null!==e.raycast&&a.internal.interaction.push(e)}return i&&void 0===i.props.attach&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&pO(i),e}function pO(e){var t;if(!e.parent)return;null==e.props.onUpdate||e.props.onUpdate(e.object);let n=null==(t=e.root)||null==t.getState?void 0:t.getState();n&&0===n.internal.frames&&n.invalidate()}let pF=e=>null==e?void 0:e.isObject3D;function pk(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function pz(e,t,n,r){let i=n.get(t);i&&(n.delete(t),0===n.size&&(e.delete(r),i.target.releasePointerCapture(r)))}let pB=e=>!!(null!=e&&e.render),pH=h.createContext(null);function pV(){let e=h.useContext(pH);if(!e)throw Error("R3F: Hooks can only be used within the Canvas component!");return e}function pG(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>e,t=arguments.length>1?arguments[1]:void 0;return pV()(e,t)}function pW(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=pV(),r=n.getState().internal.subscribe,i=py(e);return pv(()=>r(i,t,n),[t,r,n]),null}let pj=new WeakMap;function pX(e,t){return function(n){let r;for(var i,a=arguments.length,s=Array(a>1?a-1:0),o=1;onew Promise((n,i)=>r.load(e,e=>{pF(null==e?void 0:e.scene)&&Object.assign(e,function(e){let t={nodes:{},materials:{},meshes:{}};return e&&e.traverse(e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material),e.isMesh&&!t.meshes[e.name]&&(t.meshes[e.name]=e)}),t}(e.scene)),n(e)},t,t=>i(Error("Could not load ".concat(e,": ").concat(null==t?void 0:t.message)))))))}}function pq(e,t,n,r){let i=Array.isArray(t)?t:[t],a=pt(pX(n,r),[e,...i],!1,{equal:pw.equ});return Array.isArray(t)?a:a[0]}pq.preload=function(e,t,n){let r,i=Array.isArray(t)?t:[t];pt(pX(n),[e,...i],!0,r)},pq.clear=function(e,t){var n=[e,...Array.isArray(t)?t:[t]];if(void 0===n||0===n.length)d7.splice(0,d7.length);else{let e=d7.find(e=>pe(n,e.keys,e.equal));e&&e.remove()}};let pY={},pJ=/^three(?=[A-Z])/,pZ=e=>"".concat(e[0].toUpperCase()).concat(e.slice(1)),pK=0;function p$(e){if("function"==typeof e){let t="".concat(pK++);return pY[t]=e,t}Object.assign(pY,e)}function pQ(e,t){let n=pZ(e),r=pY[n];if("primitive"!==e&&!r)throw Error("R3F: ".concat(n," is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively"));if("primitive"===e&&!t.object)throw Error("R3F: Primitives without 'object' are invalid!");if(void 0!==t.args&&!Array.isArray(t.args))throw Error("R3F: The args prop must be an array!")}function p0(e){if(e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?pR(e.parent,e):pF(e.object)&&!1!==e.props.visible&&(e.object.visible=!0),e.isHidden=!1,pO(e)}}function p1(e,t,n){let r=t.root.getState();if(e.parent||e.object===r.scene){if(!t.object){var i,a;let e=pY[pZ(t.type)];t.object=null!=(i=t.props.object)?i:new e(...null!=(a=t.props.args)?a:[]),t.object.__r3f=t}if(pU(t.object,t.props),t.props.attach)pR(e,t);else if(pF(t.object)&&pF(e.object)){let r=e.object.children.indexOf(null==n?void 0:n.object);if(n&&-1!==r){let n=e.object.children.indexOf(t.object);-1!==n?(e.object.children.splice(n,1),e.object.children.splice(n{try{e.dispose()}catch(e){}};"undefined"!=typeof IS_REACT_ACT_ENVIRONMENT?t():(0,pr.unstable_scheduleCallback)(pr.unstable_IdlePriority,t)}}function p5(e,t,n){if(!t)return;t.parent=null;let r=e.children.indexOf(t);-1!==r&&e.children.splice(r,1),t.props.attach?pP(e,t):pF(t.object)&&pF(e.object)&&(e.object.remove(t.object),function(e,t){let{internal:n}=e.getState();n.interaction=n.interaction.filter(e=>e!==t),n.initialHits=n.initialHits.filter(e=>e!==t),n.hovered.forEach((e,r)=>{(e.eventObject===t||e.object===t)&&n.hovered.delete(r)}),n.capturedMap.forEach((e,r)=>{pz(n.capturedMap,t,e,r)})}(pf(t),t.object));let i=null!==t.props.dispose&&!1!==n;for(let e=t.children.length-1;e>=0;e--){let n=t.children[e];p5(t,n,i)}t.children.length=0,delete t.object.__r3f,i&&"primitive"!==t.type&&"Scene"!==t.object.type&&p4(t.object),void 0===n&&pO(t)}let p6=[],p8=()=>{},p9={},p7=0,fe=function(e){let t=(0,pn.default)(e);return t.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:h.version}),t}({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:function(e,t,n){var r;return pQ(e=pZ(e)in pY?e:e.replace(pJ,""),t),"primitive"===e&&null!=(r=t.object)&&r.__r3f&&delete t.object.__r3f,pT(t.object,n,e,t)},removeChild:p5,appendChild:p2,appendInitialChild:p2,insertBefore:p3,appendChildToContainer(e,t){let n=e.getState().scene.__r3f;t&&n&&p2(n,t)},removeChildFromContainer(e,t){let n=e.getState().scene.__r3f;t&&n&&p5(n,t)},insertInContainerBefore(e,t,n){let r=e.getState().scene.__r3f;t&&n&&r&&p3(r,t,n)},getRootHostContext:()=>p9,getChildHostContext:()=>p9,commitUpdate(e,t,n,r,i){var a,s,o;pQ(t,r);let l=!1;if("primitive"===e.type&&n.object!==r.object||(null==(a=r.args)?void 0:a.length)!==(null==(s=n.args)?void 0:s.length)?l=!0:null!=(o=r.args)&&o.some((e,t)=>{var r;return e!==(null==(r=n.args)?void 0:r[t])})&&(l=!0),l)p6.push([e,{...r},i]);else{let t=function(e,t){let n={};for(let r in t)if(!pI.includes(r)&&!pw.equ(t[r],e.props[r]))for(let e in n[r]=t[r],t)e.startsWith("".concat(r,"-"))&&(n[e]=t[e]);for(let r in e.props){if(pI.includes(r)||t.hasOwnProperty(r))continue;let{root:i,key:a}=pA(e.object,r);if(i.constructor&&0===i.constructor.length){let e=function(e){let t=pL.get(e.constructor);try{t||(t=new e.constructor,pL.set(e.constructor,t))}catch(e){}return t}(i);pw.und(e)||(n[a]=e[a])}else n[a]=0}return n}(e,r);Object.keys(t).length&&(Object.assign(e.props,t),pU(e.object,t))}(null===i.sibling||(4&i.flags)==0)&&function(){for(let[e]of p6){let t=e.parent;if(t)for(let n of(e.props.attach?pP(t,e):pF(e.object)&&pF(t.object)&&t.object.remove(e.object),e.children))n.props.attach?pP(e,n):pF(n.object)&&pF(e.object)&&e.object.remove(n.object);e.isHidden&&p0(e),e.object.__r3f&&delete e.object.__r3f,"primitive"!==e.type&&p4(e.object)}for(let[r,i,a]of p6){r.props=i;let s=r.parent;if(s){let i=pY[pZ(r.type)];r.object=null!=(e=r.props.object)?e:new i(...null!=(t=r.props.args)?t:[]),r.object.__r3f=r;var e,t,n=r.object;for(let e of[a,a.alternate])if(null!==e)if("function"==typeof e.ref){null==e.refCleanup||e.refCleanup();let t=e.ref(n);"function"==typeof t&&(e.refCleanup=t)}else e.ref&&(e.ref.current=n);for(let e of(pU(r.object,r.props),r.props.attach?pR(s,r):pF(r.object)&&pF(s.object)&&s.object.add(r.object),r.children))e.props.attach?pR(r,e):pF(e.object)&&pF(r.object)&&r.object.add(e.object);pO(r)}}p6.length=0}()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:e=>null==e?void 0:e.object,prepareForCommit:()=>null,preparePortalMount:e=>pT(e.getState().scene,e,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:function(e){if(!e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?pP(e.parent,e):pF(e.object)&&(e.object.visible=!1),e.isHidden=!0,pO(e)}},unhideInstance:p0,createTextInstance:p8,hideTextInstance:p8,unhideTextInstance:p8,scheduleTimeout:"function"==typeof setTimeout?setTimeout:void 0,cancelTimeout:"function"==typeof clearTimeout?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:h.createContext(null),setCurrentUpdatePriority(e){p7=e},getCurrentUpdatePriority:()=>p7,resolveUpdatePriority(){var e;if(0!==p7)return p7;switch("undefined"!=typeof window&&(null==(e=window.event)?void 0:e.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return d.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return d.ContinuousEventPriority;default:return d.DefaultEventPriority}},resetFormInstance(){}}),ft=new Map,fn={objects:"shallow",strict:!1};function fr(e){let t,n,r=ft.get(e),i=null==r?void 0:r.fiber,a=null==r?void 0:r.store;r&&console.warn("R3F.createRoot should only be called once!");let s="function"==typeof reportError?reportError:console.error,o=a||((e,t)=>{let n,r,i=(n=(n,r)=>{let i,a=new nX,s=new nX,o=new nX;function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r().camera,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r().size,{width:i,height:l,top:u,left:c}=n,h=i/l;t.isVector3?o.copy(t):o.set(...t);let d=e.getWorldPosition(a).distanceTo(o);if(e&&e.isOrthographicCamera)return{width:i/e.zoom,height:l/e.zoom,top:u,left:c,factor:1,distance:d,aspect:h};{let t=2*Math.tan(e.fov*Math.PI/180/2)*d,n=i/l*t;return{width:n,height:t,top:u,left:c,factor:i/n,distance:d,aspect:h}}}let u=e=>n(t=>({performance:{...t.performance,current:e}})),c=new nW;return{set:n,get:r,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return e(r(),t)},advance:(e,n)=>t(e,n,r()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new uM,pointer:c,mouse:c,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=r();i&&clearTimeout(i),e.performance.current!==e.performance.min&&u(e.performance.min),i=setTimeout(()=>u(r().performance.max),e.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:l},setEvents:e=>n(t=>({...t,events:{...t.events,...e}})),setSize:function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=r().camera,u={width:e,height:t,top:i,left:a};n(e=>({size:u,viewport:{...e.viewport,...l(o,s,u)}}))},setDpr:e=>n(t=>{let n=pS(e);return{viewport:{...t.viewport,dpr:n,initialDpr:t.viewport.initialDpr||n}}}),setFrameloop:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always",t=r().clock;t.stop(),t.elapsedTime=0,"never"!==e&&(t.start(),t.elapsedTime=0),n(()=>({frameloop:e}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:h.createRef(),active:!1,frames:0,priority:0,subscribe:(e,t,n)=>{let i=r().internal;return i.priority=i.priority+ +(t>0),i.subscribers.push({ref:e,priority:t,store:n}),i.subscribers=i.subscribers.sort((e,t)=>e.priority-t.priority),()=>{let n=r().internal;null!=n&&n.subscribers&&(n.priority=n.priority-(t>0),n.subscribers=n.subscribers.filter(t=>t.ref!==e))}}}}})?d9(n,r):d9,a=i.getState(),s=a.size,o=a.viewport.dpr,l=a.camera;return i.subscribe(()=>{let{camera:e,size:t,viewport:n,gl:r,set:a}=i.getState();if(t.width!==s.width||t.height!==s.height||n.dpr!==o){s=t,o=n.dpr,function(e,t){!e.manual&&(e&&e.isOrthographicCamera?(e.left=-(t.width/2),e.right=t.width/2,e.top=t.height/2,e.bottom=-(t.height/2)):e.aspect=t.width/t.height,e.updateProjectionMatrix())}(e,t),n.dpr>0&&r.setPixelRatio(n.dpr);let i="undefined"!=typeof HTMLCanvasElement&&r.domElement instanceof HTMLCanvasElement;r.setSize(t.width,t.height,i)}e!==l&&(l=e,a(t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}})))}),i.subscribe(t=>e(t)),i})(fy,f_),l=i||fe.createContainer(o,d.ConcurrentRoot,null,!1,null,"",s,s,s,null);r||ft.set(e,{fiber:l,store:o});let u=!1,c=null;return{async configure(){var r,i;let a,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c=new Promise(e=>a=e);let{gl:l,size:h,scene:d,events:p,onCreated:f,shadows:m=!1,linear:g=!1,flat:v=!1,legacy:y=!1,orthographic:_=!1,frameloop:w="always",dpr:E=[1,2],performance:T,raycaster:A,camera:C,onPointerMissed:R}=s,P=o.getState(),I=P.gl;if(!P.gl){let t={canvas:e,powerPreference:"high-performance",antialias:!0,alpha:!0},n="function"==typeof l?await l(t):l;I=pB(n)?n:new d2({...t,...l}),P.set({gl:I})}let L=P.raycaster;L||P.set({raycaster:L=new u4});let{params:N,...D}=A||{};if(pw.equ(D,L,fn)||pU(L,{...D}),pw.equ(N,L.params,fn)||pU(L,{params:{...L.params,...N}}),!P.camera||P.camera===n&&!pw.equ(n,C,fn)){n=C;let e=null==C?void 0:C.isCamera,t=e?C:_?new l7(0,0,0,0,.1,1e3):new af(75,0,.1,1e3);!e&&(t.position.z=5,C&&(pU(t,C),!t.manual&&("aspect"in C||"left"in C||"right"in C||"bottom"in C||"top"in C)&&(t.manual=!0,t.updateProjectionMatrix())),P.camera||null!=C&&C.rotation||t.lookAt(0,0,0)),P.set({camera:t}),L.camera=t}if(!P.scene){let e;null!=d&&d.isScene?pT(e=d,o,"",{}):(pT(e=new aM,o,"",{}),d&&pU(e,d)),P.set({scene:e})}p&&!P.events.handlers&&P.set({events:p(o)});let U=function(e,t){if(!t&&"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:t,height:n,top:r,left:i}=e.parentElement.getBoundingClientRect();return{width:t,height:n,top:r,left:i}}return!t&&"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0}:{width:0,height:0,top:0,left:0,...t}}(e,h);if(pw.equ(U,P.size,fn)||P.setSize(U.width,U.height,U.top,U.left),E&&P.viewport.dpr!==pS(E)&&P.setDpr(E),P.frameloop!==w&&P.setFrameloop(w),P.onPointerMissed||P.set({onPointerMissed:R}),T&&!pw.equ(T,P.performance,fn)&&P.set(e=>({performance:{...e.performance,...T}})),!P.xr){let e=(e,t)=>{let n=o.getState();"never"!==n.frameloop&&f_(e,!0,n,t)},t=()=>{let t=o.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||fy(t)},n={connect(){let e=o.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){let e=o.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};"function"==typeof(null==(r=I.xr)?void 0:r.addEventListener)&&n.connect(),P.set({xr:n})}if(I.shadowMap){let e=I.shadowMap.enabled,t=I.shadowMap.type;I.shadowMap.enabled=!!m,pw.boo(m)?I.shadowMap.type=S:pw.str(m)?I.shadowMap.type=null!=(i=({basic:x,percentage:b,soft:S,variance:M})[m])?i:S:pw.obj(m)&&Object.assign(I.shadowMap,m),(e!==I.shadowMap.enabled||t!==I.shadowMap.type)&&(I.shadowMap.needsUpdate=!0)}return n8.enabled=!y,u||(I.outputColorSpace=g?tQ:t$,I.toneMapping=v?ec:ef),P.legacy!==y&&P.set(()=>({legacy:y})),P.linear!==g&&P.set(()=>({linear:g})),P.flat!==v&&P.set(()=>({flat:v})),!l||pw.fun(l)||pB(l)||pw.equ(l,I,fn)||pU(I,l),t=f,u=!0,a(),this},render(n){return u||c||this.configure(),c.then(()=>{fe.updateContainer((0,pi.jsx)(fi,{store:o,children:n,onCreated:t,rootElement:e}),l,null,()=>void 0)}),o},unmount(){fa(e)}}}function fi(e){let{store:t,children:n,onCreated:r,rootElement:i}=e;return pv(()=>{let e=t.getState();e.set(e=>({internal:{...e.internal,active:!0}})),r&&r(e),t.getState().events.connected||null==e.events.connect||e.events.connect(i)},[]),(0,pi.jsx)(pH.Provider,{value:t,children:n})}function fa(e,t){let n=ft.get(e),r=null==n?void 0:n.fiber;if(r){let i=null==n?void 0:n.store.getState();i&&(i.internal.active=!1),fe.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{null==i.events.disconnect||i.events.disconnect(),null==(n=i.gl)||null==(r=n.renderLists)||null==r.dispose||r.dispose(),null==(a=i.gl)||null==a.forceContextLoss||a.forceContextLoss(),null!=(s=i.gl)&&s.xr&&i.xr.disconnect();var n,r,a,s,o=i.scene;for(let e in"Scene"!==o.type&&(null==o.dispose||o.dispose()),o){let t=o[e];(null==t?void 0:t.type)!=="Scene"&&(null==t||null==t.dispose||t.dispose())}ft.delete(e),t&&t(e)}catch(e){}},500)})}}function fs(e,t){let n={callback:e};return t.add(n),()=>void t.delete(n)}let fo=new Set,fl=new Set,fu=new Set,fc=e=>fs(e,fo),fh=e=>fs(e,fl);function fd(e,t){if(e.size)for(let{callback:n}of e.values())n(t)}function fp(e,t){switch(e){case"before":return fd(fo,t);case"after":return fd(fl,t);case"tail":return fd(fu,t)}}function ff(e,t,n){let r=t.clock.getDelta();"never"===t.frameloop&&"number"==typeof e&&(r=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),s=t.internal.subscribers;for(let e=0;e0)&&!(null!=(t=c.gl.xr)&&t.isPresenting)&&(l+=ff(e,c))}if(fg=!1,fp("after",e),0===l)return fp("tail",e),fm=!1,cancelAnimationFrame(u)}function fy(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return ft.forEach(e=>fy(e.store.getState(),n));(null==(t=e.gl.xr)||!t.isPresenting)&&e.internal.active&&"never"!==e.frameloop&&(n>1?e.internal.frames=Math.min(60,e.internal.frames+n):fg?e.internal.frames=2:e.internal.frames=1,fm||(fm=!0,requestAnimationFrame(fv)))}function f_(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(t&&fp("before",e),n)ff(e,n,r);else for(let t of ft.values())ff(e,t.store.getState());t&&fp("after",e)}let fx={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function fb(e){let{handlePointer:t}=function(e){function t(e){return e.filter(e=>["Move","Over","Enter","Out","Leave"].some(t=>{var n;return null==(n=e.__r3f)?void 0:n.handlers["onPointer"+t]}))}function n(t){let{internal:n}=e.getState();for(let e of n.hovered.values())if(!t.length||!t.find(t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId)){let r=e.eventObject.__r3f;if(n.hovered.delete(pk(e)),null!=r&&r.eventCount){let n=r.handlers,i={...e,intersections:t};null==n.onPointerOut||n.onPointerOut(i),null==n.onPointerLeave||n.onPointerLeave(i)}}}function r(e,t){for(let n=0;nn([]);case"onLostPointerCapture":return t=>{let{internal:r}=e.getState();"pointerId"in t&&r.capturedMap.has(t.pointerId)&&requestAnimationFrame(()=>{r.capturedMap.has(t.pointerId)&&(r.capturedMap.delete(t.pointerId),n([]))})}}return function(a){let{onPointerMissed:s,internal:o}=e.getState();o.lastEvent.current=a;let l="onPointerMove"===i,u="onClick"===i||"onContextMenu"===i||"onDoubleClick"===i,c=function(t,n){let r=e.getState(),i=new Set,a=[],s=n?n(r.internal.interaction):r.internal.interaction;for(let e=0;e{let n=pM(e.object),r=pM(t.object);return n&&r&&r.events.priority-n.events.priority||e.distance-t.distance}).filter(e=>{let t=pk(e);return!i.has(t)&&(i.add(t),!0)});for(let e of(r.events.filter&&(o=r.events.filter(o,r)),o)){let t=e.object;for(;t;){var l;null!=(l=t.__r3f)&&l.eventCount&&a.push({...e,eventObject:t}),t=t.parent}}if("pointerId"in t&&r.internal.capturedMap.has(t.pointerId))for(let e of r.internal.capturedMap.get(t.pointerId).values())i.has(pk(e.intersection))||a.push(e.intersection);return a}(a,l?t:void 0),h=u?function(t){let{internal:n}=e.getState(),r=t.offsetX-n.initialClick[0],i=t.offsetY-n.initialClick[1];return Math.round(Math.sqrt(r*r+i*i))}(a):0;"onPointerDown"===i&&(o.initialClick=[a.offsetX,a.offsetY],o.initialHits=c.map(e=>e.eventObject)),u&&!c.length&&h<=2&&(r(a,o.interaction),s&&s(a)),l&&n(c),!function(e,t,r,i){if(e.length){let a={stopped:!1};for(let s of e){let o=pM(s.object);if(o||s.object.traverseAncestors(e=>{let t=pM(e);if(t)return o=t,!1}),o){let{raycaster:l,pointer:u,camera:c,internal:h}=o,d=new nX(u.x,u.y,0).unproject(c),p=e=>{var t,n;return null!=(t=null==(n=h.capturedMap.get(e))?void 0:n.has(s.eventObject))&&t},f=e=>{let n={intersection:s,target:t.target};h.capturedMap.has(e)?h.capturedMap.get(e).set(s.eventObject,n):h.capturedMap.set(e,new Map([[s.eventObject,n]])),t.target.setPointerCapture(e)},m=e=>{let t=h.capturedMap.get(e);t&&pz(h.capturedMap,s.eventObject,t,e)},g={};for(let e in t){let n=t[e];"function"!=typeof n&&(g[e]=n)}let v={...s,...g,pointer:u,intersections:e,stopped:a.stopped,delta:r,unprojectedPoint:d,ray:l.ray,camera:c,stopPropagation(){let r="pointerId"in t&&h.capturedMap.get(t.pointerId);(!r||r.has(s.eventObject))&&(v.stopped=a.stopped=!0,h.hovered.size&&Array.from(h.hovered.values()).find(e=>e.eventObject===s.eventObject)&&n([...e.slice(0,e.indexOf(s)),s]))},target:{hasPointerCapture:p,setPointerCapture:f,releasePointerCapture:m},currentTarget:{hasPointerCapture:p,setPointerCapture:f,releasePointerCapture:m},nativeEvent:t};if(i(v),!0===a.stopped)break}}}}(c,a,h,function(e){let t=e.eventObject,n=t.__r3f;if(!(null!=n&&n.eventCount))return;let s=n.handlers;if(l){if(s.onPointerOver||s.onPointerEnter||s.onPointerOut||s.onPointerLeave){let t=pk(e),n=o.hovered.get(t);n?n.stopped&&e.stopPropagation():(o.hovered.set(t,e),null==s.onPointerOver||s.onPointerOver(e),null==s.onPointerEnter||s.onPointerEnter(e))}null==s.onPointerMove||s.onPointerMove(e)}else{let n=s[i];n?(!u||o.initialHits.includes(t))&&(r(a,o.interaction.filter(e=>!o.initialHits.includes(e))),n(e)):u&&o.initialHits.includes(t)&&r(a,o.interaction.filter(e=>!o.initialHits.includes(e)))}})}}}}(e);return{priority:1,enabled:!0,compute(e,t,n){t.pointer.set(e.offsetX/t.size.width*2-1,-(2*(e.offsetY/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(fx).reduce((e,n)=>({...e,[n]:t(n)}),{}),update:()=>{var t;let{events:n,internal:r}=e.getState();null!=(t=r.lastEvent)&&t.current&&n.handlers&&n.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{let{set:n,events:r}=e.getState();if(null==r.disconnect||r.disconnect(),n(e=>({events:{...e.events,connected:t}})),r.handlers)for(let e in r.handlers){let n=r.handlers[e],[i,a]=fx[e];t.addEventListener(i,n,{passive:a})}},disconnect:()=>{let{set:t,events:n}=e.getState();if(n.connected){if(n.handlers)for(let e in n.handlers){let t=n.handlers[e],[r]=fx[e];n.connected.removeEventListener(r,t)}t(e=>({events:{...e.events,connected:void 0}}))}}}}},53487,(e,t,n)=>{"use strict";let r="[^".concat("\\\\/","]"),i="[^/]",a="(?:".concat("\\/","|$)"),s="(?:^|".concat("\\/",")"),o="".concat("\\.","{1,2}").concat(a),l="(?!".concat(s).concat(o,")"),u="(?!".concat("\\.","{0,1}").concat(a,")"),c="(?!".concat(o,")"),h={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:a,DOTS_SLASH:o,NO_DOT:"(?!".concat("\\.",")"),NO_DOTS:l,NO_DOT_SLASH:u,NO_DOTS_SLASH:c,QMARK_NO_DOT:"[^.".concat("\\/","]"),STAR:"".concat(i,"*?"),START_ANCHOR:s,SEP:"/"},d={...h,SLASH_LITERAL:"[".concat("\\\\/","]"),QMARK:r,STAR:"".concat(r,"*?"),DOTS_SLASH:"".concat("\\.","{1,2}(?:[").concat("\\\\/","]|$)"),NO_DOT:"(?!".concat("\\.",")"),NO_DOTS:"(?!(?:^|[".concat("\\\\/","])").concat("\\.","{1,2}(?:[").concat("\\\\/","]|$))"),NO_DOT_SLASH:"(?!".concat("\\.","{0,1}(?:[").concat("\\\\/","]|$))"),NO_DOTS_SLASH:"(?!".concat("\\.","{1,2}(?:[").concat("\\\\/","]|$))"),QMARK_NO_DOT:"[^.".concat("\\\\/","]"),START_ANCHOR:"(?:^|[".concat("\\\\/","])"),END_ANCHOR:"(?:[".concat("\\\\/","]|$)"),SEP:"\\"};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:"))".concat(e.STAR,")")},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?d:h}},19241,(e,t,n)=>{"use strict";var r=e.i(47167);let{REGEX_BACKSLASH:i,REGEX_REMOVE_BACKSLASH:a,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:o}=e.r(53487);n.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),n.hasRegexChars=e=>s.test(e),n.isRegexChar=e=>1===e.length&&n.hasRegexChars(e),n.escapeRegex=e=>e.replace(o,"\\$1"),n.toPosixSlashes=e=>e.replace(i,"/"),n.isWindows=()=>{if("undefined"!=typeof navigator&&navigator.platform){let e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return void 0!==r.default&&!!r.default.platform&&"win32"===r.default.platform},n.removeBackslashes=e=>e.replace(a,e=>"\\"===e?"":e),n.escapeLast=(e,t,r)=>{let i=e.lastIndexOf(t,r);return -1===i?e:"\\"===e[i-1]?n.escapeLast(e,t,i-1):"".concat(e.slice(0,i),"\\").concat(e.slice(i))},n.removePrefix=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},n.wrapOutput=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.contains?"":"^",i=n.contains?"":"$",a="".concat(r,"(?:").concat(e,")").concat(i);return!0===t.negated&&(a="(?:^(?!".concat(a,").*$)")),a},n.basename=function(e){let{windows:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.split(t?/[\\/]/:"/"),r=n[n.length-1];return""===r?n[n.length-2]:r}},26094,(e,t,n)=>{"use strict";let r=e.r(19241),{CHAR_ASTERISK:i,CHAR_AT:a,CHAR_BACKWARD_SLASH:s,CHAR_COMMA:o,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:h,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:p,CHAR_PLUS:f,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:v,CHAR_RIGHT_SQUARE_BRACKET:y}=e.r(53487),_=e=>e===c||e===s,x=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let n,b,S=t||{},M=e.length-1,w=!0===S.parts||!0===S.scanToEnd,E=[],T=[],A=[],C=e,R=-1,P=0,I=0,L=!1,N=!1,D=!1,U=!1,O=!1,F=!1,k=!1,z=!1,B=!1,H=!1,V=0,G={value:"",depth:0,isGlob:!1},W=()=>R>=M,j=()=>C.charCodeAt(R+1),X=()=>(n=b,C.charCodeAt(++R));for(;R0&&(Y=C.slice(0,P),C=C.slice(P),I-=P),q&&!0===D&&I>0?(q=C.slice(0,I),J=C.slice(I)):!0===D?(q="",J=C):q=C,q&&""!==q&&"/"!==q&&q!==C&&_(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),!0===S.unescape&&(J&&(J=r.removeBackslashes(J)),q&&!0===k&&(q=r.removeBackslashes(q)));let Z={prefix:Y,input:e,start:P,base:q,glob:J,isBrace:L,isBracket:N,isGlob:D,isExtglob:U,isGlobstar:O,negated:z,negatedExtglob:B};if(!0===S.tokens&&(Z.maxDepth=0,_(b)||T.push(G),Z.tokens=T),!0===S.parts||!0===S.tokens){let t;for(let n=0;n{"use strict";let r=e.r(53487),i=e.r(19241),{MAX_LENGTH:a,POSIX_REGEX_SOURCE:s,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=r,c=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();let n="[".concat(e.join("-"),"]");try{new RegExp(n)}catch(t){return e.map(e=>i.escapeRegex(e)).join("..")}return n},h=(e,t)=>"Missing ".concat(e,': "').concat(t,'" - use "\\\\').concat(t,'" to match literal characters'),d=(e,t)=>{let n;if("string"!=typeof e)throw TypeError("Expected a string");e=u[e]||e;let p={...t},f="number"==typeof p.maxLength?Math.min(a,p.maxLength):a,m=e.length;if(m>f)throw SyntaxError("Input length: ".concat(m,", exceeds maximum allowed length: ").concat(f));let g={type:"bos",value:"",output:p.prepend||""},v=[g],y=p.capture?"":"?:",_=r.globChars(p.windows),x=r.extglobChars(_),{DOT_LITERAL:b,PLUS_LITERAL:S,SLASH_LITERAL:M,ONE_CHAR:w,DOTS_SLASH:E,NO_DOT:T,NO_DOT_SLASH:A,NO_DOTS_SLASH:C,QMARK:R,QMARK_NO_DOT:P,STAR:I,START_ANCHOR:L}=_,N=e=>"(".concat(y,"(?:(?!").concat(L).concat(e.dot?E:b,").)*?)"),D=p.dot?"":T,U=p.dot?R:P,O=!0===p.bash?N(p):I;p.capture&&(O="(".concat(O,")")),"boolean"==typeof p.noext&&(p.noextglob=p.noext);let F={input:e,index:-1,start:0,dot:!0===p.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:v};m=(e=i.removePrefix(e,F)).length;let k=[],z=[],B=[],H=g,V=()=>F.index===m-1,G=F.peek=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return e[F.index+t]},W=F.advance=()=>e[++F.index]||"",j=()=>e.slice(F.index+1),X=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;F.consumed+=e,F.index+=t},q=e=>{F.output+=null!=e.output?e.output:e.value,X(e.value)},Y=()=>{let e=1;for(;"!"===G()&&("("!==G(2)||"?"===G(3));)W(),F.start++,e++;return e%2!=0&&(F.negated=!0,F.start++,!0)},J=e=>{F[e]++,B.push(e)},Z=e=>{F[e]--,B.pop()},K=e=>{if("globstar"===H.type){let t=F.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||k.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(F.output=F.output.slice(0,-H.output.length),H.type="star",H.value="*",H.output=O,F.output+=H.output)}if(k.length&&"paren"!==e.type&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&q(e),H&&"text"===H.type&&"text"===e.type){H.output=(H.output||H.value)+e.value,H.value+=e.value;return}e.prev=H,v.push(e),H=e},$=(e,t)=>{let n={...x[t],conditions:1,inner:""};n.prev=H,n.parens=F.parens,n.output=F.output;let r=(p.capture?"(":"")+n.open;J("parens"),K({type:e,value:t,output:F.output?"":w}),K({type:"paren",extglob:!0,value:W(),output:r}),k.push(n)},Q=e=>{let r,i=e.close+(p.capture?")":"");if("negate"===e.type){let n=O;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(n=N(p)),(n!==O||V()||/^\)+$/.test(j()))&&(i=e.close=")$))".concat(n)),e.inner.includes("*")&&(r=j())&&/^\.[^\\/.]+$/.test(r)){let a=d(r,{...t,fastpaths:!1}).output;i=e.close=")".concat(a,")").concat(n,")")}"bos"===e.prev.type&&(F.negatedExtglob=!0)}K({type:"paren",extglob:!0,value:n,output:i}),Z("parens")};if(!1!==p.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,r=e.replace(l,(e,t,r,i,a,s)=>"\\"===i?(n=!0,e):"?"===i?t?t+i+(a?R.repeat(a.length):""):0===s?U+(a?R.repeat(a.length):""):R.repeat(r.length):"."===i?b.repeat(r.length):"*"===i?t?t+i+(a?O:""):O:t?e:"\\".concat(e));return(!0===n&&(r=!0===p.unescape?r.replace(/\\/g,""):r.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),r===e&&!0===p.contains)?F.output=e:F.output=i.wrapOutput(r,F,t),F}for(;!V();){if("\0"===(n=W()))continue;if("\\"===n){let e=G();if("/"===e&&!0!==p.bash||"."===e||";"===e)continue;if(!e){K({type:"text",value:n+="\\"});continue}let t=/^\\+/.exec(j()),r=0;if(t&&t[0].length>2&&(r=t[0].length,F.index+=r,r%2!=0&&(n+="\\")),!0===p.unescape?n=W():n+=W(),0===F.brackets){K({type:"text",value:n});continue}}if(F.brackets>0&&("]"!==n||"["===H.value||"[^"===H.value)){if(!1!==p.posix&&":"===n){let e=H.value.slice(1);if(e.includes("[")&&(H.posix=!0,e.includes(":"))){let e=H.value.lastIndexOf("["),t=H.value.slice(0,e),n=s[H.value.slice(e+2)];if(n){H.value=t+n,F.backtrack=!0,W(),g.output||1!==v.indexOf(H)||(g.output=w);continue}}}("["===n&&":"!==G()||"-"===n&&"]"===G())&&(n="\\".concat(n)),"]"===n&&("["===H.value||"[^"===H.value)&&(n="\\".concat(n)),!0===p.posix&&"!"===n&&"["===H.value&&(n="^"),H.value+=n,q({value:n});continue}if(1===F.quotes&&'"'!==n){n=i.escapeRegex(n),H.value+=n,q({value:n});continue}if('"'===n){F.quotes=+(1!==F.quotes),!0===p.keepQuotes&&K({type:"text",value:n});continue}if("("===n){J("parens"),K({type:"paren",value:n});continue}if(")"===n){if(0===F.parens&&!0===p.strictBrackets)throw SyntaxError(h("opening","("));let e=k[k.length-1];if(e&&F.parens===e.parens+1){Q(k.pop());continue}K({type:"paren",value:n,output:F.parens?")":"\\)"}),Z("parens");continue}if("["===n){if(!0!==p.nobracket&&j().includes("]"))J("brackets");else{if(!0!==p.nobracket&&!0===p.strictBrackets)throw SyntaxError(h("closing","]"));n="\\".concat(n)}K({type:"bracket",value:n});continue}if("]"===n){if(!0===p.nobracket||H&&"bracket"===H.type&&1===H.value.length){K({type:"text",value:n,output:"\\".concat(n)});continue}if(0===F.brackets){if(!0===p.strictBrackets)throw SyntaxError(h("opening","["));K({type:"text",value:n,output:"\\".concat(n)});continue}Z("brackets");let e=H.value.slice(1);if(!0===H.posix||"^"!==e[0]||e.includes("/")||(n="/".concat(n)),H.value+=n,q({value:n}),!1===p.literalBrackets||i.hasRegexChars(e))continue;let t=i.escapeRegex(H.value);if(F.output=F.output.slice(0,-H.value.length),!0===p.literalBrackets){F.output+=t,H.value=t;continue}H.value="(".concat(y).concat(t,"|").concat(H.value,")"),F.output+=H.value;continue}if("{"===n&&!0!==p.nobrace){J("braces");let e={type:"brace",value:n,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};z.push(e),K(e);continue}if("}"===n){let e=z[z.length-1];if(!0===p.nobrace||!e){K({type:"text",value:n,output:n});continue}let t=")";if(!0===e.dots){let e=v.slice(),n=[];for(let t=e.length-1;t>=0&&(v.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=c(n,p),F.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){let r=F.output.slice(0,e.outputIndex),i=F.tokens.slice(e.tokensIndex);for(let a of(e.value=e.output="\\{",n=t="\\}",F.output=r,i))F.output+=a.output||a.value}K({type:"brace",value:n,output:t}),Z("braces"),z.pop();continue}if("|"===n){k.length>0&&k[k.length-1].conditions++,K({type:"text",value:n});continue}if(","===n){let e=n,t=z[z.length-1];t&&"braces"===B[B.length-1]&&(t.comma=!0,e="|"),K({type:"comma",value:n,output:e});continue}if("/"===n){if("dot"===H.type&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",v.pop(),H=g;continue}K({type:"slash",value:n,output:M});continue}if("."===n){if(F.braces>0&&"dot"===H.type){"."===H.value&&(H.output=b);let e=z[z.length-1];H.type="dots",H.output+=n,H.value+=n,e.dots=!0;continue}if(F.braces+F.parens===0&&"bos"!==H.type&&"slash"!==H.type){K({type:"text",value:n,output:b});continue}K({type:"dot",value:n,output:b});continue}if("?"===n){if(!(H&&"("===H.value)&&!0!==p.noextglob&&"("===G()&&"?"!==G(2)){$("qmark",n);continue}if(H&&"paren"===H.type){let e=G(),t=n;("("!==H.value||/[!=<:]/.test(e))&&("<"!==e||/<([!=]|\w+>)/.test(j()))||(t="\\".concat(n)),K({type:"text",value:n,output:t});continue}if(!0!==p.dot&&("slash"===H.type||"bos"===H.type)){K({type:"qmark",value:n,output:P});continue}K({type:"qmark",value:n,output:R});continue}if("!"===n){if(!0!==p.noextglob&&"("===G()&&("?"!==G(2)||!/[!=<:]/.test(G(3)))){$("negate",n);continue}if(!0!==p.nonegate&&0===F.index){Y();continue}}if("+"===n){if(!0!==p.noextglob&&"("===G()&&"?"!==G(2)){$("plus",n);continue}if(H&&"("===H.value||!1===p.regex){K({type:"plus",value:n,output:S});continue}if(H&&("bracket"===H.type||"paren"===H.type||"brace"===H.type)||F.parens>0){K({type:"plus",value:n});continue}K({type:"plus",value:S});continue}if("@"===n){if(!0!==p.noextglob&&"("===G()&&"?"!==G(2)){K({type:"at",extglob:!0,value:n,output:""});continue}K({type:"text",value:n});continue}if("*"!==n){("$"===n||"^"===n)&&(n="\\".concat(n));let e=o.exec(j());e&&(n+=e[0],F.index+=e[0].length),K({type:"text",value:n});continue}if(H&&("globstar"===H.type||!0===H.star)){H.type="star",H.star=!0,H.value+=n,H.output=O,F.backtrack=!0,F.globstar=!0,X(n);continue}let t=j();if(!0!==p.noextglob&&/^\([^?]/.test(t)){$("star",n);continue}if("star"===H.type){if(!0===p.noglobstar){X(n);continue}let r=H.prev,i=r.prev,a="slash"===r.type||"bos"===r.type,s=i&&("star"===i.type||"globstar"===i.type);if(!0===p.bash&&(!a||t[0]&&"/"!==t[0])){K({type:"star",value:n,output:""});continue}let o=F.braces>0&&("comma"===r.type||"brace"===r.type),l=k.length&&("pipe"===r.type||"paren"===r.type);if(!a&&"paren"!==r.type&&!o&&!l){K({type:"star",value:n,output:""});continue}for(;"/**"===t.slice(0,3);){let n=e[F.index+4];if(n&&"/"!==n)break;t=t.slice(3),X("/**",3)}if("bos"===r.type&&V()){H.type="globstar",H.value+=n,H.output=N(p),F.output=H.output,F.globstar=!0,X(n);continue}if("slash"===r.type&&"bos"!==r.prev.type&&!s&&V()){F.output=F.output.slice(0,-(r.output+H.output).length),r.output="(?:".concat(r.output),H.type="globstar",H.output=N(p)+(p.strictSlashes?")":"|$)"),H.value+=n,F.globstar=!0,F.output+=r.output+H.output,X(n);continue}if("slash"===r.type&&"bos"!==r.prev.type&&"/"===t[0]){let e=void 0!==t[1]?"|$":"";F.output=F.output.slice(0,-(r.output+H.output).length),r.output="(?:".concat(r.output),H.type="globstar",H.output="".concat(N(p)).concat(M,"|").concat(M).concat(e,")"),H.value+=n,F.output+=r.output+H.output,F.globstar=!0,X(n+W()),K({type:"slash",value:"/",output:""});continue}if("bos"===r.type&&"/"===t[0]){H.type="globstar",H.value+=n,H.output="(?:^|".concat(M,"|").concat(N(p)).concat(M,")"),F.output=H.output,F.globstar=!0,X(n+W()),K({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-H.output.length),H.type="globstar",H.output=N(p),H.value+=n,F.output+=H.output,F.globstar=!0,X(n);continue}let r={type:"star",value:n,output:O};if(!0===p.bash){r.output=".*?",("bos"===H.type||"slash"===H.type)&&(r.output=D+r.output),K(r);continue}if(H&&("bracket"===H.type||"paren"===H.type)&&!0===p.regex){r.output=n,K(r);continue}(F.index===F.start||"slash"===H.type||"dot"===H.type)&&("dot"===H.type?(F.output+=A,H.output+=A):!0===p.dot?(F.output+=C,H.output+=C):(F.output+=D,H.output+=D),"*"!==G()&&(F.output+=w,H.output+=w)),K(r)}for(;F.brackets>0;){if(!0===p.strictBrackets)throw SyntaxError(h("closing","]"));F.output=i.escapeLast(F.output,"["),Z("brackets")}for(;F.parens>0;){if(!0===p.strictBrackets)throw SyntaxError(h("closing",")"));F.output=i.escapeLast(F.output,"("),Z("parens")}for(;F.braces>0;){if(!0===p.strictBrackets)throw SyntaxError(h("closing","}"));F.output=i.escapeLast(F.output,"{"),Z("braces")}if(!0!==p.strictSlashes&&("star"===H.type||"bracket"===H.type)&&K({type:"maybe_slash",value:"",output:"".concat(M,"?")}),!0===F.backtrack)for(let e of(F.output="",F.tokens))F.output+=null!=e.output?e.output:e.value,e.suffix&&(F.output+=e.suffix);return F};d.fastpaths=(e,t)=>{let n={...t},s="number"==typeof n.maxLength?Math.min(a,n.maxLength):a,o=e.length;if(o>s)throw SyntaxError("Input length: ".concat(o,", exceeds maximum allowed length: ").concat(s));e=u[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:h,DOTS_SLASH:d,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:g,START_ANCHOR:v}=r.globChars(n.windows),y=n.dot?f:p,_=n.dot?m:p,x=n.capture?"":"?:",b=!0===n.bash?".*?":g;n.capture&&(b="(".concat(b,")"));let S=e=>!0===e.noglobstar?b:"(".concat(x,"(?:(?!").concat(v).concat(e.dot?d:l,").)*?)"),M=e=>{switch(e){case"*":return"".concat(y).concat(h).concat(b);case".*":return"".concat(l).concat(h).concat(b);case"*.*":return"".concat(y).concat(b).concat(l).concat(h).concat(b);case"*/*":return"".concat(y).concat(b).concat(c).concat(h).concat(_).concat(b);case"**":return y+S(n);case"**/*":return"(?:".concat(y).concat(S(n)).concat(c,")?").concat(_).concat(h).concat(b);case"**/*.*":return"(?:".concat(y).concat(S(n)).concat(c,")?").concat(_).concat(b).concat(l).concat(h).concat(b);case"**/.*":return"(?:".concat(y).concat(S(n)).concat(c,")?").concat(l).concat(h).concat(b);default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=M(t[1]);if(!n)return;return n+l+t[2]}}},w=M(i.removePrefix(e,{negated:!1,prefix:""}));return w&&!0!==n.strictSlashes&&(w+="".concat(c,"?")),w},t.exports=d},53174,(e,t,n)=>{"use strict";let r=e.r(26094),i=e.r(17932),a=e.r(19241),s=e.r(53487),o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Array.isArray(e)){let r=e.map(e=>o(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=e&&"object"==typeof e&&!Array.isArray(e)&&e.tokens&&e.input;if(""===e||"string"!=typeof e&&!r)throw TypeError("Expected pattern to be a non-empty string");let i=t||{},a=i.windows,s=r?o.compileRe(e,t):o.makeRe(e,t,!1,!0),l=s.state;delete s.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=o(i.ignore,e,n)}let c=function(n){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{isMatch:c,match:h,output:d}=o.test(n,s,t,{glob:e,posix:a}),p={glob:e,state:l,regex:s,posix:a,input:n,output:d,match:h,isMatch:c};return("function"==typeof i.onResult&&i.onResult(p),!1===c)?(p.isMatch=!1,!!r&&p):u(n)?("function"==typeof i.onIgnore&&i.onIgnore(p),p.isMatch=!1,!!r&&p):("function"==typeof i.onMatch&&i.onMatch(p),!r||p)};return n&&(c.state=l),c};o.test=function(e,t,n){let{glob:r,posix:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("string"!=typeof e)throw TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};let s=n||{},l=s.format||(i?a.toPosixSlashes:null),u=e===r,c=u&&l?l(e):e;return!1===u&&(u=(c=l?l(e):e)===r),(!1===u||!0===s.capture)&&(u=!0===s.matchBase||!0===s.basename?o.matchBase(e,t,n,i):t.exec(c)),{isMatch:!!u,match:u,output:c}},o.matchBase=(e,t,n)=>(t instanceof RegExp?t:o.makeRe(t,n)).test(a.basename(e)),o.isMatch=(e,t,n)=>o(t,n)(e),o.parse=(e,t)=>Array.isArray(e)?e.map(e=>o.parse(e,t)):i(e,{...t,fastpaths:!1}),o.scan=(e,t)=>r(e,t),o.compileRe=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!0===n)return e.output;let i=t||{},a=i.contains?"":"^",s=i.contains?"":"$",l="".concat(a,"(?:").concat(e.output,")").concat(s);e&&!0===e.negated&&(l="^(?!".concat(l,").*$"));let u=o.toRegex(l,t);return!0===r&&(u.state=e),u},o.makeRe=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||"string"!=typeof e)throw TypeError("Expected a non-empty string");let a={negated:!1,fastpaths:!0};return!1!==t.fastpaths&&("."===e[0]||"*"===e[0])&&(a.output=i.fastpaths(e,t)),a.output||(a=i(e,t)),o.compileRe(a,t,n,r)},o.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},o.constants=s,t.exports=o},54970,(e,t,n)=>{"use strict";let r=e.r(53174),i=e.r(19241);function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t&&(null===t.windows||void 0===t.windows)&&(t={...t,windows:i.isWindows()}),r(e,t,n)}Object.assign(a,r),t.exports=a},98223,71726,91996,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t],98223),e.s(["getActualResourceKey",()=>l,"getMissionInfo",()=>d,"getMissionList",()=>p,"getResourceKey",()=>a,"getResourceList",()=>u,"getResourceMap",()=>s,"getSourceAndPath",()=>o,"getStandardTextureResourceKey",()=>h],91996);var n=e.i(63738);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let i=n.default;function a(e){return r(e).toLowerCase()}function s(){return i.resources}function o(e){let[t,...n]=i.resources[e],[r,a]=n[n.length-1];return[r,null!=a?a:t]}function l(e){let t=a(e);if(i.resources[t])return t;let n=t.replace(/\d+(\.(png))$/i,"$1");if(i.resources[n])return n;throw Error("Resource not found in manifest: ".concat(e))}function u(){return Object.keys(i.resources)}let c=["",".jpg",".png",".gif",".bmp"];function h(e){let t=a(e);for(let e of c){let n="".concat(t).concat(e);if(i.resources[n])return n}return t}function d(e){let t=i.missions[e];if(!t)throw Error("Mission not found: ".concat(e));return t}function p(){return Object.keys(i.missions)}},92552,(e,t,n)=>{"use strict";let r,i;function a(e,t){return t.reduce((e,t)=>{let[n,r]=t;return{type:"BinaryExpression",operator:n,left:e,right:r}},e)}function s(e,t){return{type:"UnaryExpression",operator:e,argument:t}}class o extends SyntaxError{format(e){let t="Error: "+this.message;if(this.location){let n=null,r=e.find(e=>e.source===this.location.source);r&&(n=r.text.split(/\r\n|\n|\r/g));let i=this.location.start,a=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,s=this.location.source+":"+a.line+":"+a.column;if(n){let e=this.location.end,r="".padEnd(a.line.toString().length," "),o=n[i.line-1],l=(i.line===e.line?e.column:o.length+1)-i.column||1;t+="\n --> "+s+"\n"+r+" |\n"+a.line+" | "+o+"\n"+r+" | "+"".padEnd(i.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+s}return t}static buildMessage(e,t){function n(e){return e.codePointAt(0).toString(16).toUpperCase()}let r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function i(e){return r?e.replace(r,e=>"\\u{"+n(e)+"}"):e}function a(e){return i(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+n(e)))}function s(e){return i(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+n(e)))}let o={literal:e=>'"'+a(e.text)+'"',class(e){let t=e.parts.map(e=>Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return o[e.type](e)}return"Expected "+function(e){let t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let n=1;n]/,C=/^[+\-]/,R=/^[%*\/]/,P=/^[!\-~]/,I=/^[a-zA-Z_]/,L=/^[a-zA-Z0-9_]/,N=/^[ \t]/,D=/^[^"\\\n\r]/,U=/^[^'\\\n\r]/,O=/^[0-9a-fA-F]/,F=/^[0-9]/,k=/^[xX]/,z=/^[^\n\r]/,B=/^[\n\r]/,H=/^[ \t\n\r]/,V=tT(";",!1),G=tT("package",!1),W=tT("{",!1),j=tT("}",!1),X=tT("function",!1),q=tT("(",!1),Y=tT(")",!1),J=tT("::",!1),Z=tT(",",!1),K=tT("datablock",!1),$=tT(":",!1),Q=tT("new",!1),ee=tT("[",!1),et=tT("]",!1),en=tT("=",!1),er=tT(".",!1),ei=tT("if",!1),ea=tT("else",!1),es=tT("for",!1),eo=tT("while",!1),el=tT("do",!1),eu=tT("switch$",!1),ec=tT("switch",!1),eh=tT("case",!1),ed=tT("default",!1),ep=tT("or",!1),ef=tT("return",!1),em=tT("break",!1),eg=tT("continue",!1),ev=tT("+=",!1),ey=tT("-=",!1),e_=tT("*=",!1),ex=tT("/=",!1),eb=tT("%=",!1),eS=tT("<<=",!1),eM=tT(">>=",!1),ew=tT("&=",!1),eE=tT("|=",!1),eT=tT("^=",!1),eA=tT("?",!1),eC=tT("||",!1),eR=tT("&&",!1),eP=tT("|",!1),eI=tT("^",!1),eL=tT("&",!1),eN=tT("==",!1),eD=tT("!=",!1),eU=tT("<=",!1),eO=tT(">=",!1),eF=tA(["<",">"],!1,!1,!1),ek=tT("$=",!1),ez=tT("!$=",!1),eB=tT("@",!1),eH=tT("NL",!1),eV=tT("TAB",!1),eG=tT("SPC",!1),eW=tT("<<",!1),ej=tT(">>",!1),eX=tA(["+","-"],!1,!1,!1),eq=tA(["%","*","/"],!1,!1,!1),eY=tA(["!","-","~"],!1,!1,!1),eJ=tT("++",!1),eZ=tT("--",!1),eK=tT("*",!1),e$=tT("%",!1),eQ=tA([["a","z"],["A","Z"],"_"],!1,!1,!1),e0=tA([["a","z"],["A","Z"],["0","9"],"_"],!1,!1,!1),e1=tT("$",!1),e2=tT("parent",!1),e3=tA([" "," "],!1,!1,!1),e4=tT('"',!1),e5=tT("'",!1),e6=tT("\\",!1),e8=tA(['"',"\\","\n","\r"],!0,!1,!1),e9=tA(["'","\\","\n","\r"],!0,!1,!1),e7=tT("n",!1),te=tT("r",!1),tt=tT("t",!1),tn=tT("x",!1),tr=tA([["0","9"],["a","f"],["A","F"]],!1,!1,!1),ti=tT("cr",!1),ta=tT("cp",!1),ts=tT("co",!1),to=tT("c",!1),tl=tA([["0","9"]],!1,!1,!1),tu={type:"any"},tc=tT("0",!1),th=tA(["x","X"],!1,!1,!1),td=tT("-",!1),tp=tT("true",!1),tf=tT("false",!1),tm=tT("//",!1),tg=tA(["\n","\r"],!0,!1,!1),tv=tA(["\n","\r"],!1,!1,!1),ty=tT("/*",!1),t_=tT("*/",!1),tx=tA([" "," ","\n","\r"],!1,!1,!1),tb=0|t.peg$currPos,tS=[{line:1,column:1}],tM=tb,tw=t.peg$maxFailExpected||[],tE=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in c))throw Error("Can't start parsing from rule \""+t.startRule+'".');h=c[t.startRule]}function tT(e,t){return{type:"literal",text:e,ignoreCase:t}}function tA(e,t,n,r){return{type:"class",parts:e,inverted:t,ignoreCase:n,unicode:r}}function tC(t){let n,r=tS[t];if(r)return r;if(t>=tS.length)n=tS.length-1;else for(n=t;!tS[--n];);for(r={line:(r=tS[n]).line,column:r.column};ntM&&(tM=tb,tw=[]),tw.push(e))}function tI(){let e,t,n;for(nh(),e=[],t=tb,(n=nl())===l&&(n=tL()),n!==l?t=n=[n,nh()]:(tb=t,t=l);t!==l;)e.push(t),t=tb,(n=nl())===l&&(n=tL()),n!==l?t=n=[n,nh()]:(tb=t,t=l);return{type:"Program",body:e.map(e=>{let[t]=e;return t}).filter(Boolean),execScriptPaths:Array.from(r),hasDynamicExec:i}}function tL(){let t,n,r,i,a,s,o,u,c,h,f,_,x,w,E,T,A;return(t=function(){let t,n,r,i,a,s,o,u;if(t=tb,e.substr(tb,7)===d?(n=d,tb+=7):(n=l,0===tE&&tP(G)),n!==l)if(nc()!==l)if((r=nr())!==l)if(nu(),123===e.charCodeAt(tb)?(i="{",tb++):(i=l,0===tE&&tP(W)),i!==l){for(nh(),a=[],s=tb,(o=nl())===l&&(o=tL()),o!==l?s=o=[o,u=nh()]:(tb=s,s=l);s!==l;)a.push(s),s=tb,(o=nl())===l&&(o=tL()),o!==l?s=o=[o,u=nh()]:(tb=s,s=l);(125===e.charCodeAt(tb)?(s="}",tb++):(s=l,0===tE&&tP(j)),s!==l)?(o=nu(),59===e.charCodeAt(tb)?(u=";",tb++):(u=l,0===tE&&tP(V)),u===l&&(u=null),t={type:"PackageDeclaration",name:r,body:a.map(e=>{let[t]=e;return t}).filter(Boolean)}):(tb=t,t=l)}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s,o;if(t=tb,e.substr(tb,8)===p?(n=p,tb+=8):(n=l,0===tE&&tP(X)),n!==l)if(nc()!==l)if((r=function(){let t,n,r,i;if(t=tb,(n=nr())!==l)if("::"===e.substr(tb,2)?(r="::",tb+=2):(r=l,0===tE&&tP(J)),r!==l)if((i=nr())!==l)t={type:"MethodName",namespace:n,method:i};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t===l&&(t=nr()),t}())!==l)if(nu(),40===e.charCodeAt(tb)?(i="(",tb++):(i=l,0===tE&&tP(q)),i!==l)if(nu(),(a=function(){let t,n,r,i,a,s,o,u;if(t=tb,(n=nr())!==l){for(r=[],i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=nr())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=nr())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);t=[n,...r.map(e=>{let[,,,t]=e;return t})]}else tb=t,t=l;return t}())===l&&(a=null),nu(),41===e.charCodeAt(tb)?(s=")",tb++):(s=l,0===tE&&tP(Y)),s!==l)if(nu(),(o=tH())!==l)t={type:"FunctionDeclaration",name:r,params:a||[],body:o};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&((r=tb,(i=tN())!==l)?(nu(),59===e.charCodeAt(tb)?(a=";",tb++):(a=l,0===tE&&tP(V)),a===l&&(a=null),nu(),r=i):(tb=r,r=l),(t=r)===l&&((s=tb,(o=tD())!==l)?(nu(),59===e.charCodeAt(tb)?(u=";",tb++):(u=l,0===tE&&tP(V)),u===l&&(u=null),nu(),s=o):(tb=s,s=l),(t=s)===l&&(t=function(){let t,n,r,i,a,s,o,u,c,h,d;if(t=tb,"if"===e.substr(tb,2)?(n="if",tb+=2):(n=l,0===tE&&tP(ei)),n!==l)if(nu(),40===e.charCodeAt(tb)?(r="(",tb++):(r=l,0===tE&&tP(q)),r!==l)if(nu(),(i=tV())!==l)if(nu(),41===e.charCodeAt(tb)?(a=")",tb++):(a=l,0===tE&&tP(Y)),a!==l)if(nu(),(s=tL())!==l){var p;o=tb,u=nu(),e.substr(tb,4)===m?(c=m,tb+=4):(c=l,0===tE&&tP(ea)),c!==l?(h=nu(),(d=tL())!==l?o=u=[u,c,h,d]:(tb=o,o=l)):(tb=o,o=l),o===l&&(o=null),t={type:"IfStatement",test:i,consequent:s,alternate:(p=o)?p[3]:null}}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s,o,u,c,h;if(t=tb,"for"===e.substr(tb,3)?(n="for",tb+=3):(n=l,0===tE&&tP(es)),n!==l)if(nu(),40===e.charCodeAt(tb)?(r="(",tb++):(r=l,0===tE&&tP(q)),r!==l)if(nu(),(i=tV())===l&&(i=null),nu(),59===e.charCodeAt(tb)?(a=";",tb++):(a=l,0===tE&&tP(V)),a!==l)if(nu(),(s=tV())===l&&(s=null),nu(),59===e.charCodeAt(tb)?(o=";",tb++):(o=l,0===tE&&tP(V)),o!==l)if(nu(),(u=tV())===l&&(u=null),nu(),41===e.charCodeAt(tb)?(c=")",tb++):(c=l,0===tE&&tP(Y)),c!==l)if(nu(),(h=tL())!==l){var d,p;d=i,p=s,t={type:"ForStatement",init:d,test:p,update:u,body:h}}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s,o,u;if(t=tb,"do"===e.substr(tb,2)?(n="do",tb+=2):(n=l,0===tE&&tP(el)),n!==l)if(nu(),(r=tL())!==l)if(nu(),e.substr(tb,5)===g?(i=g,tb+=5):(i=l,0===tE&&tP(eo)),i!==l)if(nu(),40===e.charCodeAt(tb)?(a="(",tb++):(a=l,0===tE&&tP(q)),a!==l)if(nu(),(s=tV())!==l)if(nu(),41===e.charCodeAt(tb)?(o=")",tb++):(o=l,0===tE&&tP(Y)),o!==l)nu(),59===e.charCodeAt(tb)?(u=";",tb++):(u=l,0===tE&&tP(V)),u===l&&(u=null),t={type:"DoWhileStatement",test:s,body:r};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s;if(t=tb,e.substr(tb,5)===g?(n=g,tb+=5):(n=l,0===tE&&tP(eo)),n!==l)if(nu(),40===e.charCodeAt(tb)?(r="(",tb++):(r=l,0===tE&&tP(q)),r!==l)if(nu(),(i=tV())!==l)if(nu(),41===e.charCodeAt(tb)?(a=")",tb++):(a=l,0===tE&&tP(Y)),a!==l)if(nu(),(s=tL())!==l)t={type:"WhileStatement",test:i,body:s};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s,o,u,c,h;if(t=tb,e.substr(tb,7)===v?(n=v,tb+=7):(n=l,0===tE&&tP(eu)),n!==l)if(nu(),40===e.charCodeAt(tb)?(r="(",tb++):(r=l,0===tE&&tP(q)),r!==l)if(nu(),(i=tV())!==l)if(nu(),41===e.charCodeAt(tb)?(a=")",tb++):(a=l,0===tE&&tP(Y)),a!==l)if(nu(),123===e.charCodeAt(tb)?(s="{",tb++):(s=l,0===tE&&tP(W)),s!==l){for(nh(),o=[],u=tb,(c=nl())===l&&(c=tB()),c!==l?u=c=[c,h=nh()]:(tb=u,u=l);u!==l;)o.push(u),u=tb,(c=nl())===l&&(c=tB()),c!==l?u=c=[c,h=nh()]:(tb=u,u=l);(125===e.charCodeAt(tb)?(u="}",tb++):(u=l,0===tE&&tP(j)),u!==l)?t={type:"SwitchStatement",stringMode:!0,discriminant:i,cases:o.map(e=>{let[t]=e;return t}).filter(e=>e&&"SwitchCase"===e.type)}:(tb=t,t=l)}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;if(t===l)if(t=tb,e.substr(tb,6)===y?(n=y,tb+=6):(n=l,0===tE&&tP(ec)),n!==l)if(nu(),40===e.charCodeAt(tb)?(r="(",tb++):(r=l,0===tE&&tP(q)),r!==l)if(nu(),(i=tV())!==l)if(nu(),41===e.charCodeAt(tb)?(a=")",tb++):(a=l,0===tE&&tP(Y)),a!==l)if(nu(),123===e.charCodeAt(tb)?(s="{",tb++):(s=l,0===tE&&tP(W)),s!==l){for(nh(),o=[],u=tb,(c=nl())===l&&(c=tB()),c!==l?u=c=[c,h=nh()]:(tb=u,u=l);u!==l;)o.push(u),u=tb,(c=nl())===l&&(c=tB()),c!==l?u=c=[c,h=nh()]:(tb=u,u=l);(125===e.charCodeAt(tb)?(u="}",tb++):(u=l,0===tE&&tP(j)),u!==l)?t={type:"SwitchStatement",stringMode:!1,discriminant:i,cases:o.map(e=>{let[t]=e;return t}).filter(e=>e&&"SwitchCase"===e.type)}:(tb=t,t=l)}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a;if(t=tb,e.substr(tb,6)===b?(n=b,tb+=6):(n=l,0===tE&&tP(ef)),n!==l)if(r=tb,(i=nc())!==l&&(a=tV())!==l?r=i=[i,a]:(tb=r,r=l),r===l&&(r=null),i=nu(),59===e.charCodeAt(tb)?(a=";",tb++):(a=l,0===tE&&tP(V)),a!==l){var s;t={type:"ReturnStatement",value:(s=r)?s[1]:null}}else tb=t,t=l;else tb=t,t=l;return t}())===l&&(c=tb,e.substr(tb,5)===S?(h=S,tb+=5):(h=l,0===tE&&tP(em)),h!==l?(nu(),59===e.charCodeAt(tb)?(f=";",tb++):(f=l,0===tE&&tP(V)),f!==l?c={type:"BreakStatement"}:(tb=c,c=l)):(tb=c,c=l),(t=c)===l&&(_=tb,e.substr(tb,8)===M?(x=M,tb+=8):(x=l,0===tE&&tP(eg)),x!==l?(nu(),59===e.charCodeAt(tb)?(w=";",tb++):(w=l,0===tE&&tP(V)),w!==l?_={type:"ContinueStatement"}:(tb=_,_=l)):(tb=_,_=l),(t=_)===l&&((E=tb,(T=tV())!==l&&(nu(),59===e.charCodeAt(tb)?(A=";",tb++):(A=l,0===tE&&tP(V)),A!==l))?E={type:"ExpressionStatement",expression:T}:(tb=E,E=l),(t=E)===l&&(t=tH())===l&&(t=nl())===l)))))&&(t=tb,nu(),59===e.charCodeAt(tb)?(n=";",tb++):(n=l,0===tE&&tP(V)),n!==l?(nu(),t=null):(tb=t,t=l)),t}function tN(){let t,n,r,i,a,s,o,u,c,h,d,p,m,g;if(t=tb,e.substr(tb,9)===f?(n=f,tb+=9):(n=l,0===tE&&tP(K)),n!==l)if(nc()!==l)if((r=nr())!==l)if(nu(),40===e.charCodeAt(tb)?(i="(",tb++):(i=l,0===tE&&tP(q)),i!==l)if(nu(),(a=tO())===l&&(a=null),nu(),41===e.charCodeAt(tb)?(s=")",tb++):(s=l,0===tE&&tP(Y)),s!==l){var v,y,_;if(nu(),o=tb,58===e.charCodeAt(tb)?(u=":",tb++):(u=l,0===tE&&tP($)),u!==l?(c=nu(),(h=nr())!==l?o=u=[u,c,h]:(tb=o,o=l)):(tb=o,o=l),o===l&&(o=null),u=nu(),c=tb,123===e.charCodeAt(tb)?(h="{",tb++):(h=l,0===tE&&tP(W)),h!==l){for(d=nu(),p=[],m=tU();m!==l;)p.push(m),m=tU();m=nu(),125===e.charCodeAt(tb)?(g="}",tb++):(g=l,0===tE&&tP(j)),g!==l?c=h=[h,d,p,m,g,nu()]:(tb=c,c=l)}else tb=c,c=l;c===l&&(c=null),v=a,y=o,_=c,t={type:"DatablockDeclaration",className:r,instanceName:v,parent:y?y[2]:null,body:_?_[2].filter(Boolean):[]}}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}function tD(){let t,n,r,i,a,s,o,u,c,h,d,p;if(t=tb,"new"===e.substr(tb,3)?(n="new",tb+=3):(n=l,0===tE&&tP(Q)),n!==l)if(nc()!==l)if((r=function(){let t,n,r,i,a,s,o,u,c,h;if((t=tb,40===e.charCodeAt(tb)?(n="(",tb++):(n=l,0===tE&&tP(q)),n!==l&&(r=nu(),(i=tV())!==l&&(a=nu(),41===e.charCodeAt(tb)?(s=")",tb++):(s=l,0===tE&&tP(Y)),s!==l)))?t=i:(tb=t,t=l),t===l)if(t=tb,(n=nr())!==l){var d;for(r=[],i=tb,a=nu(),91===e.charCodeAt(tb)?(s="[",tb++):(s=l,0===tE&&tP(ee)),s!==l?(o=nu(),(u=tz())!==l?(c=nu(),93===e.charCodeAt(tb)?(h="]",tb++):(h=l,0===tE&&tP(et)),h!==l?i=a=[a,s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),91===e.charCodeAt(tb)?(s="[",tb++):(s=l,0===tE&&tP(ee)),s!==l?(o=nu(),(u=tz())!==l?(c=nu(),93===e.charCodeAt(tb)?(h="]",tb++):(h=l,0===tE&&tP(et)),h!==l?i=a=[a,s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);d=n,t=r.reduce((e,t)=>{let[,,,n]=t;return{type:"IndexExpression",object:e,index:n}},d)}else tb=t,t=l;return t}())!==l)if(nu(),40===e.charCodeAt(tb)?(i="(",tb++):(i=l,0===tE&&tP(q)),i!==l)if(nu(),(a=tO())===l&&(a=null),nu(),41===e.charCodeAt(tb)?(s=")",tb++):(s=l,0===tE&&tP(Y)),s!==l){var f;if(nu(),o=tb,123===e.charCodeAt(tb)?(u="{",tb++):(u=l,0===tE&&tP(W)),u!==l){for(c=nu(),h=[],d=tU();d!==l;)h.push(d),d=tU();d=nu(),125===e.charCodeAt(tb)?(p="}",tb++):(p=l,0===tE&&tP(j)),p!==l?o=u=[u,c,h,d,p,nu()]:(tb=o,o=l)}else tb=o,o=l;o===l&&(o=null),t={type:"ObjectDeclaration",className:r,instanceName:a,body:(f=o)?f[2].filter(Boolean):[]}}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}function tU(){let t,n,r;return(t=tb,(n=tD())!==l)?(nu(),59===e.charCodeAt(tb)?(r=";",tb++):(r=l,0===tE&&tP(V)),r===l&&(r=null),nu(),t=n):(tb=t,t=l),t===l&&((t=tb,(n=tN())!==l)?(nu(),59===e.charCodeAt(tb)?(r=";",tb++):(r=l,0===tE&&tP(V)),r===l&&(r=null),nu(),t=n):(tb=t,t=l),t===l&&(t=function(){let t,n,r,i,a;if(t=tb,nu(),(n=tF())!==l)if(nu(),61===e.charCodeAt(tb)?(r="=",tb++):(r=l,0===tE&&tP(en)),r!==l)if(nu(),(i=tV())!==l)nu(),59===e.charCodeAt(tb)?(a=";",tb++):(a=l,0===tE&&tP(V)),a===l&&(a=null),nu(),t={type:"Assignment",target:n,value:i};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t}())===l&&(t=nl())===l&&(t=function(){let t,n;if(t=[],n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx)),n!==l)for(;n!==l;)t.push(n),n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx));else t=l;return t!==l&&(t=null),t}())),t}function tO(){let e;return(e=tQ())===l&&(e=nr())===l&&(e=no()),e}function tF(){let e,t,n,r;if(e=tb,(t=t9())!==l){for(n=[],r=tk();r!==l;)n.push(r),r=tk();e=n.reduce((e,t)=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},t)}else tb=e,e=l;return e}function tk(){let t,n,r,i;return(t=tb,46===e.charCodeAt(tb)?(n=".",tb++):(n=l,0===tE&&tP(er)),n!==l&&(nu(),(r=nr())!==l))?t={type:"property",value:r}:(tb=t,t=l),t===l&&((t=tb,91===e.charCodeAt(tb)?(n="[",tb++):(n=l,0===tE&&tP(ee)),n!==l&&(nu(),(r=tz())!==l&&(nu(),93===e.charCodeAt(tb)?(i="]",tb++):(i=l,0===tE&&tP(et)),i!==l)))?t={type:"index",value:r}:(tb=t,t=l)),t}function tz(){let t,n,r,i,a,s,o,u;if(t=tb,(n=tV())!==l){for(r=[],i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=tV())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=tV())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);t=r.length>0?[n,...r.map(e=>{let[,,,t]=e;return t})]:n}else tb=t,t=l;return t}function tB(){let t,n,r,i,a,s,o,u,c;if(t=tb,e.substr(tb,4)===_?(n=_,tb+=4):(n=l,0===tE&&tP(eh)),n!==l)if(nc()!==l)if((r=function(){let t,n,r,i,a,s,o,u;if(t=tb,(n=t4())!==l){for(r=[],i=tb,a=nu(),"or"===e.substr(tb,2)?(s="or",tb+=2):(s=l,0===tE&&tP(ep)),s!==l&&(o=nc())!==l&&(u=t4())!==l?i=a=[a,s,o,u]:(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),"or"===e.substr(tb,2)?(s="or",tb+=2):(s=l,0===tE&&tP(ep)),s!==l&&(o=nc())!==l&&(u=t4())!==l?i=a=[a,s,o,u]:(tb=i,i=l);t=r.length>0?[n,...r.map(e=>{let[,,,t]=e;return t})]:n}else tb=t,t=l;return t}())!==l)if(nu(),58===e.charCodeAt(tb)?(i=":",tb++):(i=l,0===tE&&tP($)),i!==l){for(a=nh(),s=[],o=tb,(u=nl())===l&&(u=tL()),u!==l?o=u=[u,c=nh()]:(tb=o,o=l);o!==l;)s.push(o),o=tb,(u=nl())===l&&(u=tL()),u!==l?o=u=[u,c=nh()]:(tb=o,o=l);t={type:"SwitchCase",test:r,consequent:s.map(e=>{let[t]=e;return t}).filter(Boolean)}}else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;if(t===l)if(t=tb,e.substr(tb,7)===x?(n=x,tb+=7):(n=l,0===tE&&tP(ed)),n!==l)if(nu(),58===e.charCodeAt(tb)?(r=":",tb++):(r=l,0===tE&&tP($)),r!==l){for(nh(),i=[],a=tb,(s=nl())===l&&(s=tL()),s!==l?a=s=[s,o=nh()]:(tb=a,a=l);a!==l;)i.push(a),a=tb,(s=nl())===l&&(s=tL()),s!==l?a=s=[s,o=nh()]:(tb=a,a=l);t={type:"SwitchCase",test:null,consequent:i.map(e=>{let[t]=e;return t}).filter(Boolean)}}else tb=t,t=l;else tb=t,t=l;return t}function tH(){let t,n,r,i,a,s;if(t=tb,123===e.charCodeAt(tb)?(n="{",tb++):(n=l,0===tE&&tP(W)),n!==l){for(nh(),r=[],i=tb,(a=nl())===l&&(a=tL()),a!==l?i=a=[a,s=nh()]:(tb=i,i=l);i!==l;)r.push(i),i=tb,(a=nl())===l&&(a=tL()),a!==l?i=a=[a,s=nh()]:(tb=i,i=l);(125===e.charCodeAt(tb)?(i="}",tb++):(i=l,0===tE&&tP(j)),i!==l)?t={type:"BlockStatement",body:r.map(e=>{let[t]=e;return t}).filter(Boolean)}:(tb=t,t=l)}else tb=t,t=l;return t}function tV(){let t,n,r,i;if(t=tb,(n=tF())!==l)if(nu(),(r=tG())!==l)if(nu(),(i=tV())!==l)t={type:"AssignmentExpression",operator:r,target:n,value:i};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t===l&&(t=function(){let t,n,r,i,a,s;if(t=tb,(n=tW())!==l)if(nu(),63===e.charCodeAt(tb)?(r="?",tb++):(r=l,0===tE&&tP(eA)),r!==l)if(nu(),(i=tV())!==l)if(nu(),58===e.charCodeAt(tb)?(a=":",tb++):(a=l,0===tE&&tP($)),a!==l)if(nu(),(s=tV())!==l)t={type:"ConditionalExpression",test:n,consequent:i,alternate:s};else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;else tb=t,t=l;return t===l&&(t=tW()),t}()),t}function tG(){let t;return 61===e.charCodeAt(tb)?(t="=",tb++):(t=l,0===tE&&tP(en)),t===l&&("+="===e.substr(tb,2)?(t="+=",tb+=2):(t=l,0===tE&&tP(ev)),t===l&&("-="===e.substr(tb,2)?(t="-=",tb+=2):(t=l,0===tE&&tP(ey)),t===l&&("*="===e.substr(tb,2)?(t="*=",tb+=2):(t=l,0===tE&&tP(e_)),t===l&&("/="===e.substr(tb,2)?(t="/=",tb+=2):(t=l,0===tE&&tP(ex)),t===l&&("%="===e.substr(tb,2)?(t="%=",tb+=2):(t=l,0===tE&&tP(eb)),t===l&&("<<="===e.substr(tb,3)?(t="<<=",tb+=3):(t=l,0===tE&&tP(eS)),t===l&&(">>="===e.substr(tb,3)?(t=">>=",tb+=3):(t=l,0===tE&&tP(eM)),t===l&&("&="===e.substr(tb,2)?(t="&=",tb+=2):(t=l,0===tE&&tP(ew)),t===l&&("|="===e.substr(tb,2)?(t="|=",tb+=2):(t=l,0===tE&&tP(eE)),t===l&&("^="===e.substr(tb,2)?(t="^=",tb+=2):(t=l,0===tE&&tP(eT)))))))))))),t}function tW(){let t,n,r,i,s,o,u,c;if(t=tb,(n=tj())!==l){for(r=[],i=tb,s=nu(),"||"===e.substr(tb,2)?(o="||",tb+=2):(o=l,0===tE&&tP(eC)),o!==l?(u=nu(),(c=tj())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),"||"===e.substr(tb,2)?(o="||",tb+=2):(o=l,0===tE&&tP(eC)),o!==l?(u=nu(),(c=tj())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function tj(){let t,n,r,i,s,o,u,c;if(t=tb,(n=tX())!==l){for(r=[],i=tb,s=nu(),"&&"===e.substr(tb,2)?(o="&&",tb+=2):(o=l,0===tE&&tP(eR)),o!==l?(u=nu(),(c=tX())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),"&&"===e.substr(tb,2)?(o="&&",tb+=2):(o=l,0===tE&&tP(eR)),o!==l?(u=nu(),(c=tX())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function tX(){let t,n,r,i,s,o,u,c,h;if(t=tb,(n=tq())!==l){for(r=[],i=tb,s=nu(),124===e.charCodeAt(tb)?(o="|",tb++):(o=l,0===tE&&tP(eP)),o!==l?(u=tb,tE++,124===e.charCodeAt(tb)?(c="|",tb++):(c=l,0===tE&&tP(eP)),tE--,c===l?u=void 0:(tb=u,u=l),u!==l?(c=nu(),(h=tq())!==l?i=s=[s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),124===e.charCodeAt(tb)?(o="|",tb++):(o=l,0===tE&&tP(eP)),o!==l?(u=tb,tE++,124===e.charCodeAt(tb)?(c="|",tb++):(c=l,0===tE&&tP(eP)),tE--,c===l?u=void 0:(tb=u,u=l),u!==l?(c=nu(),(h=tq())!==l?i=s=[s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function tq(){let t,n,r,i,s,o,u,c;if(t=tb,(n=tY())!==l){for(r=[],i=tb,s=nu(),94===e.charCodeAt(tb)?(o="^",tb++):(o=l,0===tE&&tP(eI)),o!==l?(u=nu(),(c=tY())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),94===e.charCodeAt(tb)?(o="^",tb++):(o=l,0===tE&&tP(eI)),o!==l?(u=nu(),(c=tY())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function tY(){let t,n,r,i,s,o,u,c,h;if(t=tb,(n=tJ())!==l){for(r=[],i=tb,s=nu(),38===e.charCodeAt(tb)?(o="&",tb++):(o=l,0===tE&&tP(eL)),o!==l?(u=tb,tE++,38===e.charCodeAt(tb)?(c="&",tb++):(c=l,0===tE&&tP(eL)),tE--,c===l?u=void 0:(tb=u,u=l),u!==l?(c=nu(),(h=tJ())!==l?i=s=[s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),38===e.charCodeAt(tb)?(o="&",tb++):(o=l,0===tE&&tP(eL)),o!==l?(u=tb,tE++,38===e.charCodeAt(tb)?(c="&",tb++):(c=l,0===tE&&tP(eL)),tE--,c===l?u=void 0:(tb=u,u=l),u!==l?(c=nu(),(h=tJ())!==l?i=s=[s,o,u,c,h]:(tb=i,i=l)):(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function tJ(){let e,t,n,r,i,s,o,u;if(e=tb,(t=tK())!==l){for(n=[],r=tb,i=nu(),(s=tZ())!==l?(o=nu(),(u=tK())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);r!==l;)n.push(r),r=tb,i=nu(),(s=tZ())!==l?(o=nu(),(u=tK())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);e=a(t,n.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=e,e=l;return e}function tZ(){let t;return"=="===e.substr(tb,2)?(t="==",tb+=2):(t=l,0===tE&&tP(eN)),t===l&&("!="===e.substr(tb,2)?(t="!=",tb+=2):(t=l,0===tE&&tP(eD))),t}function tK(){let e,t,n,r,i,s,o,u;if(e=tb,(t=tQ())!==l){for(n=[],r=tb,i=nu(),(s=t$())!==l?(o=nu(),(u=tQ())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);r!==l;)n.push(r),r=tb,i=nu(),(s=t$())!==l?(o=nu(),(u=tQ())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);e=a(t,n.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=e,e=l;return e}function t$(){let t;return"<="===e.substr(tb,2)?(t="<=",tb+=2):(t=l,0===tE&&tP(eU)),t===l&&(">="===e.substr(tb,2)?(t=">=",tb+=2):(t=l,0===tE&&tP(eO)),t===l&&(t=e.charAt(tb),A.test(t)?tb++:(t=l,0===tE&&tP(eF)))),t}function tQ(){let e,t,n,r,i,s,o,u;if(e=tb,(t=t2())!==l){for(n=[],r=tb,i=nu(),(s=t1())!==l?(o=nu(),(u=t0())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);r!==l;)n.push(r),r=tb,i=nu(),(s=t1())!==l?(o=nu(),(u=t0())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);e=a(t,n.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=e,e=l;return e}function t0(){let e,t,n,r;if(e=tb,(t=tF())!==l)if(nu(),(n=tG())!==l)if(nu(),(r=tV())!==l)e={type:"AssignmentExpression",operator:n,target:t,value:r};else tb=e,e=l;else tb=e,e=l;else tb=e,e=l;return e===l&&(e=t2()),e}function t1(){let t;return"$="===e.substr(tb,2)?(t="$=",tb+=2):(t=l,0===tE&&tP(ek)),t===l&&("!$="===e.substr(tb,3)?(t="!$=",tb+=3):(t=l,0===tE&&tP(ez)),t===l&&(64===e.charCodeAt(tb)?(t="@",tb++):(t=l,0===tE&&tP(eB)),t===l&&("NL"===e.substr(tb,2)?(t="NL",tb+=2):(t=l,0===tE&&tP(eH)),t===l&&("TAB"===e.substr(tb,3)?(t="TAB",tb+=3):(t=l,0===tE&&tP(eV)),t===l&&("SPC"===e.substr(tb,3)?(t="SPC",tb+=3):(t=l,0===tE&&tP(eG))))))),t}function t2(){let e,t,n,r,i,s,o,u;if(e=tb,(t=t4())!==l){for(n=[],r=tb,i=nu(),(s=t3())!==l?(o=nu(),(u=t4())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);r!==l;)n.push(r),r=tb,i=nu(),(s=t3())!==l?(o=nu(),(u=t4())!==l?r=i=[i,s,o,u]:(tb=r,r=l)):(tb=r,r=l);e=a(t,n.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=e,e=l;return e}function t3(){let t;return"<<"===e.substr(tb,2)?(t="<<",tb+=2):(t=l,0===tE&&tP(eW)),t===l&&(">>"===e.substr(tb,2)?(t=">>",tb+=2):(t=l,0===tE&&tP(ej))),t}function t4(){let t,n,r,i,s,o,u,c;if(t=tb,(n=t5())!==l){for(r=[],i=tb,s=nu(),o=e.charAt(tb),C.test(o)?tb++:(o=l,0===tE&&tP(eX)),o!==l?(u=nu(),(c=t5())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),o=e.charAt(tb),C.test(o)?tb++:(o=l,0===tE&&tP(eX)),o!==l?(u=nu(),(c=t5())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function t5(){let t,n,r,i,s,o,u,c;if(t=tb,(n=t6())!==l){for(r=[],i=tb,s=nu(),o=e.charAt(tb),R.test(o)?tb++:(o=l,0===tE&&tP(eq)),o!==l?(u=nu(),(c=t6())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,s=nu(),o=e.charAt(tb),R.test(o)?tb++:(o=l,0===tE&&tP(eq)),o!==l?(u=nu(),(c=t6())!==l?i=s=[s,o,u,c]:(tb=i,i=l)):(tb=i,i=l);t=a(n,r.map(e=>{let[,t,,n]=e;return[t,n]}))}else tb=t,t=l;return t}function t6(){let t,n,r;return(t=tb,n=e.charAt(tb),P.test(n)?tb++:(n=l,0===tE&&tP(eY)),n!==l&&(nu(),(r=t8())!==l))?t=s(n,r):(tb=t,t=l),t===l&&((t=tb,"++"===e.substr(tb,2)?(n="++",tb+=2):(n=l,0===tE&&tP(eJ)),n===l&&("--"===e.substr(tb,2)?(n="--",tb+=2):(n=l,0===tE&&tP(eZ))),n!==l&&(nu(),(r=t8())!==l))?t=s(n,r):(tb=t,t=l),t===l&&((t=tb,42===e.charCodeAt(tb)?(n="*",tb++):(n=l,0===tE&&tP(eK)),n!==l&&(nu(),(r=t8())!==l))?t={type:"TagDereferenceExpression",argument:r}:(tb=t,t=l),t===l&&(t=function(){let t,n,r;if(t=tb,(n=t9())!==l)if(nu(),"++"===e.substr(tb,2)?(r="++",tb+=2):(r=l,0===tE&&tP(eJ)),r===l&&("--"===e.substr(tb,2)?(r="--",tb+=2):(r=l,0===tE&&tP(eZ))),r!==l)t={type:"PostfixExpression",operator:r,argument:n};else tb=t,t=l;else tb=t,t=l;return t===l&&(t=t9()),t}()))),t}function t8(){let e,t,n,r;if(e=tb,(t=tF())!==l)if(nu(),(n=tG())!==l)if(nu(),(r=tV())!==l)e={type:"AssignmentExpression",operator:n,target:t,value:r};else tb=e,e=l;else tb=e,e=l;else tb=e,e=l;return e===l&&(e=t6()),e}function t9(){let t,n,a,s,o,u,c,h,d,p;if(t=tb,(n=function(){let t,n,r,i,a,s,o,u,c,h,d,p,f,m,g,v;if(t=tb,(o=tD())===l&&(o=tN())===l&&(o=function(){let t,n,r,i;if(t=tb,34===e.charCodeAt(tb)?(n='"',tb++):(n=l,0===tE&&tP(e4)),n!==l){for(r=[],i=ni();i!==l;)r.push(i),i=ni();(34===e.charCodeAt(tb)?(i='"',tb++):(i=l,0===tE&&tP(e4)),i!==l)?t={type:"StringLiteral",value:r.join("")}:(tb=t,t=l)}else tb=t,t=l;if(t===l)if(t=tb,39===e.charCodeAt(tb)?(n="'",tb++):(n=l,0===tE&&tP(e5)),n!==l){for(r=[],i=na();i!==l;)r.push(i),i=na();(39===e.charCodeAt(tb)?(i="'",tb++):(i=l,0===tE&&tP(e5)),i!==l)?t={type:"StringLiteral",value:r.join(""),tagged:!0}:(tb=t,t=l)}else tb=t,t=l;return t}())===l&&(o=no())===l&&((u=tb,e.substr(tb,4)===E?(c=E,tb+=4):(c=l,0===tE&&tP(tp)),c===l&&(e.substr(tb,5)===T?(c=T,tb+=5):(c=l,0===tE&&tP(tf))),c!==l&&(h=tb,tE++,d=np(),tE--,d===l?h=void 0:(tb=h,h=l),h!==l))?u={type:"BooleanLiteral",value:"true"===c}:(tb=u,u=l),(o=u)===l&&((p=ne())===l&&(p=nt())===l&&(p=nn()),(o=p)===l))&&((f=tb,40===e.charCodeAt(tb)?(m="(",tb++):(m=l,0===tE&&tP(q)),m!==l&&(nu(),(g=tV())!==l&&(nu(),41===e.charCodeAt(tb)?(v=")",tb++):(v=l,0===tE&&tP(Y)),v!==l)))?f=g:(tb=f,f=l),o=f),(n=o)!==l){for(r=[],i=tb,a=nu(),(s=tk())!==l?i=a=[a,s]:(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),(s=tk())!==l?i=a=[a,s]:(tb=i,i=l);t=r.reduce((e,t)=>{let[,n]=t;return"property"===n.type?{type:"MemberExpression",object:e,property:n.value}:{type:"IndexExpression",object:e,index:n.value}},n)}else tb=t,t=l;return t}())!==l){for(a=[],s=tb,o=nu(),40===e.charCodeAt(tb)?(u="(",tb++):(u=l,0===tE&&tP(q)),u!==l?(c=nu(),(h=t7())===l&&(h=null),d=nu(),41===e.charCodeAt(tb)?(p=")",tb++):(p=l,0===tE&&tP(Y)),p!==l?s=o=[o,u,c,h,d,p]:(tb=s,s=l)):(tb=s,s=l),s===l&&(s=tb,o=nu(),(u=tk())!==l?s=o=[o,u]:(tb=s,s=l));s!==l;)a.push(s),s=tb,o=nu(),40===e.charCodeAt(tb)?(u="(",tb++):(u=l,0===tE&&tP(q)),u!==l?(c=nu(),(h=t7())===l&&(h=null),d=nu(),41===e.charCodeAt(tb)?(p=")",tb++):(p=l,0===tE&&tP(Y)),p!==l?s=o=[o,u,c,h,d,p]:(tb=s,s=l)):(tb=s,s=l),s===l&&(s=tb,o=nu(),(u=tk())!==l?s=o=[o,u]:(tb=s,s=l));t=a.reduce((e,t)=>{if("("===t[1]){var n;let[,,,a]=t;return n=a||[],"Identifier"===e.type&&"exec"===e.name.toLowerCase()&&(n.length>0&&"StringLiteral"===n[0].type?r.add(n[0].value):i=!0),{type:"CallExpression",callee:e,arguments:n}}let a=t[1];return"property"===a.type?{type:"MemberExpression",object:e,property:a.value}:{type:"IndexExpression",object:e,index:a.value}},n)}else tb=t,t=l;return t}function t7(){let t,n,r,i,a,s,o,u;if(t=tb,(n=tV())!==l){for(r=[],i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=tV())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,a=nu(),44===e.charCodeAt(tb)?(s=",",tb++):(s=l,0===tE&&tP(Z)),s!==l?(o=nu(),(u=tV())!==l?i=a=[a,s,o,u]:(tb=i,i=l)):(tb=i,i=l);t=[n,...r.map(e=>{let[,,,t]=e;return t})]}else tb=t,t=l;return t}function ne(){let t,n,r,i,a,s,o;if(t=tb,37===e.charCodeAt(tb)?(n="%",tb++):(n=l,0===tE&&tP(e$)),n!==l){if(r=tb,i=tb,a=e.charAt(tb),I.test(a)?tb++:(a=l,0===tE&&tP(eQ)),a!==l){for(s=[],o=e.charAt(tb),L.test(o)?tb++:(o=l,0===tE&&tP(e0));o!==l;)s.push(o),o=e.charAt(tb),L.test(o)?tb++:(o=l,0===tE&&tP(e0));i=a=[a,s]}else tb=i,i=l;(r=i!==l?e.substring(r,tb):i)!==l?t={type:"Variable",scope:"local",name:r}:(tb=t,t=l)}else tb=t,t=l;return t}function nt(){let t,n,r,i,a,s,o,u,c,h,d,p,f;if(t=tb,36===e.charCodeAt(tb)?(n="$",tb++):(n=l,0===tE&&tP(e1)),n!==l){if(r=tb,i=tb,"::"===e.substr(tb,2)?(a="::",tb+=2):(a=l,0===tE&&tP(J)),a===l&&(a=null),s=e.charAt(tb),I.test(s)?tb++:(s=l,0===tE&&tP(eQ)),s!==l){for(o=[],u=e.charAt(tb),L.test(u)?tb++:(u=l,0===tE&&tP(e0));u!==l;)o.push(u),u=e.charAt(tb),L.test(u)?tb++:(u=l,0===tE&&tP(e0));if(u=[],c=tb,"::"===e.substr(tb,2)?(h="::",tb+=2):(h=l,0===tE&&tP(J)),h!==l)if(d=e.charAt(tb),I.test(d)?tb++:(d=l,0===tE&&tP(eQ)),d!==l){for(p=[],f=e.charAt(tb),L.test(f)?tb++:(f=l,0===tE&&tP(e0));f!==l;)p.push(f),f=e.charAt(tb),L.test(f)?tb++:(f=l,0===tE&&tP(e0));c=h=[h,d,p]}else tb=c,c=l;else tb=c,c=l;for(;c!==l;)if(u.push(c),c=tb,"::"===e.substr(tb,2)?(h="::",tb+=2):(h=l,0===tE&&tP(J)),h!==l)if(d=e.charAt(tb),I.test(d)?tb++:(d=l,0===tE&&tP(eQ)),d!==l){for(p=[],f=e.charAt(tb),L.test(f)?tb++:(f=l,0===tE&&tP(e0));f!==l;)p.push(f),f=e.charAt(tb),L.test(f)?tb++:(f=l,0===tE&&tP(e0));c=h=[h,d,p]}else tb=c,c=l;else tb=c,c=l;i=a=[a,s,o,u]}else tb=i,i=l;(r=i!==l?e.substring(r,tb):i)!==l?t={type:"Variable",scope:"global",name:r}:(tb=t,t=l)}else tb=t,t=l;return t}function nn(){let t,n,r,i,a,s,o,u,c,h,d;if(t=tb,n=tb,r=tb,e.substr(tb,6)===w?(i=w,tb+=6):(i=l,0===tE&&tP(e2)),i!==l){for(a=[],s=e.charAt(tb),N.test(s)?tb++:(s=l,0===tE&&tP(e3));s!==l;)a.push(s),s=e.charAt(tb),N.test(s)?tb++:(s=l,0===tE&&tP(e3));if("::"===e.substr(tb,2)?(s="::",tb+=2):(s=l,0===tE&&tP(J)),s!==l){for(o=[],u=e.charAt(tb),N.test(u)?tb++:(u=l,0===tE&&tP(e3));u!==l;)o.push(u),u=e.charAt(tb),N.test(u)?tb++:(u=l,0===tE&&tP(e3));if(u=e.charAt(tb),I.test(u)?tb++:(u=l,0===tE&&tP(eQ)),u!==l){for(c=[],h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));h!==l;)c.push(h),h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));r=i=[i,a,s,o,u,c]}else tb=r,r=l}else tb=r,r=l}else tb=r,r=l;if((n=r!==l?e.substring(n,tb):r)!==l&&(n={type:"Identifier",name:n.replace(/\s+/g,"")}),(t=n)===l){if(t=tb,n=tb,r=tb,e.substr(tb,6)===w?(i=w,tb+=6):(i=l,0===tE&&tP(e2)),i!==l){if(a=[],s=tb,"::"===e.substr(tb,2)?(o="::",tb+=2):(o=l,0===tE&&tP(J)),o!==l)if(u=e.charAt(tb),I.test(u)?tb++:(u=l,0===tE&&tP(eQ)),u!==l){for(c=[],h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));h!==l;)c.push(h),h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));s=o=[o,u,c]}else tb=s,s=l;else tb=s,s=l;if(s!==l)for(;s!==l;)if(a.push(s),s=tb,"::"===e.substr(tb,2)?(o="::",tb+=2):(o=l,0===tE&&tP(J)),o!==l)if(u=e.charAt(tb),I.test(u)?tb++:(u=l,0===tE&&tP(eQ)),u!==l){for(c=[],h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));h!==l;)c.push(h),h=e.charAt(tb),L.test(h)?tb++:(h=l,0===tE&&tP(e0));s=o=[o,u,c]}else tb=s,s=l;else tb=s,s=l;else a=l;a!==l?r=i=[i,a]:(tb=r,r=l)}else tb=r,r=l;if((n=r!==l?e.substring(n,tb):r)!==l&&(n={type:"Identifier",name:n}),(t=n)===l){if(t=tb,n=tb,r=tb,i=e.charAt(tb),I.test(i)?tb++:(i=l,0===tE&&tP(eQ)),i!==l){for(a=[],s=e.charAt(tb),L.test(s)?tb++:(s=l,0===tE&&tP(e0));s!==l;)a.push(s),s=e.charAt(tb),L.test(s)?tb++:(s=l,0===tE&&tP(e0));if(s=[],o=tb,"::"===e.substr(tb,2)?(u="::",tb+=2):(u=l,0===tE&&tP(J)),u!==l)if(c=e.charAt(tb),I.test(c)?tb++:(c=l,0===tE&&tP(eQ)),c!==l){for(h=[],d=e.charAt(tb),L.test(d)?tb++:(d=l,0===tE&&tP(e0));d!==l;)h.push(d),d=e.charAt(tb),L.test(d)?tb++:(d=l,0===tE&&tP(e0));o=u=[u,c,h]}else tb=o,o=l;else tb=o,o=l;for(;o!==l;)if(s.push(o),o=tb,"::"===e.substr(tb,2)?(u="::",tb+=2):(u=l,0===tE&&tP(J)),u!==l)if(c=e.charAt(tb),I.test(c)?tb++:(c=l,0===tE&&tP(eQ)),c!==l){for(h=[],d=e.charAt(tb),L.test(d)?tb++:(d=l,0===tE&&tP(e0));d!==l;)h.push(d),d=e.charAt(tb),L.test(d)?tb++:(d=l,0===tE&&tP(e0));o=u=[u,c,h]}else tb=o,o=l;else tb=o,o=l;r=i=[i,a,s]}else tb=r,r=l;(n=r!==l?e.substring(n,tb):r)!==l&&(n={type:"Identifier",name:n}),t=n}}return t}function nr(){let e;return(e=ne())===l&&(e=nt())===l&&(e=nn()),e}function ni(){let t,n,r;return(t=tb,92===e.charCodeAt(tb)?(n="\\",tb++):(n=l,0===tE&&tP(e6)),n!==l&&(r=ns())!==l)?t=r:(tb=t,t=l),t===l&&(t=e.charAt(tb),D.test(t)?tb++:(t=l,0===tE&&tP(e8))),t}function na(){let t,n,r;return(t=tb,92===e.charCodeAt(tb)?(n="\\",tb++):(n=l,0===tE&&tP(e6)),n!==l&&(r=ns())!==l)?t=r:(tb=t,t=l),t===l&&(t=e.charAt(tb),U.test(t)?tb++:(t=l,0===tE&&tP(e9))),t}function ns(){let t,n,r,i,a,s;return t=tb,110===e.charCodeAt(tb)?(n="n",tb++):(n=l,0===tE&&tP(e7)),n!==l&&(n="\n"),(t=n)===l&&(t=tb,114===e.charCodeAt(tb)?(n="r",tb++):(n=l,0===tE&&tP(te)),n!==l&&(n="\r"),(t=n)===l)&&(t=tb,116===e.charCodeAt(tb)?(n="t",tb++):(n=l,0===tE&&tP(tt)),n!==l&&(n=" "),(t=n)===l)&&((t=tb,120===e.charCodeAt(tb)?(n="x",tb++):(n=l,0===tE&&tP(tn)),n!==l&&(r=tb,i=tb,a=e.charAt(tb),O.test(a)?tb++:(a=l,0===tE&&tP(tr)),a!==l?(s=e.charAt(tb),O.test(s)?tb++:(s=l,0===tE&&tP(tr)),s!==l?i=a=[a,s]:(tb=i,i=l)):(tb=i,i=l),(r=i!==l?e.substring(r,tb):i)!==l))?t=String.fromCharCode(parseInt(r,16)):(tb=t,t=l),t===l&&(t=tb,"cr"===e.substr(tb,2)?(n="cr",tb+=2):(n=l,0===tE&&tP(ti)),n!==l&&(n="\x0f"),(t=n)===l&&(t=tb,"cp"===e.substr(tb,2)?(n="cp",tb+=2):(n=l,0===tE&&tP(ta)),n!==l&&(n="\x10"),(t=n)===l))&&(t=tb,"co"===e.substr(tb,2)?(n="co",tb+=2):(n=l,0===tE&&tP(ts)),n!==l&&(n="\x11"),(t=n)===l)&&((t=tb,99===e.charCodeAt(tb)?(n="c",tb++):(n=l,0===tE&&tP(to)),n!==l&&(r=e.charAt(tb),F.test(r)?tb++:(r=l,0===tE&&tP(tl)),r!==l))?t=String.fromCharCode([2,3,4,5,6,7,8,11,12,14][parseInt(r,10)]):(tb=t,t=l),t===l&&(t=tb,e.length>tb?(n=e.charAt(tb),tb++):(n=l,0===tE&&tP(tu)),t=n))),t}function no(){let t,n,r,i,a,s,o,u,c;if(t=tb,n=tb,r=tb,48===e.charCodeAt(tb)?(i="0",tb++):(i=l,0===tE&&tP(tc)),i!==l)if(a=e.charAt(tb),k.test(a)?tb++:(a=l,0===tE&&tP(th)),a!==l){if(s=[],o=e.charAt(tb),O.test(o)?tb++:(o=l,0===tE&&tP(tr)),o!==l)for(;o!==l;)s.push(o),o=e.charAt(tb),O.test(o)?tb++:(o=l,0===tE&&tP(tr));else s=l;s!==l?r=i=[i,a,s]:(tb=r,r=l)}else tb=r,r=l;else tb=r,r=l;if((n=r!==l?e.substring(n,tb):r)!==l&&(r=tb,tE++,i=np(),tE--,i===l?r=void 0:(tb=r,r=l),r!==l)?t={type:"NumberLiteral",value:parseInt(n,16)}:(tb=t,t=l),t===l){if(t=tb,n=tb,r=tb,45===e.charCodeAt(tb)?(i="-",tb++):(i=l,0===tE&&tP(td)),i===l&&(i=null),a=[],s=e.charAt(tb),F.test(s)?tb++:(s=l,0===tE&&tP(tl)),s!==l)for(;s!==l;)a.push(s),s=e.charAt(tb),F.test(s)?tb++:(s=l,0===tE&&tP(tl));else a=l;if(a!==l){if(s=tb,46===e.charCodeAt(tb)?(o=".",tb++):(o=l,0===tE&&tP(er)),o!==l){if(u=[],c=e.charAt(tb),F.test(c)?tb++:(c=l,0===tE&&tP(tl)),c!==l)for(;c!==l;)u.push(c),c=e.charAt(tb),F.test(c)?tb++:(c=l,0===tE&&tP(tl));else u=l;u!==l?s=o=[o,u]:(tb=s,s=l)}else tb=s,s=l;s===l&&(s=null),r=i=[i,a,s]}else tb=r,r=l;if(r===l)if(r=tb,45===e.charCodeAt(tb)?(i="-",tb++):(i=l,0===tE&&tP(td)),i===l&&(i=null),46===e.charCodeAt(tb)?(a=".",tb++):(a=l,0===tE&&tP(er)),a!==l){if(s=[],o=e.charAt(tb),F.test(o)?tb++:(o=l,0===tE&&tP(tl)),o!==l)for(;o!==l;)s.push(o),o=e.charAt(tb),F.test(o)?tb++:(o=l,0===tE&&tP(tl));else s=l;s!==l?r=i=[i,a,s]:(tb=r,r=l)}else tb=r,r=l;(n=r!==l?e.substring(n,tb):r)!==l&&(r=tb,tE++,i=np(),tE--,i===l?r=void 0:(tb=r,r=l),r!==l)?t={type:"NumberLiteral",value:parseFloat(n)}:(tb=t,t=l)}return t}function nl(){let t;return(t=function(){let t,n,r,i,a;if(t=tb,"//"===e.substr(tb,2)?(n="//",tb+=2):(n=l,0===tE&&tP(tm)),n!==l){for(r=tb,i=[],a=e.charAt(tb),z.test(a)?tb++:(a=l,0===tE&&tP(tg));a!==l;)i.push(a),a=e.charAt(tb),z.test(a)?tb++:(a=l,0===tE&&tP(tg));r=e.substring(r,tb),i=e.charAt(tb),B.test(i)?tb++:(i=l,0===tE&&tP(tv)),i===l&&(i=null),t={type:"Comment",value:r}}else tb=t,t=l;return t}())===l&&(t=function(){let t,n,r,i,a,s,o;if(t=tb,"/*"===e.substr(tb,2)?(n="/*",tb+=2):(n=l,0===tE&&tP(ty)),n!==l){for(r=tb,i=[],a=tb,s=tb,tE++,"*/"===e.substr(tb,2)?(o="*/",tb+=2):(o=l,0===tE&&tP(t_)),tE--,o===l?s=void 0:(tb=s,s=l),s!==l?(e.length>tb?(o=e.charAt(tb),tb++):(o=l,0===tE&&tP(tu)),o!==l?a=s=[s,o]:(tb=a,a=l)):(tb=a,a=l);a!==l;)i.push(a),a=tb,s=tb,tE++,"*/"===e.substr(tb,2)?(o="*/",tb+=2):(o=l,0===tE&&tP(t_)),tE--,o===l?s=void 0:(tb=s,s=l),s!==l?(e.length>tb?(o=e.charAt(tb),tb++):(o=l,0===tE&&tP(tu)),o!==l?a=s=[s,o]:(tb=a,a=l)):(tb=a,a=l);(r=e.substring(r,tb),"*/"===e.substr(tb,2)?(i="*/",tb+=2):(i=l,0===tE&&tP(t_)),i!==l)?t={type:"Comment",value:r}:(tb=t,t=l)}else tb=t,t=l;return t}()),t}function nu(){let t,n;for(t=[],n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx)),n===l&&(n=nd());n!==l;)t.push(n),n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx)),n===l&&(n=nd());return t}function nc(){let t,n,r,i;if(t=tb,n=[],r=e.charAt(tb),H.test(r)?tb++:(r=l,0===tE&&tP(tx)),r!==l)for(;r!==l;)n.push(r),r=e.charAt(tb),H.test(r)?tb++:(r=l,0===tE&&tP(tx));else n=l;if(n!==l){for(r=[],i=e.charAt(tb),H.test(i)?tb++:(i=l,0===tE&&tP(tx)),i===l&&(i=nd());i!==l;)r.push(i),i=e.charAt(tb),H.test(i)?tb++:(i=l,0===tE&&tP(tx)),i===l&&(i=nd());t=n=[n,r]}else tb=t,t=l;return t}function nh(){let t,n;for(t=[],n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx));n!==l;)t.push(n),n=e.charAt(tb),H.test(n)?tb++:(n=l,0===tE&&tP(tx));return t}function nd(){let t,n,r,i,a,s;if(t=tb,"//"===e.substr(tb,2)?(n="//",tb+=2):(n=l,0===tE&&tP(tm)),n!==l){for(r=[],i=e.charAt(tb),z.test(i)?tb++:(i=l,0===tE&&tP(tg));i!==l;)r.push(i),i=e.charAt(tb),z.test(i)?tb++:(i=l,0===tE&&tP(tg));i=e.charAt(tb),B.test(i)?tb++:(i=l,0===tE&&tP(tv)),i===l&&(i=null),t=n=[n,r,i]}else tb=t,t=l;if(t===l)if(t=tb,"/*"===e.substr(tb,2)?(n="/*",tb+=2):(n=l,0===tE&&tP(ty)),n!==l){for(r=[],i=tb,a=tb,tE++,"*/"===e.substr(tb,2)?(s="*/",tb+=2):(s=l,0===tE&&tP(t_)),tE--,s===l?a=void 0:(tb=a,a=l),a!==l?(e.length>tb?(s=e.charAt(tb),tb++):(s=l,0===tE&&tP(tu)),s!==l?i=a=[a,s]:(tb=i,i=l)):(tb=i,i=l);i!==l;)r.push(i),i=tb,a=tb,tE++,"*/"===e.substr(tb,2)?(s="*/",tb+=2):(s=l,0===tE&&tP(t_)),tE--,s===l?a=void 0:(tb=a,a=l),a!==l?(e.length>tb?(s=e.charAt(tb),tb++):(s=l,0===tE&&tP(tu)),s!==l?i=a=[a,s]:(tb=i,i=l)):(tb=i,i=l);"*/"===e.substr(tb,2)?(i="*/",tb+=2):(i=l,0===tE&&tP(t_)),i!==l?t=n=[n,r,i]:(tb=t,t=l)}else tb=t,t=l;return t}function np(){let t;return t=e.charAt(tb),L.test(t)?tb++:(t=l,0===tE&&tP(e0)),t}r=new Set,i=!1;let nf=(n=h())!==l&&tb===e.length;function nm(){var t,r,i;throw n!==l&&tb0&&void 0!==arguments[0]?arguments[0]:tb,n=e.codePointAt(t);return void 0===n?"":String.fromCodePoint(n)}(tM):null,i=tM{"use strict";e.s(["getFloat",()=>D,"getInt",()=>U,"getPosition",()=>O,"getProperty",()=>N,"getRotation",()=>k,"getScale",()=>F,"parseMissionScript",()=>L],62395);var t=e.i(90072);e.s(["parse",()=>A,"runServer",()=>C],86608);var n=e.i(92552);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){let t=e.indexOf("::");return -1===t?null:{namespace:e.slice(0,t),method:e.slice(t+2)}}let a={"+":"$.add","-":"$.sub","*":"$.mul","/":"$.div","<":"$.lt","<=":"$.le",">":"$.gt",">=":"$.ge","==":"$.eq","!=":"$.ne","%":"$.mod","&":"$.bitand","|":"$.bitor","^":"$.bitxor","<<":"$.shl",">>":"$.shr"};class s{getAccessInfo(e){if("Variable"===e.type){let t=JSON.stringify(e.name),n="global"===e.scope?this.globals:this.locals;return{getter:"".concat(n,".get(").concat(t,")"),setter:e=>"".concat(n,".set(").concat(t,", ").concat(e,")"),postIncHelper:"".concat(n,".postInc(").concat(t,")"),postDecHelper:"".concat(n,".postDec(").concat(t,")")}}if("MemberExpression"===e.type){let t=this.expression(e.object),n="Identifier"===e.property.type?JSON.stringify(e.property.name):this.expression(e.property);return{getter:"".concat(this.runtime,".prop(").concat(t,", ").concat(n,")"),setter:e=>"".concat(this.runtime,".setProp(").concat(t,", ").concat(n,", ").concat(e,")"),postIncHelper:"".concat(this.runtime,".propPostInc(").concat(t,", ").concat(n,")"),postDecHelper:"".concat(this.runtime,".propPostDec(").concat(t,", ").concat(n,")")}}if("IndexExpression"===e.type){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let n=JSON.stringify(e.object.name),r="global"===e.object.scope?this.globals:this.locals,i=t.join(", ");return{getter:"".concat(r,".get(").concat(n,", ").concat(i,")"),setter:e=>"".concat(r,".set(").concat(n,", ").concat(i,", ").concat(e,")"),postIncHelper:"".concat(r,".postInc(").concat(n,", ").concat(i,")"),postDecHelper:"".concat(r,".postDec(").concat(n,", ").concat(i,")")}}if("MemberExpression"===e.object.type){let n=e.object,r=this.expression(n.object),i="Identifier"===n.property.type?JSON.stringify(n.property.name):this.expression(n.property),a="".concat(this.runtime,".key(").concat(i,", ").concat(t.join(", "),")");return{getter:"".concat(this.runtime,".prop(").concat(r,", ").concat(a,")"),setter:e=>"".concat(this.runtime,".setProp(").concat(r,", ").concat(a,", ").concat(e,")"),postIncHelper:"".concat(this.runtime,".propPostInc(").concat(r,", ").concat(a,")"),postDecHelper:"".concat(this.runtime,".propPostDec(").concat(r,", ").concat(a,")")}}let n=this.expression(e.object),r=1===t.length?t[0]:"".concat(this.runtime,".key(").concat(t.join(", "),")");return{getter:"".concat(this.runtime,".getIndex(").concat(n,", ").concat(r,")"),setter:e=>"".concat(this.runtime,".setIndex(").concat(n,", ").concat(r,", ").concat(e,")"),postIncHelper:"".concat(this.runtime,".indexPostInc(").concat(n,", ").concat(r,")"),postDecHelper:"".concat(this.runtime,".indexPostDec(").concat(n,", ").concat(r,")")}}return null}generate(e){let t=[];for(let n of e.body){let e=this.statement(n);e&&t.push(e)}return t.join("\n\n")}statement(e){switch(e.type){case"Comment":return"";case"ExpressionStatement":return this.line("".concat(this.expression(e.expression),";"));case"FunctionDeclaration":return this.functionDeclaration(e);case"PackageDeclaration":return this.packageDeclaration(e);case"DatablockDeclaration":return this.datablockDeclaration(e);case"ObjectDeclaration":return this.line("".concat(this.objectDeclaration(e),";"));case"IfStatement":return this.ifStatement(e);case"ForStatement":return this.forStatement(e);case"WhileStatement":return this.whileStatement(e);case"DoWhileStatement":return this.doWhileStatement(e);case"SwitchStatement":return this.switchStatement(e);case"ReturnStatement":return this.returnStatement(e);case"BreakStatement":return this.line("break;");case"ContinueStatement":return this.line("continue;");case"BlockStatement":return this.blockStatement(e);default:throw Error("Unknown statement type: ".concat(e.type))}}functionDeclaration(e){let t=i(e.name.name);if(t){let n=t.namespace,r=t.method;this.currentClass=n.toLowerCase(),this.currentFunction=r.toLowerCase();let i=this.functionBody(e.body,e.params);return this.currentClass=null,this.currentFunction=null,"".concat(this.line("".concat(this.runtime,".registerMethod(").concat(JSON.stringify(n),", ").concat(JSON.stringify(r),", function() {")),"\n").concat(i,"\n").concat(this.line("});"))}{let t=e.name.name;this.currentFunction=t.toLowerCase();let n=this.functionBody(e.body,e.params);return this.currentFunction=null,"".concat(this.line("".concat(this.runtime,".registerFunction(").concat(JSON.stringify(t),", function() {")),"\n").concat(n,"\n").concat(this.line("});"))}}functionBody(e,t){this.indentLevel++;let n=[];n.push(this.line("const ".concat(this.locals," = ").concat(this.runtime,".locals();")));for(let e=0;ethis.statement(e)).join("\n\n");return this.indentLevel--,"".concat(this.line("".concat(this.runtime,".package(").concat(t,", function() {")),"\n").concat(n,"\n").concat(this.line("});"))}datablockDeclaration(e){let t=JSON.stringify(e.className.name),n=e.instanceName?JSON.stringify(e.instanceName.name):"null",r=e.parent?JSON.stringify(e.parent.name):"null",i=this.objectBody(e.body);return this.line("".concat(this.runtime,".datablock(").concat(t,", ").concat(n,", ").concat(r,", ").concat(i,");"))}objectDeclaration(e){let t="Identifier"===e.className.type?JSON.stringify(e.className.name):this.expression(e.className),n=null===e.instanceName?"null":"Identifier"===e.instanceName.type?JSON.stringify(e.instanceName.name):this.expression(e.instanceName),r=[],i=[];for(let t of e.body)"Assignment"===t.type?r.push(t):i.push(t);let a=this.objectBody(r);if(i.length>0){let e=i.map(e=>this.objectDeclaration(e)).join(",\n");return"".concat(this.runtime,".create(").concat(t,", ").concat(n,", ").concat(a,", [\n").concat(e,"\n])")}return"".concat(this.runtime,".create(").concat(t,", ").concat(n,", ").concat(a,")")}objectBody(e){if(0===e.length)return"{}";let t=[];for(let n of e)if("Assignment"===n.type){let e=this.expression(n.value);if("Identifier"===n.target.type){let r=n.target.name;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)?t.push("".concat(r,": ").concat(e)):t.push("[".concat(JSON.stringify(r),"]: ").concat(e))}else if("IndexExpression"===n.target.type){let r=this.objectPropertyKey(n.target);t.push("[".concat(r,"]: ").concat(e))}else{let r=this.expression(n.target);t.push("[".concat(r,"]: ").concat(e))}}if(t.length<=1)return"{ ".concat(t.join(", ")," }");let n=this.indent.repeat(this.indentLevel+1),r=this.indent.repeat(this.indentLevel);return"{\n".concat(n).concat(t.join(",\n"+n),"\n").concat(r,"}")}objectPropertyKey(e){let t="Identifier"===e.object.type?JSON.stringify(e.object.name):this.expression(e.object),n=Array.isArray(e.index)?e.index.map(e=>this.expression(e)).join(", "):this.expression(e.index);return"".concat(this.runtime,".key(").concat(t,", ").concat(n,")")}ifStatement(e){let t=this.expression(e.test),n=this.statementAsBlock(e.consequent);if(e.alternate)if("IfStatement"===e.alternate.type){let r=this.ifStatement(e.alternate).replace(/^\s*/,"");return this.line("if (".concat(t,") ").concat(n," else ").concat(r))}else{let r=this.statementAsBlock(e.alternate);return this.line("if (".concat(t,") ").concat(n," else ").concat(r))}return this.line("if (".concat(t,") ").concat(n))}forStatement(e){let t=e.init?this.expression(e.init):"",n=e.test?this.expression(e.test):"",r=e.update?this.expression(e.update):"",i=this.statementAsBlock(e.body);return this.line("for (".concat(t,"; ").concat(n,"; ").concat(r,") ").concat(i))}whileStatement(e){let t=this.expression(e.test),n=this.statementAsBlock(e.body);return this.line("while (".concat(t,") ").concat(n))}doWhileStatement(e){let t=this.statementAsBlock(e.body),n=this.expression(e.test);return this.line("do ".concat(t," while (").concat(n,");"))}switchStatement(e){if(e.stringMode)return this.switchStringStatement(e);let t=this.expression(e.discriminant);this.indentLevel++;let n=[];for(let t of e.cases)n.push(this.switchCase(t));return this.indentLevel--,"".concat(this.line("switch (".concat(t,") {")),"\n").concat(n.join("\n"),"\n").concat(this.line("}"))}switchCase(e){let t=[];if(null===e.test)t.push(this.line("default:"));else if(Array.isArray(e.test))for(let n of e.test)t.push(this.line("case ".concat(this.expression(n),":")));else t.push(this.line("case ".concat(this.expression(e.test),":")));for(let n of(this.indentLevel++,e.consequent))t.push(this.statement(n));return t.push(this.line("break;")),this.indentLevel--,t.join("\n")}switchStringStatement(e){let t=this.expression(e.discriminant),n=[];for(let t of e.cases)if(null===t.test)n.push("default: () => { ".concat(this.blockContent(t.consequent)," }"));else if(Array.isArray(t.test))for(let e of t.test)n.push("".concat(this.expression(e),": () => { ").concat(this.blockContent(t.consequent)," }"));else n.push("".concat(this.expression(t.test),": () => { ").concat(this.blockContent(t.consequent)," }"));return this.line("".concat(this.runtime,".switchStr(").concat(t,", { ").concat(n.join(", ")," });"))}returnStatement(e){return e.value?this.line("return ".concat(this.expression(e.value),";")):this.line("return;")}blockStatement(e){this.indentLevel++;let t=e.body.map(e=>this.statement(e)).join("\n");return this.indentLevel--,"{\n".concat(t,"\n").concat(this.line("}"))}statementAsBlock(e){if("BlockStatement"===e.type)return this.blockStatement(e);this.indentLevel++;let t=this.statement(e);return this.indentLevel--,"{\n".concat(t,"\n").concat(this.line("}"))}blockContent(e){return e.map(e=>this.statement(e).trim()).join(" ")}expression(e){switch(e.type){case"Identifier":return this.identifier(e);case"Variable":return this.variable(e);case"NumberLiteral":case"BooleanLiteral":return String(e.value);case"StringLiteral":return JSON.stringify(e.value);case"BinaryExpression":return this.binaryExpression(e);case"UnaryExpression":return this.unaryExpression(e);case"PostfixExpression":return this.postfixExpression(e);case"AssignmentExpression":return this.assignmentExpression(e);case"ConditionalExpression":return"(".concat(this.expression(e.test)," ? ").concat(this.expression(e.consequent)," : ").concat(this.expression(e.alternate),")");case"CallExpression":return this.callExpression(e);case"MemberExpression":return this.memberExpression(e);case"IndexExpression":return this.indexExpression(e);case"TagDereferenceExpression":return"".concat(this.runtime,".deref(").concat(this.expression(e.argument),")");case"ObjectDeclaration":return this.objectDeclaration(e);case"DatablockDeclaration":return"".concat(this.runtime,".datablock(").concat(JSON.stringify(e.className.name),", ").concat(e.instanceName?JSON.stringify(e.instanceName.name):"null",", ").concat(e.parent?JSON.stringify(e.parent.name):"null",", ").concat(this.objectBody(e.body),")");default:throw Error("Unknown expression type: ".concat(e.type))}}identifier(e){let t=i(e.name);return t&&"parent"===t.namespace.toLowerCase()?e.name:t?"".concat(this.runtime,".nsRef(").concat(JSON.stringify(t.namespace),", ").concat(JSON.stringify(t.method),")"):JSON.stringify(e.name)}variable(e){return"global"===e.scope?"".concat(this.globals,".get(").concat(JSON.stringify(e.name),")"):"".concat(this.locals,".get(").concat(JSON.stringify(e.name),")")}binaryExpression(e){let t=this.expression(e.left),n=this.expression(e.right),r=e.operator,i=this.concatExpression(t,r,n);if(i)return i;if("$="===r)return"".concat(this.runtime,".streq(").concat(t,", ").concat(n,")");if("!$="===r)return"!".concat(this.runtime,".streq(").concat(t,", ").concat(n,")");if("&&"===r||"||"===r)return"(".concat(t," ").concat(r," ").concat(n,")");let s=a[r];return s?"".concat(s,"(").concat(t,", ").concat(n,")"):"(".concat(t," ").concat(r," ").concat(n,")")}unaryExpression(e){if("++"===e.operator||"--"===e.operator){let t=this.getAccessInfo(e.argument);if(t){let n="++"===e.operator?1:-1;return t.setter("".concat(this.runtime,".add(").concat(t.getter,", ").concat(n,")"))}}let t=this.expression(e.argument);return"~"===e.operator?"".concat(this.runtime,".bitnot(").concat(t,")"):"-"===e.operator?"".concat(this.runtime,".neg(").concat(t,")"):"".concat(e.operator).concat(t)}postfixExpression(e){let t=this.getAccessInfo(e.argument);if(t){let n="++"===e.operator?t.postIncHelper:t.postDecHelper;if(n)return n}return"".concat(this.expression(e.argument)).concat(e.operator)}assignmentExpression(e){let t=this.expression(e.value),n=e.operator,r=this.getAccessInfo(e.target);if(!r)throw Error("Unhandled assignment target type: ".concat(e.target.type));if("="===n)return r.setter(t);{let e=n.slice(0,-1),i=this.compoundAssignmentValue(r.getter,e,t);return r.setter(i)}}callExpression(e){let t=e.arguments.map(e=>this.expression(e)).join(", ");if("Identifier"===e.callee.type){let n=e.callee.name,r=i(n);if(r&&"parent"===r.namespace.toLowerCase())if(this.currentClass)return"".concat(this.runtime,".parent(").concat(JSON.stringify(this.currentClass),", ").concat(JSON.stringify(r.method),", arguments[0]").concat(t?", "+t:"",")");else if(this.currentFunction)return"".concat(this.runtime,".parentFunc(").concat(JSON.stringify(this.currentFunction)).concat(t?", "+t:"",")");else throw Error("Parent:: call outside of function context");return r?"".concat(this.runtime,".nsCall(").concat(JSON.stringify(r.namespace),", ").concat(JSON.stringify(r.method)).concat(t?", "+t:"",")"):"".concat(this.functions,".call(").concat(JSON.stringify(n)).concat(t?", "+t:"",")")}if("MemberExpression"===e.callee.type){let n=this.expression(e.callee.object),r="Identifier"===e.callee.property.type?JSON.stringify(e.callee.property.name):this.expression(e.callee.property);return"".concat(this.runtime,".call(").concat(n,", ").concat(r).concat(t?", "+t:"",")")}let n=this.expression(e.callee);return"".concat(n,"(").concat(t,")")}memberExpression(e){let t=this.expression(e.object);return e.computed||"Identifier"!==e.property.type?"".concat(this.runtime,".prop(").concat(t,", ").concat(this.expression(e.property),")"):"".concat(this.runtime,".prop(").concat(t,", ").concat(JSON.stringify(e.property.name),")")}indexExpression(e){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let n=JSON.stringify(e.object.name),r="global"===e.object.scope?this.globals:this.locals;return"".concat(r,".get(").concat(n,", ").concat(t.join(", "),")")}if("MemberExpression"===e.object.type){let n=e.object,r=this.expression(n.object),i="Identifier"===n.property.type?JSON.stringify(n.property.name):this.expression(n.property),a="".concat(this.runtime,".key(").concat(i,", ").concat(t.join(", "),")");return"".concat(this.runtime,".prop(").concat(r,", ").concat(a,")")}let n=this.expression(e.object);return 1===t.length?"".concat(this.runtime,".getIndex(").concat(n,", ").concat(t[0],")"):"".concat(this.runtime,".getIndex(").concat(n,", ").concat(this.runtime,".key(").concat(t.join(", "),"))")}line(e){return this.indent.repeat(this.indentLevel)+e}concatExpression(e,t,n){switch(t){case"@":return"".concat(this.runtime,".concat(").concat(e,", ").concat(n,")");case"SPC":return"".concat(this.runtime,".concat(").concat(e,', " ", ').concat(n,")");case"TAB":return"".concat(this.runtime,".concat(").concat(e,', "\\t", ').concat(n,")");case"NL":return"".concat(this.runtime,".concat(").concat(e,', "\\n", ').concat(n,")");default:return null}}compoundAssignmentValue(e,t,n){let r=this.concatExpression(e,t,n);if(r)return r;let i=a[t];return i?"".concat(i,"(").concat(e,", ").concat(n,")"):"(".concat(e," ").concat(t," ").concat(n,")")}constructor(e={}){var t,n,i,a,s;r(this,"indent",void 0),r(this,"runtime",void 0),r(this,"functions",void 0),r(this,"globals",void 0),r(this,"locals",void 0),r(this,"indentLevel",0),r(this,"currentClass",null),r(this,"currentFunction",null),this.indent=null!=(t=e.indent)?t:" ",this.runtime=null!=(n=e.runtime)?n:"$",this.functions=null!=(i=e.functions)?i:"$f",this.globals=null!=(a=e.globals)?a:"$g",this.locals=null!=(s=e.locals)?s:"$l"}}e.s(["createRuntime",()=>E,"createScriptCache",()=>b],33870);var o=e.i(54970);class l{get size(){return this.map.size}get(e){let t=this.keyLookup.get(e.toLowerCase());return void 0!==t?this.map.get(t):void 0}set(e,t){let n=e.toLowerCase(),r=this.keyLookup.get(n);return void 0!==r?this.map.set(r,t):(this.keyLookup.set(n,e),this.map.set(e,t)),this}has(e){return this.keyLookup.has(e.toLowerCase())}delete(e){let t=e.toLowerCase(),n=this.keyLookup.get(t);return void 0!==n&&(this.keyLookup.delete(t),this.map.delete(n))}clear(){this.map.clear(),this.keyLookup.clear()}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}[Symbol.iterator](){return this.map[Symbol.iterator]()}forEach(e){for(let[t,n]of this.map)e(n,t,this)}get[Symbol.toStringTag](){return"CaseInsensitiveMap"}getOriginalKey(e){return this.keyLookup.get(e.toLowerCase())}constructor(e){if(r(this,"map",new Map),r(this,"keyLookup",new Map),e)for(let[t,n]of e)this.set(t,n)}}class u{get size(){return this.set.size}add(e){return this.set.add(e.toLowerCase()),this}has(e){return this.set.has(e.toLowerCase())}delete(e){return this.set.delete(e.toLowerCase())}clear(){this.set.clear()}[Symbol.iterator](){return this.set[Symbol.iterator]()}get[Symbol.toStringTag](){return"CaseInsensitiveSet"}constructor(e){if(r(this,"set",new Set),e)for(let t of e)this.add(t)}}function c(e){return e.replace(/\\/g,"/").toLowerCase()}function h(e){return String(null!=e?e:"")}function d(e){return Number(e)||0}function p(e){let t=h(e||"0 0 0").split(" ").map(Number);return[t[0]||0,t[1]||0,t[2]||0]}function f(e,t,n){let r=0;for(;t+r0;){if(r>=e.length)return"";let i=f(e,r,n);if(r+i>=e.length)return"";r+=i+1,t--}let i=f(e,r,n);return 0===i?"":e.substring(r,r+i)}function g(e,t,n,r){let i=0,a=t;for(;a>0;){if(i>=e.length)return"";let t=f(e,i,r);if(i+t>=e.length)return"";i+=t+1,a--}let s=i,o=n-t+1;for(;o>0;){let t=f(e,i,r);if((i+=t)>=e.length)break;i++,o--}let l=i;return l>s&&r.includes(e[l-1])&&l--,e.substring(s,l)}function v(e,t){if(""===e)return 0;let n=0;for(let r=0;rt&&s>=e.length)break}return a.join(i)}function _(e,t,n,r){let i=[],a=0,s=0;for(;a1?n-1:0),i=1;ih(e).replace(/\\([ntr\\])/g,(e,t)=>"n"===t?"\n":"t"===t?" ":"r"===t?"\r":"\\"),expandescape:e=>h(e).replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),export(e,t,n){console.warn("export(".concat(e,"): not implemented"))},quit(){console.warn("quit(): not implemented in browser")},trace(e){},isobject:e=>t().$.isObject(e),nametoid:e=>t().$.nameToId(e),strlen:e=>h(e).length,strchr(e,t){var n;let r=h(e),i=null!=(n=h(t)[0])?n:"",a=r.indexOf(i);return a>=0?r.substring(a):""},strpos:(e,t,n)=>h(e).indexOf(h(t),d(n)),strcmp(e,t){let n=h(e),r=h(t);return nr)},stricmp(e,t){let n=h(e).toLowerCase(),r=h(t).toLowerCase();return nr)},strstr:(e,t)=>h(e).indexOf(h(t)),getsubstr(e,t,n){let r=h(e),i=d(t);return void 0===n?r.substring(i):r.substring(i,i+d(n))},getword:(e,t)=>m(h(e),d(t)," \n"),getwordcount:e=>v(h(e)," \n"),getfield:(e,t)=>m(h(e),d(t)," \n"),getfieldcount:e=>v(h(e)," \n"),setword:(e,t,n)=>y(h(e),d(t),h(n)," \n"," "),setfield:(e,t,n)=>y(h(e),d(t),h(n)," \n"," "),firstword:e=>m(h(e),0," \n"),restwords:e=>g(h(e),1,1e6," \n"),trim:e=>h(e).trim(),ltrim:e=>h(e).replace(/^\s+/,""),rtrim:e=>h(e).replace(/\s+$/,""),strupr:e=>h(e).toUpperCase(),strlwr:e=>h(e).toLowerCase(),strreplace:(e,t,n)=>h(e).split(h(t)).join(h(n)),filterstring:(e,t)=>h(e),stripchars(e,t){let n=h(e),r=new Set(h(t).split(""));return n.split("").filter(e=>!r.has(e)).join("")},getfields(e,t,n){let r=void 0!==n?Number(n):1e6;return g(h(e),d(t),r," \n")},getwords(e,t,n){let r=void 0!==n?Number(n):1e6;return g(h(e),d(t),r," \n")},removeword:(e,t)=>_(h(e),d(t)," \n"," "),removefield:(e,t)=>_(h(e),d(t)," \n"," "),getrecord:(e,t)=>m(h(e),d(t),"\n"),getrecordcount:e=>v(h(e),"\n"),setrecord:(e,t,n)=>y(h(e),d(t),h(n),"\n","\n"),removerecord:(e,t)=>_(h(e),d(t),"\n","\n"),nexttoken(e,t,n){throw Error("nextToken() is not implemented: it requires variable mutation")},strtoplayername:e=>h(e).replace(/[^\w\s-]/g,"").trim(),mabs:e=>Math.abs(d(e)),mfloor:e=>Math.floor(d(e)),mceil:e=>Math.ceil(d(e)),msqrt:e=>Math.sqrt(d(e)),mpow:(e,t)=>Math.pow(d(e),d(t)),msin:e=>Math.sin(d(e)),mcos:e=>Math.cos(d(e)),mtan:e=>Math.tan(d(e)),masin:e=>Math.asin(d(e)),macos:e=>Math.acos(d(e)),matan:(e,t)=>Math.atan2(d(e),d(t)),mlog:e=>Math.log(d(e)),getrandom(e,t){if(void 0===e)return Math.random();if(void 0===t)return Math.floor(Math.random()*(d(e)+1));let n=d(e);return Math.floor(Math.random()*(d(t)-n+1))+n},mdegtorad:e=>d(e)*(Math.PI/180),mradtodeg:e=>d(e)*(180/Math.PI),mfloatlength:(e,t)=>d(e).toFixed(d(t)),getboxcenter(e){let t=h(e).split(" ").map(Number),n=t[0]||0,r=t[1]||0,i=t[2]||0,a=t[3]||0,s=t[4]||0,o=t[5]||0;return"".concat((n+a)/2," ").concat((r+s)/2," ").concat((i+o)/2)},vectoradd(e,t){let[n,r,i]=p(e),[a,s,o]=p(t);return"".concat(n+a," ").concat(r+s," ").concat(i+o)},vectorsub(e,t){let[n,r,i]=p(e),[a,s,o]=p(t);return"".concat(n-a," ").concat(r-s," ").concat(i-o)},vectorscale(e,t){let[n,r,i]=p(e),a=d(t);return"".concat(n*a," ").concat(r*a," ").concat(i*a)},vectordot(e,t){let[n,r,i]=p(e),[a,s,o]=p(t);return n*a+r*s+i*o},vectorcross(e,t){let[n,r,i]=p(e),[a,s,o]=p(t);return"".concat(r*o-i*s," ").concat(i*a-n*o," ").concat(n*s-r*a)},vectorlen(e){let[t,n,r]=p(e);return Math.sqrt(t*t+n*n+r*r)},vectornormalize(e){let[t,n,r]=p(e),i=Math.sqrt(t*t+n*n+r*r);return 0===i?"0 0 0":"".concat(t/i," ").concat(n/i," ").concat(r/i)},vectordist(e,t){let[n,r,i]=p(e),[a,s,o]=p(t),l=n-a,u=r-s,c=i-o;return Math.sqrt(l*l+u*u+c*c)},matrixcreate(e,t){throw Error("MatrixCreate() not implemented: requires axis-angle rotation math")},matrixcreatefromeuler(e){throw Error("MatrixCreateFromEuler() not implemented: requires Euler→Quaternion→AxisAngle conversion")},matrixmultiply(e,t){throw Error("MatrixMultiply() not implemented: requires full 4x4 matrix multiplication")},matrixmulpoint(e,t){throw Error("MatrixMulPoint() not implemented: requires full transform application")},matrixmulvector(e,t){throw Error("MatrixMulVector() not implemented: requires rotation matrix application")},getsimtime:()=>Date.now()-t().state.startTime,getrealtime:()=>Date.now(),schedule(e,n,r){for(var i=arguments.length,a=Array(i>3?i-3:0),s=3;s{l.state.pendingTimeouts.delete(u);try{l.$f.call(String(r),...a)}catch(e){throw console.error("schedule: error calling ".concat(r,":"),e),e}},o);return l.state.pendingTimeouts.add(u),u},cancel(e){clearTimeout(e),t().state.pendingTimeouts.delete(e)},iseventpending:e=>t().state.pendingTimeouts.has(e),exec(e){let n=String(null!=e?e:"");if(console.debug("exec(".concat(JSON.stringify(n),"): preparing to execute…")),!n.includes("."))return console.error("exec: invalid script file name ".concat(JSON.stringify(n),".")),!1;let r=c(n),i=t(),{executedScripts:a,scripts:s}=i.state;if(a.has(r))return console.debug("exec(".concat(JSON.stringify(n),"): skipping (already executed)")),!0;let o=s.get(r);return null==o?(console.warn("exec(".concat(JSON.stringify(n),"): script not found")),!1):(a.add(r),console.debug("exec(".concat(JSON.stringify(n),"): executing!")),i.executeAST(o),!0)},compile(e){throw Error("compile() not implemented: requires DSO bytecode compiler")},isdemo:()=>!1,isfile:e=>n?n.isFile(h(e)):(console.warn("isFile(): no fileSystem handler configured"),!1),fileext(e){let t=h(e),n=t.lastIndexOf(".");return n>=0?t.substring(n):""},filebase(e){let t=h(e),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),r=t.lastIndexOf("."),i=n>=0?n+1:0,a=r>i?r:t.length;return t.substring(i,a)},filepath(e){let t=h(e),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n>=0?t.substring(0,n):""},expandfilename(e){throw Error("expandFilename() not implemented: requires filesystem path expansion")},findfirstfile(e){var t;return n?(a=h(e),r=n.findFiles(a),i=0,null!=(t=r[i++])?t:""):(console.warn("findFirstFile(): no fileSystem handler configured"),"")},findnextfile(e){var t;let s=h(e);if(s!==a){if(!n)return"";a=s,r=n.findFiles(s)}return null!=(t=r[i++])?t:""},getfilecrc:e=>h(e),iswriteablefilename:e=>!1,activatepackage(e){t().$.activatePackage(h(e))},deactivatepackage(e){t().$.deactivatePackage(h(e))},ispackage:e=>t().$.isPackage(h(e)),isactivepackage:e=>t().$.isActivePackage(h(e)),getpackagelist:()=>t().$.getPackageList(),addmessagecallback(e,t){},alxcreatesource(){for(var e=arguments.length,t=Array(e),n=0;n0,alxlistenerf(e,t){},alxplay(){for(var e=arguments.length,t=Array(e),n=0;n!1,lockmouse(e){},addmaterialmapping(e,t){},flushtexturecache(){},getdesktopresolution:()=>"1920 1080 32",getdisplaydevicelist:()=>"OpenGL",getresolutionlist:e=>"640 480 800 600 1024 768 1280 720 1920 1080",getvideodriverinfo:()=>"WebGL",isdevicefullscreenonly:e=>!1,isfullscreen:()=>!1,screenshot(e){},setdisplaydevice:e=>!0,setfov(e){},setinteriorrendermode(e){},setopenglanisotropy(e){},setopenglmipreduction(e){},setopenglskymipreduction(e){},setopengltexturecompressionhint(e){},setscreenmode(e,t,n,r){},setverticalsync(e){},setzoomspeed(e){},togglefullscreen(){},videosetgammacorrection(e){},snaptoggle(){},addtaggedstring:e=>0,buildtaggedstring(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;rh(e),gettag:e=>0,gettaggedstring:e=>"",removetaggedstring(e){},commandtoclient(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i1?t-1:0),r=1;r!0,allowconnections(e){},startheartbeat(){},stopheartbeat(){},gotowebpage(e){},deletedatablocks(){},preloaddatablock:e=>!0,containerboxempty(){for(var e=arguments.length,t=Array(e),n=0;n0,containersearchnext:()=>0,initcontainerradiussearch(){for(var e=arguments.length,t=Array(e),n=0;n0,getcontrolobjectspeed:()=>0,getterrainheight:e=>0,lightscene(){for(var e=arguments.length,t=Array(e),n=0;n>>0}function w(e){if(null==e)return null;if("string"==typeof e)return e||null;if("number"==typeof e)return String(e);throw Error("Invalid instance name type: ".concat(typeof e))}function E(){var e,t,n;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=new l,a=new l,h=new l,d=[],p=new u,f=3,m=1027,g=new Map,v=new l,y=new l,_=new l,E=new l,T=new l;if(r.globals)for(let[e,t]of Object.entries(r.globals)){if(!e.startsWith("$"))throw Error('Global variable "'.concat(e,'" must start with $, e.g. "$').concat(e,'"'));_.set(e.slice(1),t)}let C=new Set,R=new Set,P=r.ignoreScripts&&r.ignoreScripts.length>0?(0,o.default)(r.ignoreScripts,{nocase:!0}):null,I=null!=(e=r.cache)?e:b(),L=I.scripts,N=I.generatedCode,D=new Map;function U(e){let t=D.get(e);return t&&t.length>0?t[t.length-1]:void 0}function O(e,t,n){let r;(r=D.get(e))||(r=[],D.set(e,r)),r.push(t);try{return n()}finally{let t=D.get(e);t&&t.pop()}}function F(e,t){return"".concat(e.toLowerCase(),"::").concat(t.toLowerCase())}function k(e,t){var n,r;return null!=(r=null==(n=i.get(e))?void 0:n.get(t))?r:null}let z=new Set,B=null,H=null,V=(null!=(t=r.builtins)?t:x)({runtime:()=>H,fileSystem:null!=(n=r.fileSystem)?n:null});function G(e){let t=h.get(e);if(!t)return void p.add(e);if(!t.active){for(let[e,n]of(t.active=!0,d.push(t.name),t.methods)){i.has(e)||i.set(e,new l);let t=i.get(e);for(let[e,r]of n)t.has(e)||t.set(e,[]),t.get(e).push(r)}for(let[e,n]of t.functions)a.has(e)||a.set(e,[]),a.get(e).push(n)}}function W(e){var t,n;return null==e||""===e?null:"object"==typeof e&&null!=e._id?e:"string"==typeof e?null!=(t=v.get(e))?t:null:"number"==typeof e&&null!=(n=g.get(e))?n:null}function j(e,t,n){let r=W(e);if(null==r)return 0;let i=J(r[t]);return r[t]=i+n,i}function X(e,t){let n=k(e,t);return n&&n.length>0?n[n.length-1]:null}function q(e,t,n,r){let i=k(e,t);return i&&0!==i.length?{found:!0,result:O(F(e,t),i.length-1,()=>i[i.length-1](n,...r))}:{found:!1}}function Y(e,t,n,r){let i=E.get(e);if(i){let e=i.get(t);if(e)for(let t of e)t(n,...r)}}function J(e){if(null==e||""===e)return 0;let t=Number(e);return isNaN(t)?0:t}function Z(e){if(!e||""===e)return null;e.startsWith("/")&&(e=e.slice(1));let t=e.split("/"),n=null;for(let e=0;e{var n;return(null==(n=t._name)?void 0:n.toLowerCase())===e});n=null!=t?t:null}if(!n)return null}}return n}function K(e){return null==e||""===e?null:Z(String(e))}function $(e){function t(e,t){return e+t.join("_")}return{get(n){for(var r,i=arguments.length,a=Array(i>1?i-1:0),s=1;s1?r-1:0),a=1;a1?r-1:0),a=1;a1?r-1:0),a=1;at.toLowerCase()===e.toLowerCase());for(let[e,r]of(-1!==n&&d.splice(n,1),t.methods)){let t=i.get(e);if(t)for(let[e,n]of r){let r=t.get(e);if(r){let e=r.indexOf(n);-1!==e&&r.splice(e,1)}}}for(let[e,n]of t.functions){let t=a.get(e);if(t){let e=t.indexOf(n);-1!==e&&t.splice(e,1)}}},create:function(e,t,n,r){let i=S(e),a=m++,s={_class:i,_className:e,_id:a};for(let[e,t]of Object.entries(n))s[S(e)]=t;s.superclass&&(s._superClass=S(String(s.superclass)),s.class&&T.set(S(String(s.class)),s._superClass)),g.set(a,s);let o=w(t);if(o&&(s._name=o,v.set(o,s)),r){for(let e of r)e._parent=s;s._children=r}let l=X(e,"onAdd");return l&&l(s),s},datablock:function(e,t,n,r){let i=S(e),a=f++,s={_class:i,_className:e,_id:a,_isDatablock:!0},o=w(n);if(o){let e=y.get(o);if(e){for(let[t,n]of Object.entries(e))t.startsWith("_")||(s[t]=n);s._parent=e}}for(let[e,t]of Object.entries(r))s[S(e)]=t;g.set(a,s);let l=w(t);return l&&(s._name=l,v.set(l,s),y.set(l,s)),s},deleteObject:function e(t){let n;if(null==t||("number"==typeof t?n=g.get(t):"string"==typeof t?n=v.get(t):"object"==typeof t&&t._id&&(n=t),!n))return!1;let r=X(n._className,"onRemove");if(r&&r(n),g.delete(n._id),n._name&&v.delete(n._name),n._isDatablock&&n._name&&y.delete(n._name),n._parent&&n._parent._children){let e=n._parent._children.indexOf(n);-1!==e&&n._parent._children.splice(e,1)}if(n._children)for(let t of[...n._children])e(t);return!0},prop:function(e,t){var n;let r=W(e);return null==r?"":null!=(n=r[S(t)])?n:""},setProp:function(e,t,n){let r=W(e);return null==r||(r[S(t)]=n),n},getIndex:function(e,t){var n;let r=W(e);return null==r?"":null!=(n=r[String(t)])?n:""},setIndex:function(e,t,n){let r=W(e);return null==r||(r[String(t)]=n),n},propPostInc:function(e,t){return j(e,S(t),1)},propPostDec:function(e,t){return j(e,S(t),-1)},indexPostInc:function(e,t){return j(e,String(t),1)},indexPostDec:function(e,t){return j(e,String(t),-1)},key:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r2?n-2:0),i=2;i2?n-2:0),i=2;io(...r)),u=r[0];return u&&"object"==typeof u&&Y(e,t,u,r.slice(1)),l},nsRef:function(e,t){let n=k(e,t);if(!n||0===n.length)return null;let r=F(e,t),i=n[n.length-1];return function(){for(var e=arguments.length,t=Array(e),a=0;ai(...t))}},parent:function(e,t,n){for(var r=arguments.length,i=Array(r>3?r-3:0),a=3;a=1){let r=l-1,a=O(o,r,()=>s[r](n,...i));return n&&"object"==typeof n&&Y(e,t,n,i),a}let u=T.get(e);for(;u;){let e=k(u,t);if(e&&e.length>0){let r=O(F(u,t),e.length-1,()=>e[e.length-1](n,...i));return n&&"object"==typeof n&&Y(u,t,n,i),r}u=T.get(u)}return""},parentFunc:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;ri[l](...n))},add:function(e,t){return J(e)+J(t)},sub:function(e,t){return J(e)-J(t)},mul:function(e,t){return J(e)*J(t)},div:function(e,t){return J(e)/J(t)},neg:function(e){return-J(e)},lt:function(e,t){return J(e)J(t)},ge:function(e,t){return J(e)>=J(t)},eq:function(e,t){return J(e)===J(t)},ne:function(e,t){return J(e)!==J(t)},mod:function(e,t){let n=0|Number(t);return 0===n?0:(0|Number(e))%n},bitand:function(e,t){return M(e)&M(t)},bitor:function(e,t){return M(e)|M(t)},bitxor:function(e,t){return M(e)^M(t)},shl:function(e,t){return M(M(e)<<(31&M(t)))},shr:function(e,t){return M(e)>>>(31&M(t))},bitnot:function(e){return~M(e)>>>0},concat:function(){for(var e=arguments.length,t=Array(e),n=0;nString(null!=e?e:"")).join("")},streq:function(e,t){return String(null!=e?e:"").toLowerCase()===String(null!=t?t:"").toLowerCase()},switchStr:function(e,t){let n=String(null!=e?e:"").toLowerCase();for(let[e,r]of Object.entries(t))if("default"!==e&&S(e)===n)return void r();t.default&&t.default()},deref:K,nameToId:function(e){let t=Z(e);return t?t._id:-1},isObject:function(e){return null!=e&&("object"==typeof e&&!!e._id||("number"==typeof e?g.has(e):"string"==typeof e&&v.has(e)))},isFunction:function(e){return a.has(e)||e.toLowerCase()in V},isPackage:function(e){return h.has(e)},isActivePackage:function(e){var t;let n=h.get(e);return null!=(t=null==n?void 0:n.active)&&t},getPackageList:function(){return d.join(" ")},locals:Q,onMethodCalled(e,t,n){let r=E.get(e);r||(r=new l,E.set(e,r));let i=r.get(t);i||(i=[],r.set(t,i)),i.push(n)}},et={call(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r0)return O(e.toLowerCase(),i.length-1,()=>i[i.length-1](...n));let s=V[e.toLowerCase()];return s?s(...n):(console.warn("Unknown function: ".concat(e,"(").concat(n.map(e=>JSON.stringify(e)).join(", "),")")),"")}},en=$(_),er={methods:i,functions:a,packages:h,activePackages:d,objectsById:g,objectsByName:v,datablocks:y,globals:_,executedScripts:C,failedScripts:R,scripts:L,generatedCode:N,pendingTimeouts:z,startTime:Date.now()};function ei(e){let t=function(e){let t=N.get(e);null==t&&(t=new s(void 0).generate(e),N.set(e,t));return t}(e),n=Q();Function("$","$f","$g","$l",t)(ee,et,en,n)}function ea(e,t){return{execute(){if(t){let e=c(t);er.executedScripts.add(e)}ei(e)}}}async function es(e,t,n){let i=r.loadScript;if(!i){e.length>0&&console.warn("Script has exec() calls but no loadScript provided:",e);return}async function a(e){var a,s;null==(a=r.signal)||a.throwIfAborted();let o=c(e);if(er.scripts.has(o)||er.failedScripts.has(o))return;if(P&&P(o)){console.warn("Ignoring script: ".concat(e)),er.failedScripts.add(o);return}if(n.has(o))return;let l=t.get(o);if(l)return void await l;null==(s=r.progress)||s.addItem(e);let u=(async()=>{var a,s,l;let u,c=await i(e);if(null==c){console.warn("Script not found: ".concat(e)),er.failedScripts.add(o),null==(s=r.progress)||s.completeItem();return}try{u=A(c,{filename:e})}catch(t){console.warn("Failed to parse script: ".concat(e),t),er.failedScripts.add(o),null==(l=r.progress)||l.completeItem();return}let h=new Set(n);h.add(o),await es(u.execScriptPaths,t,h),er.scripts.set(o,u),null==(a=r.progress)||a.completeItem()})();t.set(o,u),await u}await Promise.all(e.map(a))}async function eo(e){var t,n,i;let a=r.loadScript;if(!a)throw Error("loadFromPath requires loadScript option to be set");let s=c(e);if(er.scripts.has(s))return ea(er.scripts.get(s),e);null==(t=r.progress)||t.addItem(e);let o=await a(e);if(null==o)throw null==(i=r.progress)||i.completeItem(),Error("Script not found: ".concat(e));let l=await el(o,{path:e});return null==(n=r.progress)||n.completeItem(),l}async function el(e,t){if(null==t?void 0:t.path){let e=c(t.path);if(er.scripts.has(e))return ea(er.scripts.get(e),t.path)}return eu(A(e,{filename:null==t?void 0:t.path}),t)}async function eu(e,t){var n;let i=new Map,a=new Set;if(null==t?void 0:t.path){let n=c(t.path);er.scripts.set(n,e),a.add(n)}let s=[...e.execScriptPaths,...null!=(n=r.preloadScripts)?n:[]];return await es(s,i,a),ea(e,null==t?void 0:t.path)}return H={$:ee,$f:et,$g:en,state:er,destroy:function(){for(let e of er.pendingTimeouts)clearTimeout(e);er.pendingTimeouts.clear()},executeAST:ei,loadFromPath:eo,loadFromSource:el,loadFromAST:eu,call:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;rv.get(e)}}function T(){let e=new Set,t=0,n=0,r=null;function i(){for(let t of e)t()}return{get total(){return t},get loaded(){return n},get current(){return r},get progress(){return 0===t?0:n/t},on(t,n){e.add(n)},off(t,n){e.delete(n)},addItem(e){t++,r=e,i()},completeItem(){n++,r=null,i()},setCurrent(e){r=e,i()}}}function A(e,t){try{return n.default.parse(e)}catch(e){if((null==t?void 0:t.filename)&&e.location)throw Error("".concat(t.filename,":").concat(e.location.start.line,":").concat(e.location.start.column,": ").concat(e.message),{cause:e});throw e}}function C(e){let{missionName:t,missionType:n,runtimeOptions:r,onMissionLoadDone:i}=e,{signal:a,fileSystem:s,globals:o={},preloadScripts:l=[]}=null!=r?r:{},u=s.findFiles("scripts/*Game.cs"),c=E({...r,globals:{...o,"$Host::Map":t,"$Host::MissionType":n},preloadScripts:[...l,...u]}),h=async function(){try{let e=await c.loadFromPath("scripts/server.cs");null==a||a.throwIfAborted(),await c.loadFromPath("missions/".concat(t,".mis")),null==a||a.throwIfAborted(),e.execute(),i&&c.$.onMethodCalled("DefaultGame","missionLoadDone",i);let n=await c.loadFromSource("CreateServer($Host::Map, $Host::MissionType);");null==a||a.throwIfAborted(),n.execute()}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}}();return{runtime:c,ready:h}}e.s(["createProgressTracker",()=>T],38433);let R=/^[ \t]*(DisplayName|MissionTypes|BriefingWAV|Bitmap|PlanetName)[ \t]*=[ \t]*(.+)$/i,P=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+BEGIN[ \t]*-+$/i,I=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+END[ \t]*-+$/i;function L(e){var t,n,r,i,a,s;let o=A(e),{pragma:l,sections:u}=function(e){let t={},n=[],r={name:null,comments:[]};for(let i of e.body)if("Comment"===i.type){let e=function(e){let t;return(t=e.match(P))?{type:"sectionBegin",name:t[1]}:(t=e.match(I))?{type:"sectionEnd",name:t[1]}:(t=e.match(R))?{type:"definition",identifier:t[1],value:t[2]}:null}(i.value);if(e)switch(e.type){case"definition":null===r.name?t[e.identifier.toLowerCase()]=e.value:r.comments.push(i.value);break;case"sectionBegin":(null!==r.name||r.comments.length>0)&&n.push(r),r={name:e.name.toUpperCase(),comments:[]};break;case"sectionEnd":null!==r.name&&n.push(r),r={name:null,comments:[]}}else r.comments.push(i.value)}return(null!==r.name||r.comments.length>0)&&n.push(r),{pragma:t,sections:n}}(o);function c(e){var t,n;return null!=(n=null==(t=u.find(t=>t.name===e))?void 0:t.comments.map(e=>e.trimStart()).join("\n"))?n:null}return{displayName:null!=(n=l.displayname)?n:null,missionTypes:null!=(r=null==(t=l.missiontypes)?void 0:t.split(/\s+/).filter(Boolean))?r:[],missionBriefing:c("MISSION BRIEFING"),briefingWav:null!=(i=l.briefingwav)?i:null,bitmap:null!=(a=l.bitmap)?a:null,planetName:null!=(s=l.planetname)?s:null,missionBlurb:c("MISSION BLURB"),missionQuote:c("MISSION QUOTE"),missionString:c("MISSION STRING"),execScriptPaths:o.execScriptPaths,hasDynamicExec:o.hasDynamicExec,ast:o}}function N(e,t){if(e)return e[t.toLowerCase()]}function D(e,t){let n=e[t.toLowerCase()];return null==n?n:parseFloat(n)}function U(e,t){let n=e[t.toLowerCase()];return null==n?n:parseInt(n,10)}function O(e){var t;let[n,r,i]=(null!=(t=e.position)?t:"0 0 0").split(" ").map(e=>parseFloat(e));return[r||0,i||0,n||0]}function F(e){var t;let[n,r,i]=(null!=(t=e.scale)?t:"1 1 1").split(" ").map(e=>parseFloat(e));return[r||0,i||0,n||0]}function k(e){var n;let[r,i,a,s]=(null!=(n=e.rotation)?n:"1 0 0 0").split(" ").map(e=>parseFloat(e)),o=new t.Vector3(i,a,r).normalize(),l=-(Math.PI/180*s);return new t.Quaternion().setFromAxisAngle(o,l)}},12979,e=>{"use strict";e.s(["BASE_URL",()=>a,"FALLBACK_TEXTURE_URL",()=>o,"audioToUrl",()=>f,"getUrlForPath",()=>l,"iflTextureToUrl",()=>d,"interiorToUrl",()=>u,"loadDetailMapList",()=>m,"loadImageFrameList",()=>y,"loadMission",()=>g,"loadTerrain",()=>v,"shapeToUrl",()=>c,"terrainTextureToUrl",()=>h,"textureToUrl",()=>p],12979);var t=e.i(98223),n=e.i(91996),r=e.i(62395),i=e.i(71726);let a="/t2-mapper",s="".concat(a,"/base/"),o="".concat(a,"/magenta.png");function l(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(n){if(t)return console.warn('Resource "'.concat(e,'" not found - rendering fallback.')),t;throw n}let[i,a]=(0,n.getSourceAndPath)(r);return i?"".concat(s,"@vl2/").concat(i,"/").concat(a):"".concat(s).concat(a)}function u(e){return l("interiors/".concat(e)).replace(/\.dif$/i,".glb")}function c(e){return l("shapes/".concat(e)).replace(/\.dts$/i,".glb")}function h(e){return e=e.replace(/^terrain\./,""),l((0,n.getStandardTextureResourceKey)("textures/terrain/".concat(e)),o)}function d(e,t){let r=(0,i.normalizePath)(t).split("/"),a=r.length>1?r.slice(0,-1).join("/")+"/":"",s="".concat(a).concat(e);return l((0,n.getStandardTextureResourceKey)(s),o)}function p(e){return l((0,n.getStandardTextureResourceKey)("textures/".concat(e)),o)}function f(e){return l("audio/".concat(e))}async function m(e){let t=l("textures/".concat(e)),n=await fetch(t);return(await n.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function g(e){let t=(0,n.getMissionInfo)(e),i=await fetch(l(t.resourcePath)),a=await i.text();return(0,r.parseMissionScript)(a)}async function v(e){let t=await fetch(l("terrains/".concat(e)));return function(e){let t=new DataView(e),n=0,r=t.getUint8(n++),i=new Uint16Array(65536),a=[],s=e=>{let r="";for(let i=0;i0&&a.push(i)}let o=[];for(let e of a){let e=new Uint8Array(65536);for(let r=0;r<65536;r++){var l=t.getUint8(n++);e[r]=l}o.push(e)}return{version:r,textureNames:a,heightMap:i,alphaMaps:o}}(await t.arrayBuffer())}async function y(e){let n=l(e),r=await fetch(n),i=await r.text();return(0,t.parseImageFileList)(i)}},5230,e=>{"use strict";e.s(["useFrame",()=>t.D]);var t=e.i(46712)},16096,e=>{"use strict";e.s(["useThree",()=>t.C]);var t=e.i(46712)},79123,e=>{"use strict";e.s(["SettingsProvider",()=>u,"useControls",()=>l,"useDebug",()=>o,"useSettings",()=>s]);var t=e.i(43476),n=e.i(71645);let r=(0,n.createContext)(null),i=(0,n.createContext)(null),a=(0,n.createContext)(null);function s(){return(0,n.useContext)(r)}function o(){return(0,n.useContext)(i)}function l(){return(0,n.useContext)(a)}function u(e){let{children:s}=e,[o,l]=(0,n.useState)(!0),[u,c]=(0,n.useState)(!1),[h,d]=(0,n.useState)(1),[p,f]=(0,n.useState)(90),[m,g]=(0,n.useState)(!1),[v,y]=(0,n.useState)(!0),[_,x]=(0,n.useState)(!1),b=(0,n.useMemo)(()=>({fogEnabled:o,setFogEnabled:l,highQualityFog:u,setHighQualityFog:c,fov:p,setFov:f,audioEnabled:m,setAudioEnabled:g,animationEnabled:v,setAnimationEnabled:y}),[o,u,p,m,v]),S=(0,n.useMemo)(()=>({debugMode:_,setDebugMode:x}),[_,x]),M=(0,n.useMemo)(()=>({speedMultiplier:h,setSpeedMultiplier:d}),[h,d]);(0,n.useLayoutEffect)(()=>{let e={};try{e=JSON.parse(localStorage.getItem("settings"))||{}}catch(e){}null!=e.debugMode&&x(e.debugMode),null!=e.audioEnabled&&g(e.audioEnabled),null!=e.animationEnabled&&y(e.animationEnabled),null!=e.fogEnabled&&l(e.fogEnabled),null!=e.highQualityFog&&c(e.highQualityFog),null!=e.speedMultiplier&&d(e.speedMultiplier),null!=e.fov&&f(e.fov)},[]);let w=(0,n.useRef)(null);return(0,n.useEffect)(()=>(w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{try{localStorage.setItem("settings",JSON.stringify({fogEnabled:o,highQualityFog:u,speedMultiplier:h,fov:p,audioEnabled:m,animationEnabled:v,debugMode:_}))}catch(e){}},500),()=>{w.current&&clearTimeout(w.current)}),[o,u,h,p,m,v,_]),(0,t.jsx)(r.Provider,{value:b,children:(0,t.jsx)(i.Provider,{value:S,children:(0,t.jsx)(a.Provider,{value:M,children:s})})})}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/ceb4ad0dd35367ed.js b/docs/_next/static/chunks/ceb4ad0dd35367ed.js new file mode 100644 index 00000000..83667730 --- /dev/null +++ b/docs/_next/static/chunks/ceb4ad0dd35367ed.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47071,80520,e=>{"use strict";e.s(["useTexture",()=>a],47071);var t=e.i(71645),n=e.i(90072),r=e.i(16096);e.s(["useLoader",()=>i.G],80520);var i=e.i(46712),i=i;let o=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let l=(0,r.useThree)(e=>e.gl),s=(0,i.G)(n.TextureLoader,o(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(s)},[a]),(0,t.useEffect)(()=>{if("initTexture"in l){let e=[];Array.isArray(s)?e=s:s instanceof n.Texture?e=[s]:o(s)&&(e=Object.values(s)),e.forEach(e=>{e instanceof n.Texture&&l.initTexture(e)})}},[l,s]),(0,t.useMemo)(()=>{if(!o(e))return s;{let t={},n=0;for(let r in e)t[r]=s[n++];return t}},[e,s])}a.preload=e=>i.G.preload(n.TextureLoader,e),a.clear=e=>i.G.clear(n.TextureLoader,e)},6112,51475,77482,e=>{"use strict";e.s(["useDatablock",()=>u],6112),e.s(["RuntimeProvider",()=>s,"useRuntime",()=>c],77482);var t=e.i(43476),n=e.i(71645);e.s(["TickProvider",()=>o,"useTick",()=>a],51475);var r=e.i(5230);let i=(0,n.createContext)(null);function o(e){let{children:o}=e,a=(0,n.useRef)(void 0),l=(0,n.useRef)(0),s=(0,n.useRef)(0);(0,r.useFrame)((e,t)=>{for(l.current+=t;l.current>=.03125;)if(l.current-=.03125,s.current++,a.current)for(let e of a.current)e(s.current)});let c=(0,n.useCallback)(e=>(null!=a.current||(a.current=new Set),a.current.add(e),()=>{a.current.delete(e)}),[]),u=(0,n.useCallback)(()=>s.current,[]),f=(0,n.useMemo)(()=>({subscribe:c,getTick:u}),[c,u]);return(0,t.jsx)(i.Provider,{value:f,children:o})}function a(e){let t=(0,n.useContext)(i);if(!t)throw Error("useTick must be used within a TickProvider");let r=(0,n.useRef)(e);r.current=e,(0,n.useEffect)(()=>t.subscribe(e=>r.current(e)),[t])}let l=(0,n.createContext)(null);function s(e){let{runtime:n,children:r}=e;return(0,t.jsx)(l.Provider,{value:n,children:(0,t.jsx)(o,{children:r})})}function c(){let e=(0,n.useContext)(l);if(!e)throw Error("useRuntime must be used within a RuntimeProvider");return e}function u(e){let t=c();if(e)return t.state.datablocks.get(e)}},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},75567,e=>{"use strict";e.s(["setupAlphaTestedTexture",()=>i,"setupColor",()=>r,"setupMask",()=>o]);var t=e.i(90072);function n(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{repeat:r=[1,1],disableMipmaps:i=!1}=n;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...r),e.flipY=!1,e.anisotropy=16,i?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[1,1];return n(e,{repeat:t})}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[1,1];return n(e,{repeat:t,disableMipmaps:!0})}function o(e){let n=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return n.colorSpace=t.NoColorSpace,n.wrapS=n.wrapT=t.RepeatWrapping,n.generateMipmaps=!1,n.minFilter=t.LinearFilter,n.magFilter=t.LinearFilter,n.needsUpdate=!0,n}},47021,e=>{"use strict";e.s(["fogFragmentShader",()=>n,"injectCustomFog",()=>i,"installCustomFogShader",()=>r]);var t=e.i(8560);let n="\n#ifdef USE_FOG\n // Check fog enabled uniform - allows toggling without shader recompilation\n #ifdef USE_VOLUMETRIC_FOG\n if (!fogEnabled) {\n // Skip all fog calculations when disabled\n } else {\n #endif\n\n float dist = vFogDepth;\n\n // Discard fragments at or beyond visible distance - matches Torque's behavior\n // where objects beyond visibleDistance are not rendered at all.\n // This prevents fully-fogged geometry from showing as silhouettes against\n // the sky's fog-to-sky gradient.\n if (dist >= fogFar) {\n discard;\n }\n\n // Step 1: Calculate distance-based haze (quadratic falloff)\n // Since we discard at fogFar, haze never reaches 1.0 here\n float haze = 0.0;\n if (dist > fogNear) {\n float fogScale = 1.0 / (fogFar - fogNear);\n float distFactor = (dist - fogNear) * fogScale - 1.0;\n haze = 1.0 - distFactor * distFactor;\n }\n\n // Step 2: Calculate fog volume contributions\n // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false)\n // All fog uses the global fogColor - see Tribes2_Fog_System.md for details\n float volumeFog = 0.0;\n\n #ifdef USE_VOLUMETRIC_FOG\n {\n #ifdef USE_FOG_WORLD_POSITION\n float fragmentHeight = vFogWorldPosition.y;\n #else\n float fragmentHeight = cameraHeight;\n #endif\n\n float deltaY = fragmentHeight - cameraHeight;\n float absDeltaY = abs(deltaY);\n\n // Determine if we're going up (positive) or down (negative)\n if (absDeltaY > 0.01) {\n // Non-horizontal ray: ray-march through fog volumes\n for (int i = 0; i < 3; i++) {\n int offset = i * 4;\n float volVisDist = fogVolumeData[offset + 0];\n float volMinH = fogVolumeData[offset + 1];\n float volMaxH = fogVolumeData[offset + 2];\n float volPct = fogVolumeData[offset + 3];\n\n // Skip inactive volumes (visibleDistance = 0)\n if (volVisDist <= 0.0) continue;\n\n // Calculate fog factor for this volume\n // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage\n // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0)\n // Since we don't have quality settings, we use visFactor = 1.0\n float factor = (1.0 / volVisDist) * volPct;\n\n // Find ray intersection with this volume's height range\n float rayMinY = min(cameraHeight, fragmentHeight);\n float rayMaxY = max(cameraHeight, fragmentHeight);\n\n // Check if ray intersects volume height range\n if (rayMinY < volMaxH && rayMaxY > volMinH) {\n float intersectMin = max(rayMinY, volMinH);\n float intersectMax = min(rayMaxY, volMaxH);\n float intersectHeight = intersectMax - intersectMin;\n\n // Calculate distance traveled through this volume using similar triangles:\n // subDist / dist = intersectHeight / absDeltaY\n float subDist = dist * (intersectHeight / absDeltaY);\n\n // Accumulate fog: fog += subDist * factor\n volumeFog += subDist * factor;\n }\n }\n } else {\n // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume\n for (int i = 0; i < 3; i++) {\n int offset = i * 4;\n float volVisDist = fogVolumeData[offset + 0];\n float volMinH = fogVolumeData[offset + 1];\n float volMaxH = fogVolumeData[offset + 2];\n float volPct = fogVolumeData[offset + 3];\n\n if (volVisDist <= 0.0) continue;\n\n // If camera is inside this volume, apply fog for full distance\n if (cameraHeight >= volMinH && cameraHeight <= volMaxH) {\n float factor = (1.0 / volVisDist) * volPct;\n volumeFog += dist * factor;\n }\n }\n }\n }\n #endif\n\n // Step 3: Combine haze and volume fog\n // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct\n // This gives fog volumes priority over haze\n float volPct = min(volumeFog, 1.0);\n float hazePct = haze;\n if (volPct + hazePct > 1.0) {\n hazePct = 1.0 - volPct;\n }\n float fogFactor = hazePct + volPct;\n\n // Apply fog using global fogColor (per-volume colors not used in Tribes 2)\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n\n #ifdef USE_VOLUMETRIC_FOG\n } // end fogEnabled check\n #endif\n#endif\n";function r(){t.ShaderChunk.fog_pars_fragment="\n#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n\n // Custom volumetric fog uniforms (only defined when USE_VOLUMETRIC_FOG is set)\n // Format: [visDist, minH, maxH, percentage] x 3 volumes = 12 floats\n #ifdef USE_VOLUMETRIC_FOG\n uniform float fogVolumeData[12];\n uniform float cameraHeight;\n #endif\n\n #ifdef USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n #endif\n#endif\n",t.ShaderChunk.fog_fragment=n,t.ShaderChunk.fog_pars_vertex="\n#ifdef USE_FOG\n varying float vFogDepth;\n #ifdef USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n #endif\n#endif\n",t.ShaderChunk.fog_vertex="\n#ifdef USE_FOG\n // Use Euclidean distance from camera, not view-space z-depth\n // This ensures fog doesn't change when rotating the camera\n vFogDepth = length(mvPosition.xyz);\n #ifdef USE_FOG_WORLD_POSITION\n vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz;\n #endif\n#endif\n"}function i(e,t){e.uniforms.fogVolumeData=t.fogVolumeData,e.uniforms.cameraHeight=t.cameraHeight,e.uniforms.fogEnabled=t.fogEnabled,e.vertexShader=e.vertexShader.replace("#include ","#include \n#ifdef USE_FOG\n #define USE_FOG_WORLD_POSITION\n #define USE_VOLUMETRIC_FOG\n varying vec3 vFogWorldPosition;\n#endif"),e.vertexShader=e.vertexShader.replace("#include ","#include \n#ifdef USE_FOG\n vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz;\n#endif"),e.fragmentShader=e.fragmentShader.replace("#include ","#include \n#ifdef USE_FOG\n #define USE_VOLUMETRIC_FOG\n uniform float fogVolumeData[12];\n uniform float cameraHeight;\n uniform bool fogEnabled;\n #define USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n#endif"),e.fragmentShader=e.fragmentShader.replace("#include ",n)}},48066,e=>{"use strict";e.s(["globalFogUniforms",()=>t,"packFogVolumeData",()=>i,"resetGlobalFogUniforms",()=>r,"updateGlobalFogUniforms",()=>n]);let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function n(e,n){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];t.cameraHeight.value=e,t.fogVolumeData.value.set(n),t.fogEnabled.value=r}function r(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function i(e){let t=new Float32Array(12);for(let n=0;n<3;n++){let r=4*n,i=e[n];i&&(t[r+0]=i.visibleDistance,t[r+1]=i.minHeight,t[r+2]=i.maxHeight,t[r+3]=i.percentage)}return t}},89887,60099,e=>{"use strict";let t,n;e.s(["FloatingLabel",()=>b],89887);var r=e.i(43476),i=e.i(71645),o=e.i(5230),a=e.i(16096),l=e.i(90072);e.s(["Html",()=>y],60099);var s=e.i(31067),c=e.i(88014);let u=new l.Vector3,f=new l.Vector3,d=new l.Vector3,m=new l.Vector2;function g(e,t,n){let r=u.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,o=n.height/2;return[r.x*i+i,-(r.y*o)+o]}let h=e=>1e-10>Math.abs(e)?0:e;function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="matrix3d(";for(let n=0;16!==n;n++)r+=h(t[n]*e.elements[n])+(15!==n?",":")");return n+r}let p=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>v(e,t)),x=(n=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>v(e,n(t),"translate(-50%,-50%)")),y=i.forwardRef((e,t)=>{let{children:n,eps:r=.001,style:v,className:y,prepend:F,center:b,fullscreen:S,portal:M,distanceFactor:P,sprite:E=!1,transform:_=!1,occlude:T,onOcclude:w,castShadow:O,receiveShadow:D,material:C,geometry:R,zIndexRange:H=[0x1000037,0],calculatePosition:V=g,as:W="div",wrapperClass:L,pointerEvents:U="auto",...z}=e,{gl:k,camera:G,scene:I,size:A,raycaster:j,events:N,viewport:Y}=(0,a.useThree)(),[q]=i.useState(()=>document.createElement(W)),B=i.useRef(null),K=i.useRef(null),X=i.useRef(0),Z=i.useRef([0,0]),$=i.useRef(null),J=i.useRef(null),Q=(null==M?void 0:M.current)||N.connected||k.domElement.parentNode,ee=i.useRef(null),et=i.useRef(!1),en=i.useMemo(()=>T&&"blending"!==T||Array.isArray(T)&&T.length&&function(e){return e&&"object"==typeof e&&"current"in e}(T[0]),[T]);i.useLayoutEffect(()=>{let e=k.domElement;T&&"blending"===T?(e.style.zIndex="".concat(Math.floor(H[0]/2)),e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[T]),i.useLayoutEffect(()=>{if(K.current){let e=B.current=c.createRoot(q);if(I.updateMatrixWorld(),_)q.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=V(K.current,G,A);q.style.cssText="position:absolute;top:0;left:0;transform:translate3d(".concat(e[0],"px,").concat(e[1],"px,0);transform-origin:0 0;")}return Q&&(F?Q.prepend(q):Q.appendChild(q)),()=>{Q&&Q.removeChild(q),e.unmount()}}},[Q,_]),i.useLayoutEffect(()=>{L&&(q.className=L)},[L]);let er=i.useMemo(()=>_?{position:"absolute",top:0,left:0,width:A.width,height:A.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:b?"translate3d(-50%,-50%,0)":"none",...S&&{top:-A.height/2,left:-A.width/2,width:A.width,height:A.height},...v},[v,b,S,A,_]),ei=i.useMemo(()=>({position:"absolute",pointerEvents:U}),[U]);i.useLayoutEffect(()=>{var e,r;et.current=!1,_?null==(e=B.current)||e.render(i.createElement("div",{ref:$,style:er},i.createElement("div",{ref:J,style:ei},i.createElement("div",{ref:t,className:y,style:v,children:n})))):null==(r=B.current)||r.render(i.createElement("div",{ref:t,style:er,className:y,children:n}))});let eo=i.useRef(!0);(0,o.useFrame)(e=>{if(K.current){G.updateMatrixWorld(),K.current.updateWorldMatrix(!0,!1);let e=_?Z.current:V(K.current,G,A);if(_||Math.abs(X.current-G.zoom)>r||Math.abs(Z.current[0]-e[0])>r||Math.abs(Z.current[1]-e[1])>r){let t=function(e,t){let n=u.setFromMatrixPosition(e.matrixWorld),r=f.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),o=t.getWorldDirection(d);return i.angleTo(o)>Math.PI/2}(K.current,G),n=!1;en&&(Array.isArray(T)?n=T.map(e=>e.current):"blending"!==T&&(n=[I]));let r=eo.current;n?eo.current=function(e,t,n,r){let i=u.setFromMatrixPosition(e.matrixWorld),o=i.clone();o.project(t),m.set(o.x,o.y),n.setFromCamera(m,t);let a=n.intersectObjects(r,!0);if(a.length){let e=a[0].distance;return i.distanceTo(n.ray.origin)({vertexShader:_?void 0:'\n /*\n This shader is from the THREE\'s SpriteMaterial.\n We need to turn the backing plane into a Sprite\n (make it always face the camera) if "transfrom"\n is false.\n */\n #include \n\n void main() {\n vec2 center = vec2(0., 1.);\n float rotation = 0.0;\n\n // This is somewhat arbitrary, but it seems to work well\n // Need to figure out how to derive this dynamically if it even matters\n float size = 0.03;\n\n vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n vec2 scale;\n scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n\n gl_Position = projectionMatrix * mvPosition;\n }\n ',fragmentShader:"\n void main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n "}),[_]);return i.createElement("group",(0,s.default)({},z,{ref:K}),T&&!en&&i.createElement("mesh",{castShadow:O,receiveShadow:D,ref:ee},R||i.createElement("planeGeometry",null),C||i.createElement("shaderMaterial",{side:l.DoubleSide,vertexShader:ea.vertexShader,fragmentShader:ea.fragmentShader})))}),F=[0,0,0],b=(0,i.memo)(function(e){let{children:t,color:n="white",position:s=F,opacity:c="fadeWithDistance"}=e,u="fadeWithDistance"===c,f=(0,i.useRef)(null),d=function(e){let{camera:t}=(0,a.useThree)(),n=(0,i.useRef)(null),r=function(e){let t=(0,i.useRef)(null);return(0,o.useFrame)(()=>{e.current&&(null!=t.current||(t.current=new l.Vector3),e.current.getWorldPosition(t.current))}),t}(e);return(0,o.useFrame)(()=>{r.current?n.current=t.position.distanceTo(r.current):n.current=null}),n}(f),[m,g]=(0,i.useState)(0!==c),h=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(u&&h.current&&null!=d.current){let e=Math.max(0,Math.min(1,1-d.current/200));h.current.style.opacity=e.toString()}},[m,u]),(0,o.useFrame)(()=>{if(u){let e=d.current,t=null!=e&&e<200;if(m!==t&&g(t),h.current&&t){let t=Math.max(0,Math.min(1,1-e/200));h.current.style.opacity=t.toString()}}else g(0!==c),h.current&&(h.current.style.opacity=c.toString())}),(0,r.jsx)("group",{ref:f,children:m?(0,r.jsx)(y,{position:s,center:!0,children:(0,r.jsx)("div",{ref:h,className:"StaticShapeLabel",style:{color:n},children:t})}):null})})},51434,e=>{"use strict";e.s(["AudioProvider",()=>a,"useAudio",()=>l]);var t=e.i(43476),n=e.i(71645),r=e.i(16096),i=e.i(90072);let o=(0,n.createContext)(void 0);function a(e){let{children:a}=e,{camera:l}=(0,r.useThree)(),[s,c]=(0,n.useState)({audioLoader:null,audioListener:null});return(0,n.useEffect)(()=>{let e=new i.AudioLoader,t=l.children.find(e=>e instanceof i.AudioListener);t||(t=new i.AudioListener,l.add(t)),c({audioLoader:e,audioListener:t})},[l]),(0,t.jsx)(o.Provider,{value:s,children:a})}function l(){let e=(0,n.useContext)(o);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}},61921,e=>{e.v(t=>Promise.all(["static/chunks/5342f4b5b8c465ca.js"].map(t=>e.l(t))).then(()=>t(29055)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/40a2f59d0c05dc35.js"].map(t=>e.l(t))).then(()=>t(63724)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/440c894c0d872ba4.js"].map(t=>e.l(t))).then(()=>t(42585)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/f863efae27259b81.js b/docs/_next/static/chunks/f863efae27259b81.js deleted file mode 100644 index 4d520adb..00000000 --- a/docs/_next/static/chunks/f863efae27259b81.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42585,e=>{"use strict";e.s(["WaterBlock",()=>m,"WaterMaterial",()=>p,"WaterSurfaceMaterial",()=>d],42585);var n=e.i(43476),a=e.i(71645),t=e.i(47071),o=e.i(5230),i=e.i(90072),r=e.i(12979),l=e.i(62395),s=e.i(75567),u=e.i(48066),c=e.i(47021);let v="\n #include \n\n // Enable volumetric fog (must be defined before fog uniforms)\n #ifdef USE_FOG\n #define USE_VOLUMETRIC_FOG\n #define USE_FOG_WORLD_POSITION\n #endif\n\n uniform float uTime;\n uniform float uOpacity;\n uniform float uEnvMapIntensity;\n uniform sampler2D uBaseTexture;\n uniform sampler2D uEnvMapTexture;\n\n // Volumetric fog uniforms\n #ifdef USE_FOG\n uniform float fogVolumeData[12];\n uniform float cameraHeight;\n varying vec3 vFogWorldPosition;\n #endif\n\n varying vec3 vWorldPosition;\n varying vec3 vViewVector;\n varying float vDistance;\n\n #define TWO_PI 6.283185307179586\n\n // Constants from Tribes 2 engine\n #define BASE_DRIFT_CYCLE_TIME 8.0\n #define BASE_DRIFT_RATE 0.02\n #define BASE_DRIFT_SCALAR 0.03\n #define TEXTURE_SCALE (1.0 / 48.0)\n\n // Environment map UV wobble constants\n #define Q1 150.0\n #define Q2 2.0\n #define Q3 0.01\n\n // Rotate UV coordinates\n vec2 rotateUV(vec2 uv, float angle) {\n float c = cos(angle);\n float s = sin(angle);\n return vec2(\n uv.x * c - uv.y * s,\n uv.x * s + uv.y * c\n );\n }\n\n void main() {\n // Calculate base texture UVs using world position (1/48 tiling)\n vec2 baseUV = vWorldPosition.xz * TEXTURE_SCALE;\n\n // Phase (time in radians for drift cycle)\n float phase = mod(uTime * (TWO_PI / BASE_DRIFT_CYCLE_TIME), TWO_PI);\n\n // Base texture drift\n float baseDriftX = uTime * BASE_DRIFT_RATE;\n float baseDriftY = cos(phase) * BASE_DRIFT_SCALAR;\n\n // === Phase 1a: First base texture pass (rotated 30 degrees) ===\n vec2 uv1a = rotateUV(baseUV, radians(30.0));\n\n // === Phase 1b: Second base texture pass (rotated 60 degrees total, with drift) ===\n vec2 uv1b = rotateUV(baseUV + vec2(baseDriftX, baseDriftY), radians(60.0));\n\n // Calculate cross-fade swing value\n float A1 = cos(((vWorldPosition.x / Q1) + (uTime / Q2)) * 6.0);\n float A2 = sin(((vWorldPosition.z / Q1) + (uTime / Q2)) * TWO_PI);\n float swing = (A1 + A2) * 0.15 + 0.5;\n\n // Cross-fade alpha calculation from engine\n float alpha1a = ((1.0 - swing) * uOpacity) / max(1.0 - (swing * uOpacity), 0.001);\n float alpha1b = swing * uOpacity;\n\n // Sample base texture for both passes\n vec4 texColor1a = texture2D(uBaseTexture, uv1a);\n vec4 texColor1b = texture2D(uBaseTexture, uv1b);\n\n // Combined alpha and color\n float combinedAlpha = 1.0 - (1.0 - alpha1a) * (1.0 - alpha1b);\n vec3 baseColor = (texColor1a.rgb * alpha1a * (1.0 - alpha1b) + texColor1b.rgb * alpha1b) / max(combinedAlpha, 0.001);\n\n // === Phase 3: Environment map / specular ===\n vec3 reflectVec = -vViewVector;\n reflectVec.y = abs(reflectVec.y);\n if (reflectVec.y < 0.001) reflectVec.y = 0.001;\n\n vec2 envUV;\n if (vDistance < 0.001) {\n envUV = vec2(0.0);\n } else {\n float value = (vDistance - reflectVec.y) / (vDistance * vDistance);\n envUV.x = reflectVec.x * value;\n envUV.y = reflectVec.z * value;\n }\n\n envUV = envUV * 0.5 + 0.5;\n envUV.x += A1 * Q3;\n envUV.y += A2 * Q3;\n\n vec4 envColor = texture2D(uEnvMapTexture, envUV);\n vec3 finalColor = baseColor + envColor.rgb * envColor.a * uEnvMapIntensity;\n\n // Note: Tribes 2 water does NOT use lighting - Phase 2 (lightmap) is disabled\n // in the original engine. Water colors come directly from textures.\n\n gl_FragColor = vec4(finalColor, combinedAlpha);\n\n // Apply volumetric fog using shared Torque-style fog shader\n ".concat(c.fogFragmentShader,"\n }\n");var f=e.i(79123);function d(e){let{surfaceTexture:l,envMapTexture:c,opacity:d=.75,waveMagnitude:p=1,envMapIntensity:m=1,attach:g}=e,h=(0,r.textureToUrl)(l),x=(0,r.textureToUrl)(null!=c?c:"special/lush_env"),[T,y]=(0,t.useTexture)([h,x],e=>{(Array.isArray(e)?e:[e]).forEach(e=>{(0,s.setupColor)(e),e.colorSpace=i.NoColorSpace,e.wrapS=i.RepeatWrapping,e.wrapT=i.RepeatWrapping})}),{animationEnabled:b}=(0,f.useSettings)(),w=(0,a.useMemo)(()=>{var e,n,a,t,o,r;return e={opacity:d,waveMagnitude:p,envMapIntensity:m,baseTexture:T,envMapTexture:y},new i.ShaderMaterial({uniforms:{uTime:{value:0},uOpacity:{value:null!=(n=null==e?void 0:e.opacity)?n:.75},uWaveMagnitude:{value:null!=(a=null==e?void 0:e.waveMagnitude)?a:1},uEnvMapIntensity:{value:null!=(t=null==e?void 0:e.envMapIntensity)?t:1},uBaseTexture:{value:null!=(o=null==e?void 0:e.baseTexture)?o:null},uEnvMapTexture:{value:null!=(r=null==e?void 0:e.envMapTexture)?r:null},fogColor:{value:new i.Color},fogNear:{value:1},fogFar:{value:2e3},fogVolumeData:u.globalFogUniforms.fogVolumeData,cameraHeight:u.globalFogUniforms.cameraHeight},vertexShader:"\n #include \n\n #ifdef USE_FOG\n #define USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n #endif\n\n uniform float uTime;\n uniform float uWaveMagnitude;\n\n varying vec3 vWorldPosition;\n varying vec3 vViewVector;\n varying float vDistance;\n\n // Wave function matching Tribes 2 engine\n // Z = surfaceZ + (sin(X*0.05 + time) + sin(Y*0.05 + time)) * waveFactor\n // waveFactor = waveAmplitude * 0.25\n // Note: Using xz for Three.js Y-up (Torque uses XY with Z-up)\n float getWaveHeight(vec3 worldPos) {\n float waveFactor = uWaveMagnitude * 0.25;\n return (sin(worldPos.x * 0.05 + uTime) + sin(worldPos.z * 0.05 + uTime)) * waveFactor;\n }\n\n void main() {\n // Get world position for wave calculation\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n vWorldPosition = worldPos.xyz;\n\n // Apply wave displacement to Y (vertical axis in Three.js)\n vec3 displaced = position;\n displaced.y += getWaveHeight(worldPos.xyz);\n\n // Calculate final world position after displacement for fog\n #ifdef USE_FOG\n vec4 displacedWorldPos = modelMatrix * vec4(displaced, 1.0);\n vFogWorldPosition = displacedWorldPos.xyz;\n #endif\n\n // Calculate view vector for environment mapping\n vViewVector = cameraPosition - worldPos.xyz;\n vDistance = length(vViewVector);\n\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(displaced, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n // Set fog depth (distance from camera) - normally done by fog_vertex include\n // but we can't use that include because it references 'transformed' which we don't have\n #ifdef USE_FOG\n vFogDepth = length(mvPosition.xyz);\n #endif\n }\n",fragmentShader:v,transparent:!0,side:i.DoubleSide,depthWrite:!0,fog:!0})},[d,p,m,T,y]),P=(0,a.useRef)(0);return(0,o.useFrame)((e,n)=>{if(!b){P.current=0,w.uniforms.uTime.value=0;return}P.current+=n,w.uniforms.uTime.value=P.current}),(0,a.useEffect)(()=>()=>{w.dispose()},[w]),(0,n.jsx)("primitive",{object:w,attach:g})}function p(e){let{surfaceTexture:a,attach:o}=e,l=(0,r.textureToUrl)(a),u=(0,t.useTexture)(l,e=>(0,s.setupColor)(e));return(0,n.jsx)("meshStandardMaterial",{attach:o,map:u,transparent:!0,opacity:.8,side:i.DoubleSide})}let m=(0,a.memo)(function(e){var t,o,r,s;let{object:u}=e,c=(0,a.useMemo)(()=>(0,l.getPosition)(u),[u]),v=(0,a.useMemo)(()=>(0,l.getRotation)(u),[u]),[f,p,m]=(0,a.useMemo)(()=>(0,l.getScale)(u),[u]),g=null!=(t=(0,l.getProperty)(u,"surfaceTexture"))?t:"liquidTiles/BlueWater",h=(0,l.getProperty)(u,"envMapTexture"),x=parseFloat(null!=(o=(0,l.getProperty)(u,"surfaceOpacity"))?o:"0.75"),T=parseFloat(null!=(r=(0,l.getProperty)(u,"waveMagnitude"))?r:"1.0"),y=parseFloat(null!=(s=(0,l.getProperty)(u,"envMapIntensity"))?s:"1.0"),b=(0,a.useMemo)(()=>{let[e,n]=function(e,n){let a=e<=1024&&n<=1024?8:16;return[Math.max(4,Math.ceil(e/a)),Math.max(4,Math.ceil(n/a))]}(f,m),a=new i.PlaneGeometry(f,m,e,n);return a.rotateX(-Math.PI/2),a.translate(f/2,p,m/2),a},[f,p,m]);return(0,a.useEffect)(()=>()=>{b.dispose()},[b]),(0,n.jsx)("group",{position:c,quaternion:v,children:(0,n.jsx)("mesh",{geometry:b,children:(0,n.jsx)(a.Suspense,{fallback:(0,n.jsx)("meshStandardMaterial",{color:"blue",transparent:!0,opacity:.3,side:i.DoubleSide}),children:(0,n.jsx)(d,{attach:"material",surfaceTexture:g,envMapTexture:h,opacity:x,waveMagnitude:T,envMapIntensity:y})})})})})}]); \ No newline at end of file diff --git a/docs/_next/static/nuFCeK7OZLd9PDcpp99Xm/_buildManifest.js b/docs/_next/static/mO1QzAw7Pu83u0Fl2zAEJ/_buildManifest.js similarity index 100% rename from docs/_next/static/nuFCeK7OZLd9PDcpp99Xm/_buildManifest.js rename to docs/_next/static/mO1QzAw7Pu83u0Fl2zAEJ/_buildManifest.js diff --git a/docs/_next/static/nuFCeK7OZLd9PDcpp99Xm/_clientMiddlewareManifest.json b/docs/_next/static/mO1QzAw7Pu83u0Fl2zAEJ/_clientMiddlewareManifest.json similarity index 100% rename from docs/_next/static/nuFCeK7OZLd9PDcpp99Xm/_clientMiddlewareManifest.json rename to docs/_next/static/mO1QzAw7Pu83u0Fl2zAEJ/_clientMiddlewareManifest.json diff --git a/docs/_next/static/nuFCeK7OZLd9PDcpp99Xm/_ssgManifest.js b/docs/_next/static/mO1QzAw7Pu83u0Fl2zAEJ/_ssgManifest.js similarity index 100% rename from docs/_next/static/nuFCeK7OZLd9PDcpp99Xm/_ssgManifest.js rename to docs/_next/static/mO1QzAw7Pu83u0Fl2zAEJ/_ssgManifest.js diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/Starfallen.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/Starfallen.glb index be79aa6c..c1553f9e 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/Starfallen.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/Starfallen.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbase_ccb5.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbase_ccb5.glb index bec6ad4c..e58e2778 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbase_ccb5.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbase_ccb5.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbase_nefhillside.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbase_nefhillside.glb index 58ac4316..c8a07c59 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbase_nefhillside.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbase_nefhillside.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbunke.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbunke.glb index 5bafadd4..6c3891e5 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbunke.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bbunke.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bmisc_nefledge1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bmisc_nefledge1.glb index cd8c367c..6a11da67 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bmisc_nefledge1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bmisc_nefledge1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bmisc_nefvbay.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bmisc_nefvbay.glb index b52372fd..efeaf9bb 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bmisc_nefvbay.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/bmisc_nefvbay.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/btf_turretplatform_c.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/btf_turretplatform_c.glb index 628c610a..ef4acd1d 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/btf_turretplatform_c.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/btf_turretplatform_c.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_broadside_nef.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_broadside_nef.glb index 932c7ba7..6ddd4b36 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_broadside_nef.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_broadside_nef.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_nefRaindance.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_nefRaindance.glb index c6dd4a16..ed15b397 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_nefRaindance.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_nefRaindance.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neffloat1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neffloat1.glb index 7ff85a08..b2669278 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neffloat1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neffloat1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neffloat2.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neffloat2.glb index 9255f86d..8dbd8497 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neffloat2.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neffloat2.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neficeridge.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neficeridge.glb index 96514a10..984b6bae 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neficeridge.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_neficeridge.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_tokrz_scarabrae.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_tokrz_scarabrae.glb index ad1e23ed..cd284326 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_tokrz_scarabrae.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbase_tokrz_scarabrae.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nef_invbunk1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nef_invbunk1.glb index 503a0374..4d630a57 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nef_invbunk1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nef_invbunk1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefcliffside.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefcliffside.glb index 10b3bd54..5a5cfa8f 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefcliffside.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefcliffside.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefdcbunk.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefdcbunk.glb index f657101e..d64b571b 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefdcbunk.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefdcbunk.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefsmall.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefsmall.glb index 3c22459f..283f53e7 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefsmall.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_nefsmall.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_snowblind.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_snowblind.glb index f32cb2b8..a1f3add1 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_snowblind.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_snowblind.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_stonehenge1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_stonehenge1.glb index ee74dae8..e4ce25fb 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_stonehenge1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_stonehenge1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_vbunk1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_vbunk1.glb index 3084beba..c3e3fcd6 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_vbunk1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dbunk_vbunk1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefbridge.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefbridge.glb index a317a598..e28d199b 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefbridge.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefbridge.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand2.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand2.glb index 5aae578d..0326d452 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand2.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand2.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand3.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand3.glb index 17550e93..ce489538 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand3.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand3.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefobj1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefobj1.glb index 4a8362cb..0edc586f 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefobj1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefobj1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefobj2.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefobj2.glb index 0061a350..19173f66 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefobj2.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefobj2.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefplat1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefplat1.glb index 4f6d5651..adfd63f2 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefplat1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefplat1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefplug1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefplug1.glb index d94ef838..312e6217 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefplug1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefplug1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefrdbridge1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefrdbridge1.glb index 0908464f..81a06551 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefrdbridge1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_nefrdbridge1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower1.glb index d132ffa9..0f735c6e 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower2.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower2.glb index 4782caeb..3c6488e0 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower2.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower2.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower3.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower3.glb index b5be8c2a..fe0b820d 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower3.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_neftower3.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge1.glb index c8a26ee6..40041d66 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge2.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge2.glb index b36d318c..e1e4b066 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge2.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge2.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge3.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge3.glb index f83e796c..dde11e27 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge3.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dmisc_stonehenge3.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dtowr_classic1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dtowr_classic1.glb index 4856d6c9..7c5d31d4 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dtowr_classic1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/dtowr_classic1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/flagbridge.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/flagbridge.glb index 2dcb1f24..272833c4 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/flagbridge.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/flagbridge.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackairinv13.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackairinv13.glb index 5c82f9ce..bd8a09cb 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackairinv13.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackairinv13.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackbase5618_final.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackbase5618_final.glb index 322724fd..5842a759 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackbase5618_final.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackbase5618_final.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackturret8.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackturret8.glb index ddb599d7..4162aba2 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackturret8.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/infbutch_blackturret8.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbase_nef_giant.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbase_nef_giant.glb index d5dd1fa1..ba17b4cb 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbase_nef_giant.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbase_nef_giant.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbase_nef_vbase1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbase_nef_vbase1.glb index 27b7f8cf..d9bf258c 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbase_nef_vbase1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbase_nef_vbase1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbunk4a_CC.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbunk4a_CC.glb index 8f0cb63c..ab9297d4 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbunk4a_CC.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbunk4a_CC.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbunk7a_CC.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbunk7a_CC.glb index 479bbb6f..ae6ca1f3 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbunk7a_CC.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/pbunk7a_CC.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_base.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_base.glb index 20f7bb1a..5ad4fd5d 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_base.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_base.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_tower.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_tower.glb index 22f68531..b8acc8c9 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_tower.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_tower.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_wall4.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_wall4.glb index 6231fe2f..65464b7e 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_wall4.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ram_wall4.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker.glb index 643d2ba7..3081f121 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker2.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker2.glb index f2f29df6..6ef04e23 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker2.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker2.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_bridge1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_bridge1.glb index 524c9e34..9ff2e94e 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_bridge1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_bridge1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_mainbase.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_mainbase.glb index c3407715..274a5d6b 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_mainbase.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain2_mainbase.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain_turretbase1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain_turretbase1.glb index 7834d0d6..8015318f 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain_turretbase1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_domain_turretbase1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_bridge.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_bridge.glb index 24cfa80d..659ae86e 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_bridge.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_bridge.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_mainbase.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_mainbase.glb index 94470189..f135177d 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_mainbase.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_mainbase.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_platform1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_platform1.glb index 5024b2ee..eaba426a 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_platform1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_platform1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_towerbunker.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_towerbunker.glb index cb477aa1..5ddb51fd 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_towerbunker.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_towerbunker.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin1.glb index 3db01335..bd79c481 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin2.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin2.glb index 67e0d658..55aa2be1 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin2.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin2.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin3.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin3.glb index ef07ee07..e8f7ad0d 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin3.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin3.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin4.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin4.glb index c1a4fe2c..b04231c4 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin4.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruin4.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruinarch.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruinarch.glb index 4ce031a4..d8213741 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruinarch.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/ruinarch.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/sbunk_nef1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/sbunk_nef1.glb index 1fa6d861..f494fd2c 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/sbunk_nef1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/sbunk_nef1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/siege.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/siege.glb index 08c289d1..23c9ab7e 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/siege.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/siege.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/smisc_nef1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/smisc_nef1.glb index e502f0e6..e667c16d 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/smisc_nef1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/smisc_nef1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bbase_ccb2a.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bbase_ccb2a.glb index b4cfa59a..48828d9e 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bbase_ccb2a.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bbase_ccb2a.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bmisc_tunl_ccb1.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bmisc_tunl_ccb1.glb index 2f0a3d80..42d94226 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bmisc_tunl_ccb1.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bmisc_tunl_ccb1.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_cnr_CC.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_cnr_CC.glb index 6a49747c..f4f03f6a 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_cnr_CC.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_cnr_CC.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_lrg_CC.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_lrg_CC.glb index edb5221e..1e05739f 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_lrg_CC.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_lrg_CC.glb differ diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_sm_CC.glb b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_sm_CC.glb index a5805529..eef5651b 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_sm_CC.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/interiors/t_bwall2a_sm_CC.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/bmisc_-nef_flagstand1_x.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/bmisc_-nef_flagstand1_x.glb index 12c1a06d..73dfd832 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/bmisc_-nef_flagstand1_x.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/bmisc_-nef_flagstand1_x.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/bmisc_neftrstand1.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/bmisc_neftrstand1.glb index 9f88e24a..5a2c373e 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/bmisc_neftrstand1.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/bmisc_neftrstand1.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/cannon.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/cannon.glb index b4fc43fb..a5b85ff6 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/cannon.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/cannon.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/cannon2.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/cannon2.glb index 38ab186e..c5fe6984 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/cannon2.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/cannon2.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/cap.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/cap.glb index 9a49beae..957eee31 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/cap.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/cap.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/doubleramp2.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/doubleramp2.glb index dfbc5514..cb2bde50 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/doubleramp2.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/doubleramp2.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl1.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl1.glb index bb4477a3..3c0ec6bc 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl1.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl1.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl2.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl2.glb index 31408625..0daca551 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl2.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl2.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl3.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl3.glb index 41ce12e8..402c2a86 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl3.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_bowl3.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_ramp1.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_ramp1.glb index 57ffe659..a3ff918f 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_ramp1.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/nef_ramp1.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/rail1.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/rail1.glb index 01294f42..57d9d879 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/rail1.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/rail1.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/ramp1.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/ramp1.glb index ccfed108..8598785d 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/ramp1.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/ramp1.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/singleramp.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/singleramp.glb index 36d13417..6df35167 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/singleramp.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/singleramp.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/spawnbase.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/spawnbase.glb index ffb77c7e..8605b746 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/spawnbase.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/spawnbase.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/spawnbase2.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/spawnbase2.glb index 66f3926c..56d4031c 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/spawnbase2.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/spawnbase2.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/interiors/sphere.glb b/docs/base/@vl2/TR2final105-client.vl2/interiors/sphere.glb index d471b3c3..93eb4b8f 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/interiors/sphere.glb and b/docs/base/@vl2/TR2final105-client.vl2/interiors/sphere.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbase1.glb b/docs/base/@vl2/interiors.vl2/interiors/bbase1.glb index f49abf9a..0bf7613e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbase1.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbase1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbase4cm.glb b/docs/base/@vl2/interiors.vl2/interiors/bbase4cm.glb index d46d095a..f915dcbe 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbase4cm.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbase4cm.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbase6.glb b/docs/base/@vl2/interiors.vl2/interiors/bbase6.glb index f5b6d636..e06c87ee 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbase6.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbase6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbase7.glb b/docs/base/@vl2/interiors.vl2/interiors/bbase7.glb index b448998d..b23f8903 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbase7.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbase7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbase9.glb b/docs/base/@vl2/interiors.vl2/interiors/bbase9.glb index 467596d6..1b03bbeb 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbase9.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbase9.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdg0.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdg0.glb index c1d0f879..bd92d1b5 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdg0.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdg0.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdg1.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdg1.glb index 91a1c207..5ec781ed 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdg1.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdg1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdg2.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdg2.glb index bbe9b743..385148b4 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdg2.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdg2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdg3.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdg3.glb index 157be705..67374e36 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdg3.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdg3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdg4.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdg4.glb index 6b5566d3..03db386b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdg4.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdg4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdg5.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdg5.glb index eb61c4cf..ca1da78b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdg5.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdg5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdg6.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdg6.glb index 69e6c8db..117e1e1d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdg6.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdg6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdg7.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdg7.glb index 99028259..e8947866 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdg7.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdg7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdg8.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdg8.glb index b7b39daf..6d4dae1c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdg8.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdg8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdg9.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdg9.glb index 601b6e4e..9fbc4d45 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdg9.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdg9.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdga.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdga.glb index bef62ffe..2d1b76ff 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdga.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdga.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdgb.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdgb.glb index 6df012ef..aba34731 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdgb.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdgb.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdgn.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdgn.glb index ac58769d..314bf321 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdgn.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdgn.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbrdgo.glb b/docs/base/@vl2/interiors.vl2/interiors/bbrdgo.glb index bff2f0db..62220398 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbrdgo.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbrdgo.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbunk1.glb b/docs/base/@vl2/interiors.vl2/interiors/bbunk1.glb index 5fbe5f99..90abebc7 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbunk1.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbunk1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbunk2.glb b/docs/base/@vl2/interiors.vl2/interiors/bbunk2.glb index 6cbbb417..d8fb8664 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbunk2.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbunk2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbunk5.glb b/docs/base/@vl2/interiors.vl2/interiors/bbunk5.glb index 8881f0c8..a1b274c0 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbunk5.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbunk5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbunk7.glb b/docs/base/@vl2/interiors.vl2/interiors/bbunk7.glb index ef8e581d..50c4b884 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbunk7.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbunk7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbunk8.glb b/docs/base/@vl2/interiors.vl2/interiors/bbunk8.glb index dbd6984b..8913fda7 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbunk8.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbunk8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbunk9.glb b/docs/base/@vl2/interiors.vl2/interiors/bbunk9.glb index 9c1bd577..b9a3f259 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbunk9.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbunk9.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbunkb.glb b/docs/base/@vl2/interiors.vl2/interiors/bbunkb.glb index 894c6b11..1ec25f18 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbunkb.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbunkb.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbunkc.glb b/docs/base/@vl2/interiors.vl2/interiors/bbunkc.glb index e5a4218c..dd40e828 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbunkc.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbunkc.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bbunkd.glb b/docs/base/@vl2/interiors.vl2/interiors/bbunkd.glb index 586a5958..f9cb3b64 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bbunkd.glb and b/docs/base/@vl2/interiors.vl2/interiors/bbunkd.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bmisc1.glb b/docs/base/@vl2/interiors.vl2/interiors/bmisc1.glb index 414603cd..7c2f9b37 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bmisc1.glb and b/docs/base/@vl2/interiors.vl2/interiors/bmisc1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bmisc2.glb b/docs/base/@vl2/interiors.vl2/interiors/bmisc2.glb index 9f1a56e9..b9e23312 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bmisc2.glb and b/docs/base/@vl2/interiors.vl2/interiors/bmisc2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bmisc3.glb b/docs/base/@vl2/interiors.vl2/interiors/bmisc3.glb index 2a516a49..786c3e2e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bmisc3.glb and b/docs/base/@vl2/interiors.vl2/interiors/bmisc3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bmisc4.glb b/docs/base/@vl2/interiors.vl2/interiors/bmisc4.glb index a3060513..05ef1eda 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bmisc4.glb and b/docs/base/@vl2/interiors.vl2/interiors/bmisc4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bmisc5.glb b/docs/base/@vl2/interiors.vl2/interiors/bmisc5.glb index c05c3762..8d9f1182 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bmisc5.glb and b/docs/base/@vl2/interiors.vl2/interiors/bmisc5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bmisc6.glb b/docs/base/@vl2/interiors.vl2/interiors/bmisc6.glb index 8e84daed..34561c67 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bmisc6.glb and b/docs/base/@vl2/interiors.vl2/interiors/bmisc6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bmisc7.glb b/docs/base/@vl2/interiors.vl2/interiors/bmisc7.glb index cc4c32f3..67047d2b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bmisc7.glb and b/docs/base/@vl2/interiors.vl2/interiors/bmisc7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bmisc8.glb b/docs/base/@vl2/interiors.vl2/interiors/bmisc8.glb index 4b653dd4..2c562645 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bmisc8.glb and b/docs/base/@vl2/interiors.vl2/interiors/bmisc8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bmisc9.glb b/docs/base/@vl2/interiors.vl2/interiors/bmisc9.glb index 0970e661..5f82b6b5 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bmisc9.glb and b/docs/base/@vl2/interiors.vl2/interiors/bmisc9.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bplat1.glb b/docs/base/@vl2/interiors.vl2/interiors/bplat1.glb index 8491b547..8ef8ff0d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bplat1.glb and b/docs/base/@vl2/interiors.vl2/interiors/bplat1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bplat2.glb b/docs/base/@vl2/interiors.vl2/interiors/bplat2.glb index edb72600..c631c35a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bplat2.glb and b/docs/base/@vl2/interiors.vl2/interiors/bplat2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bplat3.glb b/docs/base/@vl2/interiors.vl2/interiors/bplat3.glb index f41a4b15..405cb325 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bplat3.glb and b/docs/base/@vl2/interiors.vl2/interiors/bplat3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bplat4.glb b/docs/base/@vl2/interiors.vl2/interiors/bplat4.glb index 458e5394..d9042c86 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bplat4.glb and b/docs/base/@vl2/interiors.vl2/interiors/bplat4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bplat6.glb b/docs/base/@vl2/interiors.vl2/interiors/bplat6.glb index 77d774fb..16c16d2c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bplat6.glb and b/docs/base/@vl2/interiors.vl2/interiors/bplat6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bpower1.glb b/docs/base/@vl2/interiors.vl2/interiors/bpower1.glb index 018ce348..26937cf9 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bpower1.glb and b/docs/base/@vl2/interiors.vl2/interiors/bpower1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/brock6.glb b/docs/base/@vl2/interiors.vl2/interiors/brock6.glb index 7f62f90f..0f3a2983 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/brock6.glb and b/docs/base/@vl2/interiors.vl2/interiors/brock6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/brock7.glb b/docs/base/@vl2/interiors.vl2/interiors/brock7.glb index 37f25f0e..c85d0e1e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/brock7.glb and b/docs/base/@vl2/interiors.vl2/interiors/brock7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/brock8.glb b/docs/base/@vl2/interiors.vl2/interiors/brock8.glb index 6f343f8c..ecccf4a4 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/brock8.glb and b/docs/base/@vl2/interiors.vl2/interiors/brock8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/brocka.glb b/docs/base/@vl2/interiors.vl2/interiors/brocka.glb index 8db74ed6..c9cfff03 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/brocka.glb and b/docs/base/@vl2/interiors.vl2/interiors/brocka.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/brockc.glb b/docs/base/@vl2/interiors.vl2/interiors/brockc.glb index 7f70db32..371ff416 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/brockc.glb and b/docs/base/@vl2/interiors.vl2/interiors/brockc.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bspir1.glb b/docs/base/@vl2/interiors.vl2/interiors/bspir1.glb index 87e1cb67..65d06e1d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bspir1.glb and b/docs/base/@vl2/interiors.vl2/interiors/bspir1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bspir2.glb b/docs/base/@vl2/interiors.vl2/interiors/bspir2.glb index dbd42215..6c61c3c1 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bspir2.glb and b/docs/base/@vl2/interiors.vl2/interiors/bspir2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bspir3.glb b/docs/base/@vl2/interiors.vl2/interiors/bspir3.glb index b246d0b5..a19de9db 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bspir3.glb and b/docs/base/@vl2/interiors.vl2/interiors/bspir3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bspir4.glb b/docs/base/@vl2/interiors.vl2/interiors/bspir4.glb index 2d6f89ff..335ab729 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bspir4.glb and b/docs/base/@vl2/interiors.vl2/interiors/bspir4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bspir5.glb b/docs/base/@vl2/interiors.vl2/interiors/bspir5.glb index 111a69e9..3ede518e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bspir5.glb and b/docs/base/@vl2/interiors.vl2/interiors/bspir5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/btowr2.glb b/docs/base/@vl2/interiors.vl2/interiors/btowr2.glb index 2aa3b0c5..e7c6aba1 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/btowr2.glb and b/docs/base/@vl2/interiors.vl2/interiors/btowr2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/btowr5.glb b/docs/base/@vl2/interiors.vl2/interiors/btowr5.glb index daf86806..72261874 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/btowr5.glb and b/docs/base/@vl2/interiors.vl2/interiors/btowr5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/btowr6.glb b/docs/base/@vl2/interiors.vl2/interiors/btowr6.glb index 7b548e54..f2ce5e8c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/btowr6.glb and b/docs/base/@vl2/interiors.vl2/interiors/btowr6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/btowr8.glb b/docs/base/@vl2/interiors.vl2/interiors/btowr8.glb index 32f88cec..b7fbbfa4 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/btowr8.glb and b/docs/base/@vl2/interiors.vl2/interiors/btowr8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/btowra.glb b/docs/base/@vl2/interiors.vl2/interiors/btowra.glb index ac5eb076..ba50b1a1 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/btowra.glb and b/docs/base/@vl2/interiors.vl2/interiors/btowra.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bvpad.glb b/docs/base/@vl2/interiors.vl2/interiors/bvpad.glb index 7e7be05f..15c2fbb7 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bvpad.glb and b/docs/base/@vl2/interiors.vl2/interiors/bvpad.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bwall1.glb b/docs/base/@vl2/interiors.vl2/interiors/bwall1.glb index aca0aa06..37eca1ee 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bwall1.glb and b/docs/base/@vl2/interiors.vl2/interiors/bwall1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bwall2.glb b/docs/base/@vl2/interiors.vl2/interiors/bwall2.glb index 6748c7a9..66044ccb 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bwall2.glb and b/docs/base/@vl2/interiors.vl2/interiors/bwall2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bwall3.glb b/docs/base/@vl2/interiors.vl2/interiors/bwall3.glb index fc07744f..207fe178 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bwall3.glb and b/docs/base/@vl2/interiors.vl2/interiors/bwall3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/bwall4.glb b/docs/base/@vl2/interiors.vl2/interiors/bwall4.glb index 737bf270..940d349a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/bwall4.glb and b/docs/base/@vl2/interiors.vl2/interiors/bwall4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbase2.glb b/docs/base/@vl2/interiors.vl2/interiors/dbase2.glb index 8aa3c09b..2491a214 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbase2.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbase2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbase3.glb b/docs/base/@vl2/interiors.vl2/interiors/dbase3.glb index 300db440..803efaae 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbase3.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbase3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbase4.glb b/docs/base/@vl2/interiors.vl2/interiors/dbase4.glb index 2d17539e..6cbc01df 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbase4.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbase4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg1.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg1.glb index 29f2baee..30770b15 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg1.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg10.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg10.glb index bf7f3b27..3d8da89a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg10.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg10.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg11.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg11.glb index e83d85ed..5e3b491e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg11.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg11.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg2.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg2.glb index bd670bcb..92099860 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg2.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg3.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg3.glb index f63f9391..98a0fbaf 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg3.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg3a.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg3a.glb index 683fe897..bcb161a9 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg3a.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg3a.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg4.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg4.glb index df030e33..19ac563a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg4.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg5.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg5.glb index 70cf8d53..d2cd58f0 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg5.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg6.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg6.glb index 0ec78af5..5b84b3c7 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg6.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg7.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg7.glb index d035c2fc..ea31631a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg7.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg7a.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg7a.glb index e41c0a18..5924f0b9 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg7a.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg7a.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg8.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg8.glb index 12ae4a6f..c7e99fed 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg8.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg9.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg9.glb index e8e8a425..cd6a1c2c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg9.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg9.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbrdg9a.glb b/docs/base/@vl2/interiors.vl2/interiors/dbrdg9a.glb index 2098fedd..2405aa2b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbrdg9a.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbrdg9a.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbunk5.glb b/docs/base/@vl2/interiors.vl2/interiors/dbunk5.glb index f9bc1e37..3a9768a9 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbunk5.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbunk5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dbunk6.glb b/docs/base/@vl2/interiors.vl2/interiors/dbunk6.glb index cdfd22d5..f0641d90 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dbunk6.glb and b/docs/base/@vl2/interiors.vl2/interiors/dbunk6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dmisc1.glb b/docs/base/@vl2/interiors.vl2/interiors/dmisc1.glb index cb6299a4..e590c379 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dmisc1.glb and b/docs/base/@vl2/interiors.vl2/interiors/dmisc1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dplat1.glb b/docs/base/@vl2/interiors.vl2/interiors/dplat1.glb index c350282b..57cafbe9 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dplat1.glb and b/docs/base/@vl2/interiors.vl2/interiors/dplat1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dplat2.glb b/docs/base/@vl2/interiors.vl2/interiors/dplat2.glb index feafcabb..6da16473 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dplat2.glb and b/docs/base/@vl2/interiors.vl2/interiors/dplat2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dplat3.glb b/docs/base/@vl2/interiors.vl2/interiors/dplat3.glb index e09c3cd7..3280954a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dplat3.glb and b/docs/base/@vl2/interiors.vl2/interiors/dplat3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dpole1.glb b/docs/base/@vl2/interiors.vl2/interiors/dpole1.glb index 36c7ee5a..3acd7a9e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dpole1.glb and b/docs/base/@vl2/interiors.vl2/interiors/dpole1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/drock6.glb b/docs/base/@vl2/interiors.vl2/interiors/drock6.glb index c97dc7df..6fd5ad97 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/drock6.glb and b/docs/base/@vl2/interiors.vl2/interiors/drock6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/drock7.glb b/docs/base/@vl2/interiors.vl2/interiors/drock7.glb index fe271bb3..61fc0640 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/drock7.glb and b/docs/base/@vl2/interiors.vl2/interiors/drock7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/drock8.glb b/docs/base/@vl2/interiors.vl2/interiors/drock8.glb index 1cd5f701..195c606c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/drock8.glb and b/docs/base/@vl2/interiors.vl2/interiors/drock8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/drocka.glb b/docs/base/@vl2/interiors.vl2/interiors/drocka.glb index c170d029..595ffcac 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/drocka.glb and b/docs/base/@vl2/interiors.vl2/interiors/drocka.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dspir1.glb b/docs/base/@vl2/interiors.vl2/interiors/dspir1.glb index dc79d1db..9fd37af8 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dspir1.glb and b/docs/base/@vl2/interiors.vl2/interiors/dspir1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dspir2.glb b/docs/base/@vl2/interiors.vl2/interiors/dspir2.glb index 6488be17..321e2cd5 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dspir2.glb and b/docs/base/@vl2/interiors.vl2/interiors/dspir2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dspir3.glb b/docs/base/@vl2/interiors.vl2/interiors/dspir3.glb index 30eb24d2..83c485af 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dspir3.glb and b/docs/base/@vl2/interiors.vl2/interiors/dspir3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dspir4.glb b/docs/base/@vl2/interiors.vl2/interiors/dspir4.glb index 4a146aab..3c81097f 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dspir4.glb and b/docs/base/@vl2/interiors.vl2/interiors/dspir4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dspir5.glb b/docs/base/@vl2/interiors.vl2/interiors/dspir5.glb index 78543c93..12f19038 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dspir5.glb and b/docs/base/@vl2/interiors.vl2/interiors/dspir5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dtowr1.glb b/docs/base/@vl2/interiors.vl2/interiors/dtowr1.glb index 5823aca1..a56d4f2c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dtowr1.glb and b/docs/base/@vl2/interiors.vl2/interiors/dtowr1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dtowr2.glb b/docs/base/@vl2/interiors.vl2/interiors/dtowr2.glb index d5e4eb8e..4683cfab 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dtowr2.glb and b/docs/base/@vl2/interiors.vl2/interiors/dtowr2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dtowr4.glb b/docs/base/@vl2/interiors.vl2/interiors/dtowr4.glb index f010b7c7..5950891b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dtowr4.glb and b/docs/base/@vl2/interiors.vl2/interiors/dtowr4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dvent.glb b/docs/base/@vl2/interiors.vl2/interiors/dvent.glb index 058cb181..b107ba2d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dvent.glb and b/docs/base/@vl2/interiors.vl2/interiors/dvent.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dvpad.glb b/docs/base/@vl2/interiors.vl2/interiors/dvpad.glb index daacbac0..d074c5ce 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dvpad.glb and b/docs/base/@vl2/interiors.vl2/interiors/dvpad.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dvpad1.glb b/docs/base/@vl2/interiors.vl2/interiors/dvpad1.glb index 01ed8c5c..782133cb 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dvpad1.glb and b/docs/base/@vl2/interiors.vl2/interiors/dvpad1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/dwall1.glb b/docs/base/@vl2/interiors.vl2/interiors/dwall1.glb index a2ecd9da..27387674 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/dwall1.glb and b/docs/base/@vl2/interiors.vl2/interiors/dwall1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbase3.glb b/docs/base/@vl2/interiors.vl2/interiors/pbase3.glb index 3c174e04..87b58da5 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbase3.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbase3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbrdg0.glb b/docs/base/@vl2/interiors.vl2/interiors/pbrdg0.glb index d9457619..8cce4121 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbrdg0.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbrdg0.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbrdg1.glb b/docs/base/@vl2/interiors.vl2/interiors/pbrdg1.glb index 3115bfcc..560b8a43 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbrdg1.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbrdg1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbrdg2.glb b/docs/base/@vl2/interiors.vl2/interiors/pbrdg2.glb index 9344fbde..ee47d468 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbrdg2.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbrdg2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbrdg3.glb b/docs/base/@vl2/interiors.vl2/interiors/pbrdg3.glb index af49376e..aa50ec84 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbrdg3.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbrdg3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbrdg4.glb b/docs/base/@vl2/interiors.vl2/interiors/pbrdg4.glb index 21d0763c..31095984 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbrdg4.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbrdg4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbrdgn.glb b/docs/base/@vl2/interiors.vl2/interiors/pbrdgn.glb index 35c3705a..90c8bbd8 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbrdgn.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbrdgn.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbrdgo.glb b/docs/base/@vl2/interiors.vl2/interiors/pbrdgo.glb index 3b58b1ec..978cb7b4 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbrdgo.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbrdgo.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbrdgp.glb b/docs/base/@vl2/interiors.vl2/interiors/pbrdgp.glb index 5af07525..13f6afea 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbrdgp.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbrdgp.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbunk1.glb b/docs/base/@vl2/interiors.vl2/interiors/pbunk1.glb index bbcf1b13..920542fb 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbunk1.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbunk1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbunk2.glb b/docs/base/@vl2/interiors.vl2/interiors/pbunk2.glb index 8bc40c4f..c2d22d8d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbunk2.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbunk2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbunk3.glb b/docs/base/@vl2/interiors.vl2/interiors/pbunk3.glb index 4929cdfc..88b5ceda 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbunk3.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbunk3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbunk5.glb b/docs/base/@vl2/interiors.vl2/interiors/pbunk5.glb index 9a5c691e..ded99cec 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbunk5.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbunk5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbunk6.glb b/docs/base/@vl2/interiors.vl2/interiors/pbunk6.glb index e39bfb47..f2bf748b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbunk6.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbunk6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbunk7.glb b/docs/base/@vl2/interiors.vl2/interiors/pbunk7.glb index 686cc787..435cc72d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbunk7.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbunk7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pbunk8.glb b/docs/base/@vl2/interiors.vl2/interiors/pbunk8.glb index 20cb1fa0..3bdb0cae 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pbunk8.glb and b/docs/base/@vl2/interiors.vl2/interiors/pbunk8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pmisc1.glb b/docs/base/@vl2/interiors.vl2/interiors/pmisc1.glb index eb1f28da..6c6173f3 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pmisc1.glb and b/docs/base/@vl2/interiors.vl2/interiors/pmisc1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pmisc2.glb b/docs/base/@vl2/interiors.vl2/interiors/pmisc2.glb index be879457..a8ade893 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pmisc2.glb and b/docs/base/@vl2/interiors.vl2/interiors/pmisc2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pmisc3.glb b/docs/base/@vl2/interiors.vl2/interiors/pmisc3.glb index 5363efff..04fc3e7b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pmisc3.glb and b/docs/base/@vl2/interiors.vl2/interiors/pmisc3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pmisc4.glb b/docs/base/@vl2/interiors.vl2/interiors/pmisc4.glb index d0805dcc..2724e47b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pmisc4.glb and b/docs/base/@vl2/interiors.vl2/interiors/pmisc4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pmisc5.glb b/docs/base/@vl2/interiors.vl2/interiors/pmisc5.glb index 3f6bd440..6823c7c1 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pmisc5.glb and b/docs/base/@vl2/interiors.vl2/interiors/pmisc5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pmisca.glb b/docs/base/@vl2/interiors.vl2/interiors/pmisca.glb index db8079be..bc27747a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pmisca.glb and b/docs/base/@vl2/interiors.vl2/interiors/pmisca.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pmiscb.glb b/docs/base/@vl2/interiors.vl2/interiors/pmiscb.glb index 78df9147..fb42460e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pmiscb.glb and b/docs/base/@vl2/interiors.vl2/interiors/pmiscb.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pmiscc.glb b/docs/base/@vl2/interiors.vl2/interiors/pmiscc.glb index 25637bdc..ae18b191 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pmiscc.glb and b/docs/base/@vl2/interiors.vl2/interiors/pmiscc.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pplat1.glb b/docs/base/@vl2/interiors.vl2/interiors/pplat1.glb index 62342bf7..be9bef4a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pplat1.glb and b/docs/base/@vl2/interiors.vl2/interiors/pplat1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pplat2.glb b/docs/base/@vl2/interiors.vl2/interiors/pplat2.glb index 34f306d4..a50eef97 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pplat2.glb and b/docs/base/@vl2/interiors.vl2/interiors/pplat2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pplat3.glb b/docs/base/@vl2/interiors.vl2/interiors/pplat3.glb index fb87851b..9f6d5927 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pplat3.glb and b/docs/base/@vl2/interiors.vl2/interiors/pplat3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pplat4.glb b/docs/base/@vl2/interiors.vl2/interiors/pplat4.glb index c8853c7f..02088454 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pplat4.glb and b/docs/base/@vl2/interiors.vl2/interiors/pplat4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pplat5.glb b/docs/base/@vl2/interiors.vl2/interiors/pplat5.glb index befb7aba..9cab59cc 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pplat5.glb and b/docs/base/@vl2/interiors.vl2/interiors/pplat5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/prock6.glb b/docs/base/@vl2/interiors.vl2/interiors/prock6.glb index 3edaaf8a..d3b80bd8 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/prock6.glb and b/docs/base/@vl2/interiors.vl2/interiors/prock6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/prock7.glb b/docs/base/@vl2/interiors.vl2/interiors/prock7.glb index 0a8de7d3..73dc511e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/prock7.glb and b/docs/base/@vl2/interiors.vl2/interiors/prock7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/prock8.glb b/docs/base/@vl2/interiors.vl2/interiors/prock8.glb index 9c840ba7..64f09c45 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/prock8.glb and b/docs/base/@vl2/interiors.vl2/interiors/prock8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/procka.glb b/docs/base/@vl2/interiors.vl2/interiors/procka.glb index e43a1221..d96a4e89 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/procka.glb and b/docs/base/@vl2/interiors.vl2/interiors/procka.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/prockb.glb b/docs/base/@vl2/interiors.vl2/interiors/prockb.glb index 76268304..e3037561 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/prockb.glb and b/docs/base/@vl2/interiors.vl2/interiors/prockb.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/prockc.glb b/docs/base/@vl2/interiors.vl2/interiors/prockc.glb index b4d6db61..d67b7624 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/prockc.glb and b/docs/base/@vl2/interiors.vl2/interiors/prockc.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pspir1.glb b/docs/base/@vl2/interiors.vl2/interiors/pspir1.glb index db074019..37d890a3 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pspir1.glb and b/docs/base/@vl2/interiors.vl2/interiors/pspir1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pspir2.glb b/docs/base/@vl2/interiors.vl2/interiors/pspir2.glb index bf24cd67..25085fe0 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pspir2.glb and b/docs/base/@vl2/interiors.vl2/interiors/pspir2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pspir3.glb b/docs/base/@vl2/interiors.vl2/interiors/pspir3.glb index d678936d..7056c751 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pspir3.glb and b/docs/base/@vl2/interiors.vl2/interiors/pspir3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pspir4.glb b/docs/base/@vl2/interiors.vl2/interiors/pspir4.glb index d9fb9583..9596cf50 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pspir4.glb and b/docs/base/@vl2/interiors.vl2/interiors/pspir4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pspir5.glb b/docs/base/@vl2/interiors.vl2/interiors/pspir5.glb index 4f8e6446..1137b469 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pspir5.glb and b/docs/base/@vl2/interiors.vl2/interiors/pspir5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/ptowr1.glb b/docs/base/@vl2/interiors.vl2/interiors/ptowr1.glb index a24925c7..71e021a4 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/ptowr1.glb and b/docs/base/@vl2/interiors.vl2/interiors/ptowr1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/ptowr2.glb b/docs/base/@vl2/interiors.vl2/interiors/ptowr2.glb index 3d7950ef..c2958251 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/ptowr2.glb and b/docs/base/@vl2/interiors.vl2/interiors/ptowr2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/ptowr4.glb b/docs/base/@vl2/interiors.vl2/interiors/ptowr4.glb index 329e039d..203de8f6 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/ptowr4.glb and b/docs/base/@vl2/interiors.vl2/interiors/ptowr4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/ptowr5.glb b/docs/base/@vl2/interiors.vl2/interiors/ptowr5.glb index 60099fcd..2af4a75c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/ptowr5.glb and b/docs/base/@vl2/interiors.vl2/interiors/ptowr5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/ptowr7.glb b/docs/base/@vl2/interiors.vl2/interiors/ptowr7.glb index 163fff54..66d52fdb 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/ptowr7.glb and b/docs/base/@vl2/interiors.vl2/interiors/ptowr7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pvbay1.glb b/docs/base/@vl2/interiors.vl2/interiors/pvbay1.glb index 66028ef9..33f51f9e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pvbay1.glb and b/docs/base/@vl2/interiors.vl2/interiors/pvbay1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pvpad.glb b/docs/base/@vl2/interiors.vl2/interiors/pvpad.glb index d0b9ad94..e21399c3 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pvpad.glb and b/docs/base/@vl2/interiors.vl2/interiors/pvpad.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/pwall1.glb b/docs/base/@vl2/interiors.vl2/interiors/pwall1.glb index 57a2adf7..5794b653 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/pwall1.glb and b/docs/base/@vl2/interiors.vl2/interiors/pwall1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbase1.glb b/docs/base/@vl2/interiors.vl2/interiors/sbase1.glb index 3dd8f344..89425f70 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbase1.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbase1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbase3.glb b/docs/base/@vl2/interiors.vl2/interiors/sbase3.glb index aeaa0164..da7d28d8 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbase3.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbase3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbase5.glb b/docs/base/@vl2/interiors.vl2/interiors/sbase5.glb index 853b2c13..1f50c7cf 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbase5.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbase5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbrdg1.glb b/docs/base/@vl2/interiors.vl2/interiors/sbrdg1.glb index 2e7485df..ca74074a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbrdg1.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbrdg1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbrdg2.glb b/docs/base/@vl2/interiors.vl2/interiors/sbrdg2.glb index bf8ab995..057d5d59 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbrdg2.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbrdg2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbrdg3.glb b/docs/base/@vl2/interiors.vl2/interiors/sbrdg3.glb index ee4e330e..2d4f454a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbrdg3.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbrdg3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbrdg4.glb b/docs/base/@vl2/interiors.vl2/interiors/sbrdg4.glb index 25937935..59fff0cb 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbrdg4.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbrdg4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbrdg5.glb b/docs/base/@vl2/interiors.vl2/interiors/sbrdg5.glb index c621e44c..e16ee772 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbrdg5.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbrdg5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbrdg6.glb b/docs/base/@vl2/interiors.vl2/interiors/sbrdg6.glb index c29e7223..06d4462c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbrdg6.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbrdg6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbrdg7.glb b/docs/base/@vl2/interiors.vl2/interiors/sbrdg7.glb index a3bf7ec1..6ad815cd 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbrdg7.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbrdg7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbrdgn.glb b/docs/base/@vl2/interiors.vl2/interiors/sbrdgn.glb index f3119ed9..1a8a1db6 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbrdgn.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbrdgn.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbrdgo.glb b/docs/base/@vl2/interiors.vl2/interiors/sbrdgo.glb index c02236fc..77e6c330 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbrdgo.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbrdgo.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbunk2.glb b/docs/base/@vl2/interiors.vl2/interiors/sbunk2.glb index ef0bced9..3278c6ef 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbunk2.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbunk2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sbunk9.glb b/docs/base/@vl2/interiors.vl2/interiors/sbunk9.glb index 562ce368..5bec6476 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sbunk9.glb and b/docs/base/@vl2/interiors.vl2/interiors/sbunk9.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/smisc1.glb b/docs/base/@vl2/interiors.vl2/interiors/smisc1.glb index d72566f2..42984d6b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/smisc1.glb and b/docs/base/@vl2/interiors.vl2/interiors/smisc1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/smisc3.glb b/docs/base/@vl2/interiors.vl2/interiors/smisc3.glb index 969da939..3c7e687a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/smisc3.glb and b/docs/base/@vl2/interiors.vl2/interiors/smisc3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/smisc4.glb b/docs/base/@vl2/interiors.vl2/interiors/smisc4.glb index 07383656..6b7ae61a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/smisc4.glb and b/docs/base/@vl2/interiors.vl2/interiors/smisc4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/smisc5.glb b/docs/base/@vl2/interiors.vl2/interiors/smisc5.glb index 8c808025..d199a908 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/smisc5.glb and b/docs/base/@vl2/interiors.vl2/interiors/smisc5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/smisca.glb b/docs/base/@vl2/interiors.vl2/interiors/smisca.glb index 453227c6..ca1f8205 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/smisca.glb and b/docs/base/@vl2/interiors.vl2/interiors/smisca.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/smiscb.glb b/docs/base/@vl2/interiors.vl2/interiors/smiscb.glb index f4c0e6f9..11c6ea0d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/smiscb.glb and b/docs/base/@vl2/interiors.vl2/interiors/smiscb.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/smiscc.glb b/docs/base/@vl2/interiors.vl2/interiors/smiscc.glb index fa389bcd..659d4e51 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/smiscc.glb and b/docs/base/@vl2/interiors.vl2/interiors/smiscc.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/splat1.glb b/docs/base/@vl2/interiors.vl2/interiors/splat1.glb index 54d3ee5d..ad0a893e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/splat1.glb and b/docs/base/@vl2/interiors.vl2/interiors/splat1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/splat3.glb b/docs/base/@vl2/interiors.vl2/interiors/splat3.glb index 6dccb22c..c8b19e27 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/splat3.glb and b/docs/base/@vl2/interiors.vl2/interiors/splat3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/splat7.glb b/docs/base/@vl2/interiors.vl2/interiors/splat7.glb index eb5c9c12..e233e974 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/splat7.glb and b/docs/base/@vl2/interiors.vl2/interiors/splat7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/srock6.glb b/docs/base/@vl2/interiors.vl2/interiors/srock6.glb index dd829d02..0da8d8e0 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/srock6.glb and b/docs/base/@vl2/interiors.vl2/interiors/srock6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/srock7.glb b/docs/base/@vl2/interiors.vl2/interiors/srock7.glb index 15e7efb8..50166fee 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/srock7.glb and b/docs/base/@vl2/interiors.vl2/interiors/srock7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/srock8.glb b/docs/base/@vl2/interiors.vl2/interiors/srock8.glb index e904ae21..029085ee 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/srock8.glb and b/docs/base/@vl2/interiors.vl2/interiors/srock8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/srocka.glb b/docs/base/@vl2/interiors.vl2/interiors/srocka.glb index 332a1552..2508703f 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/srocka.glb and b/docs/base/@vl2/interiors.vl2/interiors/srocka.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/srockb.glb b/docs/base/@vl2/interiors.vl2/interiors/srockb.glb index ce3916a7..7d7e3cec 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/srockb.glb and b/docs/base/@vl2/interiors.vl2/interiors/srockb.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/srockc.glb b/docs/base/@vl2/interiors.vl2/interiors/srockc.glb index a98209cc..5e3dc54c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/srockc.glb and b/docs/base/@vl2/interiors.vl2/interiors/srockc.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sspir1.glb b/docs/base/@vl2/interiors.vl2/interiors/sspir1.glb index d455e86f..3c1f80de 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sspir1.glb and b/docs/base/@vl2/interiors.vl2/interiors/sspir1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sspir2.glb b/docs/base/@vl2/interiors.vl2/interiors/sspir2.glb index 415f5318..d6038386 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sspir2.glb and b/docs/base/@vl2/interiors.vl2/interiors/sspir2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sspir3.glb b/docs/base/@vl2/interiors.vl2/interiors/sspir3.glb index e5f904aa..dbd76f42 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sspir3.glb and b/docs/base/@vl2/interiors.vl2/interiors/sspir3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/sspir4.glb b/docs/base/@vl2/interiors.vl2/interiors/sspir4.glb index 7b523d6a..f95901d3 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/sspir4.glb and b/docs/base/@vl2/interiors.vl2/interiors/sspir4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/stowr1.glb b/docs/base/@vl2/interiors.vl2/interiors/stowr1.glb index 5aa6d541..390fb56d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/stowr1.glb and b/docs/base/@vl2/interiors.vl2/interiors/stowr1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/stowr3.glb b/docs/base/@vl2/interiors.vl2/interiors/stowr3.glb index a757d904..8b2d99d4 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/stowr3.glb and b/docs/base/@vl2/interiors.vl2/interiors/stowr3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/stowr4.glb b/docs/base/@vl2/interiors.vl2/interiors/stowr4.glb index 39080759..1c0df8e4 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/stowr4.glb and b/docs/base/@vl2/interiors.vl2/interiors/stowr4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/stowr6.glb b/docs/base/@vl2/interiors.vl2/interiors/stowr6.glb index e3a0cf00..0d676980 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/stowr6.glb and b/docs/base/@vl2/interiors.vl2/interiors/stowr6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/svpad.glb b/docs/base/@vl2/interiors.vl2/interiors/svpad.glb index 8b6c61b3..f4255fad 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/svpad.glb and b/docs/base/@vl2/interiors.vl2/interiors/svpad.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/swall1.glb b/docs/base/@vl2/interiors.vl2/interiors/swall1.glb index 48b12add..87e1bfa5 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/swall1.glb and b/docs/base/@vl2/interiors.vl2/interiors/swall1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbase1.glb b/docs/base/@vl2/interiors.vl2/interiors/xbase1.glb index cd8cc297..718202e9 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbase1.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbase1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbase2.glb b/docs/base/@vl2/interiors.vl2/interiors/xbase2.glb index 7b4f2d73..1ae74037 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbase2.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbase2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg0.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg0.glb index 40363242..8ba9efc8 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg0.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg0.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg1.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg1.glb index d518107f..da6ba43a 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg1.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg10.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg10.glb index fd96cbc1..47368bd9 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg10.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg10.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg2.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg2.glb index 7a88f714..fc100b4f 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg2.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg3.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg3.glb index dc814943..2a323e35 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg3.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg4.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg4.glb index eb9ed72a..f1c28bec 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg4.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg5.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg5.glb index 82313e49..26b7acfa 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg5.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg6.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg6.glb index de80e57c..59565b80 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg6.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg7.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg7.glb index e7892eaf..0ab56ea8 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg7.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg8.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg8.glb index e63bc93e..ce01081d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg8.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdg9.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdg9.glb index f0fd8bdb..329baf03 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdg9.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdg9.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdga.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdga.glb index d8407509..42e0cb1f 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdga.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdga.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdgb.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdgb.glb index 371f272a..f8e28427 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdgb.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdgb.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdgn.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdgn.glb index 7a6848d8..237753b5 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdgn.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdgn.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbrdgo.glb b/docs/base/@vl2/interiors.vl2/interiors/xbrdgo.glb index 6bdf23fe..a55482c3 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbrdgo.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbrdgo.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbunk1.glb b/docs/base/@vl2/interiors.vl2/interiors/xbunk1.glb index a22a868d..911853d4 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbunk1.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbunk1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbunk5.glb b/docs/base/@vl2/interiors.vl2/interiors/xbunk5.glb index 830fc009..c8f4f7d3 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbunk5.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbunk5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbunk6.glb b/docs/base/@vl2/interiors.vl2/interiors/xbunk6.glb index 3efa9fcc..9e608905 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbunk6.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbunk6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbunk9.glb b/docs/base/@vl2/interiors.vl2/interiors/xbunk9.glb index 10d4be86..582195ac 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbunk9.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbunk9.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xbunkb.glb b/docs/base/@vl2/interiors.vl2/interiors/xbunkb.glb index 8d4b71e5..4efe4431 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xbunkb.glb and b/docs/base/@vl2/interiors.vl2/interiors/xbunkb.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xmisc1.glb b/docs/base/@vl2/interiors.vl2/interiors/xmisc1.glb index 8cc34857..419681c7 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xmisc1.glb and b/docs/base/@vl2/interiors.vl2/interiors/xmisc1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xmisc2.glb b/docs/base/@vl2/interiors.vl2/interiors/xmisc2.glb index c4eed50c..4364723c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xmisc2.glb and b/docs/base/@vl2/interiors.vl2/interiors/xmisc2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xmisc3.glb b/docs/base/@vl2/interiors.vl2/interiors/xmisc3.glb index 3a940415..15a8d08c 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xmisc3.glb and b/docs/base/@vl2/interiors.vl2/interiors/xmisc3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xmisc4.glb b/docs/base/@vl2/interiors.vl2/interiors/xmisc4.glb index 8dbc113b..61385f5b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xmisc4.glb and b/docs/base/@vl2/interiors.vl2/interiors/xmisc4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xmisc5.glb b/docs/base/@vl2/interiors.vl2/interiors/xmisc5.glb index d9e1061a..f9e5213b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xmisc5.glb and b/docs/base/@vl2/interiors.vl2/interiors/xmisc5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xmisca.glb b/docs/base/@vl2/interiors.vl2/interiors/xmisca.glb index 86dceb42..e788e986 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xmisca.glb and b/docs/base/@vl2/interiors.vl2/interiors/xmisca.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xmiscb.glb b/docs/base/@vl2/interiors.vl2/interiors/xmiscb.glb index 047dd0c0..528614aa 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xmiscb.glb and b/docs/base/@vl2/interiors.vl2/interiors/xmiscb.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xmiscc.glb b/docs/base/@vl2/interiors.vl2/interiors/xmiscc.glb index a4653fde..fd06f843 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xmiscc.glb and b/docs/base/@vl2/interiors.vl2/interiors/xmiscc.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xplat1.glb b/docs/base/@vl2/interiors.vl2/interiors/xplat1.glb index 45b1ff08..adb8110d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xplat1.glb and b/docs/base/@vl2/interiors.vl2/interiors/xplat1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xplat2.glb b/docs/base/@vl2/interiors.vl2/interiors/xplat2.glb index d6952dc0..bcac3b00 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xplat2.glb and b/docs/base/@vl2/interiors.vl2/interiors/xplat2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xplat3.glb b/docs/base/@vl2/interiors.vl2/interiors/xplat3.glb index 55613e8b..dcb7ccd5 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xplat3.glb and b/docs/base/@vl2/interiors.vl2/interiors/xplat3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xrock6.glb b/docs/base/@vl2/interiors.vl2/interiors/xrock6.glb index 01ee083d..0284124e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xrock6.glb and b/docs/base/@vl2/interiors.vl2/interiors/xrock6.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xrock7.glb b/docs/base/@vl2/interiors.vl2/interiors/xrock7.glb index e7ec6172..b72026ed 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xrock7.glb and b/docs/base/@vl2/interiors.vl2/interiors/xrock7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xrock8.glb b/docs/base/@vl2/interiors.vl2/interiors/xrock8.glb index 8ae6e69c..b926cb48 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xrock8.glb and b/docs/base/@vl2/interiors.vl2/interiors/xrock8.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xrocka.glb b/docs/base/@vl2/interiors.vl2/interiors/xrocka.glb index c0d40203..fc40eb67 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xrocka.glb and b/docs/base/@vl2/interiors.vl2/interiors/xrocka.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xrockb.glb b/docs/base/@vl2/interiors.vl2/interiors/xrockb.glb index 3bcf4a89..5e446a66 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xrockb.glb and b/docs/base/@vl2/interiors.vl2/interiors/xrockb.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xrockc.glb b/docs/base/@vl2/interiors.vl2/interiors/xrockc.glb index 4c75113a..ed7bbadf 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xrockc.glb and b/docs/base/@vl2/interiors.vl2/interiors/xrockc.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xspir1.glb b/docs/base/@vl2/interiors.vl2/interiors/xspir1.glb index 2bb388f3..600c867d 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xspir1.glb and b/docs/base/@vl2/interiors.vl2/interiors/xspir1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xspir2.glb b/docs/base/@vl2/interiors.vl2/interiors/xspir2.glb index 02c8bff6..0d0cfffc 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xspir2.glb and b/docs/base/@vl2/interiors.vl2/interiors/xspir2.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xspir3.glb b/docs/base/@vl2/interiors.vl2/interiors/xspir3.glb index 73132753..82fec800 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xspir3.glb and b/docs/base/@vl2/interiors.vl2/interiors/xspir3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xspir5.glb b/docs/base/@vl2/interiors.vl2/interiors/xspir5.glb index 1b7b49f3..163d2b26 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xspir5.glb and b/docs/base/@vl2/interiors.vl2/interiors/xspir5.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xtowr1.glb b/docs/base/@vl2/interiors.vl2/interiors/xtowr1.glb index f7b52b30..e1a13530 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xtowr1.glb and b/docs/base/@vl2/interiors.vl2/interiors/xtowr1.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xtowr3.glb b/docs/base/@vl2/interiors.vl2/interiors/xtowr3.glb index 0a2a8070..014643ed 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xtowr3.glb and b/docs/base/@vl2/interiors.vl2/interiors/xtowr3.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xtowr4.glb b/docs/base/@vl2/interiors.vl2/interiors/xtowr4.glb index 58011719..9436cb07 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xtowr4.glb and b/docs/base/@vl2/interiors.vl2/interiors/xtowr4.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xtowr7.glb b/docs/base/@vl2/interiors.vl2/interiors/xtowr7.glb index 2e4ec03d..a5349c29 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xtowr7.glb and b/docs/base/@vl2/interiors.vl2/interiors/xtowr7.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xvpad.glb b/docs/base/@vl2/interiors.vl2/interiors/xvpad.glb index dcb4939f..7e1b372e 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xvpad.glb and b/docs/base/@vl2/interiors.vl2/interiors/xvpad.glb differ diff --git a/docs/base/@vl2/interiors.vl2/interiors/xwall1.glb b/docs/base/@vl2/interiors.vl2/interiors/xwall1.glb index 22f56d89..0c8d945b 100644 Binary files a/docs/base/@vl2/interiors.vl2/interiors/xwall1.glb and b/docs/base/@vl2/interiors.vl2/interiors/xwall1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/Starfallen.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/Starfallen.glb index 894be170..bb830651 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/Starfallen.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/Starfallen.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbase_ccb5.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbase_ccb5.glb index f48a4e57..565883d5 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbase_ccb5.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbase_ccb5.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbase_nefhillside.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbase_nefhillside.glb index f0a4a014..5024f528 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbase_nefhillside.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbase_nefhillside.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbunke.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbunke.glb index 648897f4..eac01b15 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbunke.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bbunke.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bmisc_nefledge1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bmisc_nefledge1.glb index 2027c273..d6c93a08 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bmisc_nefledge1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bmisc_nefledge1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bmisc_nefvbay.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bmisc_nefvbay.glb index 1a475e1e..36fd43cc 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bmisc_nefvbay.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/bmisc_nefvbay.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/btf_turretplatform_c.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/btf_turretplatform_c.glb index f04c7b7f..77a97fc7 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/btf_turretplatform_c.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/btf_turretplatform_c.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_broadside_nef.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_broadside_nef.glb index cbfbfacf..5fe37335 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_broadside_nef.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_broadside_nef.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_nefRaindance.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_nefRaindance.glb index 852f78d8..1eb64d7a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_nefRaindance.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_nefRaindance.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neffloat1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neffloat1.glb index 06866269..ae7f2141 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neffloat1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neffloat1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neffloat2.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neffloat2.glb index 0f542745..567648de 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neffloat2.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neffloat2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neficeridge.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neficeridge.glb index 33c658a0..c71093ab 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neficeridge.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_neficeridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_tokrz_scarabrae.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_tokrz_scarabrae.glb index c4bdeeb8..d825d800 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_tokrz_scarabrae.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbase_tokrz_scarabrae.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nef_invbunk1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nef_invbunk1.glb index 739f9006..9174e56d 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nef_invbunk1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nef_invbunk1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefcliffside.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefcliffside.glb index 39ed3017..24d87022 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefcliffside.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefcliffside.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefdcbunk.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefdcbunk.glb index 26b8c755..1eefa77e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefdcbunk.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefdcbunk.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefsmall.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefsmall.glb index 45d6b368..a65102a1 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefsmall.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_nefsmall.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_snowblind.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_snowblind.glb index 0ace1bd2..94f2150b 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_snowblind.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_snowblind.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_stonehenge1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_stonehenge1.glb index 68481fb2..5f57f004 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_stonehenge1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_stonehenge1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_vbunk1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_vbunk1.glb index a49dd5c4..eddc4e11 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_vbunk1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dbunk_vbunk1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefbridge.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefbridge.glb index f15a6241..dfb5d043 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefbridge.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefbridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand2.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand2.glb index dbbd1d1d..453c86cc 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand2.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand3.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand3.glb index 6fe3c3e8..382dfa5f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand3.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefflagstand3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefobj1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefobj1.glb index e6fe8946..0a42619a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefobj1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefobj1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefobj2.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefobj2.glb index c6a52870..e916dd6a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefobj2.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefobj2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefplat1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefplat1.glb index a4e22866..2dc4e511 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefplat1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefplat1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefplug1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefplug1.glb index e274edf7..5883b887 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefplug1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefplug1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefrdbridge1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefrdbridge1.glb index 5ec0c13d..2ccdc988 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefrdbridge1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_nefrdbridge1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower1.glb index 3629e1a4..0d50521f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower2.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower2.glb index 15115872..2ac9ca89 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower2.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower3.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower3.glb index c008d8c8..b569a809 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower3.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_neftower3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge1.glb index 1c54a5ab..48eb30d8 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge2.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge2.glb index ec1b6638..3e612874 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge2.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge3.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge3.glb index 150cc577..64c15d2e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge3.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dmisc_stonehenge3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dtowr_classic1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dtowr_classic1.glb index 98dc1176..d7b75f77 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dtowr_classic1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/dtowr_classic1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/flagbridge.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/flagbridge.glb index 050f5cf3..d28c7788 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/flagbridge.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/flagbridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackairinv13.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackairinv13.glb index 2b3f2bba..929c7123 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackairinv13.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackairinv13.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackbase5618_final.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackbase5618_final.glb index 9482f9d1..a2bba8ea 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackbase5618_final.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackbase5618_final.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackturret8.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackturret8.glb index dbe970c8..20b9b669 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackturret8.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/infbutch_blackturret8.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbase_nef_giant.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbase_nef_giant.glb index 20aad1aa..66b4d340 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbase_nef_giant.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbase_nef_giant.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbase_nef_vbase1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbase_nef_vbase1.glb index 5433c4d9..8c049a4f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbase_nef_vbase1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbase_nef_vbase1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbunk4a_CC.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbunk4a_CC.glb index 4ed1b63c..ebc3971b 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbunk4a_CC.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbunk4a_CC.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbunk7a_CC.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbunk7a_CC.glb index 2552c4a2..faef77f4 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbunk7a_CC.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/pbunk7a_CC.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_base.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_base.glb index 8671c316..29ea5b12 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_base.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_base.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_tower.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_tower.glb index 643540c8..0725ffc0 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_tower.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_tower.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_wall4.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_wall4.glb index 3adf8d48..07849b02 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_wall4.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ram_wall4.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker.glb index b0980bd8..77968125 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker2.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker2.glb index a9d27ffa..8e7dd724 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker2.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_boundrymarker2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_bridge1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_bridge1.glb index 48221023..a45a4e86 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_bridge1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_bridge1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_mainbase.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_mainbase.glb index 90c280c9..e5cfcb27 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_mainbase.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain2_mainbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain_turretbase1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain_turretbase1.glb index 64fa219f..9d8de394 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain_turretbase1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_domain_turretbase1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_bridge.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_bridge.glb index 39dd55f0..aa67c5bf 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_bridge.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_bridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_mainbase.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_mainbase.glb index d76bb3e4..19d5a6b0 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_mainbase.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_mainbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_platform1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_platform1.glb index b5215bf9..ff5f7cba 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_platform1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_platform1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_towerbunker.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_towerbunker.glb index 1b506558..d4e5aeb3 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_towerbunker.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/rilke_whitedwarf_towerbunker.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin1.glb index 1440304f..fecd2be1 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin2.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin2.glb index e8dd113b..91d56603 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin2.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin3.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin3.glb index 36ed7f79..600465a3 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin3.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin4.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin4.glb index 134c80aa..f0262a29 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin4.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruin4.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruinarch.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruinarch.glb index 88dd21a3..41edda97 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruinarch.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/ruinarch.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/sbunk_nef1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/sbunk_nef1.glb index 0e9680b2..3a7c4571 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/sbunk_nef1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/sbunk_nef1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/siege.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/siege.glb index 6e035a4c..99b10710 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/siege.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/siege.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/smisc_nef1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/smisc_nef1.glb index da3e82f4..c209c518 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/smisc_nef1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/smisc_nef1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bbase_ccb2a.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bbase_ccb2a.glb index c41dcc03..18f19662 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bbase_ccb2a.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bbase_ccb2a.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bmisc_tunl_ccb1.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bmisc_tunl_ccb1.glb index e58f6d67..d90b19ed 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bmisc_tunl_ccb1.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bmisc_tunl_ccb1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_cnr_CC.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_cnr_CC.glb index a4945fbb..3f268ed3 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_cnr_CC.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_cnr_CC.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_lrg_CC.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_lrg_CC.glb index 44898004..ba11845c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_lrg_CC.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_lrg_CC.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_sm_CC.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_sm_CC.glb index 8225ec0e..8c12db98 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_sm_CC.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/interiors/t_bwall2a_sm_CC.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bbunke.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bbunke.glb index 92d22efd..8131c8ce 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bbunke.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bbunke.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_bridge0.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_bridge0.glb index 865f77fa..286d64bb 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_bridge0.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_bridge0.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_bunker1.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_bunker1.glb index 0f16db58..9e905a7c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_bunker1.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_bunker1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruina.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruina.glb index 7cc1f4a3..293b5ac8 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruina.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruina.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinb.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinb.glb index 2eeaeb36..aa73b5a3 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinb.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinb.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinc.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinc.glb index da495b5c..6cc97ffd 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinc.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinc.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruind.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruind.glb index 29a26aeb..89dfde9f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruind.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruind.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruine.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruine.glb index 4647a8b0..555ca65b 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruine.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruine.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinf.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinf.glb index d7d1ca9e..ed909e68 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinf.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinf.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruing.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruing.glb index 30fefe7d..6e8c4ee0 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruing.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruing.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinh.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinh.glb index 9ea0da4e..cc64d4b7 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinh.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruinh.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruini.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruini.glb index e9ca3b26..c1c7687b 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruini.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_ruini.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_tower1.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_tower1.glb index 11e120f2..d55d59f4 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_tower1.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_tower1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_tower2.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_tower2.glb index 1b8a8198..d3c9fbe2 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_tower2.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/bmiscpan_tower2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_base1.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_base1.glb index 984b7aa9..38c845f1 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_base1.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_base1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge1.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge1.glb index b5e07d1d..6c5d5586 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge1.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge2.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge2.glb index 1455e2cc..7fa6ae03 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge2.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge3.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge3.glb index 6cfbec63..66263625 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge3.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_bridge3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_genbunk.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_genbunk.glb index 353aac07..91f50354 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_genbunk.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_genbunk.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_turretplatform.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_turretplatform.glb index d4db399c..a94ce8d6 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_turretplatform.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btf_turretplatform.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btowr9.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btowr9.glb index f24088fe..8e936599 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btowr9.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/btowr9.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dbase5.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dbase5.glb index 6f360f47..7ea652ec 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dbase5.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dbase5.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dbase6.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dbase6.glb index 64a73c3d..3032606d 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dbase6.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dbase6.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dmisc1.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dmisc1.glb index 79e6ce10..4e4d249c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dmisc1.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dmisc1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dplat2.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dplat2.glb index 6d961576..bc823951 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dplat2.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dplat2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dtowr1.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dtowr1.glb index 74f3041c..4d8cc7e6 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dtowr1.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/dtowr1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_base.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_base.glb index 3ed815ab..efb55e76 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_base.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_base.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_gate.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_gate.glb index 27173210..71925668 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_gate.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_gate.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_misc1.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_misc1.glb index 72229381..61892822 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_misc1.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_misc1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_powerpit.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_powerpit.glb index c38cb1db..d281b999 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_powerpit.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_powerpit.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_tbunker.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_tbunker.glb index e712125e..83d410b1 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_tbunker.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_tbunker.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_tower.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_tower.glb index ccaf8f06..450575de 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_tower.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_tower.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall3.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall3.glb index 34afd3a1..3d1e8fdc 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall3.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall4.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall4.glb index e6760a8d..f063cc22 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall4.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall4.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall5.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall5.glb index de1c0652..588980f2 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall5.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall5.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall6.glb b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall6.glb index 3ddbae51..2ac61e91 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall6.glb and b/docs/base/@vl2/z_mappacks/CTF/DynamixFinalPack.vl2/interiors/tri_wall6.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipebasemini.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipebasemini.glb index c3b372d2..493593e4 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipebasemini.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipebasemini.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipebunker.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipebunker.glb index e618c54a..3b4d6742 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipebunker.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipebunker.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipestand2.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipestand2.glb index 46188e06..58aa9326 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipestand2.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pipestand2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pitbase.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pitbase.glb index 95dde1d5..19f056a8 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pitbase.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pitbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pitstand.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pitstand.glb index b0fc6bfb..da7da08f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pitstand.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthem_pitstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthemblock.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthemblock.glb index d781b95d..4941ae4d 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthemblock.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/anthemblock.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/ccb_be_tower1b_x2.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/ccb_be_tower1b_x2.glb index 896ef850..5a728dc3 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/ccb_be_tower1b_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/ccb_be_tower1b_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/centaur.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/centaur.glb index 039dfc24..ffa6a41c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/centaur.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/centaur.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/centower.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/centower.glb index ce8501bb..f5a99e82 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/centower.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/centower.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/damnationstand.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/damnationstand.glb index bd8bbf8c..4a1218d0 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/damnationstand.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/damnationstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingbase01.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingbase01.glb index d4ea7d13..4fa1b167 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingbase01.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingbase01.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingbase02.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingbase02.glb index 14253ec1..566de5be 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingbase02.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingbase02.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingstand01.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingstand01.glb index b99bdb04..957352c7 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingstand01.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingstand01.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingteeth.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingteeth.glb index b6690147..0e5f40eb 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingteeth.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingteeth.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingtower01.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingtower01.glb index cce39690..3b5d9efe 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingtower01.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingtower01.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingtower02.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingtower02.glb index 95e8d350..4de714c2 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingtower02.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingtower02.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingturretstand01.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingturretstand01.glb index 1e1838ac..225b61f6 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingturretstand01.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/flingturretstand01.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb index d3e7ce2a..abdaf01d 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_bunker.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_bunker.glb index 95769302..f6f5b509 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_bunker.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_bunker.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_mainbase.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_mainbase.glb index cd02792f..2f28d036 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_mainbase.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_mainbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_newpillarstand.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_newpillarstand.glb index 4fb9adb6..1779fafe 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_newpillarstand.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_newpillarstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_pillar.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_pillar.glb index a15a86c6..16ecf42e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_pillar.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_pillar.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_plat.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_plat.glb index fe4e8d7d..fa167be4 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_plat.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_plat.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_plat2.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_plat2.glb index 4caa3ae8..1cde6754 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_plat2.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_plat2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_podium.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_podium.glb index 8ea19acc..202b3523 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_podium.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_podium.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_snipenest.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_snipenest.glb index fe256235..a18bb9f9 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_snipenest.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_snipenest.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_turretbase.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_turretbase.glb index 301d4922..793d903b 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_turretbase.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_turretbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_vechpad.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_vechpad.glb index deccf77e..703bd853 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_vechpad.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_derm_vechpad.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_swd_flagstand.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_swd_flagstand.glb index 766ec479..da4e5e41 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_swd_flagstand.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_swd_flagstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_swd_ship2.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_swd_ship2.glb index 571fb441..7ea85307 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_swd_ship2.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/rst_swd_ship2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/s5_anthem_pipebase.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/s5_anthem_pipebase.glb index b9b31ea2..b57d166e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/s5_anthem_pipebase.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/s5_anthem_pipebase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/s5_anthem_pipestand.glb b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/s5_anthem_pipestand.glb index d76d1a2f..cde929d1 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/s5_anthem_pipestand.glb and b/docs/base/@vl2/z_mappacks/CTF/S5maps.vl2/interiors/s5_anthem_pipestand.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacbase.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacbase.glb index 95d3eae5..150d9737 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacbase.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacbridge.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacbridge.glb index 68d85e22..a555a644 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacbridge.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacbridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacstand.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacstand.glb index ffeeed69..31ada16f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacstand.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiactower.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiactower.glb index cdc745a0..ea1d190b 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiactower.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiactower.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacturret.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacturret.glb index cae42775..a222cd7e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacturret.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/anthem_cardiacturret.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingrock01.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingrock01.glb index b822fbf2..c748e495 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingrock01.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingrock01.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingrockvent01.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingrockvent01.glb index 20aa111f..096513e6 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingrockvent01.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingrockvent01.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingsilo03.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingsilo03.glb index e67be2b0..323b1d09 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingsilo03.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingsilo03.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingsilo03b.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingsilo03b.glb index 901ab787..6303832e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingsilo03b.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingsilo03b.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingstand02.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingstand02.glb index 4ce98768..b39b151c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingstand02.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingstand02.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingtanktrap01.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingtanktrap01.glb index a84cdf86..01072107 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingtanktrap01.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingtanktrap01.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingvpad01.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingvpad01.glb index 22ca580a..1f7ba528 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingvpad01.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingvpad01.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingvpad01b.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingvpad01b.glb index 6a9ddda4..6f30025f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingvpad01b.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/flingvpad01b.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_base.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_base.glb index 4d5190c3..256cba49 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_base.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_base.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_bridge.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_bridge.glb index 273809ac..d244efd3 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_bridge.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_bridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_bridge2.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_bridge2.glb index 5bcb3372..9bafeb3a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_bridge2.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_dogma_bridge2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_spir_base3.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_spir_base3.glb index cf7d9fb3..59fc9e7f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_spir_base3.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_spir_base3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_spir_pillar.glb b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_spir_pillar.glb index dd2a498b..7de69e81 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_spir_pillar.glb and b/docs/base/@vl2/z_mappacks/CTF/S8maps.vl2/interiors/rst_spir_pillar.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salgenroom2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salgenroom2.glb index 02598f5c..a66bb2a4 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salgenroom2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salgenroom2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salproj1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salproj1.glb index 6f997a25..f6508485 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salproj1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salproj1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salturretsus1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salturretsus1.glb index 77b40ad0..0676c22d 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salturretsus1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_salturretsus1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slblocks.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slblocks.glb index 314512a1..9fe0dcee 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slblocks.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slblocks.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slinvstat.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slinvstat.glb index e800f497..2af0f19f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slinvstat.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slinvstat.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slremo2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slremo2.glb index 3fb2f79f..f24ec5c4 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slremo2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slremo2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slsusbr1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slsusbr1.glb index 4c3f0b85..a8bc16da 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slsusbr1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slsusbr1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slvehramp1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slvehramp1.glb index c385f540..f9f2ec59 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slvehramp1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Euro_slvehramp1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Vpad_Bunker.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Vpad_Bunker.glb index 13b91e5f..14c91163 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Vpad_Bunker.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/Vpad_Bunker.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_-nefvbase_x.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_-nefvbase_x.glb index 3af0f3a6..9c4a0517 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_-nefvbase_x.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_-nefvbase_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_-nefvbase_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_-nefvbase_x2.glb index 4481a922..d17dbbd3 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_-nefvbase_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_-nefvbase_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_ccb1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_ccb1.glb index 1c2e0d8d..f047b710 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_ccb1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bbase_ccb1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_-nef_flagstand1_x.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_-nef_flagstand1_x.glb index d86367c5..66fd6d9e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_-nef_flagstand1_x.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_-nef_flagstand1_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_-nef_flagstand1_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_-nef_flagstand1_x2.glb index f5f50787..409f08e0 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_-nef_flagstand1_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_-nef_flagstand1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_neftrstand1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_neftrstand1.glb index 05305bc6..8cb15f1e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_neftrstand1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmisc_neftrstand1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bridge0_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bridge0_x2.glb index bbb0cc3c..ee036cb5 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bridge0_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bridge0_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bunker1_x.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bunker1_x.glb index 696aa43d..d4f45053 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bunker1_x.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bunker1_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bunker1_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bunker1_x2.glb index 48e3dbc9..dc2143ba 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bunker1_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_bunker1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruina_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruina_x2.glb index 96a2bcbe..a1d296f3 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruina_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruina_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinb_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinb_x2.glb index 2e8bc69b..42802ae8 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinb_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinb_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinc_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinc_x2.glb index 49ae44a5..14a235af 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinc_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinc_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruind_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruind_x2.glb index eec727fa..47f80a6d 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruind_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruind_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruine_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruine_x2.glb index 76cb2a37..b498001f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruine_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruine_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinf_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinf_x2.glb index 75186293..41044e00 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinf_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinf_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruing_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruing_x2.glb index 67b04189..5dd2700c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruing_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruing_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinh_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinh_x2.glb index e3eba008..ce9cc9c2 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinh_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_ruinh_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower1_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower1_x2.glb index 3e48588d..c54f5c26 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower1_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower2_x.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower2_x.glb index f7590a3d..8b0eddee 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower2_x.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower2_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower2_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower2_x2.glb index 880e5dcb..f0ed90f6 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower2_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/bmiscpan_tower2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_base1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_base1.glb index 1e906468..b45bcde5 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_base1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_base1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_bridge2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_bridge2.glb index 976c4735..09649026 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_bridge2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_bridge2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_bridge3.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_bridge3.glb index f7ef31e9..6f03985f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_bridge3.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_bridge3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform.glb index 4260ec37..6c093149 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform_x.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform_x.glb index 7aec5e51..258890bc 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform_x.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform_x2.glb index 3f38c319..be05b6f8 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/btf_turretplatform_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/ccb_be_tower1a_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/ccb_be_tower1a_x2.glb index 23cc6227..d6afd633 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/ccb_be_tower1a_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/ccb_be_tower1a_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/ccb_be_tower1b_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/ccb_be_tower1b_x2.glb index 7b95add1..cba3bee4 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/ccb_be_tower1b_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/ccb_be_tower1b_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase1_x.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase1_x.glb index 9de4b361..179cc486 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase1_x.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase1_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase1_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase1_x2.glb index c3c3cc0a..336f09ef 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase1_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase2_x.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase2_x.glb index f4cf5de1..9df993e5 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase2_x.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase2_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase2_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase2_x2.glb index 90a5c728..a762612e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase2_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dbase_-nefbase2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc1_x.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc1_x.glb index 733b444b..df425f50 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc1_x.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc1_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc1_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc1_x2.glb index 8d9d07e8..44b8884c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc1_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc_-nefflagstand1_x.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc_-nefflagstand1_x.glb index c23b80bb..3ca94865 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc_-nefflagstand1_x.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc_-nefflagstand1_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc_-nefflagstand1_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc_-nefflagstand1_x2.glb index 1e5e56b1..f44e4466 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc_-nefflagstand1_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dmisc_-nefflagstand1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_box_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_box_x2.glb index 0ea751bf..b4d64012 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_box_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_box_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_bunkera_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_bunkera_x2.glb index 94d5ab49..8d998e27 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_bunkera_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_bunkera_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_bunkerb_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_bunkerb_x2.glb index 31f3a224..a3d3fd59 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_bunkerb_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_bunkerb_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_droptop_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_droptop_x2.glb index 6ff4c4bd..78cb0e4d 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_droptop_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_droptop_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_fstand_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_fstand_x2.glb index 06fdba8c..f52dfaea 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_fstand_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_fstand_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_hangar_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_hangar_x2.glb index 8f96d156..9d5215f9 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_hangar_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_hangar_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_platform_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_platform_x2.glb index 324bafe3..0d076ec9 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_platform_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_platform_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_rig_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_rig_x2.glb index 31377527..468241a0 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_rig_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_rig_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_rustbox_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_rustbox_x2.glb index abc8f9ec..90e1051c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_rustbox_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_rustbox_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_sandcastle_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_sandcastle_x2.glb index 5b451698..092f0085 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_sandcastle_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_sandcastle_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_slab_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_slab_x2.glb index e908b8d4..8577eda2 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_slab_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_slab_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_spade_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_spade_x2.glb index a0d51238..7ab99797 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_spade_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_spade_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_steelsheet2_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_steelsheet2_x2.glb index 0813cd4d..5ae11444 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_steelsheet2_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_steelsheet2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_steelsheet_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_steelsheet_x2.glb index d5acb3cf..e03704f0 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_steelsheet_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/dox_bb_steelsheet_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_base.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_base.glb index 03cc0e7f..26da9c91 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_base.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_base.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_bridge.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_bridge.glb index 388ae69c..83d24932 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_bridge.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_bridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_turret.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_turret.glb index 9e38f952..6b8a015f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_turret.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/epicrates_turret.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/frostclawbase.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/frostclawbase.glb index 4f195bdf..dc14fe37 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/frostclawbase.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/frostclawbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisbase.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisbase.glb index d6092c18..d10c67fa 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisbase.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisinside.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisinside.glb index 84620382..6501307a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisinside.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisinside.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irismonu.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irismonu.glb index 8e42fdbf..b671df3e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irismonu.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irismonu.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruin2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruin2.glb index 2458a74e..6e23e10f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruin2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruin2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruin3.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruin3.glb index ef27540b..8a7debcb 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruin3.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruin3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruins1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruins1.glb index 712801f0..3324507f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruins1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/irisruins1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/iristurbase.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/iristurbase.glb index c5974da1..49254e64 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/iristurbase.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/iristurbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousfs.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousfs.glb index be2ca5f5..1c93274a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousfs.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousfs.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousinv.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousinv.glb index b8558b9f..a2dee656 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousinv.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousinv.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousplat1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousplat1.glb index d385edab..9985f2ec 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousplat1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereousplat1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereoustt.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereoustt.glb index a18bbf75..980ee58e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereoustt.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/kif_cinereoustt.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-base1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-base1.glb index 3470fc7e..8639bece 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-base1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-base1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-base2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-base2.glb index fada1037..b78c857a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-base2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-base2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec1.glb index 217f7723..cd641ae2 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec2.glb index e8ab45af..0fe2764d 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec3.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec3.glb index 500a6b8c..5c676c7a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec3.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec4.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec4.glb index e9a3c2c5..f91bc677 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec4.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec4.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec5.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec5.glb index f6f119f8..6d75fbf0 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec5.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec5.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec6.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec6.glb index dd92855f..df2005aa 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec6.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-ec6.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-stand1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-stand1.glb index 71601fbe..8530e813 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-stand1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-stand1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-tunnel-1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-tunnel-1.glb index e6273bce..7f03fe25 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-tunnel-1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/nycto-tunnel-1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rail1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rail1.glb index a2a87e96..57c7e4f8 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rail1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rail1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_bombscare_flagstand_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_bombscare_flagstand_x2.glb index ceef8205..f7a4320d 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_bombscare_flagstand_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_bombscare_flagstand_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_flagstand1_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_flagstand1_x2.glb index f8aafed8..f4004e64 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_flagstand1_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_flagstand1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_platform1_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_platform1_x2.glb index 6c21d415..8e2f6cc5 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_platform1_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_platform1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_sensorbunker1_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_sensorbunker1_x2.glb index 2df84c6d..2289b036 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_sensorbunker1_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_sensorbunker1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_sensorbunker2_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_sensorbunker2_x2.glb index bce74bad..09cd6069 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_sensorbunker2_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_sensorbunker2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_vpad_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_vpad_x2.glb index 3b483166..819ff802 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_vpad_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_ctm1_vpad_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bridge2_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bridge2_x2.glb index 12d0bfe9..59b8e1a2 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bridge2_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bridge2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bridgebase1_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bridgebase1_x2.glb index b3c47726..31d55c33 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bridgebase1_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bridgebase1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bunker2_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bunker2_x2.glb index 770302b8..a9c18d29 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bunker2_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_bunker2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_platform2_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_platform2_x2.glb index edde1825..1aa96d3e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_platform2_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_platform2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_platform3_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_platform3_x2.glb index 199dac6b..eae5780f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_platform3_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_platform3_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb index 5b16cbcd..b45701d4 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_vehiclepad_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_vehiclepad_x2.glb index 243630ad..f536474f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_vehiclepad_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/rilke_whitedwarf_vehiclepad_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flagbase_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flagbase_x2.glb index ff85c26e..1481598e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flagbase_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flagbase_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flagbunker.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flagbunker.glb index 8319986c..f85b3785 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flagbunker.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flagbunker.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flyingvehicle_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flyingvehicle_x2.glb index 14a7ae05..2fbb5668 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flyingvehicle_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flyingvehicle_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flyingvehiclebase.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flyingvehiclebase.glb index 81c3b9ad..d04c44d4 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flyingvehiclebase.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_flyingvehiclebase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_turretholder.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_turretholder.glb index aa93f252..3be3f61c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_turretholder.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tes_turretholder.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tbunker_x.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tbunker_x.glb index be563fd6..cbbe10e8 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tbunker_x.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tbunker_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tbunker_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tbunker_x2.glb index eb477f24..05ae1de0 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tbunker_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tbunker_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tower_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tower_x2.glb index 1a1584da..9f94ddbf 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tower_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL-MapPackEDIT.vl2/interiors/tri_tower_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_Base.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_Base.glb index f574ae65..999da583 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_Base.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_Base.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_turret.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_turret.glb index f1520eef..a498d09e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_turret.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_turret.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_vpad.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_vpad.glb index c08a1feb..a2742e1b 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_vpad.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Bleed_vpad.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_dox_bb_bunkera_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_dox_bb_bunkera_x2.glb index 0463d062..473ae089 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_dox_bb_bunkera_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_dox_bb_bunkera_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_dox_bb_hangar_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_dox_bb_hangar_x2.glb index de7d5f8f..6b4ac063 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_dox_bb_hangar_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_dox_bb_hangar_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_rilke_whitedwarf_mainbase.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_rilke_whitedwarf_mainbase.glb index 0577cc9d..5576b4e6 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_rilke_whitedwarf_mainbase.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_Dissention_rilke_whitedwarf_mainbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_base47.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_base47.glb index e8e13201..33090a4c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_base47.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_base47.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_flag6.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_flag6.glb index 086d484b..c1743f1e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_flag6.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_flag6.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_turret12.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_turret12.glb index 7e9c4942..01f6af9f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_turret12.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/Euro4_FrozenHope_inf_butch_fhope_turret12.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_bmiscpan_ruind.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_bmiscpan_ruind.glb index eec8e90f..72a593eb 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_bmiscpan_ruind.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_bmiscpan_ruind.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_btowr9.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_btowr9.glb index cc8486d6..c9adf399 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_btowr9.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_btowr9.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_drorck-base.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_drorck-base.glb index 2c14886f..8c5a920e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_drorck-base.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_drorck-base.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumbase.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumbase.glb index 02cba52d..9d414de3 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumbase.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumflag.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumflag.glb index b664565a..83b6d7aa 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumflag.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumflag.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnummisc.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnummisc.glb index 38c6f2ff..6422617c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnummisc.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnummisc.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumturret.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumturret.glb index 1f44ba44..ed385e21 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumturret.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumturret.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumvs.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumvs.glb index 5dc58451..bbe79299 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumvs.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/TL_magnumvs.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/btowr_ccb1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/btowr_ccb1.glb index 16cf6b25..ca26d8e9 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/btowr_ccb1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/btowr_ccb1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccb_be_tower1b_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccb_be_tower1b_x2.glb index def7ce88..e35452a7 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccb_be_tower1b_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccb_be_tower1b_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccbase1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccbase1.glb index 42969cd3..99a39d4f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccbase1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccbase1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccbase2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccbase2.glb index 8787e2e3..f0ec9719 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccbase2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccbase2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccflagstand.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccflagstand.glb index 77a62dea..81af0f80 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccflagstand.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ccflagstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/cctower.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/cctower.glb index 522e260b..5a5572ff 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/cctower.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/cctower.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/conbase.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/conbase.glb index 3cbdff68..b8d979b0 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/conbase.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/conbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/conspire.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/conspire.glb index 50693459..469e025c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/conspire.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/conspire.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/dox_bb_fstand_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/dox_bb_fstand_x2.glb index 6c70bb47..6df2b4d9 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/dox_bb_fstand_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/dox_bb_fstand_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/hbbunker.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/hbbunker.glb index eac95006..eeb2ef35 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/hbbunker.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/hbbunker.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/hbflagstand.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/hbflagstand.glb index dc00da43..5710490a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/hbflagstand.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/hbflagstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idbase.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idbase.glb index 3ba4951a..4cee120f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idbase.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idhangar.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idhangar.glb index 20d50cf8..d6466157 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idhangar.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idhangar.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idmiddle.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idmiddle.glb index a8a238b4..2b6a282d 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idmiddle.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/idmiddle.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2base1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2base1.glb index 1a630e9e..ed8fee1c 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2base1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2base1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2flag21.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2flag21.glb index 94302655..adc80a01 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2flag21.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2flag21.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2turret13.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2turret13.glb index 0f2625e0..05407e40 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2turret13.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2turret13.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2turret9.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2turret9.glb index 433e0c86..976f8147 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2turret9.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_fg2turret9.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_icebase51.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_icebase51.glb index 8ea90855..12f3df63 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_icebase51.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_icebase51.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_iceturretbase9.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_iceturretbase9.glb index e3ac14d7..90c3cc69 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_iceturretbase9.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_iceturretbase9.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_icevehicle11.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_icevehicle11.glb index d73b8648..36cbee0a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_icevehicle11.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/inf_butch_icevehicle11.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/jagged_base3.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/jagged_base3.glb index 418bde7e..068d5e2e 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/jagged_base3.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/jagged_base3.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/kif_skylightbase.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/kif_skylightbase.glb index 91ce2725..f0860255 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/kif_skylightbase.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/kif_skylightbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/kif_skylightfs.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/kif_skylightfs.glb index 89ac7e06..adbfbdbc 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/kif_skylightfs.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/kif_skylightfs.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/magnum_vehicle_stop.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/magnum_vehicle_stop.glb index a9c0a9dc..7f56cfb8 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/magnum_vehicle_stop.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/magnum_vehicle_stop.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/mmbase.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/mmbase.glb index 63749177..7ecbbf86 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/mmbase.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/mmbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/mmbridge.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/mmbridge.glb index af2ddc08..f4a67fbf 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/mmbridge.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/mmbridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/muddyswampstand.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/muddyswampstand.glb index a71ef72d..21429b59 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/muddyswampstand.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/muddyswampstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ocular-flagstand.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ocular-flagstand.glb index bd06bbd0..c3e3a0f6 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ocular-flagstand.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/ocular-flagstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/peach_lush_bunker1.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/peach_lush_bunker1.glb index d9d3d312..e554f90a 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/peach_lush_bunker1.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/peach_lush_bunker1.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/tes_flagbase_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/tes_flagbase_x2.glb index a1265038..f4d841f9 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/tes_flagbase_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/tes_flagbase_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/tes_flyingvehicle_x2.glb b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/tes_flyingvehicle_x2.glb index 5864d347..435c67e8 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/tes_flyingvehicle_x2.glb and b/docs/base/@vl2/z_mappacks/CTF/TWL2-MapPackEDIT.vl2/interiors/tes_flyingvehicle_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/TWL_T2arenaOfficialMaps.vl2/interiors/underhillmidbalancedfnl.glb b/docs/base/@vl2/z_mappacks/TWL_T2arenaOfficialMaps.vl2/interiors/underhillmidbalancedfnl.glb index b5c0c3f1..4d677d42 100644 Binary files a/docs/base/@vl2/z_mappacks/TWL_T2arenaOfficialMaps.vl2/interiors/underhillmidbalancedfnl.glb and b/docs/base/@vl2/z_mappacks/TWL_T2arenaOfficialMaps.vl2/interiors/underhillmidbalancedfnl.glb differ diff --git a/docs/base/@vl2/z_mappacks/TWL_T2arenaOfficialMaps.vl2/interiors/underhillsideonefnl.glb b/docs/base/@vl2/z_mappacks/TWL_T2arenaOfficialMaps.vl2/interiors/underhillsideonefnl.glb index 3ac93e24..1d0ee102 100644 Binary files a/docs/base/@vl2/z_mappacks/TWL_T2arenaOfficialMaps.vl2/interiors/underhillsideonefnl.glb and b/docs/base/@vl2/z_mappacks/TWL_T2arenaOfficialMaps.vl2/interiors/underhillsideonefnl.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_Base.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_Base.glb index 540e6e8f..622e48da 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_Base.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_Base.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_turret.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_turret.glb index 5f71ee5b..d0acb2cb 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_turret.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_turret.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_vpad.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_vpad.glb index 168e3724..79aff598 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_vpad.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Euro4_Bleed_vpad.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_magbase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_magbase.glb index 3629b735..60adc495 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_magbase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_magbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_magflagstand.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_magflagstand.glb index fd09d8df..e54571de 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_magflagstand.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_magflagstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_turretstand.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_turretstand.glb index 9cde655f..874eb90e 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_turretstand.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Magellan_kab_turretstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/SpinCycle_spbase2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/SpinCycle_spbase2.glb index 561a6247..955c578b 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/SpinCycle_spbase2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/SpinCycle_spbase2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/TL_magnumbase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/TL_magnumbase.glb index 5c2b34e1..94994150 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/TL_magnumbase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/TL_magnumbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_airtower.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_airtower.glb index 289c70bb..a0cecef1 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_airtower.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_airtower.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_invowheel.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_invowheel.glb index c7b69d77..4e46c607 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_invowheel.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_invowheel.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_newbase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_newbase.glb index 8706997d..0fefe6c1 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_newbase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_AF_newbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_MainBase_CK.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_MainBase_CK.glb index 3ab13b1b..31cd7244 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_MainBase_CK.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_MainBase_CK.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_bunktower.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_bunktower.glb index 67f73033..733b48d4 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_bunktower.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_bunktower.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_tunnel.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_tunnel.glb index 4267955c..110b486a 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_tunnel.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Bastage_BT_tunnel.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_bridge.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_bridge.glb index 12b19de5..65ffa0a0 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_bridge.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_bridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_lamp.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_lamp.glb index 1c0825e8..b9fd103f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_lamp.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_lamp.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_main.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_main.glb index d7f058d6..ac5684d0 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_main.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_main.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_turret.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_turret.glb index 28a48d46..04488741 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_turret.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Caustic_tri_turret.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Crown_tri_flag.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Crown_tri_flag.glb index e8e2dd66..fde5d082 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Crown_tri_flag.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Crown_tri_flag.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Crown_tri_turret.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Crown_tri_turret.glb index 933f1017..f0b88c41 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Crown_tri_turret.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Crown_tri_turret.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_cross.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_cross.glb index d127dc5e..085341d5 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_cross.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_cross.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_cross2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_cross2.glb index dc30c8e6..26f7bd9d 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_cross2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_cross2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_obtower.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_obtower.glb index aa1f4358..0d432532 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_obtower.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_obtower.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_tombstone2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_tombstone2.glb index b428cb5f..797d9daa 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_tombstone2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_tombstone2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_tombstone3.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_tombstone3.glb index 59a5d9db..9f6fed76 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_tombstone3.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_GraveStone_tombstone3.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_Base_CK.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_Base_CK.glb index 47b45014..607d789e 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_Base_CK.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_Base_CK.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_BunkerA.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_BunkerA.glb index 44ed87b4..29a6a847 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_BunkerA.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_BunkerA.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_Flagstand_mk2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_Flagstand_mk2.glb index a0ffa881..34c5647b 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_Flagstand_mk2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_Flagstand_mk2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_TurretPillar.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_TurretPillar.glb index 7f7b22fd..70555c5e 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_TurretPillar.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_HM_TurretPillar.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dbase_ccb1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dbase_ccb1.glb index 8cb47f7d..3bac399c 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dbase_ccb1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dbase_ccb1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dmisc_int_fstand_old.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dmisc_int_fstand_old.glb index f043893c..ec6a3de9 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dmisc_int_fstand_old.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dmisc_int_fstand_old.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dwall_ccb1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dwall_ccb1.glb index 23e45dc6..a56b85d9 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dwall_ccb1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Hellfire_dwall_ccb1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1.glb index 2166dc72..d97fa9e6 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod2a.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod2a.glb index 6655660a..7b1f0459 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod2a.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod2a.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod3.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod3.glb index 51fc4bf3..1fb375e0 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod3.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod3.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod4.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod4.glb index 4eadd870..561b9a3d 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod4.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_base1_mod4.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_bridge1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_bridge1.glb index d1c1a1ff..3ed45852 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_bridge1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_bridge1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_bridge2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_bridge2.glb index 5c3a5240..26c68b0b 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_bridge2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_bridge2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_platform2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_platform2.glb index d4b6e76c..67a6622a 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_platform2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Insurgence_ccb_bd_platform2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salgenroom2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salgenroom2.glb index 41182f63..2229e2e9 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salgenroom2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salgenroom2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salproj1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salproj1.glb index 55010b80..a677e3a3 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salproj1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salproj1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salturretsus1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salturretsus1.glb index 3aa6a996..70af8221 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salturretsus1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_salturretsus1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slblocks.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slblocks.glb index 32f49b2b..21b84ccb 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slblocks.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slblocks.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slinvstat.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slinvstat.glb index 09df5daa..8feb2066 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slinvstat.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slinvstat.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slremo2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slremo2.glb index d284148b..8ced3e44 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slremo2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slremo2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slsusbr1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slsusbr1.glb index 6bb0fe49..33ffec34 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slsusbr1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slsusbr1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slvehramp1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slvehramp1.glb index 87e04871..37984c96 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slvehramp1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Malignant_slvehramp1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ProjectX_tribalma5ters_coyboybebop_basecom1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ProjectX_tribalma5ters_coyboybebop_basecom1.glb index 82428e97..5cb9e331 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ProjectX_tribalma5ters_coyboybebop_basecom1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ProjectX_tribalma5ters_coyboybebop_basecom1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ProjectX_tunneloflove.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ProjectX_tunneloflove.glb index c12a05c4..2790aa63 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ProjectX_tunneloflove.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ProjectX_tunneloflove.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridge4.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridge4.glb index aa1b34ef..328034c4 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridge4.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridge4.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridge4b.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridge4b.glb index 643ce956..4f3e60cc 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridge4b.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridge4b.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridgeh4b.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridgeh4b.glb index 3f8ac534..acdc3261 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridgeh4b.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepbridgeh4b.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepsab3.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepsab3.glb index 947d881c..4575948d 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepsab3.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepsab3.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepsab4.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepsab4.glb index fa6208b7..db051049 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepsab4.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_SR_eepsab4.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Torrent_kif_bigbase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Torrent_kif_bigbase.glb index ad53c20c..ddd90e09 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Torrent_kif_bigbase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Torrent_kif_bigbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Torrent_kif_torrent_turret_tower.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Torrent_kif_torrent_turret_tower.glb index 0a6c24d6..ee877929 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Torrent_kif_torrent_turret_tower.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Torrent_kif_torrent_turret_tower.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_attackgate.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_attackgate.glb index c957ff17..04e2a9ea 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_attackgate.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_attackgate.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_base.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_base.glb index c0c6fa66..de73cf4e 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_base.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_base.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_gate.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_gate.glb index 829b9e0d..be2799c1 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_gate.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_gate.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_guntower.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_guntower.glb index a0aa8f0d..cea52e45 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_guntower.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_guntower.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_medtower.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_medtower.glb index c67bd1c6..bc67b286 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_medtower.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_medtower.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_vpad.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_vpad.glb index 10ef8b81..43378c92 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_vpad.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Vestige_vpad.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_Flagstand_CK.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_Flagstand_CK.glb index e3f46b8f..2fdc5f59 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_Flagstand_CK.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_Flagstand_CK.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_GenBase_CK.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_GenBase_CK.glb index 5be9bec4..d9c663be 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_GenBase_CK.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_GenBase_CK.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_Turret_CK.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_Turret_CK.glb index b0b27a1d..a4ade794 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_Turret_CK.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_WSol_Turret_CK.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_Turret.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_Turret.glb index dc97f80b..54843482 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_Turret.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_Turret.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_Turret2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_Turret2.glb index d6ba3ebd..498f58cf 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_Turret2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_Turret2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_proto.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_proto.glb index 83053cee..dd2380c4 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_proto.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_Xerxes_proto.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ZV_bbunk_ccb1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ZV_bbunk_ccb1.glb index ead0fd49..b1c03b46 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ZV_bbunk_ccb1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ZV_bbunk_ccb1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ZV_ccb_be_spire1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ZV_ccb_be_spire1.glb index ac05b437..da27dd84 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ZV_ccb_be_spire1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ZV_ccb_be_spire1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_infernoflagstand.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_infernoflagstand.glb index 21c01bbd..23606be1 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_infernoflagstand.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_infernoflagstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_stormflagstand.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_stormflagstand.glb index 8a0221f5..db52c4eb 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_stormflagstand.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_stormflagstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_tower.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_tower.glb index 6ded34fc..9fedcfa0 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_tower.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_tower.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_vbase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_vbase.glb index 9122a880..cba43fb6 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_vbase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_attrition_vbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_beachchair01.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_beachchair01.glb index 356e37f0..d010b982 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_beachchair01.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_beachchair01.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_dmisc_-nefflagstand1_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_dmisc_-nefflagstand1_x2.glb index 82e42234..57a2fcfa 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_dmisc_-nefflagstand1_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_dmisc_-nefflagstand1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ghostdance_proto.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ghostdance_proto.glb index b3e6fa69..3d19fee7 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ghostdance_proto.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_ghostdance_proto.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_base01.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_base01.glb index e75f9ea2..03a5299f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_base01.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_base01.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_bunker01.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_bunker01.glb index c749e021..247bdff6 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_bunker01.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_bunker01.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_stand01.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_stand01.glb index b7c33f7d..f9c4730f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_stand01.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_stand01.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_tower01.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_tower01.glb index eb0ce0a6..48824afa 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_tower01.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_imperium_tower01.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_bridge.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_bridge.glb index fcce9252..f32789c7 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_bridge.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_bridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_bridge_tunnel.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_bridge_tunnel.glb index d01e28b6..08c4e03b 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_bridge_tunnel.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_bridge_tunnel.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_lush_mainbase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_lush_mainbase.glb index 5bada877..ef852b13 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_lush_mainbase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_lush_mainbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_rip.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_rip.glb index ef9c2423..a58e73bd 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_rip.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_rip.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_xing.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_xing.glb index fadd1bfb..43554e76 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_xing.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_metaltanks_xing.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_rst_transitbase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_rst_transitbase.glb index 34cb00a4..a92cfd3a 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_rst_transitbase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_rst_transitbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_rst_transitstand.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_rst_transitstand.glb index e322ced1..3761b00c 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_rst_transitstand.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_rst_transitstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_t_base0.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_t_base0.glb index 15c58c98..45f49136 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_t_base0.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/Xtra_t_base0.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_cardiacturret.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_cardiacturret.glb index a76e0ac1..dab715bf 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_cardiacturret.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_cardiacturret.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipebunker.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipebunker.glb index d087145d..1c47dd2e 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipebunker.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipebunker.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-badlands.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-badlands.glb index fa906115..ce817e19 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-badlands.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-badlands.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-beach.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-beach.glb index ddc2c3c8..a24d5f65 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-beach.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-beach.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-desert.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-desert.glb index 73313225..cf4890e4 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-desert.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-desert.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-ice.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-ice.glb index e33b62de..da40f742 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-ice.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-ice.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-lava.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-lava.glb index 73225b66..21ab1019 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-lava.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2-lava.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2.glb index c2a01323..9edc27cf 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/anthem_pipestand2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_-nef_flagstand1_x.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_-nef_flagstand1_x.glb index 3334fbbc..0e79b794 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_-nef_flagstand1_x.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_-nef_flagstand1_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_-nef_flagstand1_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_-nef_flagstand1_x2.glb index 0b9d209b..7d73527c 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_-nef_flagstand1_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_-nef_flagstand1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_neftrstand1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_neftrstand1.glb index 85ebb5d3..7d88ac1f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_neftrstand1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmisc_neftrstand1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_bridge0.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_bridge0.glb index 4528b3dc..1b3daec9 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_bridge0.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_bridge0.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_bunker1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_bunker1.glb index 5a9314e7..fbfede8b 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_bunker1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_bunker1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruina.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruina.glb index 61c7e1b4..b8fbd64e 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruina.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruina.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinb.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinb.glb index 7a64ee0c..47f1cae9 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinb.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinb.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinc.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinc.glb index 8f89f773..81c5e49c 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinc.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinc.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruind.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruind.glb index d70ee275..f767391e 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruind.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruind.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruine.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruine.glb index 072eee8e..6ad8ea40 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruine.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruine.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinf.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinf.glb index 4c15d470..9f49cc69 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinf.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinf.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruing.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruing.glb index 4c40ca14..3bb69fe1 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruing.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruing.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinh.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinh.glb index 556e4269..82f21805 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinh.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruinh.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruini.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruini.glb index 88e5cc9f..8c9e8c0b 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruini.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_ruini.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_tower1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_tower1.glb index 6577636d..e1cd4ba4 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_tower1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_tower1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_tower2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_tower2.glb index b122c12b..d77e49c0 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_tower2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/bmiscpan_tower2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/btf_turretplatform_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/btf_turretplatform_x2.glb index b9eb5ceb..95c1af60 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/btf_turretplatform_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/btf_turretplatform_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/btowr5-Lava.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/btowr5-Lava.glb index 15d4b5e8..8c4b97d8 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/btowr5-Lava.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/btowr5-Lava.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/cctower.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/cctower.glb index 239ea60c..170328fd 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/cctower.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/cctower.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase1_x.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase1_x.glb index b8588c33..2c3149f4 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase1_x.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase1_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase1_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase1_x2.glb index f8281182..921bce9a 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase1_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase2_x.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase2_x.glb index 88b3ff85..d767b1d3 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase2_x.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase2_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase2_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase2_x2.glb index de29ebbc..4916ed75 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase2_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbase_-nefbase2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbunk_rf04.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbunk_rf04.glb index 3b17fc93..53302578 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbunk_rf04.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dbunk_rf04.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dmisc_-nefflagstand1_x.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dmisc_-nefflagstand1_x.glb index c0e65988..46843624 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dmisc_-nefflagstand1_x.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dmisc_-nefflagstand1_x.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dmisc_-nefflagstand1_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dmisc_-nefflagstand1_x2.glb index 6d4a19eb..1c56c18b 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dmisc_-nefflagstand1_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dmisc_-nefflagstand1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dtowr_classic1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dtowr_classic1.glb index fed2ccf8..f5f625b8 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dtowr_classic1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/dtowr_classic1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/idmiddle.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/idmiddle.glb index 4100ec54..885ef40f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/idmiddle.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/idmiddle.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_flagbase06.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_flagbase06.glb index f9ea5c48..ca93d41f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_flagbase06.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_flagbase06.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_plat6.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_plat6.glb index defaa099..f8e7e1b7 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_plat6.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_plat6.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_sensor12.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_sensor12.glb index 0c87c75e..914ca587 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_sensor12.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/inf_butch_lava_sensor12.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousfs.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousfs.glb index 24b623ba..ea8d11f7 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousfs.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousfs.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousinv.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousinv.glb index 277c6318..129bcbf1 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousinv.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousinv.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousplat1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousplat1.glb index 0dc0f67b..c14d01ec 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousplat1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereousplat1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereoustt.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereoustt.glb index c5381fb9..48253a12 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereoustt.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/kif_cinereoustt.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rail1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rail1.glb index 5f057435..950d9a2a 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rail1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rail1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_bombscare_flagstand_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_bombscare_flagstand_x2.glb index a0652a8e..3991e07a 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_bombscare_flagstand_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_bombscare_flagstand_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_ctm1_sensorbunker1_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_ctm1_sensorbunker1_x2.glb index ef487bbc..ef97a54d 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_ctm1_sensorbunker1_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_ctm1_sensorbunker1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_ctm1_sensorbunker2_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_ctm1_sensorbunker2_x2.glb index e1209229..0a9a7dcc 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_ctm1_sensorbunker2_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_ctm1_sensorbunker2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bridge2_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bridge2_x2.glb index 07e7f7d4..48304978 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bridge2_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bridge2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bridgebase1_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bridgebase1_x2.glb index bc4b676b..62b1be0d 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bridgebase1_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bridgebase1_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bunker2_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bunker2_x2.glb index 2563a653..1ecc1e8a 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bunker2_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_bunker2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_platform2_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_platform2_x2.glb index f8dd91da..75e7a5d6 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_platform2_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_platform2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_platform3_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_platform3_x2.glb index 16f1a049..d381115a 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_platform3_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_platform3_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb index 659dc839..81acd3a2 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_towerbunker2_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_vehiclepad_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_vehiclepad_x2.glb index 60a99a40..84953dc6 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_vehiclepad_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rilke_whitedwarf_vehiclepad_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase.glb index 2c18ea20..dc5d873f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase2.glb index 7afb3b77..fa022438 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase_VehFix.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase_VehFix.glb index 208dd6e5..d7e70365 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase_VehFix.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceBase_VehFix.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceStand.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceStand.glb index f7a56119..5f2ea6ca 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceStand.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_FaceStand.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEbase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEbase.glb index bf7868ff..7731a251 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEbase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part1.glb index 9ffd068f..e7803d82 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part2.glb index 8f41cf0f..c7d9caa0 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part3.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part3.glb index a78fb07e..e01d25b1 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part3.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave1_part3.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave2.glb index 48845fa6..d6845b3f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEcave2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEtower.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEtower.glb index dbbe6c64..eb146e60 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEtower.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SEtower.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SimpleFlagArena.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SimpleFlagArena.glb index cc649ea5..1a504e13 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SimpleFlagArena.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_SimpleFlagArena.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_agroleonbase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_agroleonbase.glb index 8f115b93..8183b033 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_agroleonbase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_agroleonbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_agroleonstand.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_agroleonstand.glb index d3705385..a49796e7 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_agroleonstand.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_agroleonstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_arenalight.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_arenalight.glb index aeef8f4f..cfd1dc37 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_arenalight.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_arenalight.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_astro_bunker.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_astro_bunker.glb index 5e925486..544a8bf9 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_astro_bunker.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_astro_bunker.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_astro_stand.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_astro_stand.glb index 078d7c02..19e9e6a0 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_astro_stand.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_astro_stand.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_barrier1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_barrier1.glb index 84c2489a..670cd498 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_barrier1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_barrier1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_barrier2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_barrier2.glb index be953150..1af03049 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_barrier2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_barrier2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_beagleship.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_beagleship.glb index 3c3f02d1..a8965d0a 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_beagleship.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_beagleship.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbase.glb index f9db40fe..b50d1201 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker.glb index 8c9d78f8..b43b1549 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker2.glb index e2b9194d..ece34f92 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker3.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker3.glb index 3eff45e5..c0356655 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker3.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterbunker3.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterstand.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterstand.glb index e4335783..7d658f22 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterstand.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_bitterstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_debris1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_debris1.glb index 0e09db87..d9b5be3e 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_debris1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_debris1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_debris2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_debris2.glb index 2e077dc5..902391ab 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_debris2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_debris2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building1.glb index f4d94b3b..e0e7bc82 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building2.glb index 2cb55ba1..9b35df4f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building3.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building3.glb index aeaec4f2..39ae66f8 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building3.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building3.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building4.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building4.glb index 1ebc40c4..a18a605b 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building4.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building4.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building5.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building5.glb index 360bbd9e..986e6977 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building5.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building5.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building6.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building6.glb index 29cb11ac..b82d03b8 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building6.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building6.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building7.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building7.glb index ebd04e2c..d6e397db 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building7.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building7.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building8.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building8.glb index 642e7cb8..6e0cdbee 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building8.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_building8.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_citybase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_citybase.glb index c2351c62..832bc6c2 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_citybase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_citybase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_citybridge.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_citybridge.glb index 8ae4a7df..38e415f4 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_citybridge.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_citybridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_midfield.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_midfield.glb index 80f79daf..53e5cdeb 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_midfield.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_derm_midfield.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_islebase.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_islebase.glb index 1e4d5971..7ac127b6 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_islebase.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_islebase.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_islebase2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_islebase2.glb index b1647ae5..b47d206f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_islebase2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_islebase2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lighthouse.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lighthouse.glb index 73d5e172..3a660339 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lighthouse.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lighthouse.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_flagplat.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_flagplat.glb index 14ad851e..e71cd7d2 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_flagplat.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_flagplat.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle1.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle1.glb index 12f87e8e..b8f2feb6 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle1.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle1.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle10.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle10.glb index 90efb5da..0d09f38a 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle10.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle10.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle2.glb index 696ffefc..e6a42239 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle3.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle3.glb index c1b0c909..0aac954b 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle3.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle3.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle4.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle4.glb index 5ad6cfeb..34e53fb5 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle4.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle4.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle5.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle5.glb index 3c7339d9..34be0a94 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle5.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle5.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle6.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle6.glb index 838b2ef0..81cc3313 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle6.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle6.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle7.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle7.glb index 2130cad5..12f86e99 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle7.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle7.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle8.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle8.glb index eaaab9b3..5b66d612 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle8.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle8.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle9.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle9.glb index 3ca22abb..2a2e075f 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle9.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_floatingisle9.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_rock2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_rock2.glb index 723af6d4..4dcc53dc 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_rock2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_lush_rock2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_newlighthouse.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_newlighthouse.glb index acd18b65..5cf88a00 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_newlighthouse.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_newlighthouse.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_padbottom.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_padbottom.glb index 53331e15..17550be8 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_padbottom.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_padbottom.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_padbottom2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_padbottom2.glb index f79b5383..e9dec109 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_padbottom2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_padbottom2.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_pipedream.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_pipedream.glb index 7378872e..f67c8397 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_pipedream.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_pipedream.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_spit_base.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_spit_base.glb index f1905fd6..71a5f69c 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_spit_base.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_spit_base.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_spit_stand.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_spit_stand.glb index 98482eb3..3f66f3f4 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_spit_stand.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/rst_spit_stand.glb differ diff --git a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/tes_flagbase_x2.glb b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/tes_flagbase_x2.glb index 0143f816..6069d170 100644 Binary files a/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/tes_flagbase_x2.glb and b/docs/base/@vl2/z_mappacks/zDMP-4.7.3DX.vl2/interiors/tes_flagbase_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/8mCube.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/8mCube.glb index 187ae6df..9085ad69 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/8mCube.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/8mCube.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/RDTower.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/RDTower.glb index 0d08a838..7f9a4529 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/RDTower.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/RDTower.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyBase.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyBase.glb index de1d6dc7..7192ca5f 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyBase.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyBase.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyCannon.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyCannon.glb index 144e8db3..927de971 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyCannon.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyCannon.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyCenterBase.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyCenterBase.glb index b8e213b4..4d11f78f 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyCenterBase.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/anomalyCenterBase.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/arkRing.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/arkRing.glb index 1c4e243c..9f23bee9 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/arkRing.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/arkRing.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bbstand.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bbstand.glb index bb691947..d891a538 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bbstand.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bbstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bcannon.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bcannon.glb index 68d3b232..6f77a8bd 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bcannon.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bcannon.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/beTunnel.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/beTunnel.glb index 43277211..0f3f1c52 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/beTunnel.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/beTunnel.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfBridge.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfBridge.glb index 2b68ecab..3f32e735 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfBridge.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfBridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfBridgeCap.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfBridgeCap.glb index 08a25522..af74737f 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfBridgeCap.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfBridgeCap.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfstand.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfstand.glb index f59d1f08..145975c5 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfstand.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bfstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bigTube.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bigTube.glb index 29a84310..b826faf3 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bigTube.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bigTube.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bmortar.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bmortar.glb index 201a8d3f..031c93f4 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bmortar.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bmortar.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bombbase.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bombbase.glb index 9043dac1..a34ad9a6 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bombbase.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/bombbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/cannonTunnel.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/cannonTunnel.glb index c6821ec3..bcc46efc 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/cannonTunnel.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/cannonTunnel.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/doxBunkerBase.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/doxBunkerBase.glb index 93352d45..3bbee1b3 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/doxBunkerBase.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/doxBunkerBase.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/doxRedStand.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/doxRedStand.glb index 975ad182..142bcbba 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/doxRedStand.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/doxRedStand.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_box_x2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_box_x2.glb index 566eb8e6..2ad6e6be 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_box_x2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_box_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_bunkera_x2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_bunkera_x2.glb index ea3ed750..c97cd64e 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_bunkera_x2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_bunkera_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_bunkerb_x2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_bunkerb_x2.glb index f8d3c5eb..45aa89ea 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_bunkerb_x2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_bunkerb_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_fstand_x2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_fstand_x2.glb index 30f6c331..274fad0d 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_fstand_x2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_fstand_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_hangar_x2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_hangar_x2.glb index 17fdfce0..54783e47 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_hangar_x2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_hangar_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_rig_x2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_rig_x2.glb index 4dbac3e5..a7ec03e9 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_rig_x2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_rig_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_rustbox_x2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_rustbox_x2.glb index 1883d158..46043c6e 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_rustbox_x2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_rustbox_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_sandcastle_x2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_sandcastle_x2.glb index 8d659b0c..58d8f9d0 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_sandcastle_x2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_sandcastle_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_slab_x2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_slab_x2.glb index d85b51e1..61a25455 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_slab_x2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_slab_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_spade_x2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_spade_x2.glb index 3e9024b4..0e7397cf 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_spade_x2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dox_bb_spade_x2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadL.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadL.glb index 1d2dcc51..e523ac7e 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadL.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadL.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadNeck.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadNeck.glb index d4cb1cdf..a327057a 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadNeck.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadNeck.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadR.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadR.glb index c39c4ef5..9229f075 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadR.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/dragonheadR.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_basatin-base.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_basatin-base.glb index 9e933426..7dd04dd4 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_basatin-base.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_basatin-base.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_catwalk_base.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_catwalk_base.glb index c04458c5..70070466 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_catwalk_base.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_catwalk_base.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_dx_4way-ramp.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_dx_4way-ramp.glb index 30d25f13..b1c65c3c 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_dx_4way-ramp.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_dx_4way-ramp.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_nirvana-base.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_nirvana-base.glb index 6d0e4842..28ecb975 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_nirvana-base.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_nirvana-base.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-BEbase.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-BEbase.glb index 28a7fe99..57161732 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-BEbase.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-BEbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-DSbase.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-DSbase.glb index 05f2a687..f5a7d945 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-DSbase.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-DSbase.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-turret.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-turret.glb index 32197b0c..f13bb92f 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-turret.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_sidewinder-turret.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_tg-base.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_tg-base.glb index ab4e0cb8..3621997a 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_tg-base.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ee_tg-base.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_bridge.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_bridge.glb index 4831b955..81dc414f 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_bridge.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_bridge.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_bridge_ramp.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_bridge_ramp.glb index 5965902f..bdb41dc7 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_bridge_ramp.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_bridge_ramp.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_midair_platform.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_midair_platform.glb index 297046bd..105ea93d 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_midair_platform.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ext_midair_platform.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facebasePlat.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facebasePlat.glb index 758c7ecf..4eb0cf11 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facebasePlat.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facebasePlat.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facingWorldsBase.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facingWorldsBase.glb index 0891f204..e5a8eeed 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facingWorldsBase.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facingWorldsBase.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facingWorldsBaseOld.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facingWorldsBaseOld.glb index 9a1bdc0d..1b31b07d 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facingWorldsBaseOld.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/facingWorldsBaseOld.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ffWall.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ffWall.glb index 51504c5e..92632a59 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ffWall.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/ffWall.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/frozenSolidStand.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/frozenSolidStand.glb index a838b6fa..a1058d33 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/frozenSolidStand.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/frozenSolidStand.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/largeIceWall.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/largeIceWall.glb index 4f2b4325..53893563 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/largeIceWall.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/largeIceWall.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/lightningRod.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/lightningRod.glb index 18a230e2..bfd3a819 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/lightningRod.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/lightningRod.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/mfg_tower.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/mfg_tower.glb index 42de3f8a..18e75550 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/mfg_tower.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/mfg_tower.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/monoS.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/monoS.glb index be61938f..0710a1a6 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/monoS.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/monoS.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/snowVal.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/snowVal.glb index 6b00aeb4..25ac7b71 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/snowVal.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/snowVal.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/snowtuar.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/snowtuar.glb index 34c4ed76..1325ec38 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/snowtuar.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/snowtuar.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/stormTopTunnel.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/stormTopTunnel.glb index 26142ad3..ccd90a33 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/stormTopTunnel.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/stormTopTunnel.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/stormstand.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/stormstand.glb index 378a1964..e2be6055 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/stormstand.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/stormstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/swTunnel.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/swTunnel.glb index 591bf17d..135db4f5 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/swTunnel.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/swTunnel.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_bowlstump.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_bowlstump.glb index ce3622d0..b1ab75ff 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_bowlstump.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_bowlstump.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_corridoor.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_corridoor.glb index 69a9d720..d0a8cabc 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_corridoor.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_corridoor.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_hollow.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_hollow.glb index 744eccc4..5d7cb167 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_hollow.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_hollow.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_main.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_main.glb index cc713b98..5c86b7b5 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_main.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_main.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_nocanopy.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_nocanopy.glb index a5ead7a9..70200a75 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_nocanopy.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_nocanopy.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_router.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_router.glb index 32fce6aa..70f47565 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_router.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_router.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_solid.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_solid.glb index 10d7f5db..193d25ec 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_solid.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_solid.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_stump.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_stump.glb index cd1e6ea3..938dee59 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_stump.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/tree_stump.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/vocstand.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/vocstand.glb index d9a2e01f..ae9c333a 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/vocstand.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/vocstand.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/waterStand.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/waterStand.glb index 4edda684..6f66bd0a 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/waterStand.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/interiors/waterStand.glb differ diff --git a/docs/index.html b/docs/index.html index f299879e..617aa821 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -MapGenius – Explore maps for Tribes 2 \ No newline at end of file +MapGenius – Explore maps for Tribes 2 \ No newline at end of file diff --git a/docs/index.txt b/docs/index.txt index 86a2de9d..adb421d0 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -2,7 +2,7 @@ 2:I[39756,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"default"] 3:I[37457,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"default"] 4:I[47257,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"ClientPageRoot"] -5:I[31713,["/t2-mapper/_next/static/chunks/a99c02adf7563d85.js","/t2-mapper/_next/static/chunks/32ef0c8650712240.js","/t2-mapper/_next/static/chunks/16bd4fe75afcb969.js","/t2-mapper/_next/static/chunks/49f75d30e4f6ac74.js"],"default"] +5:I[31713,["/t2-mapper/_next/static/chunks/ceb4ad0dd35367ed.js","/t2-mapper/_next/static/chunks/32ef0c8650712240.js","/t2-mapper/_next/static/chunks/7251a2126000b924.js","/t2-mapper/_next/static/chunks/c3ce0157f6850d44.js"],"default"] 8:I[97367,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"OutletBoundary"] a:I[11533,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"AsyncMetadataOutlet"] c:I[97367,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"ViewportBoundary"] @@ -10,7 +10,7 @@ e:I[97367,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"MetadataBounda f:"$Sreact.suspense" 11:I[68027,[],"default"] :HL["/t2-mapper/_next/static/chunks/15b04c9d2ba2c4cf.css","style"] -0:{"P":null,"b":"nuFCeK7OZLd9PDcpp99Xm","p":"/t2-mapper","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/15b04c9d2ba2c4cf.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/a99c02adf7563d85.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/32ef0c8650712240.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/16bd4fe75afcb969.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/49f75d30e4f6ac74.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/15b04c9d2ba2c4cf.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} +0:{"P":null,"b":"mO1QzAw7Pu83u0Fl2zAEJ","p":"/t2-mapper","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/15b04c9d2ba2c4cf.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/ceb4ad0dd35367ed.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/32ef0c8650712240.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/7251a2126000b924.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/c3ce0157f6850d44.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/15b04c9d2ba2c4cf.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} 6:{} 7:"$0:f:0:1:2:children:1:props:children:0:props:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/package-lock.json b/package-lock.json index 8c035329..6ccede20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,8 @@ "react-dom": "^19.1.1", "react-error-boundary": "^6.0.0", "three": "^0.180.0", - "unzipper": "^0.12.3" + "unzipper": "^0.12.3", + "zustand": "^5.0.9" }, "devDependencies": { "@types/express": "^5.0.5", @@ -36,6 +37,7 @@ "express": "^5.2.0", "peggy": "^5.0.6", "prettier": "^3.7.1", + "prettier-plugin-glsl": "^0.2.2", "puppeteer": "^24.32.0", "rimraf": "^6.0.1", "tsx": "^4.20.5", @@ -115,6 +117,43 @@ "node": ">=6.9.0" } }, + "node_modules/@chevrotain/cst-dts-gen": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-10.5.0.tgz", + "integrity": "sha512-lhmC/FyqQ2o7pGK4Om+hzuDrm9rhFYIJ/AXoQBeongmn870Xeb0L6oGEiuR8nohFNL5sMaQEJWCxr1oIVIVXrw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@chevrotain/gast": "10.5.0", + "@chevrotain/types": "10.5.0", + "lodash": "4.17.21" + } + }, + "node_modules/@chevrotain/gast": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-10.5.0.tgz", + "integrity": "sha512-pXdMJ9XeDAbgOWKuD1Fldz4ieCs6+nLNmyVhe2gZVqoO7v8HXuHYs5OV2EzUtbuai37TlOAQHrTDvxMnvMJz3A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@chevrotain/types": "10.5.0", + "lodash": "4.17.21" + } + }, + "node_modules/@chevrotain/types": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-10.5.0.tgz", + "integrity": "sha512-f1MAia0x/pAVPWH/T73BJVyO2XU5tI4/iE7cnxb7tqdNTNhQI3Uq3XkqcoteTmD4t1aM0LbHCJOhgIDn07kl2A==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@chevrotain/utils": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-10.5.0.tgz", + "integrity": "sha512-hBzuU5+JjB2cqNZyszkDHZgOSrUUT8V3dhgRl8Q9Gp6dAj/H5+KILGjbhDpc3Iy9qmqlm/akuOI2ut9VUtzJxQ==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/@dimforge/rapier3d-compat": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/@dimforge/rapier3d-compat/-/rapier3d-compat-0.12.0.tgz", @@ -1082,6 +1121,18 @@ "three": ">= 0.159.0" } }, + "node_modules/@netflix/nerror": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@netflix/nerror/-/nerror-1.1.3.tgz", + "integrity": "sha512-b+MGNyP9/LXkapreJzNUzcvuzZslj/RGgdVVJ16P2wSlYatfLycPObImqVJSmNAdyeShvNeM/pl3sVZsObFueg==", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "extsprintf": "^1.4.0", + "lodash": "^4.17.15" + } + }, "node_modules/@next/env": { "version": "15.5.2", "resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.2.tgz", @@ -2188,6 +2239,16 @@ "dev": true, "license": "Python-2.0" }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -2521,6 +2582,21 @@ "node": ">=18" } }, + "node_modules/chevrotain": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-10.5.0.tgz", + "integrity": "sha512-Pkv5rBY3+CsHOYfV5g/Vs5JY9WTHHDEKOlohI2XeygaZhUeqhAlldZ8Hz9cRmxu709bvS08YzxHdTPHhffc13A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@chevrotain/cst-dts-gen": "10.5.0", + "@chevrotain/gast": "10.5.0", + "@chevrotain/types": "10.5.0", + "@chevrotain/utils": "10.5.0", + "lodash": "4.17.21", + "regexp-to-ast": "0.5.0" + } + }, "node_modules/chromium-bidi": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-11.0.0.tgz", @@ -3243,6 +3319,16 @@ "@types/yauzl": "^2.9.1" } }, + "node_modules/extsprintf": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz", + "integrity": "sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" + }, "node_modules/fast-fifo": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", @@ -3827,6 +3913,13 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.orderby": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.orderby/-/lodash.orderby-4.6.0.tgz", @@ -4362,6 +4455,7 @@ "integrity": "sha512-RWKXE4qB3u5Z6yz7omJkjWwmTfLdcbv44jUVHC5NpfXwFGzvpQM798FGv/6WNK879tc+Cn0AAyherCl1KjbyZQ==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -4372,6 +4466,21 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-glsl": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/prettier-plugin-glsl/-/prettier-plugin-glsl-0.2.2.tgz", + "integrity": "sha512-VD4A59LtF6Eyw7FS46tOh6ZhVbIrdk3ikEPiFkyOAr8RgnuiL2Ad5EnuDqxYYzBqEPO3xDfhejieF3Q/AL5+7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@netflix/nerror": "^1.1.3", + "chevrotain": "^10.5.0", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "prettier": "^3.0.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -4629,6 +4738,13 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/regexp-to-ast": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz", + "integrity": "sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==", + "dev": true, + "license": "MIT" + }, "node_modules/remove-accents": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/remove-accents/-/remove-accents-0.5.0.tgz", @@ -6083,9 +6199,9 @@ } }, "node_modules/zustand": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.8.tgz", - "integrity": "sha512-gyPKpIaxY9XcO2vSMrLbiER7QMAMGOQZVRdJ6Zi782jkbzZygq5GI9nG8g+sMgitRtndwaBSl7uiqC49o1SSiw==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.9.tgz", + "integrity": "sha512-ALBtUj0AfjJt3uNRQoL1tL2tMvj6Gp/6e39dnfT6uzpelGru8v1tPOGBzayOWbPJvujM8JojDk3E1LxeFisBNg==", "license": "MIT", "engines": { "node": ">=12.20.0" diff --git a/package.json b/package.json index 3d8757ae..cd01cfc3 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,8 @@ "react-dom": "^19.1.1", "react-error-boundary": "^6.0.0", "three": "^0.180.0", - "unzipper": "^0.12.3" + "unzipper": "^0.12.3", + "zustand": "^5.0.9" }, "devDependencies": { "@types/express": "^5.0.5", @@ -49,6 +50,7 @@ "express": "^5.2.0", "peggy": "^5.0.6", "prettier": "^3.7.1", + "prettier-plugin-glsl": "^0.2.2", "puppeteer": "^24.32.0", "rimraf": "^6.0.1", "tsx": "^4.20.5", diff --git a/reference/TorqueEngineResources b/reference/TorqueEngineResources new file mode 120000 index 00000000..85a77053 --- /dev/null +++ b/reference/TorqueEngineResources @@ -0,0 +1 @@ +../../TorqueEngineResources \ No newline at end of file diff --git a/scripts/screenshot.ts b/scripts/screenshot.ts index 3eaa24a1..828ca2f9 100644 --- a/scripts/screenshot.ts +++ b/scripts/screenshot.ts @@ -1,4 +1,4 @@ -import fs from "node:fs"; +import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; import puppeteer, { type KeyInput } from "puppeteer"; @@ -41,11 +41,6 @@ if (!missionName) { const cameraKey = String(cameraNumber) as KeyInput; const outputType = "png"; -const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "t2-screenshot-")); -const outputPath = path.join( - tempDir, - `${missionName}.${cameraNumber}.${debugMode ? "debug." : ""}${outputType}`, -); const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage(); @@ -100,6 +95,16 @@ await mapViewer.press(cameraKey); await page.waitForNetworkIdle({ idleTime: 250 }); await sleep(100); +const date = new Date() +const tempDir = path.join(os.tmpdir(), "t2-mapper"); + +await fs.mkdir(tempDir, { recursive: true }); +const filePrefix = date.toISOString().replace(/([:-]|\..*$)/g, '') +const outputPath = path.join( + tempDir, + `${filePrefix}.${missionName}.${cameraNumber}.${outputType}` +); + // Take screenshot await mapViewer.screenshot({ path: outputPath, diff --git a/src/colorUtils.ts b/src/colorUtils.ts new file mode 100644 index 00000000..8603d551 --- /dev/null +++ b/src/colorUtils.ts @@ -0,0 +1,38 @@ +/** + * Color parsing utilities for Tribes 2 mission files. + * + * Torque (2001) worked in gamma/sRGB space - colors in mission files are + * specified as they should appear on screen. Three.js expects linear colors + * for lighting calculations, so convert with .convertSRGBToLinear() when + * passing to lit materials. + */ +import { Color, SRGBColorSpace } from "three"; + +/** + * Parse a Tribes 2 color string (space-separated RGB or RGBA values 0-1). + * The values are interpreted as sRGB and stored as linear internally by Three.js. + * + * @param colorString - Space-separated "R G B" or "R G B A" string (0-1 range) + * @returns Color (linear internally), or undefined if no string + */ +export function parseColor(colorString: string | undefined): Color | undefined { + if (!colorString) return undefined; + const parts = colorString.split(" ").map((s) => parseFloat(s)); + const [r = 0, g = 0, b = 0] = parts; + // Interpret as sRGB, Three.js converts to linear internally + return new Color().setRGB(r, g, b, SRGBColorSpace); +} + +/** + * Parse a Tribes 2 color string and convert to linear color space. + * Use this when passing colors to Three.js lit materials. + * + * @param colorString - Space-separated "R G B" or "R G B A" string (0-1 range) + * @returns Color in linear space, or undefined if no string + */ +export function parseColorLinear( + colorString: string | undefined, +): Color | undefined { + const color = parseColor(colorString); + return color?.convertSRGBToLinear(); +} diff --git a/src/components/CloudLayers.tsx b/src/components/CloudLayers.tsx index 86d68301..f1c3c326 100644 --- a/src/components/CloudLayers.tsx +++ b/src/components/CloudLayers.tsx @@ -19,6 +19,8 @@ import type { TorqueObject } from "../torqueScript"; import { getFloat, getProperty } from "../mission"; import { useDebug, useSettings } from "./SettingsProvider"; +const noop = () => {}; + const GRID_SIZE = 5; const VERTEX_COUNT = GRID_SIZE * GRID_SIZE; @@ -344,8 +346,6 @@ interface CloudLayerProps { speed: number; windDirection: Vector2; layerIndex: number; - debugMode: boolean; - animationEnabled: boolean; } /** @@ -358,11 +358,10 @@ function CloudLayer({ speed, windDirection, layerIndex, - debugMode, - animationEnabled, }: CloudLayerProps) { - const materialRef = useRef(null!); - const offsetRef = useRef(new Vector2(0, 0)); + const { debugMode } = useDebug(); + const { animationEnabled } = useSettings(); + const offsetRef = useRef(null); // Load cloud texture const texture = useTexture(textureUrl, setupCloudTexture); @@ -376,6 +375,12 @@ function CloudLayer({ return createCloudGeometry(radius, centerHeight, innerHeight, edgeHeight); }, [radius, heightPercent]); + useEffect(() => { + return () => { + geometry.dispose(); + }; + }, [geometry]); + // Create shader material const material = useMemo(() => { return new ShaderMaterial({ @@ -393,36 +398,38 @@ function CloudLayer({ }); }, [texture, debugMode, layerIndex]); + useEffect(() => { + return () => { + material.dispose(); + }; + }, [material]); + // Animate UV offset for cloud scrolling // From Tribes 2: mOffset = (currentTime - mLastTime) / 32.0 (time in ms) // delta is in seconds, so: delta * 1000 / 32 = delta * 31.25 - useFrame((_, delta) => { - if (!materialRef.current || !animationEnabled) return; + useFrame( + animationEnabled + ? (_, delta) => { + // Match Tribes 2 timing: deltaTime(ms) / 32 + const mOffset = (delta * 1000) / 32; - // Match Tribes 2 timing: deltaTime(ms) / 32 - const mOffset = (delta * 1000) / 32; + offsetRef.current ??= new Vector2(0, 0); - offsetRef.current.x += windDirection.x * speed * mOffset; - offsetRef.current.y += windDirection.y * speed * mOffset; + offsetRef.current.x += windDirection.x * speed * mOffset; + offsetRef.current.y += windDirection.y * speed * mOffset; - // Wrap to [0,1] range - offsetRef.current.x = offsetRef.current.x - Math.floor(offsetRef.current.x); - offsetRef.current.y = offsetRef.current.y - Math.floor(offsetRef.current.y); + // Wrap to [0,1] range + offsetRef.current.x -= Math.floor(offsetRef.current.x); + offsetRef.current.y -= Math.floor(offsetRef.current.y); - materialRef.current.uniforms.uvOffset.value.copy(offsetRef.current); - }); - - // Cleanup - useEffect(() => { - return () => { - geometry.dispose(); - material.dispose(); - }; - }, [geometry, material]); + material.uniforms.uvOffset.value.copy(offsetRef.current); + } + : noop, + ); return ( - + ); } @@ -439,7 +446,7 @@ export interface CloudLayerConfig { * 6: Environment map * 7+: Cloud layer textures */ -const CLOUD_TEXTURE_OFFSET = 7; +const CLOUD_TEXTURE_START_INDEX = 7; /** * Hook to load a DML file. @@ -467,8 +474,6 @@ export interface CloudLayersProps { * - windVelocity: Wind direction for cloud movement */ export function CloudLayers({ object }: CloudLayersProps) { - const { debugMode } = useDebug(); - const { animationEnabled } = useSettings(); const materialList = getProperty(object, "materialList"); const { data: detailMapList } = useDetailMapList(materialList); @@ -476,7 +481,6 @@ export function CloudLayers({ object }: CloudLayersProps) { const visibleDistance = getFloat(object, "visibleDistance") ?? 500; const radius = visibleDistance * 0.95; - // Extract cloud speeds from object (cloudSpeed1/2/3 are scalar values) const cloudSpeeds = useMemo( () => [ getFloat(object, "cloudSpeed1") ?? 0.0001, @@ -486,17 +490,14 @@ export function CloudLayers({ object }: CloudLayersProps) { [object], ); - // Extract cloud heights from object - // Default heights match typical Tribes 2 values (e.g., 0.35, 0.25, 0.2) - const cloudHeights = useMemo(() => { - const defaults = [0.35, 0.25, 0.2]; - const heights: number[] = []; - for (let i = 0; i < 3; i++) { - const height = getFloat(object, `cloudHeightPer${i}`) ?? defaults[i]; - heights.push(height); - } - return heights; - }, [object]); + const cloudHeights = useMemo( + () => [ + getFloat(object, "cloudHeightPer1") ?? 0.35, + getFloat(object, "cloudHeightPer2") ?? 0.25, + getFloat(object, "cloudHeightPer3") ?? 0.2, + ], + [object], + ); // Wind direction from windVelocity // Torque uses Z-up with windVelocity (x, y, z) where Y is forward. @@ -519,14 +520,13 @@ export function CloudLayers({ object }: CloudLayersProps) { if (!detailMapList) return []; const result: CloudLayerConfig[] = []; - for (let i = CLOUD_TEXTURE_OFFSET; i < detailMapList.length; i++) { - const texture = detailMapList[i]; + for (let i = 0; i < 3; i++) { + const texture = detailMapList[CLOUD_TEXTURE_START_INDEX + i]; if (texture) { - const layerIndex = i - CLOUD_TEXTURE_OFFSET; result.push({ texture, - height: cloudHeights[layerIndex] ?? 0, - speed: cloudSpeeds[layerIndex] ?? 0.0001 * (layerIndex + 1), + height: cloudHeights[i], + speed: cloudSpeeds[i], }); } } @@ -562,8 +562,6 @@ export function CloudLayers({ object }: CloudLayersProps) { speed={layer.speed} windDirection={windDirection} layerIndex={i} - debugMode={debugMode} - animationEnabled={animationEnabled} /> ); diff --git a/src/components/GenericShape.tsx b/src/components/GenericShape.tsx index c0831eb4..788b679b 100644 --- a/src/components/GenericShape.tsx +++ b/src/components/GenericShape.tsx @@ -79,8 +79,8 @@ function createMaterialFromFlags( side: 2, // DoubleSide transparent: isAdditive, alphaTest: isAdditive ? 0 : 0.5, - blending: isAdditive ? AdditiveBlending : undefined, fog: true, + ...(isAdditive && { blending: AdditiveBlending }), }); applyShapeShaderModifications(mat); return mat; diff --git a/src/components/InteriorInstance.tsx b/src/components/InteriorInstance.tsx index d94de9ad..ffa8e39f 100644 --- a/src/components/InteriorInstance.tsx +++ b/src/components/InteriorInstance.tsx @@ -1,9 +1,11 @@ -import { memo, Suspense, useMemo, useCallback } from "react"; +import { memo, Suspense, useMemo, useCallback, useEffect, useRef } from "react"; import { ErrorBoundary } from "react-error-boundary"; import { Mesh, Material, MeshStandardMaterial, + MeshBasicMaterial, + MeshLambertMaterial, Texture, SRGBColorSpace, } from "three"; @@ -58,23 +60,43 @@ function InteriorTexture({ injectCustomFog(shader, globalFogUniforms); injectInteriorLighting(shader, { surfaceOutsideVisible: isSurfaceOutsideVisible, - debugMode, }); }, - [isSurfaceOutsideVisible, debugMode], + [isSurfaceOutsideVisible], ); - // Key includes shader-affecting props to force recompilation when they change - // (r3f doesn't reactively recompile shaders on prop changes) - const materialKey = `${isSurfaceOutsideVisible}-${debugMode}`; + // Refs for forcing shader recompilation + const basicMaterialRef = useRef(null); + const lambertMaterialRef = useRef(null); + + // Force shader recompilation when debugMode changes + // r3f doesn't sync defines prop changes, so we update the material directly + useEffect(() => { + const mat = (basicMaterialRef.current ?? lambertMaterialRef.current) as + | (Material & { defines?: Record }) + | null; + if (mat) { + mat.defines ??= {}; + mat.defines.DEBUG_MODE = debugMode ? 1 : 0; + mat.needsUpdate = true; + } + }, [debugMode]); + + const defines = { DEBUG_MODE: debugMode ? 1 : 0 }; + + // Key for shader structure changes (surfaceOutsideVisible affects lighting model) + const materialKey = `${isSurfaceOutsideVisible}`; // Self-illuminating materials are fullbright (unlit), no lightmap if (isSelfIlluminating) { return ( ); @@ -89,10 +111,13 @@ function InteriorTexture({ // Using FrontSide (default) - normals are fixed in io_dif Blender export return ( ); diff --git a/src/components/SettingsProvider.tsx b/src/components/SettingsProvider.tsx index 8dadea50..09d073c7 100644 --- a/src/components/SettingsProvider.tsx +++ b/src/components/SettingsProvider.tsx @@ -3,6 +3,7 @@ import { ReactNode, useContext, useEffect, + useLayoutEffect, useMemo, useRef, useState, @@ -95,7 +96,7 @@ export function SettingsProvider({ children }: { children: ReactNode }) { ); // Read persisted settings from localStorage. - useEffect(() => { + useLayoutEffect(() => { let savedSettings: PersistedSettings = {}; try { savedSettings = JSON.parse(localStorage.getItem("settings")) || {}; diff --git a/src/components/Sky.tsx b/src/components/Sky.tsx index b387cb96..20fb61ef 100644 --- a/src/components/Sky.tsx +++ b/src/components/Sky.tsx @@ -79,6 +79,19 @@ function SkyBoxTexture({ [fogState], ); + // Create stable uniform objects that persist across renders + // This ensures the shader gets updated values when props change + const uniformsRef = useRef({ + skybox: { value: skyBox }, + fogColor: { value: fogColor ?? new Color(0, 0, 0) }, + enableFog: { value: enableFog }, + inverseProjectionMatrix: { value: inverseProjectionMatrix }, + cameraMatrixWorld: { value: camera.matrixWorld }, + cameraHeight: globalFogUniforms.cameraHeight, + fogVolumeData: { value: fogVolumeData }, + horizonFogHeight: { value: 0.18 }, + }); + // Calculate the horizon fog cutoff based on visible distance // In Torque's sky.cc: // mRadius = visibleDistance * 0.95 @@ -106,6 +119,15 @@ function SkyBoxTexture({ ); }, [fogState]); + // Update uniform values when props change + useEffect(() => { + uniformsRef.current.skybox.value = skyBox; + uniformsRef.current.fogColor.value = fogColor ?? new Color(0, 0, 0); + uniformsRef.current.enableFog.value = enableFog; + uniformsRef.current.fogVolumeData.value = fogVolumeData; + uniformsRef.current.horizonFogHeight.value = horizonFogHeight; + }, [skyBox, fogColor, enableFog, fogVolumeData, horizonFogHeight]); + return ( @@ -123,16 +145,7 @@ function SkyBoxTexture({ /> { + uniformsRef.current.skyColor.value = skyColor; + uniformsRef.current.fogColor.value = fogColor ?? new Color(0, 0, 0); + uniformsRef.current.enableFog.value = enableFog; + uniformsRef.current.fogVolumeData.value = fogVolumeData; + uniformsRef.current.horizonFogHeight.value = horizonFogHeight; + }, [skyColor, fogColor, enableFog, fogVolumeData, horizonFogHeight]); + return ( @@ -356,16 +390,7 @@ function SolidColorSky({ /> (null); @@ -530,6 +561,24 @@ function DynamicFog({ fogState }: { fogState: FogState }) { }; }, [scene, camera, fogState, fogVolumeData]); + // When fog is disabled, set near=far to effectively disable fog + // without removing scene.fog (which would require shader recompilation) + useEffect(() => { + const fog = fogRef.current; + if (!fog) return; + + if (enabled) { + const [near, far] = calculateFogParameters(fogState, camera.position.y); + fog.near = near; + fog.far = far; + } else { + // Setting near = far = large value effectively disables fog + // (fog factor = 0 when distance < near) + fog.near = 1e10; + fog.far = 1e10; + } + }, [enabled, fogState, camera.position.y]); + // Update fog parameters each frame based on camera height useFrame(() => { const fog = fogRef.current; @@ -537,14 +586,17 @@ function DynamicFog({ fogState }: { fogState: FogState }) { const cameraHeight = camera.position.y; - // Update Three.js basic fog - const [near, far] = calculateFogParameters(fogState, cameraHeight); - fog.near = near; - fog.far = far; - fog.color.copy(fogState.fogColor); + // Always update global fog uniforms so shaders know the enabled state + updateGlobalFogUniforms(cameraHeight, fogVolumeData, enabled); - // Update global fog uniforms for volumetric fog shaders - updateGlobalFogUniforms(cameraHeight, fogVolumeData); + if (enabled) { + // Update Three.js basic fog + const [near, far] = calculateFogParameters(fogState, cameraHeight); + fog.near = near; + fog.far = far; + fog.color.copy(fogState.fogColor); + } + // When disabled, fog.near/far are already set to 1e10 by the useEffect }); return null; @@ -632,7 +684,12 @@ export function Sky({ object }: { object: TorqueObject }) { - {hasFogParams ? : null} + {/* Always render DynamicFog when mission has fog params. + Pass fogEnabled to control visibility - this avoids shader recompilation + when toggling fog (USE_FOG stays defined, but fog.near/far disable fog). */} + {fogState.enabled ? ( + + ) : null} ); } diff --git a/src/components/TerrainProvider.tsx b/src/components/TerrainProvider.tsx new file mode 100644 index 00000000..665fd58c --- /dev/null +++ b/src/components/TerrainProvider.tsx @@ -0,0 +1,89 @@ +import { createContext, ReactNode, useContext, useMemo, useState } from "react"; + +/** + * Handle for querying terrain data. + * + * TerrainBlock registers this via useEffect, allowing other components + * to query terrain data without prop drilling. + */ +export interface TerrainHandle { + /** + * Query terrain height at world coordinates. + * Coordinates wrap via `& 255` to support infinite terrain tiling, + * matching Torque's FluidSupport.cc: + * i = (((m_SquareY0+Y) & 255) << 8) + ((m_SquareX0+X) & 255); + */ + getHeightAt: (worldX: number, worldZ: number) => number; + + /** + * Check if a point is above terrain at given world coordinates. + * Used for water masking (matching Torque's fluid reject mask). + * Coordinates wrap to support infinite terrain tiling. + */ + isAboveTerrain: (worldX: number, worldZ: number, height: number) => boolean; + + /** + * Get primary terrain tile bounds in world coordinates. + * Note: Terrain actually tiles infinitely via coordinate wrapping. + */ + getBounds: () => { + minX: number; + maxX: number; + minZ: number; + maxZ: number; + }; +} + +type StateSetter = ReturnType>[1]; + +interface TerrainContextValue { + terrain: TerrainHandle | null; + setTerrain: StateSetter; +} + +const TerrainContext = createContext(null); + +interface TerrainProviderProps { + children: ReactNode; +} + +/** + * Provider for terrain query handle. + * + * TerrainBlock registers its handle via useEffect on mount, and other + * components (like WaterBlock) can access it to query terrain heights. + */ +export function TerrainProvider({ children }: TerrainProviderProps) { + const [terrain, setTerrain] = useState(null); + const context = useMemo(() => ({ terrain, setTerrain }), [terrain]); + + return ( + + {children} + + ); +} + +/** + * Get the terrain handle from context. + * Returns null if no TerrainBlock has registered yet. + */ +export function useTerrainHandle() { + const context = useContext(TerrainContext); + if (!context) { + throw new Error("useTerrainHandle must be used within a TerrainProvider"); + } + return context.terrain; +} + +/** + * Get the terrain setter for registration. + * Used by TerrainBlock to register its handle. + */ +export function useRegisterTerrain() { + const context = useContext(TerrainContext); + if (!context) { + throw new Error("useRegisterTerrain must be used within a TerrainProvider"); + } + return context.setTerrain; +} diff --git a/src/components/TerrainTile.tsx b/src/components/TerrainTile.tsx index 1363877b..724b05a3 100644 --- a/src/components/TerrainTile.tsx +++ b/src/components/TerrainTile.tsx @@ -1,5 +1,10 @@ -import { memo, Suspense, useCallback, useMemo } from "react"; -import { type BufferGeometry, DataTexture, FrontSide } from "three"; +import { memo, Suspense, useCallback, useEffect, useMemo, useRef } from "react"; +import { + type BufferGeometry, + DataTexture, + FrontSide, + type MeshLambertMaterial, +} from "three"; import { useTexture } from "@react-three/drei"; import { FALLBACK_TEXTURE_URL, @@ -83,7 +88,6 @@ function BlendedTerrainTextures({ alphaTextures, visibilityMask, tiling: TILING, - debugMode, detailTexture: detailTextureUrl ? detailTexture : null, lightmap, }); @@ -95,28 +99,43 @@ function BlendedTerrainTextures({ baseTextures, alphaTextures, visibilityMask, - debugMode, detailTexture, detailTextureUrl, lightmap, ], ); - // Key must include factors that change shader code structure (not just uniforms) - // - debugMode: affects fragment shader branching - // - detailTextureUrl: affects vertex shader (adds varying) and fragment shader - // - lightmap: affects shader structure (uses lightmap for NdotL instead of vertex normals) - const materialKey = `${debugMode ? "debug" : "normal"}-${detailTextureUrl ? "detail" : "nodetail"}-${lightmap ? "lightmap" : "nolightmap"}`; + // Ref for forcing shader recompilation + const materialRef = useRef(null); + + // Force shader recompilation when debugMode changes + // r3f doesn't sync defines prop changes, so we update the material directly + useEffect(() => { + const mat = materialRef.current as MeshLambertMaterial & { + defines?: Record; + }; + if (mat) { + mat.defines ??= {}; + mat.defines.DEBUG_MODE = debugMode ? 1 : 0; + mat.needsUpdate = true; + } + }, [debugMode]); + + // Key for shader structure changes (detail texture, lightmap) + const materialKey = `${detailTextureUrl ? "detail" : "nodetail"}-${lightmap ? "lightmap" : "nolightmap"}`; // Displacement is done on CPU, so no displacementMap needed // We keep 'map' to provide UV coordinates for shader (vMapUv) // Use MeshLambertMaterial for compatibility with shadow maps return ( ); diff --git a/src/components/WaterBlock.tsx b/src/components/WaterBlock.tsx index 24989140..a23e5f6d 100644 --- a/src/components/WaterBlock.tsx +++ b/src/components/WaterBlock.tsx @@ -1,13 +1,30 @@ -import { memo, Suspense, useEffect, useMemo, useRef } from "react"; -import { useTexture } from "@react-three/drei"; -import { useFrame } from "@react-three/fiber"; +import { memo, Suspense, useEffect, useMemo, useRef, useState } from "react"; +import { Box, useTexture } from "@react-three/drei"; +import { useFrame, useThree } from "@react-three/fiber"; import { DoubleSide, NoColorSpace, PlaneGeometry, RepeatWrapping } from "three"; import { textureToUrl } from "../loaders"; import type { TorqueObject } from "../torqueScript"; -import { getPosition, getProperty, getRotation, getScale } from "../mission"; +import { + getFloat, + getPosition, + getProperty, + getRotation, + getScale, +} from "../mission"; import { setupColor } from "../textureUtils"; import { createWaterMaterial } from "../waterMaterial"; -import { useSettings } from "./SettingsProvider"; +import { useDebug, useSettings } from "./SettingsProvider"; +import { usePositionTracker } from "./usePositionTracker"; + +const REP_SIZE = 2048; + +/** + * Terrain coordinate offset from world space. + * In Tribes 2, terrain coordinates are offset by +1024 from world coordinates. + * This allows world positions like (-672, -736) to map to valid terrain + * positions (352, 288) after the offset. + */ +const TERRAIN_OFFSET = 1024; /** * Calculate tessellation to match Tribes 2 engine. @@ -35,81 +52,6 @@ function calculateWaterSegments( return [segmentsX, segmentsZ]; } -/** - * Animated water surface material using Tribes 2-accurate shader. - * - * The Torque V12 engine renders water in multiple passes: - * - Phase 1a/1b: Two cross-faded base texture passes, each rotated 30° - * - Phase 3: Environment/specular map with reflection UVs - * - Phase 4: Fog overlay - */ -export function WaterSurfaceMaterial({ - surfaceTexture, - envMapTexture, - opacity = 0.75, - waveMagnitude = 1.0, - envMapIntensity = 1.0, - attach, -}: { - surfaceTexture: string; - envMapTexture?: string; - opacity?: number; - waveMagnitude?: number; - envMapIntensity?: number; - attach?: string; -}) { - const baseUrl = textureToUrl(surfaceTexture); - const envUrl = textureToUrl(envMapTexture ?? "special/lush_env"); - - const [baseTexture, envTexture] = useTexture( - [baseUrl, envUrl], - (textures) => { - const texArray = Array.isArray(textures) ? textures : [textures]; - texArray.forEach((tex) => { - setupColor(tex); - // Use NoColorSpace for water textures - our custom ShaderMaterial - // outputs values that are already in the correct space for display. - // Using SRGBColorSpace would cause double-conversion. - tex.colorSpace = NoColorSpace; - tex.wrapS = RepeatWrapping; - tex.wrapT = RepeatWrapping; - }); - }, - ); - - const { animationEnabled } = useSettings(); - - const material = useMemo(() => { - return createWaterMaterial({ - opacity, - waveMagnitude, - envMapIntensity, - baseTexture, - envMapTexture: envTexture, - }); - }, [opacity, waveMagnitude, envMapIntensity, baseTexture, envTexture]); - - const elapsedRef = useRef(0); - - useFrame((_, delta) => { - if (!animationEnabled) { - elapsedRef.current = 0; - material.uniforms.uTime.value = 0; - return; - } - elapsedRef.current += delta; - material.uniforms.uTime.value = elapsedRef.current; - }); - - useEffect(() => { - return () => { - material.dispose(); - }; - }, [material]); - - return ; -} - /** * Simple fallback material for non-top faces and loading state. */ @@ -145,26 +87,117 @@ export function WaterMaterial({ * * Unlike a simple box, we use a subdivided PlaneGeometry for the water surface * so that vertex displacement can create visible waves. + * + * Water tiling follows Torque's FluidQuadTree.cc behavior: + * - Determines camera's terrain "rep" via I = (s32)(m_Eye.X / 2048.0f) + * - Renders 9 reps (3x3 grid) centered on camera's rep */ export const WaterBlock = memo(function WaterBlock({ object, }: { object: TorqueObject; }) { - const position = useMemo(() => getPosition(object), [object]); + const { debugMode } = useDebug(); const q = useMemo(() => getRotation(object), [object]); - const [scaleX, scaleY, scaleZ] = useMemo(() => getScale(object), [object]); + const position = useMemo(() => getPosition(object), [object]); + const scale = useMemo(() => getScale(object), [object]); + const [scaleX, scaleY, scaleZ] = scale; + const camera = useThree((state) => state.camera); + const hasCameraPositionChanged = usePositionTracker(); + + // Water surface height (top of water volume) + // TODO: Use this for terrain intersection masking (reject water blocks where + // terrain height > surfaceZ + waveMagnitude/2). Requires TerrainProvider. + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const surfaceZ = position[1] + scaleY; + + // Wave magnitude affects terrain masking (Torque adds half to surface height) + const waveMagnitude = getFloat(object, "waveMagnitude") ?? 1.0; + + // Convert world position to terrain space and snap to grid. + // Matches Torque's UpdateFluidRegion() and fluid::SetInfo(): + // 1. Add TERRAIN_OFFSET (1024) to convert world -> terrain space + // 2. Round to nearest terrain square: (s32)((X0 / 8.0f) + 0.5f) = Math.round(x/8) + // 3. Clamp to valid terrain range [0, 2040] squares + // 4. Convert back to world units (multiply by 8) + const basePosition = useMemo(() => { + const [x, y, z] = position; + + // Convert to terrain space (add 1024 offset) + const terrainX = x + TERRAIN_OFFSET; + const terrainZ = z + TERRAIN_OFFSET; + + // Round to terrain squares: (s32)((X0 / 8.0f) + 0.5f) is Math.round() + let squareX = Math.round(terrainX / 8); + let squareZ = Math.round(terrainZ / 8); + + // Clamp to valid range [0, 2040] as in fluidSupport.cc + squareX = Math.max(0, Math.min(2040, squareX)); + squareZ = Math.max(0, Math.min(2040, squareZ)); + + // Convert back to world units (terrain squares * 8) + // This is the fluid's anchor point in terrain space + const baseX = squareX * 8; + const baseZ = squareZ * 8; + + return [baseX, y, baseZ] as [number, number, number]; + }, [position]); + + // Calculate 3x3 grid of reps centered on camera position. + // ALL water blocks use 9-rep tiling - the masking system handles visibility. + // Matches fluidQuadTree.cc RunQuadTree(): + // I = (s32)(m_Eye.X / 2048.0f); + // if( m_Eye.X < 0.0f ) I--; + const calculateReps = (camX: number, camZ: number): Array<[number, number]> => { + // Convert camera to terrain space + const terrainCamX = camX + TERRAIN_OFFSET; + const terrainCamZ = camZ + TERRAIN_OFFSET; + + // Determine camera's terrain rep using terrain coordinates. + // Torque uses: I = (s32)(m_Eye.X / 2048.0f); if (m_Eye.X < 0) I--; + // This is truncation toward zero, then decrement for negative. + let cameraRepX = Math.trunc(terrainCamX / REP_SIZE); + let cameraRepZ = Math.trunc(terrainCamZ / REP_SIZE); + if (terrainCamX < 0) cameraRepX--; + if (terrainCamZ < 0) cameraRepZ--; + + // Build 3x3 grid of reps around camera + const newReps: Array<[number, number]> = []; + for (let repZ = cameraRepZ - 1; repZ <= cameraRepZ + 1; repZ++) { + for (let repX = cameraRepX - 1; repX <= cameraRepX + 1; repX++) { + newReps.push([repX, repZ]); + } + } + return newReps; + }; + + // Track which reps to render, updated each frame based on camera position. + // Initialize with current camera position so water is visible immediately. + const [reps, setReps] = useState>(() => + calculateReps(camera.position.x, camera.position.z), + ); + + useFrame(() => { + if (!hasCameraPositionChanged(camera.position)) { + return; + } + + const newReps = calculateReps(camera.position.x, camera.position.z); + + // Only update state if reps actually changed (avoid unnecessary re-renders) + setReps((prevReps) => { + if (JSON.stringify(prevReps) === JSON.stringify(newReps)) { + return prevReps; + } + return newReps; + }); + }); const surfaceTexture = getProperty(object, "surfaceTexture") ?? "liquidTiles/BlueWater"; const envMapTexture = getProperty(object, "envMapTexture"); - const opacity = parseFloat(getProperty(object, "surfaceOpacity") ?? "0.75"); - const waveMagnitude = parseFloat( - getProperty(object, "waveMagnitude") ?? "1.0", - ); - const envMapIntensity = parseFloat( - getProperty(object, "envMapIntensity") ?? "1.0", - ); + const opacity = getFloat(object, "surfaceOpacity") ?? 0.75; + const envMapIntensity = getFloat(object, "envMapIntensity") ?? 1.0; // Create subdivided plane geometry for the water surface // Tessellation matches Tribes 2 engine (5x5 vertices per block) @@ -177,8 +210,8 @@ export const WaterBlock = memo(function WaterBlock({ // Rotate from XY plane to XZ plane (lying flat) geom.rotateX(-Math.PI / 2); - // Translate so origin is at corner (matching Torque's water block positioning) - // and position at top of water volume (Y = scaleY) + // Position at top of water volume (Y = scaleY) + // Offset by half scale to put corner at origin (position is corner after modulo) geom.translate(scaleX / 2, scaleY, scaleZ / 2); return geom; @@ -190,30 +223,148 @@ export const WaterBlock = memo(function WaterBlock({ }; }, [surfaceGeometry]); + // Render each rep that overlaps with terrain bounds return ( - - {/* Water surface - subdivided plane with wave shader */} - - - } + + {/* Debug wireframe showing actual water block bounds */} + {debugMode && ( + - - - + + + )} + { + // Convert from terrain space to world space by subtracting TERRAIN_OFFSET + // Matches Torque's L2Wm transform: L2Wv = (-1024, -1024, 0) + const worldX = basePosition[0] + repX * REP_SIZE - TERRAIN_OFFSET; + const worldZ = basePosition[2] + repZ * REP_SIZE - TERRAIN_OFFSET; + return ( + + + + ); + })} + > + + ); }); + +/** + * Inner component that renders all water reps with a shared material. + * Separated to allow Suspense boundary around texture loading while + * ensuring all reps share the same material instance and animation. + */ +const WaterReps = memo(function WaterReps({ + reps, + basePosition, + surfaceGeometry, + surfaceTexture, + envMapTexture, + opacity, + waveMagnitude, + envMapIntensity, +}: { + reps: Array<[number, number]>; + basePosition: [number, number, number]; + surfaceGeometry: PlaneGeometry; + surfaceTexture: string; + envMapTexture: string | undefined; + opacity: number; + waveMagnitude: number; + envMapIntensity: number; +}) { + const baseUrl = textureToUrl(surfaceTexture); + const envUrl = textureToUrl(envMapTexture ?? "special/lush_env"); + + const [baseTexture, envTexture] = useTexture( + [baseUrl, envUrl], + (textures) => { + const texArray = Array.isArray(textures) ? textures : [textures]; + texArray.forEach((tex) => { + setupColor(tex); + tex.colorSpace = NoColorSpace; + tex.wrapS = RepeatWrapping; + tex.wrapT = RepeatWrapping; + }); + }, + ); + + const { animationEnabled } = useSettings(); + + // Single shared material for all water reps + const material = useMemo(() => { + return createWaterMaterial({ + opacity, + waveMagnitude, + envMapIntensity, + baseTexture, + envMapTexture: envTexture, + }); + }, [opacity, waveMagnitude, envMapIntensity, baseTexture, envTexture]); + + // Single animation loop for the shared material + const elapsedRef = useRef(0); + + useFrame((_, delta) => { + if (!animationEnabled) { + elapsedRef.current = 0; + material.uniforms.uTime.value = 0; + } else { + elapsedRef.current += delta; + material.uniforms.uTime.value = elapsedRef.current; + } + }); + + useEffect(() => { + return () => { + material.dispose(); + }; + }, [material]); + + return ( + <> + {reps.map(([repX, repZ]) => { + // Convert from terrain space to world space by subtracting TERRAIN_OFFSET + // Matches Torque's L2Wm transform: L2Wv = (-1024, -1024, 0) + const worldX = basePosition[0] + repX * REP_SIZE - TERRAIN_OFFSET; + const worldZ = basePosition[2] + repZ * REP_SIZE - TERRAIN_OFFSET; + return ( + + ); + })} + + ); +}); diff --git a/src/components/usePositionTracker.ts b/src/components/usePositionTracker.ts new file mode 100644 index 00000000..9474294d --- /dev/null +++ b/src/components/usePositionTracker.ts @@ -0,0 +1,25 @@ +import { useCallback, useRef } from "react"; +import { Vector3 } from "three"; + +export function usePositionTracker() { + const positionRef = useRef(null); + + const hasChanged = useCallback((position: Vector3) => { + if (!positionRef.current) { + positionRef.current = position.clone(); + return true; + } + const isSamePosition = + positionRef.current.x === position.x && + positionRef.current.y === position.y && + positionRef.current.z === position.z; + + if (!isSamePosition) { + positionRef.current.copy(position); + } + + return isSamePosition; + }, []); + + return hasChanged; +} diff --git a/src/file.vert b/src/file.vert new file mode 100644 index 00000000..a7f82df0 --- /dev/null +++ b/src/file.vert @@ -0,0 +1,112 @@ +#ifdef USE_FOG +// Check runtime fog enabled uniform - allows toggling without shader recompilation +if (fogEnabled) { + // Fog disabled at runtime, skip all fog calculations +} else { + float dist = vFogDepth; + + // Discard fragments at or beyond visible distance - matches Torque's behavior + // where objects beyond visibleDistance are not rendered at all. + // This prevents fully-fogged geometry from showing as silhouettes against + // the sky's fog-to-sky gradient. + if (dist >= fogFar) { + discard; + } + + // Step 1: Calculate distance-based haze (quadratic falloff) + // Since we discard at fogFar, haze never reaches 1.0 here + float haze = 0.0; + if (dist > fogNear) { + float fogScale = 1.0 / (fogFar - fogNear); + float distFactor = (dist - fogNear) * fogScale - 1.0; + haze = 1.0 - distFactor * distFactor; + } + + // Step 2: Calculate fog volume contributions + // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false) + // All fog uses the global fogColor - see Tribes2_Fog_System.md for details + float volumeFog = 0.0; + + #ifdef USE_VOLUMETRIC_FOG + { + #ifdef USE_FOG_WORLD_POSITION + float fragmentHeight = vFogWorldPosition.y; + #else + float fragmentHeight = cameraHeight; + #endif + + float deltaY = fragmentHeight - cameraHeight; + float absDeltaY = abs(deltaY); + + // Determine if we're going up (positive) or down (negative) + if (absDeltaY > 0.01) { + // Non-horizontal ray: ray-march through fog volumes + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = allFogVolumes[offset + 0]; + float volMinH = allFogVolumes[offset + 1]; + float volMaxH = allFogVolumes[offset + 2]; + float volPct = allFogVolumes[offset + 3]; + + // Skip inactive volumes (visibleDistance = 0) + if (volVisDist <= 0.0) continue; + + // Calculate fog factor for this volume + // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage + // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0) + // Since we don't have quality settings, we use visFactor = 1.0 + float factor = (1.0 / volVisDist) * volPct; + + // Find ray intersection with this volume's height range + float rayMinY = min(cameraHeight, fragmentHeight); + float rayMaxY = max(cameraHeight, fragmentHeight); + + // Check if ray intersects volume height range + if (rayMinY < volMaxH && rayMaxY > volMinH) { + float intersectMin = max(rayMinY, volMinH); + float intersectMax = min(rayMaxY, volMaxH); + float intersectHeight = intersectMax - intersectMin; + + // Calculate distance traveled through this volume using similar triangles: + // subDist / dist = intersectHeight / absDeltaY + float subDist = dist * (intersectHeight / absDeltaY); + + // Accumulate fog: fog += subDist * factor + volumeFog += subDist * factor; + } + } + } else { + // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = allFogVolumes[offset + 0]; + float volMinH = allFogVolumes[offset + 1]; + float volMaxH = allFogVolumes[offset + 2]; + float volPct = allFogVolumes[offset + 3]; + + if (volVisDist <= 0.0) continue; + + // If camera is inside this volume, apply fog for full distance + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + float factor = (1.0 / volVisDist) * volPct; + volumeFog += dist * factor; + } + } + } + } + #endif + + // Step 3: Combine haze and volume fog + // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct + // This gives fog volumes priority over haze + float volPct = min(volumeFog, 1.0); + float hazePct = haze; + if (volPct + hazePct > 1.0) { + hazePct = 1.0 - volPct; + } + float fogFactor = hazePct + volPct; + + // Apply fog using global fogColor (per-volume colors not used in Tribes 2) + gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor); +} +#endif diff --git a/src/fogShader.ts b/src/fogShader.ts index a2eccbd7..2ce8ecda 100644 --- a/src/fogShader.ts +++ b/src/fogShader.ts @@ -58,6 +58,13 @@ export const fogUniformsDeclaration = ` */ export const fogFragmentShader = ` #ifdef USE_FOG + // Check fog enabled uniform - allows toggling without shader recompilation + #ifdef USE_VOLUMETRIC_FOG + if (!fogEnabled) { + // Skip all fog calculations when disabled + } else { + #endif + float dist = vFogDepth; // Discard fragments at or beyond visible distance - matches Torque's behavior @@ -163,6 +170,10 @@ export const fogFragmentShader = ` // Apply fog using global fogColor (per-volume colors not used in Tribes 2) gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor); + + #ifdef USE_VOLUMETRIC_FOG + } // end fogEnabled check + #endif #endif `; @@ -245,6 +256,7 @@ export function installCustomFogShader(): void { export interface FogShaderUniformObjects { fogVolumeData: { value: Float32Array }; cameraHeight: { value: number }; + fogEnabled: { value: boolean }; } /** @@ -261,6 +273,7 @@ export function addFogUniformsToShader( // Pass the uniform objects directly so they stay linked to FogProvider updates shader.uniforms.fogVolumeData = fogUniforms.fogVolumeData; shader.uniforms.cameraHeight = fogUniforms.cameraHeight; + shader.uniforms.fogEnabled = fogUniforms.fogEnabled; } /** @@ -309,6 +322,7 @@ export function injectCustomFog( #define USE_VOLUMETRIC_FOG uniform float fogVolumeData[12]; uniform float cameraHeight; + uniform bool fogEnabled; #define USE_FOG_WORLD_POSITION varying vec3 vFogWorldPosition; #endif`, diff --git a/src/globalFogUniforms.ts b/src/globalFogUniforms.ts index ff9d664c..1552d0f2 100644 --- a/src/globalFogUniforms.ts +++ b/src/globalFogUniforms.ts @@ -22,6 +22,7 @@ export const globalFogUniforms = { value: new Float32Array(MAX_FOG_VOLUMES * FLOATS_PER_VOLUME), }, cameraHeight: { value: 0 }, + fogEnabled: { value: true }, }; /** @@ -31,9 +32,11 @@ export const globalFogUniforms = { export function updateGlobalFogUniforms( cameraHeight: number, fogVolumeData: Float32Array, + enabled: boolean = true, ): void { globalFogUniforms.cameraHeight.value = cameraHeight; globalFogUniforms.fogVolumeData.value.set(fogVolumeData); + globalFogUniforms.fogEnabled.value = enabled; } /** @@ -43,6 +46,7 @@ export function updateGlobalFogUniforms( export function resetGlobalFogUniforms(): void { globalFogUniforms.cameraHeight.value = 0; globalFogUniforms.fogVolumeData.value.fill(0); + globalFogUniforms.fogEnabled.value = true; } /** diff --git a/src/interiorMaterial.ts b/src/interiorMaterial.ts index 99bfc123..11e3944a 100644 --- a/src/interiorMaterial.ts +++ b/src/interiorMaterial.ts @@ -28,7 +28,6 @@ import { Vector3 } from "three"; export type InteriorLightingOptions = { surfaceOutsideVisible?: boolean; - debugMode?: boolean; }; // sRGB <-> Linear conversion functions (GLSL) @@ -57,18 +56,16 @@ float debugGrid(vec2 uv, float gridSize, float lineWidth) { export function injectInteriorLighting( shader: any, - options?: InteriorLightingOptions, + options: InteriorLightingOptions, ): void { - const isOutsideVisible = options?.surfaceOutsideVisible ?? false; - const isDebugMode = options?.debugMode ?? false; + const isOutsideVisible = options.surfaceOutsideVisible ?? false; // Outside surfaces: scene lighting + lightmap // Inside surfaces: lightmap only (no scene lighting) shader.uniforms.useSceneLighting = { value: isOutsideVisible }; - // Debug mode uniforms - shader.uniforms.interiorDebugMode = { value: isDebugMode }; - // Blue for outside visible, red for inside + // Debug color: blue for outside visible, red for inside + // Only used when DEBUG_MODE define is set shader.uniforms.interiorDebugColor = { value: isOutsideVisible ? new Vector3(0.0, 0.4, 1.0) @@ -81,7 +78,6 @@ export function injectInteriorLighting( `#include ${colorSpaceFunctions} uniform bool useSceneLighting; -uniform bool interiorDebugMode; uniform vec3 interiorDebugColor; `, ); @@ -150,12 +146,10 @@ outgoingLight = resultLinear + totalEmissiveRadiance; `// Debug mode: overlay colored grid on top of normal rendering // Blue grid = SurfaceOutsideVisible (receives scene ambient light) // Red grid = inside surface (no scene ambient light) -#ifdef USE_MAP -if (interiorDebugMode) { +#if DEBUG_MODE && defined(USE_MAP) // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide float gridIntensity = debugGrid(vMapUv, 4.0, 1.5); gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1); -} #endif #include `, diff --git a/src/skyMaterial.ts b/src/skyMaterial.ts new file mode 100644 index 00000000..d0c9a231 --- /dev/null +++ b/src/skyMaterial.ts @@ -0,0 +1,127 @@ +import { ShaderMaterial } from "three"; + +const vertexShader = /* glsl */ ` + varying vec2 vUv; + + void main() { + vUv = uv; + gl_Position = vec4(position.xy, 0.9999, 1.0); + } +`; + +const fragmentShader = /*glsl*/ ` + uniform samplerCube skybox; + uniform vec3 fogColor; + uniform bool enableFog; + uniform mat4 inverseProjectionMatrix; + uniform mat4 cameraMatrixWorld; + uniform float cameraHeight; + uniform float fogVolumeData[12]; + uniform float horizonFogHeight; + + varying vec2 vUv; + + + void main() { + vec2 ndc = vUv * 2.0 - 1.0; + vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); + viewPos.xyz /= viewPos.w; + vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); + direction = vec3(direction.z, direction.y, -direction.x); + // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear + vec4 skyColor = textureCube(skybox, direction); + vec3 finalColor; + + if (enableFog) { + // fogColor is passed in linear space (converted in Sky.tsx) + + // Calculate how much fog volume the ray passes through + // For skybox at "infinite" distance, the relevant height is how much + // of the volume is above/below camera depending on view direction + float volumeFogInfluence = 0.0; + + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + // Check if camera is inside this volume + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + // Camera is inside the fog volume + // Looking horizontally or up at shallow angles means ray travels + // through more fog before exiting the volume + float heightAboveCamera = volMaxH - cameraHeight; + float heightBelowCamera = cameraHeight - volMinH; + float volumeHeight = volMaxH - volMinH; + + // For horizontal rays (direction.y ≈ 0), maximum fog influence + // For rays going up steeply, less fog (exits volume quickly) + // For rays going down, more fog (travels through volume below) + float rayInfluence; + if (direction.y >= 0.0) { + // Looking up: influence based on how steep we're looking + // Shallow angles = long path through fog = high influence + rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); + } else { + // Looking down: always high fog (into the volume) + rayInfluence = 1.0; + } + + // Scale by percentage and volume depth factor + volumeFogInfluence += rayInfluence * volPct; + } + } + + // Base fog factor from view direction (for haze at horizon) + // In Torque, the fog "bans" (bands) are rendered as geometry from + // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox. + // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3). + // + // horizonFogHeight is the direction.y value where the fog band ends: + // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2) + // + // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18 + // + // Torque renders the fog bands as geometry with linear vertex alpha + // interpolation. We use a squared curve (t^2) to create a gentler + // falloff at the top of the gradient, matching Tribes 2's appearance. + float baseFogFactor; + if (direction.y <= 0.0) { + // Looking at or below horizon: full fog + baseFogFactor = 1.0; + } else if (direction.y >= horizonFogHeight) { + // Above fog band: no fog + baseFogFactor = 0.0; + } else { + // Within fog band: squared curve for gentler falloff at top + float t = direction.y / horizonFogHeight; + baseFogFactor = (1.0 - t) * (1.0 - t); + } + + // Combine base fog with volume fog influence + // When inside a volume, increase fog intensity + float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); + + // Mix in linear space (skybox and fogColor are both linear) + finalColor = mix(skyColor.rgb, fogColor, finalFogFactor); + } else { + finalColor = skyColor.rgb; + } + gl_FragColor = vec4(finalColor, 1.0); + #include + } +`; + +export function createSkyBoxMaterial({ uniforms }) { + return new ShaderMaterial({ + uniforms, + vertexShader, + fragmentShader, + depthWrite: false, + depthTest: false, + }); +} diff --git a/src/terrainMaterial.ts b/src/terrainMaterial.ts index 05137320..dda368a3 100644 --- a/src/terrainMaterial.ts +++ b/src/terrainMaterial.ts @@ -57,7 +57,6 @@ export function updateTerrainTextureShader({ alphaTextures, visibilityMask, tiling, - debugMode = false, detailTexture = null, lightmap = null, }: { @@ -66,7 +65,6 @@ export function updateTerrainTextureShader({ alphaTextures: any[]; visibilityMask: any; tiling: Record; - debugMode?: boolean; detailTexture?: any; lightmap?: any; }) { @@ -94,8 +92,6 @@ export function updateTerrainTextureShader({ }; }); - // Add debug mode uniform - shader.uniforms.debugMode = { value: debugMode ? 1.0 : 0.0 }; // Add lightmap uniform for smooth per-pixel terrain lighting if (lightmap) { @@ -141,7 +137,6 @@ uniform float tiling2; uniform float tiling3; uniform float tiling4; uniform float tiling5; -uniform float debugMode; ${visibilityMask ? "uniform sampler2D visibilityMask;" : ""} ${lightmap ? "uniform sampler2D terrainLightmap;" : ""} ${ @@ -344,14 +339,15 @@ void RE_Direct_TerrainShadow( const in IncidentLight directLight, const in vec3 ); // Add debug grid overlay AFTER opaque_fragment sets gl_FragColor + // Uses #if so material.defines.DEBUG_MODE (0 or 1) can trigger recompilation shader.fragmentShader = shader.fragmentShader.replace( "#include ", - `// Debug mode: overlay green grid matching terrain grid squares (256x256) -if (debugMode > 0.5) { + `#if DEBUG_MODE + // Debug mode: overlay green grid matching terrain grid squares (256x256) float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5); vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.05); -} +#endif #include `, ); diff --git a/src/torqueScript/index.ts b/src/torqueScript/index.ts index d0b152bf..eca4f494 100644 --- a/src/torqueScript/index.ts +++ b/src/torqueScript/index.ts @@ -75,18 +75,32 @@ export interface RunServerResult { export function runServer(options: RunServerOptions): RunServerResult { const { missionName, missionType, runtimeOptions, onMissionLoadDone } = options; - const { signal, fileSystem } = runtimeOptions ?? {}; + const { + signal, + fileSystem, + globals = {}, + preloadScripts = [], + } = runtimeOptions ?? {}; + + // server.cs has a loop that calls `findFirstFile("scripts/*Game.cs")` and + // runs `exec()` on each resulting glob match. Since we can't statically + // analyze dynamic exec paths, we need to preload all game scripts in the same + // way (so they're available when exec() is called). We could assume that we + // only need some (like DefaultGame.cs and the one for our game type), but + // sometimes map authors bundle a custom script that they don't exec() in the + // .mis file, instead preferring to give it a "*Game.cs" name so it's loaded + // automatically. + const gameScripts = fileSystem.findFiles("scripts/*Game.cs"); const runtime = createRuntime({ ...runtimeOptions, globals: { - ...runtimeOptions?.globals, + ...globals, "$Host::Map": missionName, "$Host::MissionType": missionType, }, + preloadScripts: [...preloadScripts, ...gameScripts], }); - const gameTypeName = `${missionType}Game`; - const gameTypeScript = `scripts/${gameTypeName}.cs`; const ready = (async function createServer() { try { @@ -94,29 +108,6 @@ export function runServer(options: RunServerOptions): RunServerResult { const serverScript = await runtime.loadFromPath("scripts/server.cs"); signal?.throwIfAborted(); - // server.cs has a glob loop that does: findFirstFile("scripts/*Game.cs") - // and then exec()s each result dynamically. Since we can't statically - // analyze dynamic exec paths, we need to either preload all game scripts - // in the same way (so they're available when exec() is called) or just - // exec() the ones we know we need... - // - // To load them all, do: - // if (fileSystem) { - // const gameScripts = fileSystem.findFiles("scripts/*Game.cs"); - // await Promise.all( - // gameScripts.map((path) => runtime.loadFromPath(path)), - // ); - // signal?.throwIfAborted(); - // } - await runtime.loadFromPath("scripts/DefaultGame.cs"); - signal?.throwIfAborted(); - try { - await runtime.loadFromPath(gameTypeScript); - } catch (err) { - // It's OK if that one fails. Not every game type needs its own script. - } - signal?.throwIfAborted(); - // Also preload the mission file (another dynamic exec path) await runtime.loadFromPath(`missions/${missionName}.mis`); signal?.throwIfAborted(); diff --git a/src/waterMaterial.ts b/src/waterMaterial.ts index 20d3d066..5d7f3958 100644 --- a/src/waterMaterial.ts +++ b/src/waterMaterial.ts @@ -93,6 +93,7 @@ const fragmentShader = /* glsl */ ` #ifdef USE_FOG uniform float fogVolumeData[12]; uniform float cameraHeight; + uniform bool fogEnabled; varying vec3 vFogWorldPosition; #endif @@ -210,6 +211,7 @@ export function createWaterMaterial(options?: { // Volumetric fog uniforms (shared with global fog system) fogVolumeData: globalFogUniforms.fogVolumeData, cameraHeight: globalFogUniforms.cameraHeight, + fogEnabled: globalFogUniforms.fogEnabled, }, vertexShader, fragmentShader,