Skip to content

nexu-io/open-design / plugins/_official/examples/open-design-homepage

open-design-homepage

Unverified

A pixel-faithful, self-contained mirror of the live open-design.ai homepage — an interactive React Three Fiber / Next.js hero with a real-time 3D wordmark, sticker collage, variable fonts, and scroll-driven motion. First-party showcase of the visual ceiling for interactive web marketing surfaces.

FileKindSize
SKILL.mdskill md3.7 KB
assets/_next/static/chunks/1098c2541054fc77.jsscript903.3 KB
assets/_next/static/chunks/1552c7742c37f06d.jsscript282 B
assets/_next/static/chunks/1ed7a178f7acd3df.jsscript484.4 KB
assets/_next/static/chunks/56b0d8f9f2c1e441.jsscript33.0 KB
assets/_next/static/chunks/635eb04122aa774f.cssother39.9 KB
assets/_next/static/chunks/7758f29a8aeb1c60.jsscript402.2 KB
assets/_next/static/chunks/7cc1924554447827.jsscript48.1 KB
assets/_next/static/chunks/83f95f6c165018c5.jsscript112.2 KB
assets/_next/static/chunks/8c2d1abc8462562b.jsscript197.3 KB
assets/_next/static/chunks/8f06fe72571f37b9.jsscript30.0 KB
assets/_next/static/chunks/a6dad97d9634a72d.jsscript110.0 KB
assets/_next/static/chunks/d59f7a97fb1c563f.jsscript141.6 KB
assets/_next/static/chunks/e553ef8ae208a000.jsscript19.4 KB
assets/_next/static/chunks/turbopack-425288158aa66df2.jsscript10.1 KB
assets/apple-icon.pngbinary9.4 KB
assets/bgm.mp3binary685.8 KB
assets/fonts/DepartureMono-Regular.otfbinary82.5 KB
assets/fonts/GeistMono[wght].ttfbinary167.1 KB
assets/fonts/TikTokSans.ttfbinary756.4 KB
assets/icon.svgother916 B
assets/img/m3.pngbinary36.3 KB
assets/model/cnt.gltfother535.3 KB
assets/model/cursor.glbbinary38.7 KB
assets/model/hello.gltfother292.3 KB
assets/sticker_img/s_01.webpbinary184.1 KB
assets/sticker_img/s_02.webpbinary124.5 KB
assets/sticker_img/s_03.webpbinary183.7 KB
assets/sticker_img/s_04.webpbinary357.3 KB
assets/sticker_img/s_05.webpbinary103.1 KB
assets/sticker_img/s_06.webpbinary193.2 KB
assets/sticker_img/s_07.webpbinary200.6 KB
assets/sticker_img/s_08.webpbinary142.9 KB
assets/sticker_img/s_09.webpbinary78.6 KB
assets/sticker_img/s_10.webpbinary131.9 KB
assets/sticker_img/s_11.webpbinary333.2 KB
assets/sticker_img/s_12.webpbinary229.5 KB
assets/work/ali01.webpbinary243.1 KB
assets/work/ali02.webpbinary243.1 KB
assets/work/c4.webpbinary189.3 KB
assets/work/ds01.webpbinary238.7 KB
assets/work/ds02.webpbinary238.7 KB
assets/work/inspire_mono_01.webpbinary169.3 KB
assets/work/inspire_mono_02.webpbinary169.3 KB
assets/work/reunimos01.webpbinary343.6 KB
assets/work/reunimos02.webpbinary343.6 KB
assets/work/s01.webpbinary267.9 KB
assets/work/s02.webpbinary267.9 KB
assets/work/sd01.webpbinary128.8 KB
assets/work/sd02.webpbinary128.8 KB
assets/work/si.webpbinary434.9 KB
assets/work/si02.webpbinary434.9 KB
assets/work/tt01.webpbinary1012 B
assets/work/tt02.webpbinary1.0 KB
assets/work/vs01.webpbinary159.4 KB
assets/work/vs02.webpbinary159.4 KB
assets/work/wasm01.webpbinary234.9 KB
assets/work/wasm02.webpbinary234.9 KB
example.htmlother33.9 KB
example.webpbinary67.4 KB
open-design.jsonconfig7.4 KB

assets/_next/static/chunks/1ed7a178f7acd3df.js

View on GitHub
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21348,t=>{"use strict";let e,i,r,s,n,a,o,h,l,u={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},c={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},d="attached",p="detached",f="srgb",m="srgb-linear",y="linear",g="srgb",x={COMPUTE:"compute",RENDER:"render"},b={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},v={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},w={TEXTURE_COMPARE:"depthTextureCompare"},M={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function S(t,e){return new M[t](e)}function _(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function A(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function T(){let t=A("canvas");return t.style.display="block",t}let C={},E=null;function I(t){E=t}function R(){return E}function O(...t){let e="THREE."+t.shift();E?E("log",e,...t):console.log(e,...t)}function z(t){let e=t[0];if("string"==typeof e&&e.startsWith("TSL:")){let e=t[1];e&&e.isStackTrace?t[0]+=" "+e.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function B(...t){let e="THREE."+(t=z(t)).shift();if(E)E("warn",e,...t);else{let i=t[0];i&&i.isStackTrace?console.warn(i.getError(e)):console.warn(e,...t)}}function k(...t){let e="THREE."+(t=z(t)).shift();if(E)E("error",e,...t);else{let i=t[0];i&&i.isStackTrace?console.error(i.getError(e)):console.error(e,...t)}}function P(...t){let e=t.join(" ");e in C||(C[e]=!0,B(...t))}function N(t,e,i){return new Promise(function(r,s){setTimeout(function n(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:s();break;case t.TIMEOUT_EXPIRED:setTimeout(n,i);break;default:r()}},i)})}let L={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};class F{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){let i=this._listeners;return void 0!==i&&void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){let i=this._listeners;if(void 0===i)return;let r=i[t];if(void 0!==r){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}}dispatchEvent(t){let e=this._listeners;if(void 0===e)return;let i=e[t.type];if(void 0!==i){t.target=this;let e=i.slice(0);for(let i=0,r=e.length;i<r;i++)e[i].call(this,t);t.target=null}}}let j=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],D=1234567,U=Math.PI/180,V=180/Math.PI;function W(){let t=0xffffffff*Math.random()|0,e=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0,r=0xffffffff*Math.random()|0;return(j[255&t]+j[t>>8&255]+j[t>>16&255]+j[t>>24&255]+"-"+j[255&e]+j[e>>8&255]+"-"+j[e>>16&15|64]+j[e>>24&255]+"-"+j[63&i|128]+j[i>>8&255]+"-"+j[i>>16&255]+j[i>>24&255]+j[255&r]+j[r>>8&255]+j[r>>16&255]+j[r>>24&255]).toLowerCase()}function q(t,e,i){return Math.max(e,Math.min(i,t))}function G(t,e){return(t%e+e)%e}function H(t,e,i){return(1-i)*t+i*e}function J(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/0xffffffff;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/0x7fffffff,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw Error("Invalid component type.")}}function X(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(0xffffffff*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(0x7fffffff*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw Error("Invalid component type.")}}let $={DEG2RAD:U,RAD2DEG:V,generateUUID:W,clamp:q,euclideanModulo:G,mapLinear:function(t,e,i,r,s){return r+(t-e)*(s-r)/(i-e)},inverseLerp:function(t,e,i){return t!==e?(i-t)/(e-t):0},lerp:H,damp:function(t,e,i,r){return H(t,e,1-Math.exp(-i*r))},pingpong:function(t,e=1){return e-Math.abs(G(t,2*e)-e)},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(D=t);let e=D+=0x6d2b79f5;return e=Math.imul(e^e>>>15,1|e),(((e^=e+Math.imul(e^e>>>7,61|e))^e>>>14)>>>0)/0x100000000},degToRad:function(t){return t*U},radToDeg:function(t){return t*V},isPowerOfTwo:function(t){return(t&t-1)==0&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,i,r,s){let n=Math.cos,a=Math.sin,o=n(i/2),h=a(i/2),l=n((e+r)/2),u=a((e+r)/2),c=n((e-r)/2),d=a((e-r)/2),p=n((r-e)/2),f=a((r-e)/2);switch(s){case"XYX":t.set(o*u,h*c,h*d,o*l);break;case"YZY":t.set(h*d,o*u,h*c,o*l);break;case"ZXZ":t.set(h*c,h*d,o*u,o*l);break;case"XZX":t.set(o*u,h*f,h*p,o*l);break;case"YXY":t.set(h*p,o*u,h*f,o*l);break;case"ZYZ":t.set(h*f,h*p,o*u,o*l);break;default:B("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}},normalize:X,denormalize:J};class Y{static{Y.prototype.isVector2=!0}constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=q(this.x,t.x,e.x),this.y=q(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=q(this.x,t,e),this.y=q(this.y,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(q(i,t,e))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===e?Math.PI/2:Math.acos(q(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let i=Math.cos(e),r=Math.sin(e),s=this.x-t.x,n=this.y-t.y;return this.x=s*i-n*r+t.x,this.y=s*r+n*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Z{constructor(t=0,e=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=r}static slerpFlat(t,e,i,r,s,n,a){let o=i[r+0],h=i[r+1],l=i[r+2],u=i[r+3],c=s[n+0],d=s[n+1],p=s[n+2],f=s[n+3];if(u!==f||o!==c||h!==d||l!==p){let t=o*c+h*d+l*p+u*f;t<0&&(c=-c,d=-d,p=-p,f=-f,t=-t);let e=1-a;if(t<.9995){let i=Math.acos(t),r=Math.sin(i);o=o*(e=Math.sin(e*i)/r)+c*(a=Math.sin(a*i)/r),h=h*e+d*a,l=l*e+p*a,u=u*e+f*a}else{let t=1/Math.sqrt((o=o*e+c*a)*o+(h=h*e+d*a)*h+(l=l*e+p*a)*l+(u=u*e+f*a)*u);o*=t,h*=t,l*=t,u*=t}}t[e]=o,t[e+1]=h,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,r,s,n){let a=i[r],o=i[r+1],h=i[r+2],l=i[r+3],u=s[n],c=s[n+1],d=s[n+2],p=s[n+3];return t[e]=a*p+l*u+o*d-h*c,t[e+1]=o*p+l*c+h*u-a*d,t[e+2]=h*p+l*d+a*c-o*u,t[e+3]=l*p-a*u-o*c-h*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,r){return this._x=t,this._y=e,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let i=t._x,r=t._y,s=t._z,n=t._order,a=Math.cos,o=Math.sin,h=a(i/2),l=a(r/2),u=a(s/2),c=o(i/2),d=o(r/2),p=o(s/2);switch(n){case"XYZ":this._x=c*l*u+h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u-c*d*p;break;case"YXZ":this._x=c*l*u+h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u+c*d*p;break;case"ZXY":this._x=c*l*u-h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u-c*d*p;break;case"ZYX":this._x=c*l*u-h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u+c*d*p;break;case"YZX":this._x=c*l*u+h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u-c*d*p;break;case"XZY":this._x=c*l*u-h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u+c*d*p;break;default:B("Quaternion: .setFromEuler() encountered an unknown order: "+n)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,i=e[0],r=e[4],s=e[8],n=e[1],a=e[5],o=e[9],h=e[2],l=e[6],u=e[10],c=i+a+u;if(c>0){let t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(l-o)*t,this._y=(s-h)*t,this._z=(n-r)*t}else if(i>a&&i>u){let t=2*Math.sqrt(1+i-a-u);this._w=(l-o)/t,this._x=.25*t,this._y=(r+n)/t,this._z=(s+h)/t}else if(a>u){let t=2*Math.sqrt(1+a-i-u);this._w=(s-h)/t,this._x=(r+n)/t,this._y=.25*t,this._z=(o+l)/t}else{let t=2*Math.sqrt(1+u-i-a);this._w=(n-r)/t,this._x=(s+h)/t,this._y=(o+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<1e-8?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=i,this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(q(this.dot(t),-1,1)))}rotateTowards(t,e){let i=this.angleTo(t);if(0===i)return this;let r=Math.min(1,e/i);return this.slerp(t,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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let i=t._x,r=t._y,s=t._z,n=t._w,a=e._x,o=e._y,h=e._z,l=e._w;return this._x=i*l+n*a+r*h-s*o,this._y=r*l+n*o+s*a-i*h,this._z=s*l+n*h+i*o-r*a,this._w=n*l-i*a-r*o-s*h,this._onChangeCallback(),this}slerp(t,e){let i=t._x,r=t._y,s=t._z,n=t._w,a=this.dot(t);a<0&&(i=-i,r=-r,s=-s,n=-n,a=-a);let o=1-e;if(a<.9995){let t=Math.acos(a),h=Math.sin(t);o=Math.sin(o*t)/h,e=Math.sin(e*t)/h,this._x=this._x*o+i*e,this._y=this._y*o+r*e,this._z=this._z*o+s*e,this._w=this._w*o+n*e,this._onChangeCallback()}else this._x=this._x*o+i*e,this._y=this._y*o+r*e,this._z=this._z*o+s*e,this._w=this._w*o+n*e,this.normalize();return this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class K{static{K.prototype.isVector3=!0}constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(tt.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(tt.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,i=this.y,r=this.z,s=t.elements,n=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*n,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*n,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*n,this}applyQuaternion(t){let e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=2*(n*r-a*i),l=2*(a*e-s*r),u=2*(s*i-n*e);return this.x=e+o*h+n*u-a*l,this.y=i+o*l+a*h-s*u,this.z=r+o*u+s*l-n*h,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r,this.y=s[1]*e+s[5]*i+s[9]*r,this.z=s[2]*e+s[6]*i+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=q(this.x,t.x,e.x),this.y=q(this.y,t.y,e.y),this.z=q(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=q(this.x,t,e),this.y=q(this.y,t,e),this.z=q(this.z,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(q(i,t,e))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let i=t.x,r=t.y,s=t.z,n=e.x,a=e.y,o=e.z;return this.x=r*o-s*a,this.y=s*n-i*o,this.z=i*a-r*n,this}projectOnVector(t){let e=t.lengthSq();if(0===e)return this.set(0,0,0);let i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Q.copy(this).projectOnVector(t),this.sub(Q)}reflect(t){return this.sub(Q.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===e?Math.PI/2:Math.acos(q(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){let r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=2*Math.random()-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let Q=new K,tt=new Z;class te{static{te.prototype.isMatrix3=!0}constructor(t,e,i,r,s,n,a,o,h){this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,r,s,n,a,o,h)}set(t,e,i,r,s,n,a,o,h){let l=this.elements;return l[0]=t,l[1]=r,l[2]=a,l[3]=e,l[4]=s,l[5]=o,l[6]=i,l[7]=n,l[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,r=e.elements,s=this.elements,n=i[0],a=i[3],o=i[6],h=i[1],l=i[4],u=i[7],c=i[2],d=i[5],p=i[8],f=r[0],m=r[3],y=r[6],g=r[1],x=r[4],b=r[7],v=r[2],w=r[5],M=r[8];return s[0]=n*f+a*g+o*v,s[3]=n*m+a*x+o*w,s[6]=n*y+a*b+o*M,s[1]=h*f+l*g+u*v,s[4]=h*m+l*x+u*w,s[7]=h*y+l*b+u*M,s[2]=c*f+d*g+p*v,s[5]=c*m+d*x+p*w,s[8]=c*y+d*b+p*M,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*n*l-e*a*h-i*s*l+i*a*o+r*s*h-r*n*o}invert(){let t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,c=a*o-l*s,d=h*s-n*o,p=e*u+i*c+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return t[0]=u*f,t[1]=(r*h-l*i)*f,t[2]=(a*i-r*n)*f,t[3]=c*f,t[4]=(l*e-r*o)*f,t[5]=(r*s-a*e)*f,t[6]=d*f,t[7]=(i*o-h*e)*f,t[8]=(n*e-i*s)*f,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,r,s,n,a){let o=Math.cos(s),h=Math.sin(s);return this.set(i*o,i*h,-i*(o*n+h*a)+n+t,-r*h,r*o,-r*(-h*n+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(ti.makeScale(t,e)),this}rotate(t){return this.premultiply(ti.makeRotation(-t)),this}translate(t,e){return this.premultiply(ti.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){let i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let ti=new te,tr=new te().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ts=new te().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),tn=(o=[.64,.33,.3,.6,.15,.06],h=[.2126,.7152,.0722],l=[.3127,.329],(a={enabled:!0,workingColorSpace:m,spaces:{},convert:function(t,e,i){return!1!==this.enabled&&e!==i&&e&&i&&(this.spaces[e].transfer===g&&(t.r=ta(t.r),t.g=ta(t.g),t.b=ta(t.b)),this.spaces[e].primaries!==this.spaces[i].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[i].fromXYZ)),this.spaces[i].transfer===g&&(t.r=to(t.r),t.g=to(t.g),t.b=to(t.b))),t},workingToColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},colorSpaceToWorking:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return""===t?y:this.spaces[t].transfer},getToneMappingMode:function(t){return this.spaces[t].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,i){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[i].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,e){return P("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),a.workingToColorSpace(t,e)},toWorkingColorSpace:function(t,e){return P("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),a.colorSpaceToWorking(t,e)}}).define({[m]:{primaries:o,whitePoint:l,transfer:y,toXYZ:tr,fromXYZ:ts,luminanceCoefficients:h,workingColorSpaceConfig:{unpackColorSpace:f},outputColorSpaceConfig:{drawingBufferColorSpace:f}},[f]:{primaries:o,whitePoint:l,transfer:g,toXYZ:tr,fromXYZ:ts,luminanceCoefficients:h,outputColorSpaceConfig:{drawingBufferColorSpace:f}}}),a);function ta(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function to(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class th{static getDataURL(t,i="image/png"){let r;if(/^data:/i.test(t.src)||"u"<typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)r=t;else{void 0===e&&(e=A("canvas")),e.width=t.width,e.height=t.height;let i=e.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),r=e}return r.toDataURL(i)}static sRGBToLinear(t){if("u">typeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&t instanceof ImageBitmap){let e=A("canvas");e.width=t.width,e.height=t.height;let i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);let r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let t=0;t<s.length;t++)s[t]=255*ta(s[t]/255);return i.putImageData(r,0,0),e}if(!t.data)return B("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t;{let e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*ta(e[t]/255)):e[t]=ta(e[t]);return{data:e,width:t.width,height:t.height}}}}let tl=0;class tu{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:tl++}),this.uuid=W(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){let e=this.data;return"u">typeof HTMLVideoElement&&e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):"u">typeof VideoFrame&&e instanceof VideoFrame?t.set(e.displayWidth,e.displayHeight,0):null!==e?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){!0===t&&this.version++}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];let i={uuid:this.uuid,url:""},r=this.data;if(null!==r){let t;if(Array.isArray(r)){t=[];for(let e=0,i=r.length;e<i;e++)r[e].isDataTexture?t.push(tc(r[e].image)):t.push(tc(r[e]))}else t=tc(r);i.url=t}return e||(t.images[this.uuid]=i),i}}function tc(t){return"u">typeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&t instanceof ImageBitmap?th.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(B("Texture: Unable to serialize Texture."),{})}let td=0,tp=new K;class tf extends F{constructor(t=tf.DEFAULT_IMAGE,e=tf.DEFAULT_MAPPING,i=1001,r=1001,s=1006,n=1008,a=1023,o=1009,h=tf.DEFAULT_ANISOTROPY,l=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:td++}),this.uuid=W(),this.name="",this.source=new tu(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=n,this.anisotropy=h,this.format=a,this.internalFormat=null,this.type=o,this.offset=new Y(0,0),this.repeat=new Y(1,1),this.center=new Y(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new te,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!t&&!!t.depth&&t.depth>1,this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(tp).x}get height(){return this.source.getSize(tp).y}get depth(){return this.source.getSize(tp).z}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.normalized=t.normalized,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let i=t[e];if(void 0===i){B(`Texture.setValues(): parameter '${e}' has value of undefined.`);continue}let r=this[e];if(void 0===r){B(`Texture.setValues(): property '${e}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[e]=i}}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];let i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}}tf.DEFAULT_IMAGE=null,tf.DEFAULT_MAPPING=300,tf.DEFAULT_ANISOTROPY=1;class tm{static{tm.prototype.isVector4=!0}constructor(t=0,e=0,i=0,r=1){this.x=t,this.y=e,this.z=i,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,i=this.y,r=this.z,s=this.w,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*r+n[12]*s,this.y=n[1]*e+n[5]*i+n[9]*r+n[13]*s,this.z=n[2]*e+n[6]*i+n[10]*r+n[14]*s,this.w=n[3]*e+n[7]*i+n[11]*r+n[15]*s,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,r,s,n=t.elements,a=n[0],o=n[4],h=n[8],l=n[1],u=n[5],c=n[9],d=n[2],p=n[6],f=n[10];if(.01>Math.abs(o-l)&&.01>Math.abs(h-d)&&.01>Math.abs(c-p)){if(.1>Math.abs(o+l)&&.1>Math.abs(h+d)&&.1>Math.abs(c+p)&&.1>Math.abs(a+u+f-3))return this.set(1,0,0,0),this;e=Math.PI;let t=(a+1)/2,n=(u+1)/2,m=(f+1)/2,y=(o+l)/4,g=(h+d)/4,x=(c+p)/4;return t>n&&t>m?t<.01?(i=0,r=.707106781,s=.707106781):(r=y/(i=Math.sqrt(t)),s=g/i):n>m?n<.01?(i=.707106781,r=0,s=.707106781):(i=y/(r=Math.sqrt(n)),s=x/r):m<.01?(i=.707106781,r=.707106781,s=0):(i=g/(s=Math.sqrt(m)),r=x/s),this.set(i,r,s,e),this}let m=Math.sqrt((p-c)*(p-c)+(h-d)*(h-d)+(l-o)*(l-o));return .001>Math.abs(m)&&(m=1),this.x=(p-c)/m,this.y=(h-d)/m,this.z=(l-o)/m,this.w=Math.acos((a+u+f-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=q(this.x,t.x,e.x),this.y=q(this.y,t.y,e.y),this.z=q(this.z,t.z,e.z),this.w=q(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=q(this.x,t,e),this.y=q(this.y,t,e),this.z=q(this.z,t,e),this.w=q(this.w,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(q(i,t,e))}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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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}}class ty extends F{constructor(t=1,e=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=i.depth,this.scissor=new tm(0,0,t,e),this.scissorTest=!1,this.viewport=new tm(0,0,t,e),this.textures=[];const r=new tf({width:t,height:e,depth:i.depth}),s=i.count;for(let t=0;t<s;t++)this.textures[t]=r.clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(t={}){let e={minFilter:1006,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==t.mapping&&(e.mapping=t.mapping),void 0!==t.wrapS&&(e.wrapS=t.wrapS),void 0!==t.wrapT&&(e.wrapT=t.wrapT),void 0!==t.wrapR&&(e.wrapR=t.wrapR),void 0!==t.magFilter&&(e.magFilter=t.magFilter),void 0!==t.minFilter&&(e.minFilter=t.minFilter),void 0!==t.format&&(e.format=t.format),void 0!==t.type&&(e.type=t.type),void 0!==t.anisotropy&&(e.anisotropy=t.anisotropy),void 0!==t.colorSpace&&(e.colorSpace=t.colorSpace),void 0!==t.flipY&&(e.flipY=t.flipY),void 0!==t.generateMipmaps&&(e.generateMipmaps=t.generateMipmaps),void 0!==t.internalFormat&&(e.internalFormat=t.internalFormat);for(let t=0;t<this.textures.length;t++)this.textures[t].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==t&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,i=1){if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=i,!0!==this.textures[r].isData3DTexture&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,i=t.textures.length;e<i;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;let i=Object.assign({},t.textures[e].image);this.textures[e].source=new tu(i)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this.multiview=t.multiview,this}dispose(){this.dispatchEvent({type:"dispose"})}}class tg extends ty{constructor(t=1,e=1,i={}){super(t,e,i),this.isWebGLRenderTarget=!0}}class tx extends tf{constructor(t=null,e=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:i,depth:r},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class tb extends tg{constructor(t=1,e=1,i=1,r={}){super(t,e,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new tx(null,t,e,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class tv extends tf{constructor(t=null,e=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:i,depth:r},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class tw extends tg{constructor(t=1,e=1,i=1,r={}){super(t,e,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new tv(null,t,e,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class tM{static{tM.prototype.isMatrix4=!0}constructor(t,e,i,r,s,n,a,o,h,l,u,c,d,p,f,m){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,i,r,s,n,a,o,h,l,u,c,d,p,f,m)}set(t,e,i,r,s,n,a,o,h,l,u,c,d,p,f,m){let y=this.elements;return y[0]=t,y[4]=e,y[8]=i,y[12]=r,y[1]=s,y[5]=n,y[9]=a,y[13]=o,y[2]=h,y[6]=l,y[10]=u,y[14]=c,y[3]=d,y[7]=p,y[11]=f,y[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 tM().fromArray(this.elements)}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){let e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return 0===this.determinant()?(t.set(1,0,0),e.set(0,1,0),i.set(0,0,1)):(t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2)),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){if(0===t.determinant())return this.identity();let e=this.elements,i=t.elements,r=1/tS.setFromMatrixColumn(t,0).length(),s=1/tS.setFromMatrixColumn(t,1).length(),n=1/tS.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,e[7]=0,e[8]=i[8]*n,e[9]=i[9]*n,e[10]=i[10]*n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,i=t.x,r=t.y,s=t.z,n=Math.cos(i),a=Math.sin(i),o=Math.cos(r),h=Math.sin(r),l=Math.cos(s),u=Math.sin(s);if("XYZ"===t.order){let t=n*l,i=n*u,r=a*l,s=a*u;e[0]=o*l,e[4]=-o*u,e[8]=h,e[1]=i+r*h,e[5]=t-s*h,e[9]=-a*o,e[2]=s-t*h,e[6]=r+i*h,e[10]=n*o}else if("YXZ"===t.order){let t=o*l,i=o*u,r=h*l,s=h*u;e[0]=t+s*a,e[4]=r*a-i,e[8]=n*h,e[1]=n*u,e[5]=n*l,e[9]=-a,e[2]=i*a-r,e[6]=s+t*a,e[10]=n*o}else if("ZXY"===t.order){let t=o*l,i=o*u,r=h*l,s=h*u;e[0]=t-s*a,e[4]=-n*u,e[8]=r+i*a,e[1]=i+r*a,e[5]=n*l,e[9]=s-t*a,e[2]=-n*h,e[6]=a,e[10]=n*o}else if("ZYX"===t.order){let t=n*l,i=n*u,r=a*l,s=a*u;e[0]=o*l,e[4]=r*h-i,e[8]=t*h+s,e[1]=o*u,e[5]=s*h+t,e[9]=i*h-r,e[2]=-h,e[6]=a*o,e[10]=n*o}else if("YZX"===t.order){let t=n*o,i=n*h,r=a*o,s=a*h;e[0]=o*l,e[4]=s-t*u,e[8]=r*u+i,e[1]=u,e[5]=n*l,e[9]=-a*l,e[2]=-h*l,e[6]=i*u+r,e[10]=t-s*u}else if("XZY"===t.order){let t=n*o,i=n*h,r=a*o,s=a*h;e[0]=o*l,e[4]=-u,e[8]=h*l,e[1]=t*u+s,e[5]=n*l,e[9]=i*u-r,e[2]=r*u-i,e[6]=a*l,e[10]=s*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(tA,t,tT)}lookAt(t,e,i){let r=this.elements;return tI.subVectors(t,e),0===tI.lengthSq()&&(tI.z=1),tI.normalize(),tC.crossVectors(i,tI),0===tC.lengthSq()&&(1===Math.abs(i.z)?tI.x+=1e-4:tI.z+=1e-4,tI.normalize(),tC.crossVectors(i,tI)),tC.normalize(),tE.crossVectors(tI,tC),r[0]=tC.x,r[4]=tE.x,r[8]=tI.x,r[1]=tC.y,r[5]=tE.y,r[9]=tI.y,r[2]=tC.z,r[6]=tE.z,r[10]=tI.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,r=e.elements,s=this.elements,n=i[0],a=i[4],o=i[8],h=i[12],l=i[1],u=i[5],c=i[9],d=i[13],p=i[2],f=i[6],m=i[10],y=i[14],g=i[3],x=i[7],b=i[11],v=i[15],w=r[0],M=r[4],S=r[8],_=r[12],A=r[1],T=r[5],C=r[9],E=r[13],I=r[2],R=r[6],O=r[10],z=r[14],B=r[3],k=r[7],P=r[11],N=r[15];return s[0]=n*w+a*A+o*I+h*B,s[4]=n*M+a*T+o*R+h*k,s[8]=n*S+a*C+o*O+h*P,s[12]=n*_+a*E+o*z+h*N,s[1]=l*w+u*A+c*I+d*B,s[5]=l*M+u*T+c*R+d*k,s[9]=l*S+u*C+c*O+d*P,s[13]=l*_+u*E+c*z+d*N,s[2]=p*w+f*A+m*I+y*B,s[6]=p*M+f*T+m*R+y*k,s[10]=p*S+f*C+m*O+y*P,s[14]=p*_+f*E+m*z+y*N,s[3]=g*w+x*A+b*I+v*B,s[7]=g*M+x*T+b*R+v*k,s[11]=g*S+x*C+b*O+v*P,s[15]=g*_+x*E+b*z+v*N,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[4],r=t[8],s=t[12],n=t[1],a=t[5],o=t[9],h=t[13],l=t[2],u=t[6],c=t[10],d=t[14],p=t[3],f=t[7],m=t[11],y=t[15],g=o*d-h*c,x=a*d-h*u,b=a*c-o*u,v=n*d-h*l,w=n*c-o*l,M=n*u-a*l;return e*(f*g-m*x+y*b)-i*(p*g-m*v+y*w)+r*(p*x-f*v+y*M)-s*(p*b-f*w+m*M)}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(t,e,i){let r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){let t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],m=t[14],y=t[15],g=e*a-i*n,x=e*o-r*n,b=e*h-s*n,v=i*o-r*a,w=i*h-s*a,M=r*h-s*o,S=l*f-u*p,_=l*m-c*p,A=l*y-d*p,T=u*m-c*f,C=u*y-d*f,E=c*y-d*m,I=g*E-x*C+b*T+v*A-w*_+M*S;if(0===I)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let R=1/I;return t[0]=(a*E-o*C+h*T)*R,t[1]=(r*C-i*E-s*T)*R,t[2]=(f*M-m*w+y*v)*R,t[3]=(c*w-u*M-d*v)*R,t[4]=(o*A-n*E-h*_)*R,t[5]=(e*E-r*A+s*_)*R,t[6]=(m*b-p*M-y*x)*R,t[7]=(l*M-c*b+d*x)*R,t[8]=(n*C-a*A+h*S)*R,t[9]=(i*A-e*C-s*S)*R,t[10]=(p*w-f*b+y*g)*R,t[11]=(u*b-l*w-d*g)*R,t[12]=(a*_-n*T-o*S)*R,t[13]=(e*T-i*_+r*S)*R,t[14]=(f*x-p*v-m*g)*R,t[15]=(l*v-u*x+c*g)*R,this}scale(t){let e=this.elements,i=t.x,r=t.y,s=t.z;return e[0]*=i,e[4]*=r,e[8]*=s,e[1]*=i,e[5]*=r,e[9]*=s,e[2]*=i,e[6]*=r,e[10]*=s,e[3]*=i,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements;return Math.sqrt(Math.max(t[0]*t[0]+t[1]*t[1]+t[2]*t[2],t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t[8]*t[8]+t[9]*t[9]+t[10]*t[10]))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let i=Math.cos(e),r=Math.sin(e),s=1-i,n=t.x,a=t.y,o=t.z,h=s*n,l=s*a;return this.set(h*n+i,h*a-r*o,h*o+r*a,0,h*a+r*o,l*a+i,l*o-r*n,0,h*o-r*a,l*o+r*n,s*o*o+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,r,s,n){return this.set(1,i,s,0,t,1,n,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){let r=this.elements,s=e._x,n=e._y,a=e._z,o=e._w,h=s+s,l=n+n,u=a+a,c=s*h,d=s*l,p=s*u,f=n*l,m=n*u,y=a*u,g=o*h,x=o*l,b=o*u,v=i.x,w=i.y,M=i.z;return r[0]=(1-(f+y))*v,r[1]=(d+b)*v,r[2]=(p-x)*v,r[3]=0,r[4]=(d-b)*w,r[5]=(1-(c+y))*w,r[6]=(m+g)*w,r[7]=0,r[8]=(p+x)*M,r[9]=(m-g)*M,r[10]=(1-(c+f))*M,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){let r=this.elements;t.x=r[12],t.y=r[13],t.z=r[14];let s=this.determinant();if(0===s)return i.set(1,1,1),e.identity(),this;let n=tS.set(r[0],r[1],r[2]).length(),a=tS.set(r[4],r[5],r[6]).length(),o=tS.set(r[8],r[9],r[10]).length();s<0&&(n=-n),t_.copy(this);let h=1/n,l=1/a,u=1/o;return t_.elements[0]*=h,t_.elements[1]*=h,t_.elements[2]*=h,t_.elements[4]*=l,t_.elements[5]*=l,t_.elements[6]*=l,t_.elements[8]*=u,t_.elements[9]*=u,t_.elements[10]*=u,e.setFromRotationMatrix(t_),i.x=n,i.y=a,i.z=o,this}makePerspective(t,e,i,r,s,n,a=2e3,o=!1){let h,l,u=this.elements;if(o)h=s/(n-s),l=n*s/(n-s);else if(2e3===a)h=-(n+s)/(n-s),l=-2*n*s/(n-s);else if(2001===a)h=-n/(n-s),l=-n*s/(n-s);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return u[0]=2*s/(e-t),u[4]=0,u[8]=(e+t)/(e-t),u[12]=0,u[1]=0,u[5]=2*s/(i-r),u[9]=(i+r)/(i-r),u[13]=0,u[2]=0,u[6]=0,u[10]=h,u[14]=l,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(t,e,i,r,s,n,a=2e3,o=!1){let h,l,u=this.elements;if(o)h=1/(n-s),l=n/(n-s);else if(2e3===a)h=-2/(n-s),l=-(n+s)/(n-s);else if(2001===a)h=-1/(n-s),l=-s/(n-s);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return u[0]=2/(e-t),u[4]=0,u[8]=0,u[12]=-(e+t)/(e-t),u[1]=0,u[5]=2/(i-r),u[9]=0,u[13]=-(i+r)/(i-r),u[2]=0,u[6]=0,u[10]=h,u[14]=l,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){let i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}let tS=new K,t_=new tM,tA=new K(0,0,0),tT=new K(1,1,1),tC=new K,tE=new K,tI=new K,tR=new tM,tO=new Z;class tz{constructor(t=0,e=0,i=0,r=tz.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){let r=t.elements,s=r[0],n=r[4],a=r[8],o=r[1],h=r[5],l=r[9],u=r[2],c=r[6],d=r[10];switch(e){case"XYZ":this._y=Math.asin(q(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-n,s)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-q(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(q(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-n,h)):(this._y=0,this._z=Math.atan2(o,s));break;case"ZYX":this._y=Math.asin(-q(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(c,d),this._z=Math.atan2(o,s)):(this._x=0,this._z=Math.atan2(-n,h));break;case"YZX":this._z=Math.asin(q(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-q(n,-1,1)),.9999999>Math.abs(n)?(this._x=Math.atan2(c,h),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-l,d),this._y=0);break;default:B("Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return tR.makeRotationFromQuaternion(t),this.setFromRotationMatrix(tR,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return tO.setFromEuler(this),this.setFromQuaternion(tO,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}tz.DEFAULT_ORDER="XYZ";class tB{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}isEnabled(t){return(this.mask&1<<t)!=0}}let tk=0,tP=new K,tN=new Z,tL=new tM,tF=new K,tj=new K,tD=new K,tU=new Z,tV=new K(1,0,0),tW=new K(0,1,0),tq=new K(0,0,1),tG={type:"added"},tH={type:"removed"},tJ={type:"childadded",child:null},tX={type:"childremoved",child:null};class t$ extends F{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tk++}),this.uuid=W(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=t$.DEFAULT_UP.clone();const t=new K,e=new tz,i=new Z,r=new K(1,1,1);e._onChange(function(){i.setFromEuler(e,!1)}),i._onChange(function(){e.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new tM},normalMatrix:{value:new te}}),this.matrix=new tM,this.matrixWorld=new tM,this.matrixAutoUpdate=t$.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=t$.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new tB,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return tN.setFromAxisAngle(t,e),this.quaternion.multiply(tN),this}rotateOnWorldAxis(t,e){return tN.setFromAxisAngle(t,e),this.quaternion.premultiply(tN),this}rotateX(t){return this.rotateOnAxis(tV,t)}rotateY(t){return this.rotateOnAxis(tW,t)}rotateZ(t){return this.rotateOnAxis(tq,t)}translateOnAxis(t,e){return tP.copy(t).applyQuaternion(this.quaternion),this.position.add(tP.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(tV,t)}translateY(t){return this.translateOnAxis(tW,t)}translateZ(t){return this.translateOnAxis(tq,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(tL.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?tF.copy(t):tF.set(t,e,i);let r=this.parent;this.updateWorldMatrix(!0,!1),tj.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?tL.lookAt(tj,tF,this.up):tL.lookAt(tF,tj,this.up),this.quaternion.setFromRotationMatrix(tL),r&&(tL.extractRotation(r.matrixWorld),tN.setFromRotationMatrix(tL),this.quaternion.premultiply(tN.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?k("Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(tG),tJ.child=t,this.dispatchEvent(tJ),tJ.child=null):k("Object3D.add: object not an instance of THREE.Object3D.",t),this}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}let e=this.children.indexOf(t);return -1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(tH),tX.child=t,this.dispatchEvent(tX),tX.child=null),this}removeFromParent(){let t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),tL.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),tL.multiply(t.parent.matrixWorld)),t.applyMatrix4(tL),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(tG),tJ.child=t,this.dispatchEvent(tJ),tJ.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,r=this.children.length;i<r;i++){let r=this.children[i].getObjectByProperty(t,e);if(void 0!==r)return r}}getObjectsByProperty(t,e,i=[]){this[t]===e&&i.push(this);let r=this.children;for(let s=0,n=r.length;s<n;s++)r[s].getObjectsByProperty(t,e,i);return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tj,t,tD),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tj,tU,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);let e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].traverseVisible(t)}traverseAncestors(t){let e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let t=this.pivot;if(null!==t){let e=t.x,i=t.y,r=t.z,s=this.matrix.elements;s[12]+=e-s[0]*e-s[4]*i-s[8]*r,s[13]+=i-s[1]*e-s[5]*i-s[9]*r,s[14]+=r-s[2]*e-s[6]*i-s[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e){let i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){let t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}toJSON(t){let e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let r={};function s(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),!1!==this.static&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),null!==this.pivot&&(r.pivot=this.pivot.toArray()),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),void 0!==this.morphTargetDictionary&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),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(t=>({...t,boundingBox:t.boundingBox?t.boundingBox.toJSON():void 0,boundingSphere:t.boundingSphere?t.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(t=>({...t})),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(t),r.indirectTexture=this._indirectTexture.toJSON(t),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(t)),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(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);let e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){let i=e.shapes;if(Array.isArray(i))for(let e=0,r=i.length;e<r;e++){let r=i[e];s(t.shapes,r)}else s(t.shapes,i)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(s(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let e=[];for(let i=0,r=this.material.length;i<r;i++)e.push(s(t.materials,this.material[i]));r.material=e}else r.material=s(t.materials,this.material);if(this.children.length>0){r.children=[];for(let e=0;e<this.children.length;e++)r.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let e=0;e<this.animations.length;e++){let i=this.animations[e];r.animations.push(s(t.animations,i))}}if(e){let e=n(t.geometries),r=n(t.materials),s=n(t.textures),a=n(t.images),o=n(t.shapes),h=n(t.skeletons),l=n(t.animations),u=n(t.nodes);e.length>0&&(i.geometries=e),r.length>0&&(i.materials=r),s.length>0&&(i.textures=s),a.length>0&&(i.images=a),o.length>0&&(i.shapes=o),h.length>0&&(i.skeletons=h),l.length>0&&(i.animations=l),u.length>0&&(i.nodes=u)}return i.object=r,i;function n(t){let e=[];for(let i in t){let r=t[i];delete r.metadata,e.push(r)}return e}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.pivot=null!==t.pivot?t.pivot.clone():null,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){let i=t.children[e];this.add(i.clone())}return this}}t$.DEFAULT_UP=new K(0,1,0),t$.DEFAULT_MATRIX_AUTO_UPDATE=!0,t$.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class tY extends t${constructor(){super(),this.isGroup=!0,this.type="Group"}}let tZ={type:"move"};class tK{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new tY,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 tY,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new K,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new K),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new tY,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new K,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new K,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let i of t.hand.values())this._getHandJoint(e,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,i){let r=null,s=null,n=null,a=this._targetRay,o=this._grip,h=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(h&&t.hand){for(let r of(n=!0,t.hand.values())){let t=e.getJointPose(r,i),s=this._getHandJoint(h,r);null!==t&&(s.matrix.fromArray(t.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,s.jointRadius=t.radius),s.visible=null!==t}let r=h.joints["index-finger-tip"],s=h.joints["thumb-tip"],a=r.position.distanceTo(s.position);h.inputState.pinching&&a>.025?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!h.inputState.pinching&&a<=.015&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&null!==(s=e.getPose(t.gripSpace,i))&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,o.eventsEnabled&&o.dispatchEvent({type:"gripUpdated",data:t,target:this}));null!==a&&(null===(r=e.getPose(t.targetRaySpace,i))&&null!==s&&(r=s),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(tZ)))}return null!==a&&(a.visible=null!==r),null!==o&&(o.visible=null!==s),null!==h&&(h.visible=null!==n),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){let i=new tY;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}let tQ={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},t0={h:0,s:0,l:0},t1={h:0,s:0,l:0};function t2(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*6*(2/3-i):t}class t3{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){return void 0===e&&void 0===i?t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t):this.setRGB(t,e,i),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=f){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,tn.colorSpaceToWorking(this,e),this}setRGB(t,e,i,r=tn.workingColorSpace){return this.r=t,this.g=e,this.b=i,tn.colorSpaceToWorking(this,r),this}setHSL(t,e,i,r=tn.workingColorSpace){if(t=G(t,1),e=q(e,0,1),i=q(i,0,1),0===e)this.r=this.g=this.b=i;else{let r=i<=.5?i*(1+e):i+e-i*e,s=2*i-r;this.r=t2(s,r,t+1/3),this.g=t2(s,r,t),this.b=t2(s,r,t-1/3)}return tn.colorSpaceToWorking(this,r),this}setStyle(t,e=f){let i;function r(e){void 0!==e&&1>parseFloat(e)&&B("Color: Alpha component of "+t+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let s,n=i[1],a=i[2];switch(n){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:B("Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let r=i[1],s=r.length;if(3===s)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(6===s)return this.setHex(parseInt(r,16),e);B("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=f){let i=tQ[t.toLowerCase()];return void 0!==i?this.setHex(i,e):B("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=ta(t.r),this.g=ta(t.g),this.b=ta(t.b),this}copyLinearToSRGB(t){return this.r=to(t.r),this.g=to(t.g),this.b=to(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=f){return tn.workingToColorSpace(t5.copy(this),t),65536*Math.round(q(255*t5.r,0,255))+256*Math.round(q(255*t5.g,0,255))+Math.round(q(255*t5.b,0,255))}getHexString(t=f){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=tn.workingColorSpace){let i,r;tn.workingToColorSpace(t5.copy(this),e);let s=t5.r,n=t5.g,a=t5.b,o=Math.max(s,n,a),h=Math.min(s,n,a),l=(h+o)/2;if(h===o)i=0,r=0;else{let t=o-h;switch(r=l<=.5?t/(o+h):t/(2-o-h),o){case s:i=(n-a)/t+6*(n<a);break;case n:i=(a-s)/t+2;break;case a:i=(s-n)/t+4}i/=6}return t.h=i,t.s=r,t.l=l,t}getRGB(t,e=tn.workingColorSpace){return tn.workingToColorSpace(t5.copy(this),e),t.r=t5.r,t.g=t5.g,t.b=t5.b,t}getStyle(t=f){tn.workingToColorSpace(t5.copy(this),t);let e=t5.r,i=t5.g,r=t5.b;return t!==f?`color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*i)},${Math.round(255*r)})`}offsetHSL(t,e,i){return this.getHSL(t0),this.setHSL(t0.h+t,t0.s+e,t0.l+i)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(t0),t.getHSL(t1);let i=H(t0.h,t1.h,e),r=H(t0.s,t1.s,e),s=H(t0.l,t1.l,e);return this.setHSL(i,r,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,i=this.g,r=this.b,s=t.elements;return this.r=s[0]*e+s[3]*i+s[6]*r,this.g=s[1]*e+s[4]*i+s[7]*r,this.b=s[2]*e+s[5]*i+s[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let t5=new t3;t3.NAMES=tQ;class t4{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new t3(t),this.density=e}clone(){return new t4(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class t6{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new t3(t),this.near=e,this.far=i}clone(){return new t6(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class t8 extends 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 tz,this.environmentIntensity=1,this.environmentRotation=new tz,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}let t9=new K,t7=new K,et=new K,ee=new K,ei=new K,er=new K,es=new K,en=new K,ea=new K,eo=new K,eh=new tm,el=new tm,eu=new tm;class ec{constructor(t=new K,e=new K,i=new K){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,r){r.subVectors(i,e),t9.subVectors(t,e),r.cross(t9);let s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,i,r,s){t9.subVectors(r,e),t7.subVectors(i,e),et.subVectors(t,e);let n=t9.dot(t9),a=t9.dot(t7),o=t9.dot(et),h=t7.dot(t7),l=t7.dot(et),u=n*h-a*a;if(0===u)return s.set(0,0,0),null;let c=1/u,d=(h*o-a*l)*c,p=(n*l-a*o)*c;return s.set(1-d-p,p,d)}static containsPoint(t,e,i,r){return null!==this.getBarycoord(t,e,i,r,ee)&&ee.x>=0&&ee.y>=0&&ee.x+ee.y<=1}static getInterpolation(t,e,i,r,s,n,a,o){return null===this.getBarycoord(t,e,i,r,ee)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(s,ee.x),o.addScaledVector(n,ee.y),o.addScaledVector(a,ee.z),o)}static getInterpolatedAttribute(t,e,i,r,s,n){return eh.setScalar(0),el.setScalar(0),eu.setScalar(0),eh.fromBufferAttribute(t,e),el.fromBufferAttribute(t,i),eu.fromBufferAttribute(t,r),n.setScalar(0),n.addScaledVector(eh,s.x),n.addScaledVector(el,s.y),n.addScaledVector(eu,s.z),n}static isFrontFacing(t,e,i,r){return t9.subVectors(i,e),t7.subVectors(t,e),0>t9.cross(t7).dot(r)}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,i,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return t9.subVectors(this.c,this.b),t7.subVectors(this.a,this.b),.5*t9.cross(t7).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ec.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ec.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,r,s){return ec.getInterpolation(t,this.a,this.b,this.c,e,i,r,s)}containsPoint(t){return ec.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ec.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let i,r,s=this.a,n=this.b,a=this.c;ei.subVectors(n,s),er.subVectors(a,s),en.subVectors(t,s);let o=ei.dot(en),h=er.dot(en);if(o<=0&&h<=0)return e.copy(s);ea.subVectors(t,n);let l=ei.dot(ea),u=er.dot(ea);if(l>=0&&u<=l)return e.copy(n);let c=o*u-l*h;if(c<=0&&o>=0&&l<=0)return i=o/(o-l),e.copy(s).addScaledVector(ei,i);eo.subVectors(t,a);let d=ei.dot(eo),p=er.dot(eo);if(p>=0&&d<=p)return e.copy(a);let f=d*h-o*p;if(f<=0&&h>=0&&p<=0)return r=h/(h-p),e.copy(s).addScaledVector(er,r);let m=l*p-d*u;if(m<=0&&u-l>=0&&d-p>=0)return es.subVectors(a,n),r=(u-l)/(u-l+(d-p)),e.copy(n).addScaledVector(es,r);let y=1/(m+f+c);return i=f*y,r=c*y,e.copy(s).addScaledVector(ei,i).addScaledVector(er,r)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}class ed{constructor(t=new K(Infinity,Infinity,Infinity),e=new K(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(ef.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(ef.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let i=ef.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let i=t.geometry;if(void 0!==i){let r=i.getAttribute("position");if(!0===e&&void 0!==r&&!0!==t.isInstancedMesh)for(let e=0,i=r.count;e<i;e++)!0===t.isMesh?t.getVertexPosition(e,ef):ef.fromBufferAttribute(r,e),ef.applyMatrix4(t.matrixWorld),this.expandByPoint(ef);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),em.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),em.copy(i.boundingBox)),em.applyMatrix4(t.matrixWorld),this.union(em)}let r=t.children;for(let t=0,i=r.length;t<i;t++)this.expandByObject(r[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,ef),ef.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(eM),eS.subVectors(this.max,eM),ey.subVectors(t.a,eM),eg.subVectors(t.b,eM),ex.subVectors(t.c,eM),eb.subVectors(eg,ey),ev.subVectors(ex,eg),ew.subVectors(ey,ex);let e=[0,-eb.z,eb.y,0,-ev.z,ev.y,0,-ew.z,ew.y,eb.z,0,-eb.x,ev.z,0,-ev.x,ew.z,0,-ew.x,-eb.y,eb.x,0,-ev.y,ev.x,0,-ew.y,ew.x,0];return!!eT(e,ey,eg,ex,eS)&&!!eT(e=[1,0,0,0,1,0,0,0,1],ey,eg,ex,eS)&&(e_.crossVectors(eb,ev),eT(e=[e_.x,e_.y,e_.z],ey,eg,ex,eS))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,ef).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(ef).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(ep[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ep[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ep[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ep[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ep[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ep[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ep[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ep[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ep)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}let ep=[new K,new K,new K,new K,new K,new K,new K,new K],ef=new K,em=new ed,ey=new K,eg=new K,ex=new K,eb=new K,ev=new K,ew=new K,eM=new K,eS=new K,e_=new K,eA=new K;function eT(t,e,i,r,s){for(let n=0,a=t.length-3;n<=a;n+=3){eA.fromArray(t,n);let a=s.x*Math.abs(eA.x)+s.y*Math.abs(eA.y)+s.z*Math.abs(eA.z),o=e.dot(eA),h=i.dot(eA),l=r.dot(eA);if(Math.max(-Math.max(o,h,l),Math.min(o,h,l))>a)return!1}return!0}let eC=function(){let t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),r=new Uint32Array(512),s=new Uint32Array(512);for(let t=0;t<256;++t){let e=t-127;e<-27?(r[t]=0,r[256|t]=32768,s[t]=24,s[256|t]=24):e<-14?(r[t]=1024>>-e-14,r[256|t]=1024>>-e-14|32768,s[t]=-e-1,s[256|t]=-e-1):e<=15?(r[t]=e+15<<10,r[256|t]=e+15<<10|32768,s[t]=13,s[256|t]=13):e<128?(r[t]=31744,r[256|t]=64512,s[t]=24,s[256|t]=24):(r[t]=31744,r[256|t]=64512,s[t]=13,s[256|t]=13)}let n=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;(8388608&e)==0;)e<<=1,i-=8388608;e&=-8388609,i+=0x38800000,n[t]=e|i}for(let t=1024;t<2048;++t)n[t]=0x38000000+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=0x47800000,a[32]=0x80000000;for(let t=33;t<63;++t)a[t]=0x80000000+(t-32<<23);a[63]=0xc7800000;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:i,baseTable:r,shiftTable:s,mantissaTable:n,exponentTable:a,offsetTable:o}}();function eE(t){Math.abs(t)>65504&&B("DataUtils.toHalfFloat(): Value out of range."),t=q(t,-65504,65504),eC.floatView[0]=t;let e=eC.uint32View[0],i=e>>23&511;return eC.baseTable[i]+((8388607&e)>>eC.shiftTable[i])}function eI(t){let e=t>>10;return eC.uint32View[0]=eC.mantissaTable[eC.offsetTable[e]+(1023&t)]+eC.exponentTable[e],eC.floatView[0]}class eR{static toHalfFloat(t){return eE(t)}static fromHalfFloat(t){return eI(t)}}let eO=new K,ez=new Y,eB=0;class ek extends F{constructor(t,e,i=!1){if(super(),Array.isArray(t))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:eB++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[t+r]=e.array[i+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)ez.fromBufferAttribute(this,e),ez.applyMatrix3(t),this.setXY(e,ez.x,ez.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)eO.fromBufferAttribute(this,e),eO.applyMatrix3(t),this.setXYZ(e,eO.x,eO.y,eO.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)eO.fromBufferAttribute(this,e),eO.applyMatrix4(t),this.setXYZ(e,eO.x,eO.y,eO.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)eO.fromBufferAttribute(this,e),eO.applyNormalMatrix(t),this.setXYZ(e,eO.x,eO.y,eO.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)eO.fromBufferAttribute(this,e),eO.transformDirection(t),this.setXYZ(e,eO.x,eO.y,eO.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let i=this.array[t*this.itemSize+e];return this.normalized&&(i=J(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=X(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=J(e,this.array)),e}setX(t,e){return this.normalized&&(e=X(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=J(e,this.array)),e}setY(t,e){return this.normalized&&(e=X(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=J(e,this.array)),e}setZ(t,e){return this.normalized&&(e=X(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=J(e,this.array)),e}setW(t,e){return this.normalized&&(e=X(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=X(e,this.array),i=X(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,r){return t*=this.itemSize,this.normalized&&(e=X(e,this.array),i=X(i,this.array),r=X(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this}setXYZW(t,e,i,r,s){return t*=this.itemSize,this.normalized&&(e=X(e,this.array),i=X(i,this.array),r=X(r,this.array),s=X(s,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),35044!==this.usage&&(t.usage=this.usage),t}dispose(){this.dispatchEvent({type:"dispose"})}}class eP extends ek{constructor(t,e,i){super(new Int8Array(t),e,i)}}class eN extends ek{constructor(t,e,i){super(new Uint8Array(t),e,i)}}class eL extends ek{constructor(t,e,i){super(new Uint8ClampedArray(t),e,i)}}class eF extends ek{constructor(t,e,i){super(new Int16Array(t),e,i)}}class ej extends ek{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class eD extends ek{constructor(t,e,i){super(new Int32Array(t),e,i)}}class eU extends ek{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class eV extends ek{constructor(t,e,i){super(new Uint16Array(t),e,i),this.isFloat16BufferAttribute=!0}getX(t){let e=eI(this.array[t*this.itemSize]);return this.normalized&&(e=J(e,this.array)),e}setX(t,e){return this.normalized&&(e=X(e,this.array)),this.array[t*this.itemSize]=eE(e),this}getY(t){let e=eI(this.array[t*this.itemSize+1]);return this.normalized&&(e=J(e,this.array)),e}setY(t,e){return this.normalized&&(e=X(e,this.array)),this.array[t*this.itemSize+1]=eE(e),this}getZ(t){let e=eI(this.array[t*this.itemSize+2]);return this.normalized&&(e=J(e,this.array)),e}setZ(t,e){return this.normalized&&(e=X(e,this.array)),this.array[t*this.itemSize+2]=eE(e),this}getW(t){let e=eI(this.array[t*this.itemSize+3]);return this.normalized&&(e=J(e,this.array)),e}setW(t,e){return this.normalized&&(e=X(e,this.array)),this.array[t*this.itemSize+3]=eE(e),this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=X(e,this.array),i=X(i,this.array)),this.array[t+0]=eE(e),this.array[t+1]=eE(i),this}setXYZ(t,e,i,r){return t*=this.itemSize,this.normalized&&(e=X(e,this.array),i=X(i,this.array),r=X(r,this.array)),this.array[t+0]=eE(e),this.array[t+1]=eE(i),this.array[t+2]=eE(r),this}setXYZW(t,e,i,r,s){return t*=this.itemSize,this.normalized&&(e=X(e,this.array),i=X(i,this.array),r=X(r,this.array),s=X(s,this.array)),this.array[t+0]=eE(e),this.array[t+1]=eE(i),this.array[t+2]=eE(r),this.array[t+3]=eE(s),this}}class eW extends ek{constructor(t,e,i){super(new Float32Array(t),e,i)}}let eq=new ed,eG=new K,eH=new K;class eJ{constructor(t=new K,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let i=this.center;void 0!==e?i.copy(e):eq.setFromPoints(t).getCenter(i);let r=0;for(let e=0,s=t.length;e<s;e++)r=Math.max(r,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?t.makeEmpty():(t.set(this.center,this.center),t.expandByScalar(this.radius)),t}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;eG.subVectors(t,this.center);let e=eG.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),i=(t-this.radius)*.5;this.center.addScaledVector(eG,i/t),this.radius+=i}return this}union(t){return t.isEmpty()||(this.isEmpty()?this.copy(t):!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(eH.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(eG.copy(t.center).add(eH)),this.expandByPoint(eG.copy(t.center).sub(eH)))),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let eX=0,e$=new tM,eY=new t$,eZ=new K,eK=new ed,eQ=new ed,e0=new K;class e1 extends F{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:eX++}),this.uuid=W(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(!function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?ej:eU)(t,1):this.index=t,this}setIndirect(t,e=0){return this.indirect=t,this.indirectOffset=e,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let e=new te().getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}let r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return e$.makeRotationFromQuaternion(t),this.applyMatrix4(e$),this}rotateX(t){return e$.makeRotationX(t),this.applyMatrix4(e$),this}rotateY(t){return e$.makeRotationY(t),this.applyMatrix4(e$),this}rotateZ(t){return e$.makeRotationZ(t),this.applyMatrix4(e$),this}translate(t,e,i){return e$.makeTranslation(t,e,i),this.applyMatrix4(e$),this}scale(t,e,i){return e$.makeScale(t,e,i),this.applyMatrix4(e$),this}lookAt(t){return eY.lookAt(t),eY.updateMatrix(),this.applyMatrix4(eY.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(eZ).negate(),this.translate(eZ.x,eZ.y,eZ.z),this}setFromPoints(t){let e=this.getAttribute("position");if(void 0===e){let e=[];for(let i=0,r=t.length;i<r;i++){let r=t[i];e.push(r.x,r.y,r.z||0)}this.setAttribute("position",new eW(e,3))}else{let i=Math.min(t.length,e.count);for(let r=0;r<i;r++){let i=t[r];e.setXYZ(r,i.x,i.y,i.z||0)}t.length>e.count&&B("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ed);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){k("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new K(-1/0,-1/0,-1/0),new K(Infinity,Infinity,Infinity));return}if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];eK.setFromBufferAttribute(i),this.morphTargetsRelative?(e0.addVectors(this.boundingBox.min,eK.min),this.boundingBox.expandByPoint(e0),e0.addVectors(this.boundingBox.max,eK.max),this.boundingBox.expandByPoint(e0)):(this.boundingBox.expandByPoint(eK.min),this.boundingBox.expandByPoint(eK.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&k('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new eJ);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){k("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new K,1/0);return}if(t){let i=this.boundingSphere.center;if(eK.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];eQ.setFromBufferAttribute(i),this.morphTargetsRelative?(e0.addVectors(eK.min,eQ.min),eK.expandByPoint(e0),e0.addVectors(eK.max,eQ.max),eK.expandByPoint(e0)):(eK.expandByPoint(eQ.min),eK.expandByPoint(eQ.max))}eK.getCenter(i);let r=0;for(let e=0,s=t.count;e<s;e++)e0.fromBufferAttribute(t,e),r=Math.max(r,i.distanceToSquared(e0));if(e)for(let s=0,n=e.length;s<n;s++){let n=e[s],a=this.morphTargetsRelative;for(let e=0,s=n.count;e<s;e++)e0.fromBufferAttribute(n,e),a&&(eZ.fromBufferAttribute(t,e),e0.add(eZ)),r=Math.max(r,i.distanceToSquared(e0))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&k('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void k("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let i=e.position,r=e.normal,s=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new ek(new Float32Array(4*i.count),4));let n=this.getAttribute("tangent"),a=[],o=[];for(let t=0;t<i.count;t++)a[t]=new K,o[t]=new K;let h=new K,l=new K,u=new K,c=new Y,d=new Y,p=new Y,f=new K,m=new K,y=this.groups;0===y.length&&(y=[{start:0,count:t.count}]);for(let e=0,r=y.length;e<r;++e){let r=y[e],n=r.start,g=r.count;for(let e=n,r=n+g;e<r;e+=3)!function(t,e,r){h.fromBufferAttribute(i,t),l.fromBufferAttribute(i,e),u.fromBufferAttribute(i,r),c.fromBufferAttribute(s,t),d.fromBufferAttribute(s,e),p.fromBufferAttribute(s,r),l.sub(h),u.sub(h),d.sub(c),p.sub(c);let n=1/(d.x*p.y-p.x*d.y);isFinite(n)&&(f.copy(l).multiplyScalar(p.y).addScaledVector(u,-d.y).multiplyScalar(n),m.copy(u).multiplyScalar(d.x).addScaledVector(l,-p.x).multiplyScalar(n),a[t].add(f),a[e].add(f),a[r].add(f),o[t].add(m),o[e].add(m),o[r].add(m))}(t.getX(e+0),t.getX(e+1),t.getX(e+2))}let g=new K,x=new K,b=new K,v=new K;function w(t){b.fromBufferAttribute(r,t),v.copy(b);let e=a[t];g.copy(e),g.sub(b.multiplyScalar(b.dot(e))).normalize(),x.crossVectors(v,e);let i=x.dot(o[t]);n.setXYZW(t,g.x,g.y,g.z,i<0?-1:1)}for(let e=0,i=y.length;e<i;++e){let i=y[e],r=i.start,s=i.count;for(let e=r,i=r+s;e<i;e+=3)w(t.getX(e+0)),w(t.getX(e+1)),w(t.getX(e+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new ek(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);let r=new K,s=new K,n=new K,a=new K,o=new K,h=new K,l=new K,u=new K;if(t)for(let c=0,d=t.count;c<d;c+=3){let d=t.getX(c+0),p=t.getX(c+1),f=t.getX(c+2);r.fromBufferAttribute(e,d),s.fromBufferAttribute(e,p),n.fromBufferAttribute(e,f),l.subVectors(n,s),u.subVectors(r,s),l.cross(u),a.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),h.fromBufferAttribute(i,f),a.add(l),o.add(l),h.add(l),i.setXYZ(d,a.x,a.y,a.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(f,h.x,h.y,h.z)}else for(let t=0,a=e.count;t<a;t+=3)r.fromBufferAttribute(e,t+0),s.fromBufferAttribute(e,t+1),n.fromBufferAttribute(e,t+2),l.subVectors(n,s),u.subVectors(r,s),l.cross(u),i.setXYZ(t+0,l.x,l.y,l.z),i.setXYZ(t+1,l.x,l.y,l.z),i.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)e0.fromBufferAttribute(t,e),e0.normalize(),t.setXYZ(e,e0.x,e0.y,e0.z)}toNonIndexed(){function t(t,e){let i=t.array,r=t.itemSize,s=t.normalized,n=new i.constructor(e.length*r),a=0,o=0;for(let s=0,h=e.length;s<h;s++){a=t.isInterleavedBufferAttribute?e[s]*t.data.stride+t.offset:e[s]*r;for(let t=0;t<r;t++)n[o++]=i[a++]}return new ek(n,r,s)}if(null===this.index)return B("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new e1,i=this.index.array,r=this.attributes;for(let s in r){let n=t(r[s],i);e.setAttribute(s,n)}let s=this.morphAttributes;for(let r in s){let n=[],a=s[r];for(let e=0,r=a.length;e<r;e++){let r=t(a[e],i);n.push(r)}e.morphAttributes[r]=n}e.morphTargetsRelative=this.morphTargetsRelative;let n=this.groups;for(let t=0,i=n.length;t<i;t++){let i=n[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){let t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){let e=this.parameters;for(let i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};let e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let i=this.attributes;for(let e in i){let r=i[e];t.data.attributes[e]=r.toJSON(t.data)}let r={},s=!1;for(let e in this.morphAttributes){let i=this.morphAttributes[e],n=[];for(let e=0,r=i.length;e<r;e++){let r=i[e];n.push(r.toJSON(t.data))}n.length>0&&(r[e]=n,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);let n=this.groups;n.length>0&&(t.data.groups=JSON.parse(JSON.stringify(n)));let a=this.boundingSphere;return null!==a&&(t.data.boundingSphere=a.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let i=t.index;null!==i&&this.setIndex(i.clone());let r=t.attributes;for(let t in r){let i=r[t];this.setAttribute(t,i.clone(e))}let s=t.morphAttributes;for(let t in s){let i=[],r=s[t];for(let t=0,s=r.length;t<s;t++)i.push(r[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;let n=t.groups;for(let t=0,e=n.length;t<e;t++){let e=n[t];this.addGroup(e.start,e.count,e.materialIndex)}let a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());let o=t.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class e2{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=W()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let r=0,s=this.stride;r<s;r++)this.array[t+r]=e.array[i+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=W()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=W()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.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}}}let e3=new K;class e5{constructor(t,e,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)e3.fromBufferAttribute(this,e),e3.applyMatrix4(t),this.setXYZ(e,e3.x,e3.y,e3.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)e3.fromBufferAttribute(this,e),e3.applyNormalMatrix(t),this.setXYZ(e,e3.x,e3.y,e3.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)e3.fromBufferAttribute(this,e),e3.transformDirection(t),this.setXYZ(e,e3.x,e3.y,e3.z);return this}getComponent(t,e){let i=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(i=J(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=X(i,this.array)),this.data.array[t*this.data.stride+this.offset+e]=i,this}setX(t,e){return this.normalized&&(e=X(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=X(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=X(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=X(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=J(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=J(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=J(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=J(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=X(e,this.array),i=X(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=X(e,this.array),i=X(i,this.array),r=X(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this}setXYZW(t,e,i,r,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=X(e,this.array),i=X(i,this.array),r=X(r,this.array),s=X(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this.data.array[t+3]=s,this}clone(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new e5(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{O("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new ek(new this.array.constructor(t),this.itemSize,this.normalized)}}toJSON(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{O("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}}}let e4=0;class e6 extends F{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:e4++}),this.uuid=W(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new t3(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,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}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(let e in t){let i=t[e];if(void 0===i){B(`Material: parameter '${e}' has value of undefined.`);continue}let r=this[e];if(void 0===r){B(`Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i}}toJSON(t){let e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});let i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function r(t){let e=[];for(let i in t){let r=t[i];delete r.metadata,e.push(r)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(i.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(i.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!1===this.allowOverride&&(i.allowOverride=!1),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),e){let e=r(t.textures),s=r(t.images);e.length>0&&(i.textures=e),s.length>0&&(i.images=s)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,i=null;if(null!==e){let t=e.length;i=Array(t);for(let r=0;r!==t;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class e8 extends e6{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new t3(0xffffff),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let e9=new K,e7=new K,it=new K,ie=new Y,ii=new Y,ir=new tM,is=new K,ia=new K,io=new K,ih=new Y,il=new Y,iu=new Y;class ic extends t${constructor(t=new e8){if(super(),this.isSprite=!0,this.type="Sprite",void 0===i){i=new e1;const t=new e2(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);i.setIndex([0,1,2,0,2,3]),i.setAttribute("position",new e5(t,3,0,!1)),i.setAttribute("uv",new e5(t,2,3,!1))}this.geometry=i,this.material=t,this.center=new Y(.5,.5),this.count=1}raycast(t,e){let i,r;null===t.camera&&k('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),e7.setFromMatrixScale(this.matrixWorld),ir.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),it.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&e7.multiplyScalar(-it.z);let s=this.material.rotation;0!==s&&(r=Math.cos(s),i=Math.sin(s));let n=this.center;id(is.set(-.5,-.5,0),it,n,e7,i,r),id(ia.set(.5,-.5,0),it,n,e7,i,r),id(io.set(.5,.5,0),it,n,e7,i,r),ih.set(0,0),il.set(1,0),iu.set(1,1);let a=t.ray.intersectTriangle(is,ia,io,!1,e9);if(null===a&&(id(ia.set(-.5,.5,0),it,n,e7,i,r),il.set(0,1),null===(a=t.ray.intersectTriangle(is,io,ia,!1,e9))))return;let o=t.ray.origin.distanceTo(e9);o<t.near||o>t.far||e.push({distance:o,point:e9.clone(),uv:ec.getInterpolation(e9,is,ia,io,ih,il,iu,new Y),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function id(t,e,i,r,s,n){ie.subVectors(t,i).addScalar(.5).multiply(r),void 0!==s?(ii.x=n*ie.x-s*ie.y,ii.y=s*ie.x+n*ie.y):ii.copy(ie),t.copy(e),t.x+=ii.x,t.y+=ii.y,t.applyMatrix4(ir)}let ip=new K,im=new K;class iy extends t${constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);let e=t.levels;for(let t=0,i=e.length;t<i;t++){let i=e[t];this.addLevel(i.object.clone(),i.distance,i.hysteresis)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0,i=0){let r;e=Math.abs(e);let s=this.levels;for(r=0;r<s.length&&!(e<s[r].distance);r++);return s.splice(r,0,{distance:e,hysteresis:i,object:t}),this.add(t),this}removeLevel(t){let e=this.levels;for(let i=0;i<e.length;i++)if(e[i].distance===t){let t=e.splice(i,1);return this.remove(t[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){let e=this.levels;if(e.length>0){let i,r;for(i=1,r=e.length;i<r;i++){let r=e[i].distance;if(e[i].object.visible&&(r-=r*e[i].hysteresis),t<r)break}return e[i-1].object}return null}raycast(t,e){if(this.levels.length>0){ip.setFromMatrixPosition(this.matrixWorld);let i=t.ray.origin.distanceTo(ip);this.getObjectForDistance(i).raycast(t,e)}}update(t){let e=this.levels;if(e.length>1){let i,r;ip.setFromMatrixPosition(t.matrixWorld),im.setFromMatrixPosition(this.matrixWorld);let s=ip.distanceTo(im)/t.zoom;for(i=1,e[0].object.visible=!0,r=e.length;i<r;i++){let t=e[i].distance;if(e[i].object.visible&&(t-=t*e[i].hysteresis),s>=t)e[i-1].object.visible=!1,e[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<r;i++)e[i].object.visible=!1}}toJSON(t){let e=super.toJSON(t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];let i=this.levels;for(let t=0,r=i.length;t<r;t++){let r=i[t];e.object.levels.push({object:r.object.uuid,distance:r.distance,hysteresis:r.hysteresis})}return e}}let ig=new K,ix=new K,ib=new K,iv=new K,iw=new K,iM=new K,iS=new K;class i_{constructor(t=new K,e=new K(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,ig)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=ig.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ig.copy(this.origin).addScaledVector(this.direction,e),ig.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){let s,n,a,o;ix.copy(t).add(e).multiplyScalar(.5),ib.copy(e).sub(t).normalize(),iv.copy(this.origin).sub(ix);let h=.5*t.distanceTo(e),l=-this.direction.dot(ib),u=iv.dot(this.direction),c=-iv.dot(ib),d=iv.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(s=l*c-u,n=l*u-c,o=h*p,s>=0)if(n>=-o)if(n<=o){let t=1/p;s*=t,n*=t,a=s*(s+l*n+2*u)+n*(l*s+n+2*c)+d}else a=-(s=Math.max(0,-(l*(n=h)+u)))*s+n*(n+2*c)+d;else a=-(s=Math.max(0,-(l*(n=-h)+u)))*s+n*(n+2*c)+d;else n<=-o?(n=(s=Math.max(0,-(-l*h+u)))>0?-h:Math.min(Math.max(-h,-c),h),a=-s*s+n*(n+2*c)+d):n<=o?(s=0,a=(n=Math.min(Math.max(-h,-c),h))*(n+2*c)+d):(n=(s=Math.max(0,-(l*h+u)))>0?h:Math.min(Math.max(-h,-c),h),a=-s*s+n*(n+2*c)+d);else n=l>0?-h:h,a=-(s=Math.max(0,-(l*n+u)))*s+n*(n+2*c)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,s),r&&r.copy(ix).addScaledVector(ib,n),a}intersectSphere(t,e){ig.subVectors(t.center,this.origin);let i=ig.dot(this.direction),r=ig.dot(ig)-i*i,s=t.radius*t.radius;if(r>s)return null;let n=Math.sqrt(s-r),a=i-n,o=i+n;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return!(t.radius<0)&&this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){let i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return!!(0===e||t.normal.dot(this.direction)*e<0)}intersectBox(t,e){let i,r,s,n,a,o,h=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,c=this.origin;return(h>=0?(i=(t.min.x-c.x)*h,r=(t.max.x-c.x)*h):(i=(t.max.x-c.x)*h,r=(t.min.x-c.x)*h),l>=0?(s=(t.min.y-c.y)*l,n=(t.max.y-c.y)*l):(s=(t.max.y-c.y)*l,n=(t.min.y-c.y)*l),i>n||s>r||((s>i||isNaN(i))&&(i=s),(n<r||isNaN(r))&&(r=n),u>=0?(a=(t.min.z-c.z)*u,o=(t.max.z-c.z)*u):(a=(t.max.z-c.z)*u,o=(t.min.z-c.z)*u),i>o||a>r||((a>i||i!=i)&&(i=a),(o<r||r!=r)&&(r=o),r<0)))?null:this.at(i>=0?i:r,e)}intersectsBox(t){return null!==this.intersectBox(t,ig)}intersectTriangle(t,e,i,r,s){let n;iw.subVectors(e,t),iM.subVectors(i,t),iS.crossVectors(iw,iM);let a=this.direction.dot(iS);if(a>0){if(r)return null;n=1}else{if(!(a<0))return null;n=-1,a=-a}iv.subVectors(this.origin,t);let o=n*this.direction.dot(iM.crossVectors(iv,iM));if(o<0)return null;let h=n*this.direction.dot(iw.cross(iv));if(h<0||o+h>a)return null;let l=-n*iv.dot(iS);return l<0?null:this.at(l/a,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class iA extends e6{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new t3(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 tz,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}let iT=new tM,iC=new i_,iE=new eJ,iI=new K,iR=new K,iO=new K,iz=new K,iB=new K,ik=new K,iP=new K,iN=new K;class iL extends t${constructor(t=new e1,e=new iA){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){let i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,n=i.morphTargetsRelative;e.fromBufferAttribute(r,t);let a=this.morphTargetInfluences;if(s&&a){ik.set(0,0,0);for(let i=0,r=s.length;i<r;i++){let r=a[i],o=s[i];0!==r&&(iB.fromBufferAttribute(o,t),n?ik.addScaledVector(iB,r):ik.addScaledVector(iB.sub(e),r))}e.add(ik)}return e}raycast(t,e){let i=this.geometry,r=this.material,s=this.matrixWorld;void 0===r||(null===i.boundingSphere&&i.computeBoundingSphere(),iE.copy(i.boundingSphere),iE.applyMatrix4(s),iC.copy(t.ray).recast(t.near),!1===iE.containsPoint(iC.origin)&&(null===iC.intersectSphere(iE,iI)||iC.origin.distanceToSquared(iI)>(t.far-t.near)**2)||(iT.copy(s).invert(),iC.copy(t.ray).applyMatrix4(iT),(null===i.boundingBox||!1!==iC.intersectsBox(i.boundingBox))&&this._computeIntersections(t,e,iC)))}_computeIntersections(t,e,i){let r,s=this.geometry,n=this.material,a=s.index,o=s.attributes.position,h=s.attributes.uv,l=s.attributes.uv1,u=s.attributes.normal,c=s.groups,d=s.drawRange;if(null!==a)if(Array.isArray(n))for(let s=0,o=c.length;s<o;s++){let o=c[s],p=n[o.materialIndex],f=Math.max(o.start,d.start),m=Math.min(a.count,Math.min(o.start+o.count,d.start+d.count));for(let s=f;s<m;s+=3)(r=iF(this,p,t,i,h,l,u,a.getX(s),a.getX(s+1),a.getX(s+2)))&&(r.faceIndex=Math.floor(s/3),r.face.materialIndex=o.materialIndex,e.push(r))}else{let s=Math.max(0,d.start),o=Math.min(a.count,d.start+d.count);for(let c=s;c<o;c+=3)(r=iF(this,n,t,i,h,l,u,a.getX(c),a.getX(c+1),a.getX(c+2)))&&(r.faceIndex=Math.floor(c/3),e.push(r))}else if(void 0!==o)if(Array.isArray(n))for(let s=0,a=c.length;s<a;s++){let a=c[s],p=n[a.materialIndex],f=Math.max(a.start,d.start),m=Math.min(o.count,Math.min(a.start+a.count,d.start+d.count));for(let s=f;s<m;s+=3)(r=iF(this,p,t,i,h,l,u,s,s+1,s+2))&&(r.faceIndex=Math.floor(s/3),r.face.materialIndex=a.materialIndex,e.push(r))}else{let s=Math.max(0,d.start),a=Math.min(o.count,d.start+d.count);for(let o=s;o<a;o+=3)(r=iF(this,n,t,i,h,l,u,o,o+1,o+2))&&(r.faceIndex=Math.floor(o/3),e.push(r))}}}function iF(t,e,i,r,s,n,a,o,h,l){t.getVertexPosition(o,iR),t.getVertexPosition(h,iO),t.getVertexPosition(l,iz);let u=function(t,e,i,r,s,n,a,o){if(null===(1===e.side?r.intersectTriangle(a,n,s,!0,o):r.intersectTriangle(s,n,a,0===e.side,o)))return null;iN.copy(o),iN.applyMatrix4(t.matrixWorld);let h=i.ray.origin.distanceTo(iN);return h<i.near||h>i.far?null:{distance:h,point:iN.clone(),object:t}}(t,e,i,r,iR,iO,iz,iP);if(u){let t=new K;ec.getBarycoord(iP,iR,iO,iz,t),s&&(u.uv=ec.getInterpolatedAttribute(s,o,h,l,t,new Y)),n&&(u.uv1=ec.getInterpolatedAttribute(n,o,h,l,t,new Y)),a&&(u.normal=ec.getInterpolatedAttribute(a,o,h,l,t,new K),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let e={a:o,b:h,c:l,normal:new K,materialIndex:0};ec.getNormal(iR,iO,iz,e.normal),u.face=e,u.barycoord=t}return u}let ij=new tm,iD=new tm,iU=new tm,iV=new tm,iW=new tM,iq=new K,iG=new eJ,iH=new tM,iJ=new i_;class iX extends iL{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=d,this.bindMatrix=new tM,this.bindMatrixInverse=new tM,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let t=this.geometry;null===this.boundingBox&&(this.boundingBox=new ed),this.boundingBox.makeEmpty();let e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,iq),this.boundingBox.expandByPoint(iq)}computeBoundingSphere(){let t=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new eJ),this.boundingSphere.makeEmpty();let e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,iq),this.boundingSphere.expandByPoint(iq)}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}raycast(t,e){let i=this.material,r=this.matrixWorld;void 0===i||(null===this.boundingSphere&&this.computeBoundingSphere(),iG.copy(this.boundingSphere),iG.applyMatrix4(r),!1===t.ray.intersectsSphere(iG)||(iH.copy(r).invert(),iJ.copy(t.ray).applyMatrix4(iH),(null===this.boundingBox||!1!==iJ.intersectsBox(this.boundingBox))&&this._computeIntersections(t,e,iJ)))}getVertexPosition(t,e){return super.getVertexPosition(t,e),this.applyBoneTransform(t,e),e}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let t=new tm,e=this.geometry.attributes.skinWeight;for(let i=0,r=e.count;i<r;i++){t.fromBufferAttribute(e,i);let r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode===d?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===p?this.bindMatrixInverse.copy(this.bindMatrix).invert():B("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(t,e){let i=this.skeleton,r=this.geometry;iD.fromBufferAttribute(r.attributes.skinIndex,t),iU.fromBufferAttribute(r.attributes.skinWeight,t),e.isVector4?(ij.copy(e),e.set(0,0,0,0)):(ij.set(...e,1),e.set(0,0,0)),ij.applyMatrix4(this.bindMatrix);for(let t=0;t<4;t++){let r=iU.getComponent(t);if(0!==r){let s=iD.getComponent(t);iW.multiplyMatrices(i.bones[s].matrixWorld,i.boneInverses[s]),e.addScaledVector(iV.copy(ij).applyMatrix4(iW),r)}}return e.isVector4&&(e.w=ij.w),e.applyMatrix4(this.bindMatrixInverse)}}class i$ extends t${constructor(){super(),this.isBone=!0,this.type="Bone"}}class iY extends tf{constructor(t=null,e=1,i=1,r,s,n,a,o,h=1003,l=1003,u,c){super(null,n,a,o,h,l,r,s,u,c),this.isDataTexture=!0,this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let iZ=new tM,iK=new tM;class iQ{constructor(t=[],e=[]){this.uuid=W(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){let t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){B("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new tM)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){let e=new tM;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){let t=this.bones,e=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let r=0,s=t.length;r<s;r++){let s=t[r]?t[r].matrixWorld:iK;iZ.multiplyMatrices(s,e[r]),iZ.toArray(i,16*r)}null!==r&&(r.needsUpdate=!0)}clone(){return new iQ(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length),e=new Float32Array((t=Math.max(t=4*Math.ceil(t/4),4))*t*4);e.set(this.boneMatrices);let i=new iY(e,t,t,1023,1015);return i.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=i,this}getBoneByName(t){for(let e=0,i=this.bones.length;e<i;e++){let i=this.bones[e];if(i.name===t)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let i=0,r=t.bones.length;i<r;i++){let r=t.bones[i],s=e[r];void 0===s&&(B("Skeleton: No bone found with UUID:",r),s=new i$),this.bones.push(s),this.boneInverses.push(new tM().fromArray(t.boneInverses[i]))}return this.init(),this}toJSON(){let t={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;let e=this.bones,i=this.boneInverses;for(let r=0,s=e.length;r<s;r++){let s=e[r];t.bones.push(s.uuid);let n=i[r];t.boneInverses.push(n.toArray())}return t}}class i0 extends ek{constructor(t,e,i,r=1){super(t,e,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){let t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}let i1=new tM,i2=new tM,i3=[],i5=new ed,i4=new tM,i6=new iL,i8=new eJ;class i9 extends iL{constructor(t,e,i){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new i0(new Float32Array(16*i),16),this.previousInstanceMatrix=null,this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let t=0;t<i;t++)this.setMatrixAt(t,i4)}computeBoundingBox(){let t=this.geometry,e=this.count;null===this.boundingBox&&(this.boundingBox=new ed),null===t.boundingBox&&t.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<e;i++)this.getMatrixAt(i,i1),i5.copy(t.boundingBox).applyMatrix4(i1),this.boundingBox.union(i5)}computeBoundingSphere(){let t=this.geometry,e=this.count;null===this.boundingSphere&&(this.boundingSphere=new eJ),null===t.boundingSphere&&t.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<e;i++)this.getMatrixAt(i,i1),i8.copy(t.boundingSphere).applyMatrix4(i1),this.boundingSphere.union(i8)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),null!==t.previousInstanceMatrix&&(this.previousInstanceMatrix=t.previousInstanceMatrix.clone()),null!==t.morphTexture&&(this.morphTexture=t.morphTexture.clone()),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}getColorAt(t,e){return null===this.instanceColor?e.setRGB(1,1,1):e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){return e.fromArray(this.instanceMatrix.array,16*t)}getMorphAt(t,e){let i=e.morphTargetInfluences,r=this.morphTexture.source.data.data,s=t*(i.length+1)+1;for(let t=0;t<i.length;t++)i[t]=r[s+t]}raycast(t,e){let i=this.matrixWorld,r=this.count;if((i6.geometry=this.geometry,i6.material=this.material,void 0!==i6.material)&&(null===this.boundingSphere&&this.computeBoundingSphere(),i8.copy(this.boundingSphere),i8.applyMatrix4(i),!1!==t.ray.intersectsSphere(i8)))for(let s=0;s<r;s++){this.getMatrixAt(s,i1),i2.multiplyMatrices(i,i1),i6.matrixWorld=i2,i6.raycast(t,i3);for(let t=0,i=i3.length;t<i;t++){let i=i3[t];i.instanceId=s,i.object=this,e.push(i)}i3.length=0}}setColorAt(t,e){return null===this.instanceColor&&(this.instanceColor=new i0(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),e.toArray(this.instanceColor.array,3*t),this}setMatrixAt(t,e){return e.toArray(this.instanceMatrix.array,16*t),this}setMorphAt(t,e){let i=e.morphTargetInfluences,r=i.length+1;null===this.morphTexture&&(this.morphTexture=new iY(new Float32Array(r*this.count),r,this.count,1028,1015));let s=this.morphTexture.source.data.data,n=0;for(let t=0;t<i.length;t++)n+=i[t];let a=this.geometry.morphTargetsRelative?1:1-n,o=r*t;return s[o]=a,s.set(i,o+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}}let i7=new K,rt=new K,re=new te;class ri{constructor(t=new K(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,r){return this.normal.set(t,e,i),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){let r=i7.subVectors(i,e).cross(rt.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e,i=!0){let r=t.delta(i7),s=this.normal.dot(r);if(0===s)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;let n=-(t.start.dot(this.normal)+this.constant)/s;return!0===i&&(n<0||n>1)?null:e.copy(t.start).addScaledVector(r,n)}intersectsLine(t){let e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let i=e||re.getNormalMatrix(t),r=this.coplanarPoint(i7).applyMatrix4(t),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}let rr=new eJ,rs=new Y(.5,.5),rn=new K;class ra{constructor(t=new ri,e=new ri,i=new ri,r=new ri,s=new ri,n=new ri){this.planes=[t,e,i,r,s,n]}set(t,e,i,r,s,n){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(n),this}copy(t){let e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=2e3,i=!1){let r=this.planes,s=t.elements,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],p=s[8],f=s[9],m=s[10],y=s[11],g=s[12],x=s[13],b=s[14],v=s[15];if(r[0].setComponents(h-n,d-l,y-p,v-g).normalize(),r[1].setComponents(h+n,d+l,y+p,v+g).normalize(),r[2].setComponents(h+a,d+u,y+f,v+x).normalize(),r[3].setComponents(h-a,d-u,y-f,v-x).normalize(),i)r[4].setComponents(o,c,m,b).normalize(),r[5].setComponents(h-o,d-c,y-m,v-b).normalize();else if(r[4].setComponents(h-o,d-c,y-m,v-b).normalize(),2e3===e)r[5].setComponents(h+o,d+c,y+m,v+b).normalize();else if(2001===e)r[5].setComponents(o,c,m,b).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),rr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),rr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(rr)}intersectsSprite(t){return rr.center.set(0,0,0),rr.radius=.7071067811865476+rs.distanceTo(t.center),rr.applyMatrix4(t.matrixWorld),this.intersectsSphere(rr)}intersectsSphere(t){let e=this.planes,i=t.center,r=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(i)<r)return!1;return!0}intersectsBox(t){let e=this.planes;for(let i=0;i<6;i++){let r=e[i];if(rn.x=r.normal.x>0?t.max.x:t.min.x,rn.y=r.normal.y>0?t.max.y:t.min.y,rn.z=r.normal.z>0?t.max.z:t.min.z,0>r.distanceToPoint(rn))return!1}return!0}containsPoint(t){let e=this.planes;for(let i=0;i<6;i++)if(0>e[i].distanceToPoint(t))return!1;return!0}clone(){return new this.constructor().copy(this)}}let ro=new tM,rh=new ra;class rl{constructor(){this.coordinateSystem=2e3}intersectsObject(t,e){if(!e.isArrayCamera||0===e.cameras.length)return!1;for(let i=0;i<e.cameras.length;i++){let r=e.cameras[i];if(ro.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),rh.setFromProjectionMatrix(ro,r.coordinateSystem,r.reversedDepth),rh.intersectsObject(t))return!0}return!1}intersectsSprite(t,e){if(!e||!e.cameras||0===e.cameras.length)return!1;for(let i=0;i<e.cameras.length;i++){let r=e.cameras[i];if(ro.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),rh.setFromProjectionMatrix(ro,r.coordinateSystem,r.reversedDepth),rh.intersectsSprite(t))return!0}return!1}intersectsSphere(t,e){if(!e||!e.cameras||0===e.cameras.length)return!1;for(let i=0;i<e.cameras.length;i++){let r=e.cameras[i];if(ro.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),rh.setFromProjectionMatrix(ro,r.coordinateSystem,r.reversedDepth),rh.intersectsSphere(t))return!0}return!1}intersectsBox(t,e){if(!e||!e.cameras||0===e.cameras.length)return!1;for(let i=0;i<e.cameras.length;i++){let r=e.cameras[i];if(ro.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),rh.setFromProjectionMatrix(ro,r.coordinateSystem,r.reversedDepth),rh.intersectsBox(t))return!0}return!1}containsPoint(t,e){if(!e||!e.cameras||0===e.cameras.length)return!1;for(let i=0;i<e.cameras.length;i++){let r=e.cameras[i];if(ro.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),rh.setFromProjectionMatrix(ro,r.coordinateSystem,r.reversedDepth),rh.containsPoint(t))return!0}return!1}clone(){return new rl}}function ru(t,e){return t-e}function rc(t,e){return t.z-e.z}function rd(t,e){return e.z-t.z}let rp=new tM,rf=new t3(1,1,1),rm=new ra,ry=new rl,rg=new ed,rx=new eJ,rb=new K,rv=new K,rw=new K,rM=new class{constructor(){this.index=0,this.pool=[],this.list=[]}push(t,e,i,r){let s=this.pool,n=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});let a=s[this.index];n.push(a),this.index++,a.start=t,a.count=e,a.z=i,a.index=r}reset(){this.list.length=0,this.index=0}},rS=new iL,r_=[];function rA(t,e){if(t.constructor!==e.constructor){let i=Math.min(t.length,e.length);for(let r=0;r<i;r++)e[r]=t[r]}else{let i=Math.min(t.length,e.length);e.set(new t.constructor(t.buffer,0,i))}}class rT extends iL{constructor(t,e,i=2*e,r){super(new e1,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=t,this._maxVertexCount=e,this._maxIndexCount=i,this._multiDrawCounts=new Int32Array(t),this._multiDrawStarts=new Int32Array(t),this._multiDrawCount=0,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let t=Math.sqrt(4*this._maxInstanceCount),e=new iY(new Float32Array((t=Math.max(t=4*Math.ceil(t/4),4))*t*4),t,t,1023,1015);this._matricesTexture=e}_initIndirectTexture(){let t=Math.sqrt(this._maxInstanceCount),e=new iY(new Uint32Array((t=Math.ceil(t))*t),t,t,1029,1014);this._indirectTexture=e}_initColorsTexture(){let t=Math.sqrt(this._maxInstanceCount),e=new iY(new Float32Array((t=Math.ceil(t))*t*4).fill(1),t,t,1023,1015);e.colorSpace=tn.workingColorSpace,this._colorsTexture=e}_initializeGeometry(t){let e=this.geometry,i=this._maxVertexCount,r=this._maxIndexCount;if(!1===this._geometryInitialized){for(let r in t.attributes){let{array:s,itemSize:n,normalized:a}=t.getAttribute(r),o=new ek(new s.constructor(i*n),n,a);e.setAttribute(r,o)}if(null!==t.getIndex()){let t=i>65535?new Uint32Array(r):new Uint16Array(r);e.setIndex(new ek(t,1))}this._geometryInitialized=!0}}_validateGeometry(t){let e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let i in e.attributes){if(!t.hasAttribute(i))throw Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);let r=t.getAttribute(i),s=e.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(t){let e=this._instanceInfo;if(t<0||t>=e.length||!1===e[t].active)throw Error(`THREE.BatchedMesh: Invalid instanceId ${t}. Instance is either out of range or has been deleted.`)}validateGeometryId(t){let e=this._geometryInfo;if(t<0||t>=e.length||!1===e[t].active)throw Error(`THREE.BatchedMesh: Invalid geometryId ${t}. Geometry is either out of range or has been deleted.`)}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ed);let t=this.boundingBox,e=this._instanceInfo;t.makeEmpty();for(let i=0,r=e.length;i<r;i++){if(!1===e[i].active)continue;let r=e[i].geometryIndex;this.getMatrixAt(i,rp),this.getBoundingBoxAt(r,rg).applyMatrix4(rp),t.union(rg)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new eJ);let t=this.boundingSphere,e=this._instanceInfo;t.makeEmpty();for(let i=0,r=e.length;i<r;i++){if(!1===e[i].active)continue;let r=e[i].geometryIndex;this.getMatrixAt(i,rp),this.getBoundingSphereAt(r,rx).applyMatrix4(rp),t.union(rx)}}addInstance(t){if(this._instanceInfo.length>=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let e={visible:!0,active:!0,geometryIndex:t},i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(ru),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=e):(i=this._instanceInfo.length,this._instanceInfo.push(e));let r=this._matricesTexture;rp.identity().toArray(r.image.data,16*i),r.needsUpdate=!0;let s=this._colorsTexture;return s&&(rf.toArray(s.image.data,4*i),s.needsUpdate=!0),this._visibilityChanged=!0,i}addGeometry(t,e=-1,i=-1){let r;this._initializeGeometry(t),this._validateGeometry(t);let s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},n=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=-1===e?t.getAttribute("position").count:e;let a=t.getIndex();if(null!==a&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=-1===i?a.count:i),-1!==s.indexStart&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(ru),n[r=this._availableGeometryIds.shift()]=s):(r=this._geometryCount,this._geometryCount++,n.push(s)),this.setGeometryAt(r,t),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,r}setGeometryAt(t,e){if(t>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);let i=this.geometry,r=null!==i.getIndex(),s=i.getIndex(),n=e.getIndex(),a=this._geometryInfo[t];if(r&&n.count>a.reservedIndexCount||e.attributes.position.count>a.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let o=a.vertexStart,h=a.reservedVertexCount;for(let t in a.vertexCount=e.getAttribute("position").count,i.attributes){let r=e.getAttribute(t),s=i.getAttribute(t);!function(t,e,i=0){let r=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){let s=t.count;for(let n=0;n<s;n++)for(let s=0;s<r;s++)e.setComponent(n+i,s,t.getComponent(n,s))}else e.array.set(t.array,i*r);e.needsUpdate=!0}(r,s,o);let n=r.itemSize;for(let t=r.count;t<h;t++){let e=o+t;for(let t=0;t<n;t++)s.setComponent(e,t,0)}s.needsUpdate=!0,s.addUpdateRange(o*n,h*n)}if(r){let t=a.indexStart,i=a.reservedIndexCount;a.indexCount=e.getIndex().count;for(let e=0;e<n.count;e++)s.setX(t+e,o+n.getX(e));for(let e=n.count;e<i;e++)s.setX(t+e,o);s.needsUpdate=!0,s.addUpdateRange(t,a.reservedIndexCount)}return a.start=r?a.indexStart:a.vertexStart,a.count=r?a.indexCount:a.vertexCount,a.boundingBox=null,null!==e.boundingBox&&(a.boundingBox=e.boundingBox.clone()),a.boundingSphere=null,null!==e.boundingSphere&&(a.boundingSphere=e.boundingSphere.clone()),this._visibilityChanged=!0,t}deleteGeometry(t){let e=this._geometryInfo;if(t>=e.length||!1===e[t].active)return this;let i=this._instanceInfo;for(let e=0,r=i.length;e<r;e++)i[e].active&&i[e].geometryIndex===t&&this.deleteInstance(e);return e[t].active=!1,this._availableGeometryIds.push(t),this._visibilityChanged=!0,this}deleteInstance(t){return this.validateInstanceId(t),this._instanceInfo[t].active=!1,this._availableInstanceIds.push(t),this._visibilityChanged=!0,this}optimize(){let t=0,e=0,i=this._geometryInfo,r=i.map((t,e)=>e).sort((t,e)=>i[t].vertexStart-i[e].vertexStart),s=this.geometry;for(let n=0,a=i.length;n<a;n++){let a=i[r[n]];if(!1!==a.active){if(null!==s.index){if(a.indexStart!==e){let{indexStart:i,vertexStart:r,reservedIndexCount:n}=a,o=s.index,h=o.array,l=t-r;for(let t=i;t<i+n;t++)h[t]=h[t]+l;o.array.copyWithin(e,i,i+n),o.addUpdateRange(e,n),o.needsUpdate=!0,a.indexStart=e}e+=a.reservedIndexCount}if(a.vertexStart!==t){let{vertexStart:e,reservedVertexCount:i}=a,r=s.attributes;for(let s in r){let n=r[s],{array:a,itemSize:o}=n;a.copyWithin(t*o,e*o,(e+i)*o),n.addUpdateRange(t*o,i*o),n.needsUpdate=!0}a.vertexStart=t}t+=a.reservedVertexCount,a.start=s.index?a.indexStart:a.vertexStart}}return this._nextIndexStart=e,this._nextVertexStart=t,this._visibilityChanged=!0,this}getBoundingBoxAt(t,e){if(t>=this._geometryCount)return null;let i=this.geometry,r=this._geometryInfo[t];if(null===r.boundingBox){let t=new ed,e=i.index,s=i.attributes.position;for(let i=r.start,n=r.start+r.count;i<n;i++){let r=i;e&&(r=e.getX(r)),t.expandByPoint(rb.fromBufferAttribute(s,r))}r.boundingBox=t}return e.copy(r.boundingBox),e}getBoundingSphereAt(t,e){if(t>=this._geometryCount)return null;let i=this.geometry,r=this._geometryInfo[t];if(null===r.boundingSphere){let e=new eJ;this.getBoundingBoxAt(t,rg),rg.getCenter(e.center);let s=i.index,n=i.attributes.position,a=0;for(let t=r.start,i=r.start+r.count;t<i;t++){let i=t;s&&(i=s.getX(i)),rb.fromBufferAttribute(n,i),a=Math.max(a,e.center.distanceToSquared(rb))}e.radius=Math.sqrt(a),r.boundingSphere=e}return e.copy(r.boundingSphere),e}setMatrixAt(t,e){this.validateInstanceId(t);let i=this._matricesTexture,r=this._matricesTexture.image.data;return e.toArray(r,16*t),i.needsUpdate=!0,this}getMatrixAt(t,e){return this.validateInstanceId(t),e.fromArray(this._matricesTexture.image.data,16*t)}setColorAt(t,e){return this.validateInstanceId(t),null===this._colorsTexture&&this._initColorsTexture(),e.toArray(this._colorsTexture.image.data,4*t),this._colorsTexture.needsUpdate=!0,this}getColorAt(t,e){return(this.validateInstanceId(t),null!==this._colorsTexture)?e.fromArray(this._colorsTexture.image.data,4*t):e.isVector4?e.set(1,1,1,1):e.setRGB(1,1,1)}setVisibleAt(t,e){return this.validateInstanceId(t),this._instanceInfo[t].visible===e||(this._instanceInfo[t].visible=e,this._visibilityChanged=!0),this}getVisibleAt(t){return this.validateInstanceId(t),this._instanceInfo[t].visible}setGeometryIdAt(t,e){return this.validateInstanceId(t),this.validateGeometryId(e),this._instanceInfo[t].geometryIndex=e,this}getGeometryIdAt(t){return this.validateInstanceId(t),this._instanceInfo[t].geometryIndex}getGeometryRangeAt(t,e={}){this.validateGeometryId(t);let i=this._geometryInfo[t];return e.vertexStart=i.vertexStart,e.vertexCount=i.vertexCount,e.reservedVertexCount=i.reservedVertexCount,e.indexStart=i.indexStart,e.indexCount=i.indexCount,e.reservedIndexCount=i.reservedIndexCount,e.start=i.start,e.count=i.count,e}setInstanceCount(t){let e=this._availableInstanceIds,i=this._instanceInfo;for(e.sort(ru);e[e.length-1]===i.length-1;)i.pop(),e.pop();if(t<i.length)throw Error(`BatchedMesh: Instance ids outside the range ${t} are being used. Cannot shrink instance count.`);let r=new Int32Array(t),s=new Int32Array(t);rA(this._multiDrawCounts,r),rA(this._multiDrawStarts,s),this._multiDrawCounts=r,this._multiDrawStarts=s,this._maxInstanceCount=t;let n=this._indirectTexture,a=this._matricesTexture,o=this._colorsTexture;n.dispose(),this._initIndirectTexture(),rA(n.image.data,this._indirectTexture.image.data),a.dispose(),this._initMatricesTexture(),rA(a.image.data,this._matricesTexture.image.data),o&&(o.dispose(),this._initColorsTexture(),rA(o.image.data,this._colorsTexture.image.data))}setGeometrySize(t,e){let i=[...this._geometryInfo].filter(t=>t.active);if(Math.max(...i.map(t=>t.vertexStart+t.reservedVertexCount))>t)throw Error(`BatchedMesh: Geometry vertex values are being used outside the range ${e}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(t=>t.indexStart+t.reservedIndexCount))>e)throw Error(`BatchedMesh: Geometry index values are being used outside the range ${e}. Cannot shrink further.`);let r=this.geometry;r.dispose(),this._maxVertexCount=t,this._maxIndexCount=e,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new e1,this._initializeGeometry(r));let s=this.geometry;for(let t in r.index&&rA(r.index.array,s.index.array),r.attributes)rA(r.attributes[t].array,s.attributes[t].array)}raycast(t,e){let i=this._instanceInfo,r=this._geometryInfo,s=this.matrixWorld,n=this.geometry;rS.material=this.material,rS.geometry.index=n.index,rS.geometry.attributes=n.attributes,null===rS.geometry.boundingBox&&(rS.geometry.boundingBox=new ed),null===rS.geometry.boundingSphere&&(rS.geometry.boundingSphere=new eJ);for(let n=0,a=i.length;n<a;n++){if(!i[n].visible||!i[n].active)continue;let a=i[n].geometryIndex,o=r[a];rS.geometry.setDrawRange(o.start,o.count),this.getMatrixAt(n,rS.matrixWorld).premultiply(s),this.getBoundingBoxAt(a,rS.geometry.boundingBox),this.getBoundingSphereAt(a,rS.geometry.boundingSphere),rS.raycast(t,r_);for(let t=0,i=r_.length;t<i;t++){let i=r_[t];i.object=this,i.batchId=n,e.push(i)}r_.length=0}rS.material=null,rS.geometry.index=null,rS.geometry.attributes={},rS.geometry.setDrawRange(0,1/0)}copy(t){return super.copy(t),this.geometry=t.geometry.clone(),this.perObjectFrustumCulled=t.perObjectFrustumCulled,this.sortObjects=t.sortObjects,this.boundingBox=null!==t.boundingBox?t.boundingBox.clone():null,this.boundingSphere=null!==t.boundingSphere?t.boundingSphere.clone():null,this._geometryInfo=t._geometryInfo.map(t=>({...t,boundingBox:null!==t.boundingBox?t.boundingBox.clone():null,boundingSphere:null!==t.boundingSphere?t.boundingSphere.clone():null})),this._instanceInfo=t._instanceInfo.map(t=>({...t})),this._availableInstanceIds=t._availableInstanceIds.slice(),this._availableGeometryIds=t._availableGeometryIds.slice(),this._nextIndexStart=t._nextIndexStart,this._nextVertexStart=t._nextVertexStart,this._geometryCount=t._geometryCount,this._maxInstanceCount=t._maxInstanceCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._indirectTexture=t._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=t._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(t,e,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let n=r.getIndex(),a=null===n?1:n.array.BYTES_PER_ELEMENT,o=1;s.wireframe&&(o=2,a=r.attributes.position.count>65535?4:2);let h=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,c=this._geometryInfo,d=this.perObjectFrustumCulled,p=this._indirectTexture,f=p.image.data,m=i.isArrayCamera?ry:rm;d&&!i.isArrayCamera&&(rp.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),rm.setFromProjectionMatrix(rp,i.coordinateSystem,i.reversedDepth));let y=0;if(this.sortObjects){rp.copy(this.matrixWorld).invert(),rb.setFromMatrixPosition(i.matrixWorld).applyMatrix4(rp),rv.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(rp);for(let t=0,e=h.length;t<e;t++)if(h[t].visible&&h[t].active){let e=h[t].geometryIndex;this.getMatrixAt(t,rp),this.getBoundingSphereAt(e,rx).applyMatrix4(rp);let r=!1;if(d&&(r=!m.intersectsSphere(rx,i)),!r){let i=c[e],r=rw.subVectors(rx.center,rb).dot(rv);rM.push(i.start,i.count,r,t)}}let t=rM.list,e=this.customSort;null===e?t.sort(s.transparent?rd:rc):e.call(this,t,i);for(let e=0,i=t.length;e<i;e++){let i=t[e];l[y]=i.start*a*o,u[y]=i.count*o,f[y]=i.index,y++}rM.reset()}else for(let t=0,e=h.length;t<e;t++)if(h[t].visible&&h[t].active){let e=h[t].geometryIndex,r=!1;if(d&&(this.getMatrixAt(t,rp),this.getBoundingSphereAt(e,rx).applyMatrix4(rp),r=!m.intersectsSphere(rx,i)),!r){let i=c[e];l[y]=i.start*a*o,u[y]=i.count*o,f[y]=t,y++}}p.needsUpdate=!0,this._multiDrawCount=y,this._visibilityChanged=!1}onBeforeShadow(t,e,i,r,s,n){this.onBeforeRender(t,null,r,s,n)}}class rC extends e6{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new t3(0xffffff),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}let rE=new K,rI=new K,rR=new tM,rO=new i_,rz=new eJ,rB=new K,rk=new K;class rP extends t${constructor(t=new e1,e=new rC){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,i=[0];for(let t=1,r=e.count;t<r;t++)rE.fromBufferAttribute(e,t-1),rI.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=rE.distanceTo(rI);t.setAttribute("lineDistance",new eW(i,1))}else B("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){let i=this.geometry,r=this.matrixWorld,s=t.params.Line.threshold,n=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),rz.copy(i.boundingSphere),rz.applyMatrix4(r),rz.radius+=s,!1===t.ray.intersectsSphere(rz))return;rR.copy(r).invert(),rO.copy(t.ray).applyMatrix4(rR);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,h=this.isLineSegments?2:1,l=i.index,u=i.attributes.position;if(null!==l){let i=Math.max(0,n.start),r=Math.min(l.count,n.start+n.count);for(let s=i,n=r-1;s<n;s+=h){let i=rN(this,t,rO,o,l.getX(s),l.getX(s+1),s);i&&e.push(i)}if(this.isLineLoop){let s=rN(this,t,rO,o,l.getX(r-1),l.getX(i),r-1);s&&e.push(s)}}else{let i=Math.max(0,n.start),r=Math.min(u.count,n.start+n.count);for(let s=i,n=r-1;s<n;s+=h){let i=rN(this,t,rO,o,s,s+1,s);i&&e.push(i)}if(this.isLineLoop){let s=rN(this,t,rO,o,r-1,i,r-1);s&&e.push(s)}}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function rN(t,e,i,r,s,n,a){let o=t.geometry.attributes.position;if(rE.fromBufferAttribute(o,s),rI.fromBufferAttribute(o,n),i.distanceSqToSegment(rE,rI,rB,rk)>r)return;rB.applyMatrix4(t.matrixWorld);let h=e.ray.origin.distanceTo(rB);if(!(h<e.near)&&!(h>e.far))return{distance:h,point:rk.clone().applyMatrix4(t.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:t}}let rL=new K,rF=new K;class rj extends rP{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,i=[];for(let t=0,r=e.count;t<r;t+=2)rL.fromBufferAttribute(e,t),rF.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+rL.distanceTo(rF);t.setAttribute("lineDistance",new eW(i,1))}else B("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class rD extends rP{constructor(t,e){super(t,e),this.isLineLoop=!0,this.type="LineLoop"}}class rU extends e6{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new t3(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let rV=new tM,rW=new i_,rq=new eJ,rG=new K;class rH extends t${constructor(t=new e1,e=new rU){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){let i=this.geometry,r=this.matrixWorld,s=t.params.Points.threshold,n=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),rq.copy(i.boundingSphere),rq.applyMatrix4(r),rq.radius+=s,!1===t.ray.intersectsSphere(rq))return;rV.copy(r).invert(),rW.copy(t.ray).applyMatrix4(rV);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,h=i.index,l=i.attributes.position;if(null!==h){let i=Math.max(0,n.start),s=Math.min(h.count,n.start+n.count);for(let n=i;n<s;n++){let i=h.getX(n);rG.fromBufferAttribute(l,i),rJ(rG,i,o,r,t,e,this)}}else{let i=Math.max(0,n.start),s=Math.min(l.count,n.start+n.count);for(let n=i;n<s;n++)rG.fromBufferAttribute(l,n),rJ(rG,n,o,r,t,e,this)}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function rJ(t,e,i,r,s,n,a){let o=rW.distanceSqToPoint(t);if(o<i){let i=new K;rW.closestPointToPoint(t,i),i.applyMatrix4(r);let h=s.ray.origin.distanceTo(i);if(h<s.near||h>s.far)return;n.push({distance:h,distanceToRay:Math.sqrt(o),point:i,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class rX extends tf{constructor(t,e,i,r,s=1006,n=1006,a,o,h){super(t,e,i,r,s,n,a,o,h),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const l=this;"requestVideoFrameCallback"in t&&(this._requestVideoFrameCallbackId=t.requestVideoFrameCallback(function e(){l.needsUpdate=!0,l._requestVideoFrameCallbackId=t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class r$ extends rX{constructor(t,e,i,r,s,n,a,o){super({},t,e,i,r,s,n,a,o),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(t){this.image=t,this.needsUpdate=!0}}class rY extends tf{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}}class rZ extends tf{constructor(t,e,i,r,s,n,a,o,h,l,u,c){super(null,n,a,o,h,l,r,s,u,c),this.isCompressedTexture=!0,this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class rK extends rZ{constructor(t,e,i,r,s,n){super(t,e,i,s,n),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=1001,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class rQ extends rZ{constructor(t,e,i){super(void 0,t[0].width,t[0].height,e,i,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class r0 extends tf{constructor(t=[],e=301,i,r,s,n,a,o,h,l){super(t,e,i,r,s,n,a,o,h,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class r1 extends tf{constructor(t,e,i,r,s,n,a,o,h){super(t,e,i,r,s,n,a,o,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class r2 extends tf{constructor(t,e,i,r,s,n,a,o,h){super(t,e,i,r,s,n,a,o,h),this.isHTMLTexture=!0,this.generateMipmaps=!1,this.needsUpdate=!0;const l=t?t.parentNode:null;null!==l&&"requestPaint"in l&&(l.onpaint=()=>{this.needsUpdate=!0},l.requestPaint())}dispose(){let t=this.image?this.image.parentNode:null;null!==t&&"onpaint"in t&&(t.onpaint=null),super.dispose()}}class r3 extends tf{constructor(t,e,i=1014,r,s,n,a=1003,o=1003,h,l=1026,u=1){if(1026!==l&&1027!==l)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:t,height:e,depth:u},r,s,n,a,o,l,i,h),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new tu(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}class r5 extends r3{constructor(t,e=1014,i=301,r,s,n=1003,a=1003,o,h=1026){const l={width:t,height:t,depth:1};super(t,t,e,i,r,s,n,a,o,h),this.image=[l,l,l,l,l,l],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}}class r4 extends tf{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}}class r6 extends e1{constructor(t=1,e=1,i=1,r=1,s=1,n=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:s,depthSegments:n};const a=this;r=Math.floor(r),s=Math.floor(s);const o=[],h=[],l=[],u=[];let c=0,d=0;function p(t,e,i,r,s,n,p,f,m,y,g){let x=n/m,b=p/y,v=n/2,w=p/2,M=f/2,S=m+1,_=y+1,A=0,T=0,C=new K;for(let n=0;n<_;n++){let a=n*b-w;for(let o=0;o<S;o++){let c=o*x-v;C[t]=c*r,C[e]=a*s,C[i]=M,h.push(C.x,C.y,C.z),C[t]=0,C[e]=0,C[i]=f>0?1:-1,l.push(C.x,C.y,C.z),u.push(o/m),u.push(1-n/y),A+=1}}for(let t=0;t<y;t++)for(let e=0;e<m;e++){let i=c+e+S*t,r=c+e+S*(t+1),s=c+(e+1)+S*(t+1),n=c+(e+1)+S*t;o.push(i,r,n),o.push(r,s,n),T+=6}a.addGroup(d,T,g),d+=T,c+=A}p("z","y","x",-1,-1,i,e,t,n=Math.floor(n),s,0),p("z","y","x",1,-1,i,e,-t,n,s,1),p("x","z","y",1,1,t,i,e,r,n,2),p("x","z","y",1,-1,t,i,-e,r,n,3),p("x","y","z",1,-1,t,e,i,r,s,4),p("x","y","z",-1,-1,t,e,-i,r,s,5),this.setIndex(o),this.setAttribute("position",new eW(h,3)),this.setAttribute("normal",new eW(l,3)),this.setAttribute("uv",new eW(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r6(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}class r8 extends e1{constructor(t=1,e=1,i=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:t,height:e,capSegments:i,radialSegments:r,heightSegments:s},e=Math.max(0,e),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r));const n=[],a=[],o=[],h=[],l=e/2,u=Math.PI/2*t,c=e,d=2*u+c,p=2*i+(s=Math.max(1,Math.floor(s))),f=r+1,m=new K,y=new K;for(let g=0;g<=p;g++){let x=0,b=0,v=0,w=0;if(g<=i){const e=g/i,r=e*Math.PI/2;b=-l-t*Math.cos(r),v=t*Math.sin(r),w=-t*Math.cos(r),x=e*u}else if(g<=i+s){const r=(g-i)/s;b=-l+r*e,v=t,w=0,x=u+r*c}else{const e=(g-i-s)/i,r=e*Math.PI/2;b=l+t*Math.sin(r),v=t*Math.cos(r),w=t*Math.sin(r),x=u+c+e*u}const M=Math.max(0,Math.min(1,x/d));let S=0;0===g?S=.5/r:g===p&&(S=-.5/r);for(let t=0;t<=r;t++){const e=t/r,i=e*Math.PI*2,s=Math.sin(i),n=Math.cos(i);y.x=-v*n,y.y=b,y.z=v*s,a.push(y.x,y.y,y.z),m.set(-v*n,w,v*s),m.normalize(),o.push(m.x,m.y,m.z),h.push(e+S,M)}if(g>0){const t=(g-1)*f;for(let e=0;e<r;e++){const i=t+e,r=t+e+1,s=g*f+e,a=g*f+e+1;n.push(i,r,s),n.push(r,a,s)}}}this.setIndex(n),this.setAttribute("position",new eW(a,3)),this.setAttribute("normal",new eW(o,3)),this.setAttribute("uv",new eW(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r8(t.radius,t.height,t.capSegments,t.radialSegments,t.heightSegments)}}class r9 extends e1{constructor(t=1,e=32,i=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:r},e=Math.max(3,e);const s=[],n=[],a=[],o=[],h=new K,l=new Y;n.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let s=0,u=3;s<=e;s++,u+=3){const c=i+s/e*r;h.x=t*Math.cos(c),h.y=t*Math.sin(c),n.push(h.x,h.y,h.z),a.push(0,0,1),l.x=(n[u]/t+1)/2,l.y=(n[u+1]/t+1)/2,o.push(l.x,l.y)}for(let t=1;t<=e;t++)s.push(t,t+1,0);this.setIndex(s),this.setAttribute("position",new eW(n,3)),this.setAttribute("normal",new eW(a,3)),this.setAttribute("uv",new eW(o,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r9(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class r7 extends e1{constructor(t=1,e=1,i=1,r=32,s=1,n=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:r,heightSegments:s,openEnded:n,thetaStart:a,thetaLength:o};const h=this;r=Math.floor(r),s=Math.floor(s);const l=[],u=[],c=[],d=[];let p=0;const f=[],m=i/2;let y=0;function g(i){let s=p,n=new Y,f=new K,g=0,x=!0===i?t:e,b=!0===i?1:-1;for(let t=1;t<=r;t++)u.push(0,m*b,0),c.push(0,b,0),d.push(.5,.5),p++;let v=p;for(let t=0;t<=r;t++){let e=t/r*o+a,i=Math.cos(e),s=Math.sin(e);f.x=x*s,f.y=m*b,f.z=x*i,u.push(f.x,f.y,f.z),c.push(0,b,0),n.x=.5*i+.5,n.y=.5*s*b+.5,d.push(n.x,n.y),p++}for(let t=0;t<r;t++){let e=s+t,r=v+t;!0===i?l.push(r,r+1,e):l.push(r+1,r,e),g+=3}h.addGroup(y,g,!0===i?1:2),y+=g}(function(){let n=new K,g=new K,x=0,b=(e-t)/i;for(let h=0;h<=s;h++){let l=[],y=h/s,x=y*(e-t)+t;for(let t=0;t<=r;t++){let e=t/r,s=e*o+a,h=Math.sin(s),f=Math.cos(s);g.x=x*h,g.y=-y*i+m,g.z=x*f,u.push(g.x,g.y,g.z),n.set(h,b,f).normalize(),c.push(n.x,n.y,n.z),d.push(e,1-y),l.push(p++)}f.push(l)}for(let i=0;i<r;i++)for(let r=0;r<s;r++){let n=f[r][i],a=f[r+1][i],o=f[r+1][i+1],h=f[r][i+1];(t>0||0!==r)&&(l.push(n,a,h),x+=3),(e>0||r!==s-1)&&(l.push(a,o,h),x+=3)}h.addGroup(y,x,0),y+=x})(),!1===n&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new eW(u,3)),this.setAttribute("normal",new eW(c,3)),this.setAttribute("uv",new eW(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r7(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class st extends r7{constructor(t=1,e=1,i=32,r=1,s=!1,n=0,a=2*Math.PI){super(0,t,e,i,r,s,n,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:n,thetaLength:a}}static fromJSON(t){return new st(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class se extends e1{constructor(t=[],e=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:r};const s=[],n=[];function a(t){s.push(t.x,t.y,t.z)}function o(e,i){let r=3*e;i.x=t[r+0],i.y=t[r+1],i.z=t[r+2]}function h(t,e,i,r){r<0&&1===t.x&&(n[e]=t.x-1),0===i.x&&0===i.z&&(n[e]=r/2/Math.PI+.5)}function l(t){return Math.atan2(t.z,-t.x)}(function(t){let i=new K,r=new K,s=new K;for(let n=0;n<e.length;n+=3)o(e[n+0],i),o(e[n+1],r),o(e[n+2],s),function(t,e,i,r){let s=r+1,n=[];for(let r=0;r<=s;r++){n[r]=[];let a=t.clone().lerp(i,r/s),o=e.clone().lerp(i,r/s),h=s-r;for(let t=0;t<=h;t++)0===t&&r===s?n[r][t]=a:n[r][t]=a.clone().lerp(o,t/h)}for(let t=0;t<s;t++)for(let e=0;e<2*(s-t)-1;e++){let i=Math.floor(e/2);e%2==0?(a(n[t][i+1]),a(n[t+1][i]),a(n[t][i])):(a(n[t][i+1]),a(n[t+1][i+1]),a(n[t+1][i]))}}(i,r,s,t)})(r),function(t){let e=new K;for(let i=0;i<s.length;i+=3)e.x=s[i+0],e.y=s[i+1],e.z=s[i+2],e.normalize().multiplyScalar(t),s[i+0]=e.x,s[i+1]=e.y,s[i+2]=e.z}(i),function(){let t=new K;for(let i=0;i<s.length;i+=3){var e;t.x=s[i+0],t.y=s[i+1],t.z=s[i+2];let r=l(t)/2/Math.PI+.5,a=Math.atan2(-(e=t).y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5;n.push(r,1-a)}(function(){let t=new K,e=new K,i=new K,r=new K,a=new Y,o=new Y,u=new Y;for(let c=0,d=0;c<s.length;c+=9,d+=6){t.set(s[c+0],s[c+1],s[c+2]),e.set(s[c+3],s[c+4],s[c+5]),i.set(s[c+6],s[c+7],s[c+8]),a.set(n[d+0],n[d+1]),o.set(n[d+2],n[d+3]),u.set(n[d+4],n[d+5]),r.copy(t).add(e).add(i).divideScalar(3);let p=l(r);h(a,d+0,t,p),h(o,d+2,e,p),h(u,d+4,i,p)}})(),function(){for(let t=0;t<n.length;t+=6){let e=n[t+0],i=n[t+2],r=n[t+4],s=Math.max(e,i,r),a=Math.min(e,i,r);s>.9&&a<.1&&(e<.2&&(n[t+0]+=1),i<.2&&(n[t+2]+=1),r<.2&&(n[t+4]+=1))}}()}(),this.setAttribute("position",new eW(s,3)),this.setAttribute("normal",new eW(s.slice(),3)),this.setAttribute("uv",new eW(n,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new se(t.vertices,t.indices,t.radius,t.detail)}}class si extends se{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2,r=1/i;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,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,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],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new si(t.radius,t.detail)}}let sr=new K,ss=new K,sn=new K,sa=new ec;class so extends e1{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const i=Math.cos(U*e),r=t.getIndex(),s=t.getAttribute("position"),n=r?r.count:s.count,a=[0,0,0],o=["a","b","c"],h=[,,,],l={},u=[];for(let t=0;t<n;t+=3){r?(a[0]=r.getX(t),a[1]=r.getX(t+1),a[2]=r.getX(t+2)):(a[0]=t,a[1]=t+1,a[2]=t+2);const{a:e,b:n,c}=sa;if(e.fromBufferAttribute(s,a[0]),n.fromBufferAttribute(s,a[1]),c.fromBufferAttribute(s,a[2]),sa.getNormal(sn),h[0]=`${Math.round(1e4*e.x)},${Math.round(1e4*e.y)},${Math.round(1e4*e.z)}`,h[1]=`${Math.round(1e4*n.x)},${Math.round(1e4*n.y)},${Math.round(1e4*n.z)}`,h[2]=`${Math.round(1e4*c.x)},${Math.round(1e4*c.y)},${Math.round(1e4*c.z)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let t=0;t<3;t++){const e=(t+1)%3,r=h[t],s=h[e],n=sa[o[t]],c=sa[o[e]],d=`${r}_${s}`,p=`${s}_${r}`;p in l&&l[p]?(sn.dot(l[p].normal)<=i&&(u.push(n.x,n.y,n.z),u.push(c.x,c.y,c.z)),l[p]=null):d in l||(l[d]={index0:a[t],index1:a[e],normal:sn.clone()})}}for(const t in l)if(l[t]){const{index0:e,index1:i}=l[t];sr.fromBufferAttribute(s,e),ss.fromBufferAttribute(s,i),u.push(sr.x,sr.y,sr.z),u.push(ss.x,ss.y,ss.z)}this.setAttribute("position",new eW(u,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}class sh{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){B("Curve: .getPoint() not implemented.")}getPointAt(t,e){let i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],i,r=this.getPoint(0),s=0;e.push(0);for(let n=1;n<=t;n++)e.push(s+=(i=this.getPoint(n/t)).distanceTo(r)),r=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e=null){let i,r=this.getLengths(),s=0,n=r.length;i=e||t*r[n-1];let a=0,o=n-1,h;for(;a<=o;)if((h=r[s=Math.floor(a+(o-a)/2)]-i)<0)a=s+1;else if(h>0)o=s-1;else{o=s;break}if(r[s=o]===i)return s/(n-1);let l=r[s],u=r[s+1];return(s+(i-l)/(u-l))/(n-1)}getTangent(t,e){let i=t-1e-4,r=t+1e-4;i<0&&(i=0),r>1&&(r=1);let s=this.getPoint(i),n=this.getPoint(r),a=e||(s.isVector2?new Y:new K);return a.copy(n).sub(s).normalize(),a}getTangentAt(t,e){let i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e=!1){let i=new K,r=[],s=[],n=[],a=new K,o=new tM;for(let e=0;e<=t;e++){let i=e/t;r[e]=this.getTangentAt(i,new K)}s[0]=new K,n[0]=new K;let h=Number.MAX_VALUE,l=Math.abs(r[0].x),u=Math.abs(r[0].y),c=Math.abs(r[0].z);l<=h&&(h=l,i.set(1,0,0)),u<=h&&(h=u,i.set(0,1,0)),c<=h&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),n[0].crossVectors(r[0],s[0]);for(let e=1;e<=t;e++){if(s[e]=s[e-1].clone(),n[e]=n[e-1].clone(),a.crossVectors(r[e-1],r[e]),a.length()>Number.EPSILON){a.normalize();let t=Math.acos(q(r[e-1].dot(r[e]),-1,1));s[e].applyMatrix4(o.makeRotationAxis(a,t))}n[e].crossVectors(r[e],s[e])}if(!0===e){let e=Math.acos(q(s[0].dot(s[t]),-1,1));e/=t,r[0].dot(a.crossVectors(s[0],s[t]))>0&&(e=-e);for(let i=1;i<=t;i++)s[i].applyMatrix4(o.makeRotationAxis(r[i],e*i)),n[i].crossVectors(r[i],s[i])}return{tangents:r,normals:s,binormals:n}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class sl extends sh{constructor(t=0,e=0,i=1,r=1,s=0,n=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=n,this.aClockwise=a,this.aRotation=o}getPoint(t,e=new Y){let i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,s=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=s?0:i),!0!==this.aClockwise||s||(r===i?r=-i:r-=i);let n=this.aStartAngle+t*r,a=this.aX+this.xRadius*Math.cos(n),o=this.aY+this.yRadius*Math.sin(n);if(0!==this.aRotation){let t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=a-this.aX,r=o-this.aY;a=i*t-r*e+this.aX,o=i*e+r*t+this.aY}return e.set(a,o)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class su extends sl{constructor(t,e,i,r,s,n){super(t,e,i,i,r,s,n),this.isArcCurve=!0,this.type="ArcCurve"}}function sc(){let t=0,e=0,i=0,r=0;function s(s,n,a,o){t=s,e=a,i=-3*s+3*n-2*a-o,r=2*s-2*n+a+o}return{initCatmullRom:function(t,e,i,r,n){s(e,i,n*(i-t),n*(r-e))},initNonuniformCatmullRom:function(t,e,i,r,n,a,o){let h=(e-t)/n-(i-t)/(n+a)+(i-e)/a,l=(i-e)/a-(r-e)/(a+o)+(r-i)/o;s(e,i,h*=a,l*=a)},calc:function(s){let n=s*s;return t+e*s+i*n+n*s*r}}}let sd=new K,sp=new K,sf=new sc,sm=new sc,sy=new sc;class sg extends sh{constructor(t=[],e=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=r}getPoint(t,e=new K){let i,r,s=this.points,n=s.length,a=(n-!this.closed)*t,o=Math.floor(a),h=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/n)+1)*n:0===h&&o===n-1&&(o=n-2,h=1),this.closed||o>0?i=s[(o-1)%n]:(sp.subVectors(s[0],s[1]).add(s[0]),i=sp);let l=s[o%n],u=s[(o+1)%n];if(this.closed||o+2<n?r=s[(o+2)%n]:(sd.subVectors(s[n-1],s[n-2]).add(s[n-1]),r=sd),"centripetal"===this.curveType||"chordal"===this.curveType){let t="chordal"===this.curveType?.5:.25,e=Math.pow(i.distanceToSquared(l),t),s=Math.pow(l.distanceToSquared(u),t),n=Math.pow(u.distanceToSquared(r),t);s<1e-4&&(s=1),e<1e-4&&(e=s),n<1e-4&&(n=s),sf.initNonuniformCatmullRom(i.x,l.x,u.x,r.x,e,s,n),sm.initNonuniformCatmullRom(i.y,l.y,u.y,r.y,e,s,n),sy.initNonuniformCatmullRom(i.z,l.z,u.z,r.z,e,s,n)}else"catmullrom"===this.curveType&&(sf.initCatmullRom(i.x,l.x,u.x,r.x,this.tension),sm.initCatmullRom(i.y,l.y,u.y,r.y,this.tension),sy.initCatmullRom(i.z,l.z,u.z,r.z,this.tension));return e.set(sf.calc(h),sm.calc(h),sy.calc(h)),e}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(new K().fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function sx(t,e,i,r,s){let n=(r-e)*.5,a=(s-i)*.5,o=t*t;return t*o*(2*i-2*r+n+a)+(-3*i+3*r-2*n-a)*o+n*t+i}function sb(t,e,i,r){let s;return(s=1-t)*s*e+2*(1-t)*t*i+t*t*r}function sv(t,e,i,r,s){let n,a;return(n=1-t)*n*n*e+3*(a=1-t)*a*t*i+3*(1-t)*t*t*r+t*t*t*s}class sw extends sh{constructor(t=new Y,e=new Y,i=new Y,r=new Y){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new Y){let i=this.v0,r=this.v1,s=this.v2,n=this.v3;return e.set(sv(t,i.x,r.x,s.x,n.x),sv(t,i.y,r.y,s.y,n.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class sM extends sh{constructor(t=new K,e=new K,i=new K,r=new K){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new K){let i=this.v0,r=this.v1,s=this.v2,n=this.v3;return e.set(sv(t,i.x,r.x,s.x,n.x),sv(t,i.y,r.y,s.y,n.y),sv(t,i.z,r.z,s.z,n.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class sS extends sh{constructor(t=new Y,e=new Y){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Y){return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Y){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class s_ extends sh{constructor(t=new K,e=new K){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new K){return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new K){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class sA extends sh{constructor(t=new Y,e=new Y,i=new Y){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new Y){let i=this.v0,r=this.v1,s=this.v2;return e.set(sb(t,i.x,r.x,s.x),sb(t,i.y,r.y,s.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class sT extends sh{constructor(t=new K,e=new K,i=new K){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new K){let i=this.v0,r=this.v1,s=this.v2;return e.set(sb(t,i.x,r.x,s.x),sb(t,i.y,r.y,s.y),sb(t,i.z,r.z,s.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class sC extends sh{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Y){let i=this.points,r=(i.length-1)*t,s=Math.floor(r),n=r-s,a=i[0===s?s:s-1],o=i[s],h=i[s>i.length-2?i.length-1:s+1],l=i[s>i.length-3?i.length-1:s+2];return e.set(sx(n,a.x,o.x,h.x,l.x),sx(n,a.y,o.y,h.y,l.y)),e}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(i.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(new Y().fromArray(i))}return this}}var sE=Object.freeze({__proto__:null,ArcCurve:su,CatmullRomCurve3:sg,CubicBezierCurve:sw,CubicBezierCurve3:sM,EllipseCurve:sl,LineCurve:sS,LineCurve3:s_,QuadraticBezierCurve:sA,QuadraticBezierCurve3:sT,SplineCurve:sC});class sI extends sh{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){let i=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new sE[i](e,t))}return this}getPoint(t,e){let i=t*this.getLength(),r=this.getCurveLengths(),s=0;for(;s<r.length;){if(r[s]>=i){let t=r[s]-i,n=this.curves[s],a=n.getLength(),o=0===a?0:1-t/a;return n.getPointAt(o,e)}s++}return null}getLength(){let t=this.getCurveLengths();return t[t.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 t=[],e=0;for(let i=0,r=this.curves.length;i<r;i++)t.push(e+=this.curves[i].getLength());return this.cacheLengths=t,t}getSpacedPoints(t=40){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){let e,i=[];for(let r=0,s=this.curves;r<s.length;r++){let n=s[r],a=n.isEllipseCurve?2*t:n.isLineCurve||n.isLineCurve3?1:n.isSplineCurve?t*n.points.length:t,o=n.getPoints(a);for(let t=0;t<o.length;t++){let r=o[t];e&&e.equals(r)||(i.push(r),e=r)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){let i=this.curves[e];t.curves.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let i=t.curves[e];this.curves.push(new sE[i.type]().fromJSON(i))}return this}}class sR extends sI{constructor(t){super(),this.type="Path",this.currentPoint=new Y,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){let i=new sS(this.currentPoint.clone(),new Y(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,r){let s=new sA(this.currentPoint.clone(),new Y(t,e),new Y(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(t,e,i,r,s,n){let a=new sw(this.currentPoint.clone(),new Y(t,e),new Y(i,r),new Y(s,n));return this.curves.push(a),this.currentPoint.set(s,n),this}splineThru(t){let e=new sC([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,r,s,n){let a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(t+a,e+o,i,r,s,n),this}absarc(t,e,i,r,s,n){return this.absellipse(t,e,i,i,r,s,n),this}ellipse(t,e,i,r,s,n,a,o){let h=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+h,e+l,i,r,s,n,a,o),this}absellipse(t,e,i,r,s,n,a,o){let h=new sl(t,e,i,r,s,n,a,o);if(this.curves.length>0){let t=h.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(h);let l=h.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class sO extends sR{constructor(t){super(t),this.uuid=W(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let i=0,r=this.holes.length;i<r;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let i=t.holes[e];this.holes.push(i.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){let i=this.holes[e];t.holes.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let i=t.holes[e];this.holes.push(new sR().fromJSON(i))}return this}}function sz(t,e,i,r,s){let n;if(s===function(t,e,i,r){let s=0;for(let n=e,a=i-r;n<i;n+=r)s+=(t[a]-t[n])*(t[n+1]+t[a+1]),a=n;return s}(t,e,i,r)>0)for(let s=e;s<i;s+=r)n=sG(s/r|0,t[s],t[s+1],n);else for(let s=i-r;s>=e;s-=r)n=sG(s/r|0,t[s],t[s+1],n);return n&&sj(n,n.next)&&(sH(n),n=n.next),n}function sB(t,e){if(!t)return t;e||(e=t);let i=t,r;do if(r=!1,!i.steiner&&(sj(i,i.next)||0===sF(i.prev,i,i.next))){if(sH(i),(i=e=i.prev)===i.next)break;r=!0}else i=i.next;while(r||i!==e)return e}function sk(t,e){let i=t.x-e.x;return 0===i&&0==(i=t.y-e.y)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function sP(t,e,i,r,s){return(t=((t=((t=((t=((t=(t-i)*s|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)|(e=((e=((e=((e=((e=(e-r)*s|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)<<1}function sN(t,e,i,r,s,n,a,o){return(s-a)*(e-o)>=(t-a)*(n-o)&&(t-a)*(r-o)>=(i-a)*(e-o)&&(i-a)*(n-o)>=(s-a)*(r-o)}function sL(t,e,i,r,s,n,a,o){return(t!==a||e!==o)&&sN(t,e,i,r,s,n,a,o)}function sF(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function sj(t,e){return t.x===e.x&&t.y===e.y}function sD(t,e,i,r){let s=sV(sF(t,e,i)),n=sV(sF(t,e,r)),a=sV(sF(i,r,t)),o=sV(sF(i,r,e));return!!(s!==n&&a!==o||0===s&&sU(t,i,e)||0===n&&sU(t,r,e)||0===a&&sU(i,t,r)||0===o&&sU(i,e,r))}function sU(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function sV(t){return t>0?1:t<0?-1:0}function sW(t,e){return 0>sF(t.prev,t,t.next)?sF(t,e,t.next)>=0&&sF(t,t.prev,e)>=0:0>sF(t,e,t.prev)||0>sF(t,t.next,e)}function sq(t,e){let i=sJ(t.i,t.x,t.y),r=sJ(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,r.next=i,i.prev=r,n.next=r,r.prev=n,r}function sG(t,e,i,r){let s=sJ(t,e,i);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function sH(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function sJ(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class sX{static triangulate(t,e,i=2){return function(t,e,i=2){let r,s,n,a=e&&e.length,o=a?e[0]*i:t.length,h=sz(t,0,o,i,!0),l=[];if(!h||h.next===h.prev)return l;if(a&&(h=function(t,e,i,r){let s=[];for(let i=0,n=e.length;i<n;i++){let a=e[i]*r,o=i<n-1?e[i+1]*r:t.length,h=sz(t,a,o,r,!1);h===h.next&&(h.steiner=!0),s.push(function(t){let e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t)return i}(h))}s.sort(sk);for(let t=0;t<s.length;t++)i=function(t,e){let i=function(t,e){let i,r=e,s=t.x,n=t.y,a=-1/0;if(sj(t,r))return r;do{if(sj(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let t=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=s&&t>a&&(a=t,i=r.x<r.next.x?r:r.next,t===s))return i}r=r.next}while(r!==e)if(!i)return null;let o=i,h=i.x,l=i.y,u=1/0;r=i;do{if(s>=r.x&&r.x>=h&&s!==r.x&&sN(n<l?s:a,n,h,l,n<l?a:s,n,r.x,r.y)){var c,d;let e=Math.abs(n-r.y)/(s-r.x);sW(r,t)&&(e<u||e===u&&(r.x>i.x||r.x===i.x&&(c=i,d=r,0>sF(c.prev,c,d.prev)&&0>sF(d.next,c,c.next))))&&(i=r,u=e)}r=r.next}while(r!==o)return i}(t,e);if(!i)return e;let r=sq(i,t);return sB(r,r.next),sB(i,i.next)}(s[t],i);return i}(t,e,h,i)),t.length>80*i){r=t[0],s=t[1];let e=r,a=s;for(let n=i;n<o;n+=i){let i=t[n],o=t[n+1];i<r&&(r=i),o<s&&(s=o),i>e&&(e=i),o>a&&(a=o)}n=0!==(n=Math.max(e-r,a-s))?32767/n:0}return function t(e,i,r,s,n,a,o){if(!e)return;!o&&a&&function(t,e,i,r){let s=t;do 0===s.z&&(s.z=sP(s.x,s.y,e,i,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==t)s.prevZ.nextZ=null,s.prevZ=null,function(t){let e,i=1;do{let r,s=t;t=null;let n=null;for(e=0;s;){e++;let a=s,o=0;for(let t=0;t<i&&(o++,a=a.nextZ);t++);let h=i;for(;o>0||h>0&&a;)0!==o&&(0===h||!a||s.z<=a.z)?(r=s,s=s.nextZ,o--):(r=a,a=a.nextZ,h--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;s=a}n.nextZ=null,i*=2}while(e>1)}(s)}(e,s,n,a);let h=e;for(;e.prev!==e.next;){let l=e.prev,u=e.next;if(a?function(t,e,i,r){let s=t.prev,n=t.next;if(sF(s,t,n)>=0)return!1;let a=s.x,o=t.x,h=n.x,l=s.y,u=t.y,c=n.y,d=Math.min(a,o,h),p=Math.min(l,u,c),f=Math.max(a,o,h),m=Math.max(l,u,c),y=sP(d,p,e,i,r),g=sP(f,m,e,i,r),x=t.prevZ,b=t.nextZ;for(;x&&x.z>=y&&b&&b.z<=g;){if(x.x>=d&&x.x<=f&&x.y>=p&&x.y<=m&&x!==s&&x!==n&&sL(a,l,o,u,h,c,x.x,x.y)&&sF(x.prev,x,x.next)>=0||(x=x.prevZ,b.x>=d&&b.x<=f&&b.y>=p&&b.y<=m&&b!==s&&b!==n&&sL(a,l,o,u,h,c,b.x,b.y)&&sF(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;x&&x.z>=y;){if(x.x>=d&&x.x<=f&&x.y>=p&&x.y<=m&&x!==s&&x!==n&&sL(a,l,o,u,h,c,x.x,x.y)&&sF(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=g;){if(b.x>=d&&b.x<=f&&b.y>=p&&b.y<=m&&b!==s&&b!==n&&sL(a,l,o,u,h,c,b.x,b.y)&&sF(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}(e,s,n,a):function(t){let e=t.prev,i=t.next;if(sF(e,t,i)>=0)return!1;let r=e.x,s=t.x,n=i.x,a=e.y,o=t.y,h=i.y,l=Math.min(r,s,n),u=Math.min(a,o,h),c=Math.max(r,s,n),d=Math.max(a,o,h),p=i.next;for(;p!==e;){if(p.x>=l&&p.x<=c&&p.y>=u&&p.y<=d&&sL(r,a,s,o,n,h,p.x,p.y)&&sF(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(e)){i.push(l.i,e.i,u.i),sH(e),e=u.next,h=u.next;continue}if((e=u)===h){o?1===o?t(e=function(t,e){let i=t;do{let r=i.prev,s=i.next.next;!sj(r,s)&&sD(r,i,i.next,s)&&sW(r,s)&&sW(s,r)&&(e.push(r.i,i.i,s.i),sH(i),sH(i.next),i=t=s),i=i.next}while(i!==t)return sB(i)}(sB(e),i),i,r,s,n,a,2):2===o&&function(e,i,r,s,n,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){var h,l;if(o.i!==e.i&&(h=o,l=e,h.next.i!==l.i&&h.prev.i!==l.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&sD(i,i.next,t,e))return!0;i=i.next}while(i!==t)return!1}(h,l)&&(sW(h,l)&&sW(l,h)&&function(t,e){let i=t,r=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do i.y>n!=i.next.y>n&&i.next.y!==i.y&&s<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==t)return r}(h,l)&&(sF(h.prev,h,l.prev)||sF(h,l.prev,l))||sj(h,l)&&sF(h.prev,h,h.next)>0&&sF(l.prev,l,l.next)>0))){let h=sq(o,e);o=sB(o,o.next),h=sB(h,h.next),t(o,i,r,s,n,a,0),t(h,i,r,s,n,a,0);return}e=e.next}o=o.next}while(o!==e)}(e,i,r,s,n,a):t(sB(e),i,r,s,n,a,1);break}}}(h,l,i,r,s,n,0),l}(t,e,i)}}class s${static area(t){let e=t.length,i=0;for(let r=e-1,s=0;s<e;r=s++)i+=t[r].x*t[s].y-t[s].x*t[r].y;return .5*i}static isClockWise(t){return 0>s$.area(t)}static triangulateShape(t,e){let i=[],r=[],s=[];sY(t),sZ(i,t);let n=t.length;e.forEach(sY);for(let t=0;t<e.length;t++)r.push(n),n+=e[t].length,sZ(i,e[t]);let a=sX.triangulate(i,r);for(let t=0;t<a.length;t+=3)s.push(a.slice(t,t+3));return s}}function sY(t){let e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function sZ(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}class sK extends e1{constructor(t=new sO([new Y(.5,.5),new Y(-.5,.5),new Y(-.5,-.5),new Y(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const i=this,r=[],s=[];for(let n=0,a=t.length;n<a;n++)!function(t){let n,a,o,h,l,u=[],c=void 0!==e.curveSegments?e.curveSegments:12,d=void 0!==e.steps?e.steps:1,p=void 0!==e.depth?e.depth:1,f=void 0===e.bevelEnabled||e.bevelEnabled,m=void 0!==e.bevelThickness?e.bevelThickness:.2,y=void 0!==e.bevelSize?e.bevelSize:m-.1,g=void 0!==e.bevelOffset?e.bevelOffset:0,x=void 0!==e.bevelSegments?e.bevelSegments:3,b=e.extrudePath,v=void 0!==e.UVGenerator?e.UVGenerator:sQ,w,M=!1;if(b){w=b.getSpacedPoints(d),M=!0,f=!1;let t=!!b.isCatmullRomCurve3&&b.closed;n=b.computeFrenetFrames(d,t),a=new K,o=new K,h=new K}f||(x=0,m=0,y=0,g=0);let S=t.extractPoints(c),_=S.shape,A=S.holes;if(!s$.isClockWise(_)){_=_.reverse();for(let t=0,e=A.length;t<e;t++){let e=A[t];s$.isClockWise(e)&&(A[t]=e.reverse())}}function T(t){let e=1e-10*1e-10,i=t[0];for(let r=1;r<=t.length;r++){let s=r%t.length,n=t[s],a=n.x-i.x,o=n.y-i.y,h=a*a+o*o,l=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(i.x),Math.abs(i.y));if(h<=e*l*l){t.splice(s,1),r--;continue}i=n}}T(_),A.forEach(T);let C=A.length,E=_;for(let t=0;t<C;t++){let e=A[t];_=_.concat(e)}function I(t,e,i){return e||k("ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,i)}let R=_.length;function O(t,e,i){let r,s,n,a=t.x-e.x,o=t.y-e.y,h=i.x-t.x,l=i.y-t.y,u=a*a+o*o;if(Math.abs(a*l-o*h)>Number.EPSILON){let c=Math.sqrt(u),d=Math.sqrt(h*h+l*l),p=e.x-o/c,f=e.y+a/c,m=((i.x-l/d-p)*l-(i.y+h/d-f)*h)/(a*l-o*h),y=(r=p+a*m-t.x)*r+(s=f+o*m-t.y)*s;if(y<=2)return new Y(r,s);n=Math.sqrt(y/2)}else{let t=!1;a>Number.EPSILON?h>Number.EPSILON&&(t=!0):a<-Number.EPSILON?h<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(l)&&(t=!0),t?(r=-o,s=a,n=Math.sqrt(u)):(r=a,s=o,n=Math.sqrt(u/2))}return new Y(r/n,s/n)}let z=[];for(let t=0,e=E.length,i=e-1,r=t+1;t<e;t++,i++,r++)i===e&&(i=0),r===e&&(r=0),z[t]=O(E[t],E[i],E[r]);let B=[],P,N=z.concat();for(let t=0;t<C;t++){let e=A[t];P=[];for(let t=0,i=e.length,r=i-1,s=t+1;t<i;t++,r++,s++)r===i&&(r=0),s===i&&(s=0),P[t]=O(e[t],e[r],e[s]);B.push(P),N=N.concat(P)}if(0===x)l=s$.triangulateShape(E,A);else{let t=[],e=[];for(let i=0;i<x;i++){let r=i/x,s=m*Math.cos(r*Math.PI/2),n=y*Math.sin(r*Math.PI/2)+g;for(let e=0,i=E.length;e<i;e++){let i=I(E[e],z[e],n);D(i.x,i.y,-s),0===r&&t.push(i)}for(let t=0;t<C;t++){let i=A[t];P=B[t];let a=[];for(let t=0,e=i.length;t<e;t++){let e=I(i[t],P[t],n);D(e.x,e.y,-s),0===r&&a.push(e)}0===r&&e.push(a)}}l=s$.triangulateShape(t,e)}let L=l.length,F=y+g;for(let t=0;t<R;t++){let e=f?I(_[t],N[t],F):_[t];M?(o.copy(n.normals[0]).multiplyScalar(e.x),a.copy(n.binormals[0]).multiplyScalar(e.y),h.copy(w[0]).add(o).add(a),D(h.x,h.y,h.z)):D(e.x,e.y,0)}for(let t=1;t<=d;t++)for(let e=0;e<R;e++){let i=f?I(_[e],N[e],F):_[e];M?(o.copy(n.normals[t]).multiplyScalar(i.x),a.copy(n.binormals[t]).multiplyScalar(i.y),h.copy(w[t]).add(o).add(a),D(h.x,h.y,h.z)):D(i.x,i.y,p/d*t)}for(let t=x-1;t>=0;t--){let e=t/x,i=m*Math.cos(e*Math.PI/2),r=y*Math.sin(e*Math.PI/2)+g;for(let t=0,e=E.length;t<e;t++){let e=I(E[t],z[t],r);D(e.x,e.y,p+i)}for(let t=0,e=A.length;t<e;t++){let e=A[t];P=B[t];for(let t=0,s=e.length;t<s;t++){let s=I(e[t],P[t],r);M?D(s.x,s.y+w[d-1].y,w[d-1].x+i):D(s.x,s.y,p+i)}}}function j(t,e){let s=t.length;for(;--s>=0;){let n=s,a=s-1;a<0&&(a=t.length-1);for(let t=0,s=d+2*x;t<s;t++){let s=R*t,o=R*(t+1);!function(t,e,s,n){V(t),V(e),V(n),V(e),V(s),V(n);let a=r.length/3,o=v.generateSideWallUV(i,r,a-6,a-3,a-2,a-1);W(o[0]),W(o[1]),W(o[3]),W(o[1]),W(o[2]),W(o[3])}(e+n+s,e+a+s,e+a+o,e+n+o)}}}function D(t,e,i){u.push(t),u.push(e),u.push(i)}function U(t,e,s){V(t),V(e),V(s);let n=r.length/3,a=v.generateTopUV(i,r,n-3,n-2,n-1);W(a[0]),W(a[1]),W(a[2])}function V(t){r.push(u[3*t+0]),r.push(u[3*t+1]),r.push(u[3*t+2])}function W(t){s.push(t.x),s.push(t.y)}(function(){let t=r.length/3;if(f){let t=0*R;for(let e=0;e<L;e++){let i=l[e];U(i[2]+t,i[1]+t,i[0]+t)}t=R*(d+2*x);for(let e=0;e<L;e++){let i=l[e];U(i[0]+t,i[1]+t,i[2]+t)}}else{for(let t=0;t<L;t++){let e=l[t];U(e[2],e[1],e[0])}for(let t=0;t<L;t++){let e=l[t];U(e[0]+R*d,e[1]+R*d,e[2]+R*d)}}i.addGroup(t,r.length/3-t,0)})(),function(){let t=r.length/3,e=0;j(E,0),e+=E.length;for(let t=0,i=A.length;t<i;t++){let i=A[t];j(i,e),e+=i.length}i.addGroup(t,r.length/3-t,1)}()}(t[n]);this.setAttribute("position",new eW(r,3)),this.setAttribute("uv",new eW(s,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return function(t,e,i){if(i.shapes=[],Array.isArray(t))for(let e=0,r=t.length;e<r;e++){let r=t[e];i.shapes.push(r.uuid)}else i.shapes.push(t.uuid);return i.options=Object.assign({},e),void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){let i=[];for(let r=0,s=t.shapes.length;r<s;r++){let s=e[t.shapes[r]];i.push(s)}let r=t.options.extrudePath;return void 0!==r&&(t.options.extrudePath=new sE[r.type]().fromJSON(r)),new sK(i,t.options)}}let sQ={generateTopUV:function(t,e,i,r,s){let n=e[3*i],a=e[3*i+1],o=e[3*r],h=e[3*r+1],l=e[3*s],u=e[3*s+1];return[new Y(n,a),new Y(o,h),new Y(l,u)]},generateSideWallUV:function(t,e,i,r,s,n){let a=e[3*i],o=e[3*i+1],h=e[3*i+2],l=e[3*r],u=e[3*r+1],c=e[3*r+2],d=e[3*s],p=e[3*s+1],f=e[3*s+2],m=e[3*n],y=e[3*n+1],g=e[3*n+2];return Math.abs(o-u)<Math.abs(a-l)?[new Y(a,1-h),new Y(l,1-c),new Y(d,1-f),new Y(m,1-g)]:[new Y(o,1-h),new Y(u,1-c),new Y(p,1-f),new Y(y,1-g)]}};class s0 extends se{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new s0(t.radius,t.detail)}}class s1 extends e1{constructor(t=[new Y(0,-.5),new Y(.5,0),new Y(0,.5)],e=12,i=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:r},e=Math.floor(e),r=q(r,0,2*Math.PI);const s=[],n=[],a=[],o=[],h=[],l=1/e,u=new K,c=new Y,d=new K,p=new K,f=new K;let m=0,y=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,d.x=+(y=t[e+1].y-t[e].y),d.y=-m,d.z=0*y,f.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case t.length-1:o.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,d.x=+(y=t[e+1].y-t[e].y),d.y=-m,d.z=0*y,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),o.push(d.x,d.y,d.z),f.copy(p)}for(let s=0;s<=e;s++){const d=i+s*l*r,p=Math.sin(d),f=Math.cos(d);for(let i=0;i<=t.length-1;i++){u.x=t[i].x*p,u.y=t[i].y,u.z=t[i].x*f,n.push(u.x,u.y,u.z),c.x=s/e,c.y=i/(t.length-1),a.push(c.x,c.y);const r=o[3*i+0]*p,l=o[3*i+1],d=o[3*i+0]*f;h.push(r,l,d)}}for(let i=0;i<e;i++)for(let e=0;e<t.length-1;e++){const r=e+i*t.length,n=r+t.length,a=r+t.length+1,o=r+1;s.push(r,n,o),s.push(a,o,n)}this.setIndex(s),this.setAttribute("position",new eW(n,3)),this.setAttribute("uv",new eW(a,2)),this.setAttribute("normal",new eW(h,3))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new s1(t.points,t.segments,t.phiStart,t.phiLength)}}class s2 extends se{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new s2(t.radius,t.detail)}}class s3 extends e1{constructor(t=1,e=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:r};const s=t/2,n=e/2,a=Math.floor(i),o=Math.floor(r),h=a+1,l=o+1,u=t/a,c=e/o,d=[],p=[],f=[],m=[];for(let t=0;t<l;t++){const e=t*c-n;for(let i=0;i<h;i++){const r=i*u-s;p.push(r,-e,0),f.push(0,0,1),m.push(i/a),m.push(1-t/o)}}for(let t=0;t<o;t++)for(let e=0;e<a;e++){const i=e+h*t,r=e+h*(t+1),s=e+1+h*(t+1),n=e+1+h*t;d.push(i,r,n),d.push(r,s,n)}this.setIndex(d),this.setAttribute("position",new eW(p,3)),this.setAttribute("normal",new eW(f,3)),this.setAttribute("uv",new eW(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new s3(t.width,t.height,t.widthSegments,t.heightSegments)}}class s5 extends e1{constructor(t=.5,e=1,i=32,r=1,s=0,n=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:n},i=Math.max(3,i);const a=[],o=[],h=[],l=[];let u=t;const c=(e-t)/(r=Math.max(1,r)),d=new K,p=new Y;for(let t=0;t<=r;t++){for(let t=0;t<=i;t++){const r=s+t/i*n;d.x=u*Math.cos(r),d.y=u*Math.sin(r),o.push(d.x,d.y,d.z),h.push(0,0,1),p.x=(d.x/e+1)/2,p.y=(d.y/e+1)/2,l.push(p.x,p.y)}u+=c}for(let t=0;t<r;t++){const e=t*(i+1);for(let t=0;t<i;t++){const r=t+e,s=r+i+1,n=r+i+2,o=r+1;a.push(r,s,o),a.push(s,n,o)}}this.setIndex(a),this.setAttribute("position",new eW(o,3)),this.setAttribute("normal",new eW(h,3)),this.setAttribute("uv",new eW(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new s5(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class s4 extends e1{constructor(t=new sO([new Y(0,.5),new Y(-.5,-.5),new Y(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const i=[],r=[],s=[],n=[];let a=0,o=0;if(!1===Array.isArray(t))h(t);else for(let e=0;e<t.length;e++)h(t[e]),this.addGroup(a,o,e),a+=o,o=0;function h(t){let a=r.length/3,h=t.extractPoints(e),l=h.shape,u=h.holes;!1===s$.isClockWise(l)&&(l=l.reverse());for(let t=0,e=u.length;t<e;t++){let e=u[t];!0===s$.isClockWise(e)&&(u[t]=e.reverse())}let c=s$.triangulateShape(l,u);for(let t=0,e=u.length;t<e;t++){let e=u[t];l=l.concat(e)}for(let t=0,e=l.length;t<e;t++){let e=l[t];r.push(e.x,e.y,0),s.push(0,0,1),n.push(e.x,e.y)}for(let t=0,e=c.length;t<e;t++){let e=c[t],r=e[0]+a,s=e[1]+a,n=e[2]+a;i.push(r,s,n),o+=3}}this.setIndex(i),this.setAttribute("position",new eW(r,3)),this.setAttribute("normal",new eW(s,3)),this.setAttribute("uv",new eW(n,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return function(t,e){if(e.shapes=[],Array.isArray(t))for(let i=0,r=t.length;i<r;i++){let r=t[i];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}static fromJSON(t,e){let i=[];for(let r=0,s=t.shapes.length;r<s;r++){let s=e[t.shapes[r]];i.push(s)}return new s4(i,t.curveSegments)}}class s6 extends e1{constructor(t=1,e=32,i=16,r=0,s=2*Math.PI,n=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:r,phiLength:s,thetaStart:n,thetaLength:a},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));const o=Math.min(n+a,Math.PI);let h=0;const l=[],u=new K,c=new K,d=[],p=[],f=[],m=[];for(let d=0;d<=i;d++){const y=[],g=d/i;let x=0;0===d&&0===n?x=.5/e:d===i&&o===Math.PI&&(x=-.5/e);for(let i=0;i<=e;i++){const o=i/e;u.x=-t*Math.cos(r+o*s)*Math.sin(n+g*a),u.y=t*Math.cos(n+g*a),u.z=t*Math.sin(r+o*s)*Math.sin(n+g*a),p.push(u.x,u.y,u.z),c.copy(u).normalize(),f.push(c.x,c.y,c.z),m.push(o+x,1-g),y.push(h++)}l.push(y)}for(let t=0;t<i;t++)for(let r=0;r<e;r++){const e=l[t][r+1],s=l[t][r],a=l[t+1][r],h=l[t+1][r+1];(0!==t||n>0)&&d.push(e,s,h),(t!==i-1||o<Math.PI)&&d.push(s,a,h)}this.setIndex(d),this.setAttribute("position",new eW(p,3)),this.setAttribute("normal",new eW(f,3)),this.setAttribute("uv",new eW(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new s6(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class s8 extends se{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new s8(t.radius,t.detail)}}class s9 extends e1{constructor(t=1,e=.4,i=12,r=48,s=2*Math.PI,n=0,a=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:r,arc:s,thetaStart:n,thetaLength:a},i=Math.floor(i),r=Math.floor(r);const o=[],h=[],l=[],u=[],c=new K,d=new K,p=new K;for(let o=0;o<=i;o++){const f=n+o/i*a;for(let n=0;n<=r;n++){const a=n/r*s;d.x=(t+e*Math.cos(f))*Math.cos(a),d.y=(t+e*Math.cos(f))*Math.sin(a),d.z=e*Math.sin(f),h.push(d.x,d.y,d.z),c.x=t*Math.cos(a),c.y=t*Math.sin(a),p.subVectors(d,c).normalize(),l.push(p.x,p.y,p.z),u.push(n/r),u.push(o/i)}}for(let t=1;t<=i;t++)for(let e=1;e<=r;e++){const i=(r+1)*t+e-1,s=(r+1)*(t-1)+e-1,n=(r+1)*(t-1)+e,a=(r+1)*t+e;o.push(i,s,a),o.push(s,n,a)}this.setIndex(o),this.setAttribute("position",new eW(h,3)),this.setAttribute("normal",new eW(l,3)),this.setAttribute("uv",new eW(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new s9(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}class s7 extends e1{constructor(t=1,e=.4,i=64,r=8,s=2,n=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:r,p:s,q:n},i=Math.floor(i),r=Math.floor(r);const a=[],o=[],h=[],l=[],u=new K,c=new K,d=new K,p=new K,f=new K,m=new K,y=new K;for(let a=0;a<=i;++a){const x=a/i*s*Math.PI*2;g(x,s,n,t,d),g(x+.01,s,n,t,p),m.subVectors(p,d),y.addVectors(p,d),f.crossVectors(m,y),y.crossVectors(f,m),f.normalize(),y.normalize();for(let t=0;t<=r;++t){const s=t/r*Math.PI*2,n=-e*Math.cos(s),p=e*Math.sin(s);u.x=d.x+(n*y.x+p*f.x),u.y=d.y+(n*y.y+p*f.y),u.z=d.z+(n*y.z+p*f.z),o.push(u.x,u.y,u.z),c.subVectors(u,d).normalize(),h.push(c.x,c.y,c.z),l.push(a/i),l.push(t/r)}}for(let t=1;t<=i;t++)for(let e=1;e<=r;e++){const i=(r+1)*(t-1)+(e-1),s=(r+1)*t+(e-1),n=(r+1)*t+e,o=(r+1)*(t-1)+e;a.push(i,s,o),a.push(s,n,o)}function g(t,e,i,r,s){let n=Math.cos(t),a=Math.sin(t),o=i/e*t,h=Math.cos(o);s.x=r*(2+h)*.5*n,s.y=r*(2+h)*a*.5,s.z=r*Math.sin(o)*.5}this.setIndex(a),this.setAttribute("position",new eW(o,3)),this.setAttribute("normal",new eW(h,3)),this.setAttribute("uv",new eW(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new s7(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class nt extends e1{constructor(t=new sT(new K(-1,-1,0),new K(-1,1,0),new K(1,1,0)),e=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:r,closed:s};const n=t.computeFrenetFrames(e,s);this.tangents=n.tangents,this.normals=n.normals,this.binormals=n.binormals;const a=new K,o=new K,h=new Y;let l=new K;const u=[],c=[],d=[],p=[];function f(s){l=t.getPointAt(s/e,l);let h=n.normals[s],d=n.binormals[s];for(let t=0;t<=r;t++){let e=t/r*Math.PI*2,s=Math.sin(e),n=-Math.cos(e);o.x=n*h.x+s*d.x,o.y=n*h.y+s*d.y,o.z=n*h.z+s*d.z,o.normalize(),c.push(o.x,o.y,o.z),a.x=l.x+i*o.x,a.y=l.y+i*o.y,a.z=l.z+i*o.z,u.push(a.x,a.y,a.z)}}(function(){for(let t=0;t<e;t++)f(t);f(!1===s?e:0),function(){for(let t=0;t<=e;t++)for(let i=0;i<=r;i++)h.x=t/e,h.y=i/r,d.push(h.x,h.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=r;e++){let i=(r+1)*(t-1)+(e-1),s=(r+1)*t+(e-1),n=(r+1)*t+e,a=(r+1)*(t-1)+e;p.push(i,s,a),p.push(s,n,a)}}()})(),this.setIndex(p),this.setAttribute("position",new eW(u,3)),this.setAttribute("normal",new eW(c,3)),this.setAttribute("uv",new eW(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new nt(new sE[t.path.type]().fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class ne extends e1{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],i=new Set,r=new K,s=new K;if(null!==t.index){const n=t.attributes.position,a=t.index;let o=t.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let t=0,h=o.length;t<h;++t){const h=o[t],l=h.start,u=h.count;for(let t=l,o=l+u;t<o;t+=3)for(let o=0;o<3;o++){const h=a.getX(t+o),l=a.getX(t+(o+1)%3);r.fromBufferAttribute(n,h),s.fromBufferAttribute(n,l),!0===ni(r,s,i)&&(e.push(r.x,r.y,r.z),e.push(s.x,s.y,s.z))}}}else{const n=t.attributes.position;for(let t=0,a=n.count/3;t<a;t++)for(let a=0;a<3;a++){const o=3*t+a,h=3*t+(a+1)%3;r.fromBufferAttribute(n,o),s.fromBufferAttribute(n,h),!0===ni(r,s,i)&&(e.push(r.x,r.y,r.z),e.push(s.x,s.y,s.z))}}this.setAttribute("position",new eW(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function ni(t,e,i){let r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,s=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==i.has(r)&&!0!==i.has(s)&&(i.add(r),i.add(s),!0)}var nr=Object.freeze({__proto__:null,BoxGeometry:r6,CapsuleGeometry:r8,CircleGeometry:r9,ConeGeometry:st,CylinderGeometry:r7,DodecahedronGeometry:si,EdgesGeometry:so,ExtrudeGeometry:sK,IcosahedronGeometry:s0,LatheGeometry:s1,OctahedronGeometry:s2,PlaneGeometry:s3,PolyhedronGeometry:se,RingGeometry:s5,ShapeGeometry:s4,SphereGeometry:s6,TetrahedronGeometry:s8,TorusGeometry:s9,TorusKnotGeometry:s7,TubeGeometry:nt,WireframeGeometry:ne});class ns extends e6{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new t3(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}function nn(t){let e={};for(let i in t)for(let r in e[i]={},t[i]){let s=t[i][r];if(no(s))s.isRenderTargetTexture?(B("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][r]=null):e[i][r]=s.clone();else if(Array.isArray(s))if(no(s[0])){let t=[];for(let e=0,i=s.length;e<i;e++)t[e]=s[e].clone();e[i][r]=t}else e[i][r]=s.slice();else e[i][r]=s}return e}function na(t){let e={};for(let i=0;i<t.length;i++){let r=nn(t[i]);for(let t in r)e[t]=r[t]}return e}function no(t){return t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture||t.isQuaternion)}function nh(t){let e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:tn.workingColorSpace}let nl={clone:nn,merge:na};class nu extends e6{constructor(t){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!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=nn(t.uniforms),this.uniformsGroups=function(t){let e=[];for(let i=0;i<t.length;i++)e.push(t[i].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){let e=super.toJSON(t);for(let i in e.glslVersion=this.glslVersion,e.uniforms={},this.uniforms){let r=this.uniforms[i].value;r&&r.isTexture?e.uniforms[i]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[i]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[i]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[i]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[i]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[i]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[i]={type:"m4",value:r.toArray()}:e.uniforms[i]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let i={};for(let t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class nc extends nu{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class nd extends e6{constructor(t){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new t3(0xffffff),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new t3(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tz,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class np extends nd{constructor(t){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 Y(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return q(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new t3(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 t3(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new t3(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(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class nf extends e6{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new t3(0xffffff),this.specular=new t3(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new t3(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tz,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class nm extends e6{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new t3(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new t3(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class ny extends e6{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class ng extends e6{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new t3(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new t3(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tz,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class nx extends e6{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class nb extends e6{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}class nv extends e6{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new t3(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this.fog=t.fog,this}}class nw extends rC{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function nM(t,e){return t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t}function nS(t){let e=t.length,i=Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort(function(e,i){return t[e]-t[i]}),i}function n_(t,e,i){let r=t.length,s=new t.constructor(r);for(let n=0,a=0;a!==r;++n){let r=i[n]*e;for(let i=0;i!==e;++i)s[a++]=t[r+i]}return s}function nA(t,e,i,r){let s=1,n=t[0];for(;void 0!==n&&void 0===n[r];)n=t[s++];if(void 0===n)return;let a=n[r];if(void 0!==a)if(Array.isArray(a))do void 0!==(a=n[r])&&(e.push(n.time),i.push(...a)),n=t[s++];while(void 0!==n)else if(void 0!==a.toArray)do void 0!==(a=n[r])&&(e.push(n.time),a.toArray(i,i.length)),n=t[s++];while(void 0!==n)else do void 0!==(a=n[r])&&(e.push(n.time),i.push(a)),n=t[s++];while(void 0!==n)}class nT{static convertArray(t,e){return nM(t,e)}static isTypedArray(t){return _(t)}static getKeyframeOrder(t){return nS(t)}static sortedArray(t,e,i){return n_(t,e,i)}static flattenJSON(t,e,i,r){nA(t,e,i,r)}static subclip(t,e,i,r,s=30){return function(t,e,i,r,s=30){let n=t.clone();n.name=e;let a=[];for(let t=0;t<n.tracks.length;++t){let e=n.tracks[t],o=e.getValueSize(),h=[],l=[];for(let t=0;t<e.times.length;++t){let n=e.times[t]*s;if(!(n<i)&&!(n>=r)){h.push(e.times[t]);for(let i=0;i<o;++i)l.push(e.values[t*o+i])}}0!==h.length&&(e.times=nM(h,e.times.constructor),e.values=nM(l,e.values.constructor),a.push(e))}n.tracks=a;let o=1/0;for(let t=0;t<n.tracks.length;++t)o>n.tracks[t].times[0]&&(o=n.tracks[t].times[0]);for(let t=0;t<n.tracks.length;++t)n.tracks[t].shift(-1*o);return n.resetDuration(),n}(t,e,i,r,s)}static makeClipAdditive(t,e=0,i=t,r=30){return function(t,e=0,i=t,r=30){r<=0&&(r=30);let s=i.tracks.length,n=e/r;for(let e=0;e<s;++e){let r,s=i.tracks[e],a=s.ValueTypeName;if("bool"===a||"string"===a)continue;let o=t.tracks.find(function(t){return t.name===s.name&&t.ValueTypeName===a});if(void 0===o)continue;let h=0,l=s.getValueSize();s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=l/3);let u=0,c=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=c/3);let d=s.times.length-1;if(n<=s.times[0]){let t=h,e=l-h;r=s.values.slice(t,e)}else if(n>=s.times[d]){let t=d*l+h,e=t+l-h;r=s.values.slice(t,e)}else{let t=s.createInterpolant(),e=h,i=l-h;t.evaluate(n),r=t.resultBuffer.slice(e,i)}"quaternion"===a&&new Z().fromArray(r).normalize().conjugate().toArray(r);let p=o.times.length;for(let t=0;t<p;++t){let e=t*c+u;if("quaternion"===a)Z.multiplyQuaternionsFlat(o.values,e,r,0,o.values,e);else{let t=c-2*u;for(let i=0;i<t;++i)o.values[e+i]-=r[i]}}}return t.blendMode=2501,t}(t,e,i,r)}}class nC{constructor(t,e,i,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,r=e[i],s=e[i-1];t:{e:{let n;i:{r:if(!(t<r)){for(let n=i+2;;){if(void 0===r){if(t<s)break r;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===n)break;if(s=r,t<(r=e[++i]))break e}n=e.length;break i}if(!(t>=s)){let a=e[1];t<a&&(i=2,s=a);for(let n=i-2;;){if(void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(i===n)break;if(r=s,t>=(s=e[--i-1]))break e}n=i,i=0;break i}break t}for(;i<n;){let r=i+n>>>1;t<e[r]?n=r:i=r+1}if(r=e[i],void 0===(s=e[i-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=t*r;for(let t=0;t!==r;++t)e[t]=i[s+t];return e}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}class nE extends nC{constructor(t,e,i,r){super(t,e,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(t,e,i){let r=this.parameterPositions,s=t-2,n=t+1,a=r[s],o=r[n];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:s=t,a=2*e-i;break;case 2402:s=r.length-2,a=e+r[s]-r[s+1];break;default:s=t,a=i}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:n=t,o=2*i-e;break;case 2402:n=1,o=i+r[1]-r[0];break;default:n=t-1,o=e}let h=(i-e)*.5,l=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(o-i),this._offsetPrev=s*l,this._offsetNext=n*l}interpolate_(t,e,i,r){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(i-e)/(r-e),f=p*p,m=f*p,y=-c*m+2*c*f-c*p,g=(1+c)*m+(-1.5-2*c)*f+(-.5+c)*p+1,x=(-1-d)*m+(1.5+d)*f+.5*p,b=d*m-d*f;for(let t=0;t!==a;++t)s[t]=y*n[l+t]+g*n[h+t]+x*n[o+t]+b*n[u+t];return s}}class nI extends nC{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=(i-e)/(r-e),u=1-l;for(let t=0;t!==a;++t)s[t]=n[h+t]*u+n[o+t]*l;return s}}class nR extends nC{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t){return this.copySampleValue_(t-1)}}class nO extends nC{interpolate_(t,e,i,r){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=this.settings||this.DefaultSettings_,u=l.inTangents,c=l.outTangents;if(!u||!c){let t=(i-e)/(r-e),l=1-t;for(let e=0;e!==a;++e)s[e]=n[h+e]*l+n[o+e]*t;return s}let d=2*a,p=t-1;for(let l=0;l!==a;++l){let a,f,m,y,g,x=n[h+l],b=n[o+l],v=p*d+2*l,w=c[v],M=c[v+1],S=t*d+2*l,_=u[S],A=u[S+1],T=(i-e)/(r-e);for(let t=0;t<8;t++){f=(a=T*T)*T;let t=(g=(y=(m=1-T)*m)*m)*e+3*y*T*w+3*m*a*_+f*r-i;if(1e-10>Math.abs(t))break;let s=3*y*(w-e)+6*m*T*(_-w)+3*a*(r-_);if(1e-10>Math.abs(s))break;T-=t/s,T=Math.max(0,Math.min(1,T))}s[l]=g*x+3*y*T*M+3*m*a*A+f*b}return s}}class nz{constructor(t,e,i,r){if(void 0===t)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=nM(e,this.TimeBufferType),this.values=nM(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){let e,i=t.constructor;if(i.toJSON!==this.toJSON)e=i.toJSON(t);else{e={name:t.name,times:nM(t.times,Array),values:nM(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}InterpolantFactoryMethodDiscrete(t){return new nR(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new nI(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new nE(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodBezier(t){let e=new nO(this.times,this.values,this.getValueSize(),t);return this.settings&&(e.settings=this.settings),e}setInterpolation(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth;break;case 2303:e=this.InterpolantFactoryMethodBezier}if(void 0===e){let e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(e);return B("KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302;case this.InterpolantFactoryMethodBezier:return 2303}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){let e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]+=t}return this}scale(t){if(1!==t){let e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]*=t}return this}trim(t,e){let i=this.times,r=i.length,s=0,n=r-1;for(;s!==r&&i[s]<t;)++s;for(;-1!==n&&i[n]>e;)--n;if(++n,0!==s||n!==r){s>=n&&(s=(n=Math.max(n,1))-1);let t=this.getValueSize();this.times=i.slice(s,n),this.values=this.values.slice(s*t,n*t)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(k("KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,r=this.values,s=i.length;0===s&&(k("KeyframeTrack: Track is empty.",this),t=!1);let n=null;for(let e=0;e!==s;e++){let r=i[e];if("number"==typeof r&&isNaN(r)){k("KeyframeTrack: Time is not a valid number.",this,e,r),t=!1;break}if(null!==n&&n>r){k("KeyframeTrack: Out of order keys.",this,e,r,n),t=!1;break}n=r}if(void 0!==r&&_(r))for(let e=0,i=r.length;e!==i;++e){let i=r[e];if(isNaN(i)){k("KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),r=2302===this.getInterpolation(),s=t.length-1,n=1;for(let a=1;a<s;++a){let s=!1,o=t[a];if(o!==t[a+1]&&(1!==a||o!==t[0]))if(r)s=!0;else{let t=a*i,r=t-i,n=t+i;for(let a=0;a!==i;++a){let i=e[t+a];if(i!==e[r+a]||i!==e[n+a]){s=!0;break}}}if(s){if(a!==n){t[n]=t[a];let r=a*i,s=n*i;for(let t=0;t!==i;++t)e[s+t]=e[r+t]}++n}}if(s>0){t[n]=t[s];for(let t=s*i,r=n*i,a=0;a!==i;++a)e[r+a]=e[t+a];++n}return n!==t.length?(this.times=t.slice(0,n),this.values=e.slice(0,n*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=new this.constructor(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}nz.prototype.ValueTypeName="",nz.prototype.TimeBufferType=Float32Array,nz.prototype.ValueBufferType=Float32Array,nz.prototype.DefaultInterpolation=2301;class nB extends nz{constructor(t,e,i){super(t,e,i)}}nB.prototype.ValueTypeName="bool",nB.prototype.ValueBufferType=Array,nB.prototype.DefaultInterpolation=2300,nB.prototype.InterpolantFactoryMethodLinear=void 0,nB.prototype.InterpolantFactoryMethodSmooth=void 0;class nk extends nz{constructor(t,e,i,r){super(t,e,i,r)}}nk.prototype.ValueTypeName="color";class nP extends nz{constructor(t,e,i,r){super(t,e,i,r)}}nP.prototype.ValueTypeName="number";class nN extends nC{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=(i-e)/(r-e),h=t*a;for(let t=h+a;h!==t;h+=4)Z.slerpFlat(s,0,n,h-a,n,h,o);return s}}class nL extends nz{constructor(t,e,i,r){super(t,e,i,r)}InterpolantFactoryMethodLinear(t){return new nN(this.times,this.values,this.getValueSize(),t)}}nL.prototype.ValueTypeName="quaternion",nL.prototype.InterpolantFactoryMethodSmooth=void 0;class nF extends nz{constructor(t,e,i){super(t,e,i)}}nF.prototype.ValueTypeName="string",nF.prototype.ValueBufferType=Array,nF.prototype.DefaultInterpolation=2300,nF.prototype.InterpolantFactoryMethodLinear=void 0,nF.prototype.InterpolantFactoryMethodSmooth=void 0;class nj extends nz{constructor(t,e,i,r){super(t,e,i,r)}}nj.prototype.ValueTypeName="vector";class nD{constructor(t="",e=-1,i=[],r=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=r,this.uuid=W(),this.userData={},this.duration<0&&this.resetDuration()}static parse(t){let e=[],i=t.tracks,r=1/(t.fps||1);for(let t=0,s=i.length;t!==s;++t)e.push((function(t){if(void 0===t.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return nP;case"vector":case"vector2":case"vector3":case"vector4":return nj;case"color":return nk;case"quaternion":return nL;case"bool":case"boolean":return nB;case"string":return nF}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){let e=[],i=[];nA(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)})(i[t]).scale(r));let s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s.userData=JSON.parse(t.userData||"{}"),s}static toJSON(t){let e=[],i=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode,userData:JSON.stringify(t.userData)};for(let t=0,r=i.length;t!==r;++t)e.push(nz.toJSON(i[t]));return r}static forFromMorphTargetSequence(t,e,i,r){let s=e.length,n=[];for(let t=0;t<s;t++){let a=[],o=[];a.push((t+s-1)%s,t,(t+1)%s),o.push(0,1,0);let h=nS(a);a=n_(a,1,h),o=n_(o,1,h),r||0!==a[0]||(a.push(s),o.push(o[0])),n.push(new nP(".morphTargetInfluences["+e[t].name+"]",a,o).scale(1/i))}return new this(t,-1,n)}static findByName(t,e){let i=t;Array.isArray(t)||(i=t.geometry&&t.geometry.animations||t.animations);for(let t=0;t<i.length;t++)if(i[t].name===e)return i[t];return null}static forClipsFromMorphTargetSequences(t,e,i){let r={},s=/^([\w-]*?)([\d]+)$/;for(let e=0,i=t.length;e<i;e++){let i=t[e],n=i.name.match(s);if(n&&n.length>1){let t=n[1],e=r[t];e||(r[t]=e=[]),e.push(i)}}let n=[];for(let t in r)n.push(this.forFromMorphTargetSequence(t,r[t],e,i));return n}static parseAnimation(t,e){if(B("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!t)return k("AnimationClip: No animation in JSONLoader data."),null;let i=function(t,e,i,r,s){if(0!==i.length){let n=[],a=[];nA(i,n,a,r),0!==n.length&&s.push(new t(e,n,a))}},r=[],s=t.name||"default",n=t.fps||30,a=t.blendMode,o=t.length||-1,h=t.hierarchy||[];for(let t=0;t<h.length;t++){let s=h[t].keys;if(s&&0!==s.length)if(s[0].morphTargets){let t,e={};for(t=0;t<s.length;t++)if(s[t].morphTargets)for(let i=0;i<s[t].morphTargets.length;i++)e[s[t].morphTargets[i]]=-1;for(let i in e){let e=[],n=[];for(let r=0;r!==s[t].morphTargets.length;++r){let r=s[t];e.push(r.time),n.push(+(r.morphTarget===i))}r.push(new nP(".morphTargetInfluence["+i+"]",e,n))}o=e.length*n}else{let n=".bones["+e[t].name+"]";i(nj,n+".position",s,"pos",r),i(nL,n+".quaternion",s,"rot",r),i(nj,n+".scale",s,"scl",r)}}return 0===r.length?null:new this(s,o,r,a)}resetDuration(){let t=this.tracks,e=0;for(let i=0,r=t.length;i!==r;++i){let t=this.tracks[i];e=Math.max(e,t.times[t.times.length-1])}return this.duration=e,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){let t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());let e=new this.constructor(this.name,this.duration,t,this.blendMode);return e.userData=JSON.parse(JSON.stringify(this.userData)),e}toJSON(){return this.constructor.toJSON(this)}}let nU={enabled:!1,files:{},add:function(t,e){!1===this.enabled||nV(t)||(this.files[t]=e)},get:function(t){if(!1!==this.enabled&&!nV(t))return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function nV(t){try{let e=t.slice(t.indexOf(":")+1),i=new URL(e);return"blob:"===i.protocol}catch(t){return!1}}class nW{constructor(t,e,i){let r;const s=this;let n=!1,a=0,o=0;const h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this._abortController=null,this.itemStart=function(t){o++,!1===n&&void 0!==s.onStart&&s.onStart(t,a,o),n=!0},this.itemEnd=function(t){a++,void 0!==s.onProgress&&s.onProgress(t,a,o),a===o&&(n=!1,void 0!==s.onLoad&&s.onLoad())},this.itemError=function(t){void 0!==s.onError&&s.onError(t)},this.resolveURL=function(t){return r?r(t):t},this.setURLModifier=function(t){return r=t,this},this.addHandler=function(t,e){return h.push(t,e),this},this.removeHandler=function(t){let e=h.indexOf(t);return -1!==e&&h.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=h.length;e<i;e+=2){let i=h[e],r=h[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}let nq=new nW;class nG{constructor(t){this.manager=void 0!==t?t:nq,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(t,e){let i=this;return new Promise(function(r,s){i.load(t,r,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}abort(){return this}}nG.DEFAULT_MATERIAL_NAME="__DEFAULT";let nH={};class nJ extends Error{constructor(t,e){super(t),this.response=e}}class nX extends nG{constructor(t){super(t),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(t,e,i,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let s=nU.get(`file:${t}`);if(void 0!==s){this.manager.itemStart(t),setTimeout(()=>{e&&e(s),this.manager.itemEnd(t)},0);return}if(void 0!==nH[t])return void nH[t].push({onLoad:e,onProgress:i,onError:r});nH[t]=[],nH[t].push({onLoad:e,onProgress:i,onError:r});let n=new Request(t,{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}),a=this.mimeType,o=this.responseType;fetch(n).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&B("FileLoader: HTTP Status 0 received."),"u"<typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;let i=nH[t],r=e.body.getReader(),s=e.headers.get("X-File-Size")||e.headers.get("Content-Length"),n=s?parseInt(s):0,a=0!==n,o=0;return new Response(new ReadableStream({start(t){!function e(){r.read().then(({done:r,value:s})=>{if(r)t.close();else{let r=new ProgressEvent("progress",{lengthComputable:a,loaded:o+=s.byteLength,total:n});for(let t=0,e=i.length;t<e;t++){let e=i[t];e.onProgress&&e.onProgress(r)}t.enqueue(s),e()}},e=>{t.error(e)})}()}}))}throw new nJ(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>new DOMParser().parseFromString(t,a));case"json":return t.json();default:if(""===a)return t.text();{let e=/charset="?([^;"\s]*)"?/i.exec(a),i=new TextDecoder(e&&e[1]?e[1].toLowerCase():void 0);return t.arrayBuffer().then(t=>i.decode(t))}}}).then(e=>{nU.add(`file:${t}`,e);let i=nH[t];delete nH[t];for(let t=0,r=i.length;t<r;t++){let r=i[t];r.onLoad&&r.onLoad(e)}}).catch(e=>{let i=nH[t];if(void 0===i)throw this.manager.itemError(t),e;delete nH[t];for(let t=0,r=i.length;t<r;t++){let r=i[t];r.onError&&r.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class n$ extends nG{constructor(t){super(t)}load(t,e,i,r){let s=this,n=new nX(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(t,function(i){try{e(s.parse(JSON.parse(i)))}catch(e){r?r(e):k(e),s.manager.itemError(t)}},i,r)}parse(t){let e=[];for(let i=0;i<t.length;i++){let r=nD.parse(t[i]);e.push(r)}return e}}class nY extends nG{constructor(t){super(t)}load(t,e,i,r){let s=this,n=[],a=new rZ,o=new nX(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(s.withCredentials);let h=0;if(Array.isArray(t))for(let l=0,u=t.length;l<u;++l)!function(l){o.load(t[l],function(t){let i=s.parse(t,!0);n[l]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},6===(h+=1)&&(1===i.mipmapCount&&(a.minFilter=1006),a.image=n,a.format=i.format,a.needsUpdate=!0,e&&e(a))},i,r)}(l);else o.load(t,function(t){let i=s.parse(t,!0);if(i.isCubemap){let t=i.mipmaps.length/i.mipmapCount;for(let e=0;e<t;e++){n[e]={mipmaps:[]};for(let t=0;t<i.mipmapCount;t++)n[e].mipmaps.push(i.mipmaps[e*i.mipmapCount+t]),n[e].format=i.format,n[e].width=i.width,n[e].height=i.height}a.image=n}else a.image.width=i.width,a.image.height=i.height,a.mipmaps=i.mipmaps;1===i.mipmapCount&&(a.minFilter=1006),a.format=i.format,a.needsUpdate=!0,e&&e(a)},i,r);return a}}let nZ=new WeakMap;class nK extends nG{constructor(t){super(t)}load(t,e,i,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let s=this,n=nU.get(`image:${t}`);if(void 0!==n){if(!0===n.complete)s.manager.itemStart(t),setTimeout(function(){e&&e(n),s.manager.itemEnd(t)},0);else{let t=nZ.get(n);void 0===t&&(t=[],nZ.set(n,t)),t.push({onLoad:e,onError:r})}return n}let a=A("img");function o(){l(),e&&e(this);let i=nZ.get(this)||[];for(let t=0;t<i.length;t++){let e=i[t];e.onLoad&&e.onLoad(this)}nZ.delete(this),s.manager.itemEnd(t)}function h(e){l(),r&&r(e),nU.remove(`image:${t}`);let i=nZ.get(this)||[];for(let t=0;t<i.length;t++){let r=i[t];r.onError&&r.onError(e)}nZ.delete(this),s.manager.itemError(t),s.manager.itemEnd(t)}function l(){a.removeEventListener("load",o,!1),a.removeEventListener("error",h,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",h,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),nU.add(`image:${t}`,a),s.manager.itemStart(t),a.src=t,a}}class nQ extends nG{constructor(t){super(t)}load(t,e,i,r){let s=new r0;s.colorSpace=f;let n=new nK(this.manager);n.setCrossOrigin(this.crossOrigin),n.setPath(this.path);let a=0;for(let i=0;i<t.length;++i)!function(i){n.load(t[i],function(t){s.images[i]=t,6==++a&&(s.needsUpdate=!0,e&&e(s))},void 0,r)}(i);return s}}class n0 extends nG{constructor(t){super(t)}load(t,e,i,r){let s=this,n=new iY,a=new nX(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(t,function(t){let i;try{i=s.parse(t)}catch(t){void 0!==r?r(t):k(t);return}void 0!==i.image?n.image=i.image:void 0!==i.data&&(n.image.width=i.width,n.image.height=i.height,n.image.data=i.data),n.wrapS=void 0!==i.wrapS?i.wrapS:1001,n.wrapT=void 0!==i.wrapT?i.wrapT:1001,n.magFilter=void 0!==i.magFilter?i.magFilter:1006,n.minFilter=void 0!==i.minFilter?i.minFilter:1006,n.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.colorSpace&&(n.colorSpace=i.colorSpace),void 0!==i.flipY&&(n.flipY=i.flipY),void 0!==i.format&&(n.format=i.format),void 0!==i.type&&(n.type=i.type),void 0!==i.mipmaps&&(n.mipmaps=i.mipmaps,n.minFilter=1008),1===i.mipmapCount&&(n.minFilter=1006),void 0!==i.generateMipmaps&&(n.generateMipmaps=i.generateMipmaps),n.needsUpdate=!0,e&&e(n,i)},i,r),n}}class n1 extends nG{constructor(t){super(t)}load(t,e,i,r){let s=new tf,n=new nK(this.manager);return n.setCrossOrigin(this.crossOrigin),n.setPath(this.path),n.load(t,function(t){s.image=t,s.needsUpdate=!0,void 0!==e&&e(s)},i,r),s}}class n2 extends t${constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new t3(t),this.intensity=e}dispose(){this.dispatchEvent({type:"dispose"})}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,e}}class n3 extends n2{constructor(t,e,i){super(t,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(t$.DEFAULT_UP),this.updateMatrix(),this.groundColor=new t3(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}toJSON(t){let e=super.toJSON(t);return e.object.groundColor=this.groundColor.getHex(),e}}let n5=new tM,n4=new K,n6=new K;class n8{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Y(512,512),this.mapType=1009,this.map=null,this.mapPass=null,this.matrix=new tM,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ra,this._frameExtents=new Y(1,1),this._viewportCount=1,this._viewports=[new tm(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,i=this.matrix;n4.setFromMatrixPosition(t.matrixWorld),e.position.copy(n4),n6.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(n6),e.updateMatrixWorld(),n5.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(n5,e.coordinateSystem,e.reversedDepth),2001===e.coordinateSystem||e.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(n5)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this.biasNode=t.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return 1!==this.intensity&&(t.intensity=this.intensity),0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),(512!==this.mapSize.x||512!==this.mapSize.y)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}let n9=new K,n7=new Z,at=new K;class ae extends t${constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new tM,this.projectionMatrix=new tM,this.projectionMatrixInverse=new tM,this.coordinateSystem=2e3,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose(n9,n7,at),1===at.x&&1===at.y&&1===at.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(n9,n7,at.set(1,1,1)).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorld.decompose(n9,n7,at),1===at.x&&1===at.y&&1===at.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(n9,n7,at.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}let ai=new K,ar=new Y,as=new Y;class an extends ae{constructor(t=50,e=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=2*V*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*U*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*V*Math.atan(Math.tan(.5*U*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,i){ai.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(ai.x,ai.y).multiplyScalar(-t/ai.z),ai.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ai.x,ai.y).multiplyScalar(-t/ai.z)}getViewSize(t,e){return this.getViewBounds(t,ar,as),e.subVectors(as,ar)}setViewOffset(t,e,i,r,s,n){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=n,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(.5*U*this.fov)/this.zoom,i=2*e,r=this.aspect*i,s=-.5*r,n=this.view;if(null!==this.view&&this.view.enabled){let t=n.fullWidth,a=n.fullHeight;s+=n.offsetX*r/t,e-=n.offsetY*i/a,r*=n.width/t,i*=n.height/a}let a=this.filmOffset;0!==a&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,e,e-i,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}class aa extends n8{constructor(){super(new an(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){let e=this.camera,i=2*V*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,s=t.distance||e.far;(i!==e.fov||r!==e.aspect||s!==e.far)&&(e.fov=i,e.aspect=r,e.far=s,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class ao extends n2{constructor(t,e,i=0,r=Math.PI/3,s=0,n=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(t$.DEFAULT_UP),this.updateMatrix(),this.target=new t$,this.distance=i,this.angle=r,this.penumbra=s,this.decay=n,this.map=null,this.shadow=new aa}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.map=t.map,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.angle=this.angle,e.object.decay=this.decay,e.object.penumbra=this.penumbra,e.object.target=this.target.uuid,this.map&&this.map.isTexture&&(e.object.map=this.map.toJSON(t).uuid),e.object.shadow=this.shadow.toJSON(),e}}class ah extends n8{constructor(){super(new an(90,1,.5,500)),this.isPointLightShadow=!0}}class al extends n2{constructor(t,e,i=0,r=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new ah}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.decay=this.decay,e.object.shadow=this.shadow.toJSON(),e}}class au extends ae{constructor(t=-1,e=1,i=1,r=-1,s=.1,n=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=r,this.near=s,this.far=n,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,r,s,n){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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=n,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2,s=i-t,n=i+t,a=r+e,o=r-e;if(null!==this.view&&this.view.enabled){let t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=t*this.view.offsetX,n=s+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(s,n,a,o,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}class ac extends n8{constructor(){super(new au(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ad extends n2{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(t$.DEFAULT_UP),this.updateMatrix(),this.target=new t$,this.shadow=new ac}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.shadow=this.shadow.toJSON(),e.object.target=this.target.uuid,e}}class ap extends n2{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class af extends n2{constructor(t,e,i=10,r=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){let e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class am{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new K)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){let i=t.x,r=t.y,s=t.z,n=this.coefficients;return e.copy(n[0]).multiplyScalar(.282095),e.addScaledVector(n[1],.488603*r),e.addScaledVector(n[2],.488603*s),e.addScaledVector(n[3],.488603*i),e.addScaledVector(n[4],i*r*1.092548),e.addScaledVector(n[5],r*s*1.092548),e.addScaledVector(n[6],.315392*(3*s*s-1)),e.addScaledVector(n[7],i*s*1.092548),e.addScaledVector(n[8],.546274*(i*i-r*r)),e}getIrradianceAt(t,e){let i=t.x,r=t.y,s=t.z,n=this.coefficients;return e.copy(n[0]).multiplyScalar(.886227),e.addScaledVector(n[1],1.023328*r),e.addScaledVector(n[2],1.023328*s),e.addScaledVector(n[3],1.023328*i),e.addScaledVector(n[4],.858086*i*r),e.addScaledVector(n[5],.858086*r*s),e.addScaledVector(n[6],.743125*s*s-.247708),e.addScaledVector(n[7],.858086*i*s),e.addScaledVector(n[8],.429043*(i*i-r*r)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(t,e=0){let i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(t,e+3*r);return this}toArray(t=[],e=0){let i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(t,e+3*r);return t}static getBasisAt(t,e){let i=t.x,r=t.y,s=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*s,e[3]=.488603*i,e[4]=1.092548*i*r,e[5]=1.092548*r*s,e[6]=.315392*(3*s*s-1),e[7]=1.092548*i*s,e[8]=.546274*(i*i-r*r)}}class ay extends n2{constructor(t=new am,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}toJSON(t){let e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class ag extends nG{constructor(t){super(t),this.textures={}}load(t,e,i,r){let s=this,n=new nX(s.manager);n.setPath(s.path),n.setRequestHeader(s.requestHeader),n.setWithCredentials(s.withCredentials),n.load(t,function(i){try{e(s.parse(JSON.parse(i)))}catch(e){r?r(e):k(e),s.manager.itemError(t)}},i,r)}parse(t){let e=this.textures;function i(t){return void 0===e[t]&&B("MaterialLoader: Undefined texture",t),e[t]}let r=this.createMaterialFromType(t.type);if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&void 0!==r.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.sheen&&(r.sheen=t.sheen),void 0!==t.sheenColor&&(r.sheenColor=new t3().setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(r.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==r.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==r.specular&&r.specular.setHex(t.specular),void 0!==t.specularIntensity&&(r.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearcoat&&(r.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(r.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.dispersion&&(r.dispersion=t.dispersion),void 0!==t.iridescence&&(r.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(r.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(r.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(r.transmission=t.transmission),void 0!==t.thickness&&(r.thickness=t.thickness),void 0!==t.attenuationDistance&&(r.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(r.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(r.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.shadowSide&&(r.shadowSide=t.shadowSide),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.alphaHash&&(r.alphaHash=t.alphaHash),void 0!==t.depthFunc&&(r.depthFunc=t.depthFunc),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.blendSrc&&(r.blendSrc=t.blendSrc),void 0!==t.blendDst&&(r.blendDst=t.blendDst),void 0!==t.blendEquation&&(r.blendEquation=t.blendEquation),void 0!==t.blendSrcAlpha&&(r.blendSrcAlpha=t.blendSrcAlpha),void 0!==t.blendDstAlpha&&(r.blendDstAlpha=t.blendDstAlpha),void 0!==t.blendEquationAlpha&&(r.blendEquationAlpha=t.blendEquationAlpha),void 0!==t.blendColor&&void 0!==r.blendColor&&r.blendColor.setHex(t.blendColor),void 0!==t.blendAlpha&&(r.blendAlpha=t.blendAlpha),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),void 0!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.alphaToCoverage&&(r.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(r.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(r.forceSinglePass=t.forceSinglePass),void 0!==t.allowOverride&&(r.allowOverride=t.allowOverride),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?r.vertexColors=t.vertexColors>0:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(let e in t.uniforms){let s=t.uniforms[e];switch(r.uniforms[e]={},s.type){case"t":r.uniforms[e].value=i(s.value);break;case"c":r.uniforms[e].value=new t3().setHex(s.value);break;case"v2":r.uniforms[e].value=new Y().fromArray(s.value);break;case"v3":r.uniforms[e].value=new K().fromArray(s.value);break;case"v4":r.uniforms[e].value=new tm().fromArray(s.value);break;case"m3":r.uniforms[e].value=new te().fromArray(s.value);break;case"m4":r.uniforms[e].value=new tM().fromArray(s.value);break;default:r.uniforms[e].value=s.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(r.glslVersion=t.glslVersion),void 0!==t.extensions)for(let e in t.extensions)r.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(r.lights=t.lights),void 0!==t.clipping&&(r.clipping=t.clipping),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=i(t.map)),void 0!==t.matcap&&(r.matcap=i(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(r.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),r.normalScale=new Y().fromArray(e)}return void 0!==t.displacementMap&&(r.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=i(t.specularMap)),void 0!==t.specularIntensityMap&&(r.specularIntensityMap=i(t.specularIntensityMap)),void 0!==t.specularColorMap&&(r.specularColorMap=i(t.specularColorMap)),void 0!==t.envMap&&(r.envMap=i(t.envMap)),void 0!==t.envMapRotation&&r.envMapRotation.fromArray(t.envMapRotation),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(r.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(r.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(r.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=new Y().fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(r.iridescenceMap=i(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(r.iridescenceThicknessMap=i(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(r.transmissionMap=i(t.transmissionMap)),void 0!==t.thicknessMap&&(r.thicknessMap=i(t.thicknessMap)),void 0!==t.anisotropyMap&&(r.anisotropyMap=i(t.anisotropyMap)),void 0!==t.sheenColorMap&&(r.sheenColorMap=i(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(r.sheenRoughnessMap=i(t.sheenRoughnessMap)),r}setTextures(t){return this.textures=t,this}createMaterialFromType(t){return ag.createMaterialFromType(t)}static createMaterialFromType(t){return new({ShadowMaterial:ns,SpriteMaterial:e8,RawShaderMaterial:nc,ShaderMaterial:nu,PointsMaterial:rU,MeshPhysicalMaterial:np,MeshStandardMaterial:nd,MeshPhongMaterial:nf,MeshToonMaterial:nm,MeshNormalMaterial:ny,MeshLambertMaterial:ng,MeshDepthMaterial:nx,MeshDistanceMaterial:nb,MeshBasicMaterial:iA,MeshMatcapMaterial:nv,LineDashedMaterial:nw,LineBasicMaterial:rC,Material:e6})[t]}}class ax{static extractUrlBase(t){let e=t.lastIndexOf("/");return -1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t))?t:e+t}}class ab extends e1{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){let t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class av extends nG{constructor(t){super(t)}load(t,e,i,r){let s=this,n=new nX(s.manager);n.setPath(s.path),n.setRequestHeader(s.requestHeader),n.setWithCredentials(s.withCredentials),n.load(t,function(i){try{e(s.parse(JSON.parse(i)))}catch(e){r?r(e):k(e),s.manager.itemError(t)}},i,r)}parse(t){let e={},i={};function r(t,r){if(void 0!==e[r])return e[r];let s=t.interleavedBuffers[r],n=function(t,e){if(void 0!==i[e])return i[e];let r=new Uint32Array(t.arrayBuffers[e]).buffer;return i[e]=r,r}(t,s.buffer),a=new e2(S(s.type,n),s.stride);return a.uuid=s.uuid,e[r]=a,a}let s=t.isInstancedBufferGeometry?new ab:new e1,n=t.data.index;if(void 0!==n){let t=S(n.type,n.array);s.setIndex(new ek(t,1))}let a=t.data.attributes;for(let e in a){let i,n=a[e];if(n.isInterleavedBufferAttribute)i=new e5(r(t.data,n.data),n.itemSize,n.offset,n.normalized);else{let t=S(n.type,n.array);i=new(n.isInstancedBufferAttribute?i0:ek)(t,n.itemSize,n.normalized)}void 0!==n.name&&(i.name=n.name),void 0!==n.usage&&i.setUsage(n.usage),s.setAttribute(e,i)}let o=t.data.morphAttributes;if(o)for(let e in o){let i=o[e],n=[];for(let e=0,s=i.length;e<s;e++){let s,a=i[e];s=a.isInterleavedBufferAttribute?new e5(r(t.data,a.data),a.itemSize,a.offset,a.normalized):new ek(S(a.type,a.array),a.itemSize,a.normalized),void 0!==a.name&&(s.name=a.name),n.push(s)}s.morphAttributes[e]=n}t.data.morphTargetsRelative&&(s.morphTargetsRelative=!0);let h=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==h)for(let t=0,e=h.length;t!==e;++t){let e=h[t];s.addGroup(e.start,e.count,e.materialIndex)}let l=t.data.boundingSphere;return void 0!==l&&(s.boundingSphere=new eJ().fromJSON(l)),t.name&&(s.name=t.name),t.userData&&(s.userData=t.userData),s}}let aw={};class aM extends nG{constructor(t){super(t)}load(t,e,i,r){let s=this,n=""===this.path?ax.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||n;let a=new nX(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(i){let n=null;try{n=JSON.parse(i)}catch(e){void 0!==r&&r(e),k("ObjectLoader: Can't parse "+t+".",e.message);return}let a=n.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase()){void 0!==r&&r(Error("THREE.ObjectLoader: Can't load "+t)),k("ObjectLoader: Can't load "+t);return}s.parse(n,e)},i,r)}async loadAsync(t,e){let i,r=""===this.path?ax.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||r;let s=new nX(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);let n=await s.loadAsync(t,e);try{i=JSON.parse(n)}catch(e){throw Error("ObjectLoader: Can't parse "+t+". "+e.message)}let a=i.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase())throw Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(i)}parse(t,e){let i=this.parseAnimations(t.animations),r=this.parseShapes(t.shapes),s=this.parseGeometries(t.geometries,r),n=this.parseImages(t.images,function(){void 0!==e&&e(h)}),a=this.parseTextures(t.textures,n),o=this.parseMaterials(t.materials,a),h=this.parseObject(t.object,s,o,a,i),l=this.parseSkeletons(t.skeletons,h);if(this.bindSkeletons(h,l),this.bindLightTargets(h),void 0!==e){let t=!1;for(let e in n)if(n[e].data instanceof HTMLImageElement){t=!0;break}!1===t&&e(h)}return h}async parseAsync(t){let e=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),r=this.parseGeometries(t.geometries,i),s=await this.parseImagesAsync(t.images),n=this.parseTextures(t.textures,s),a=this.parseMaterials(t.materials,n),o=this.parseObject(t.object,r,a,n,e),h=this.parseSkeletons(t.skeletons,o);return this.bindSkeletons(o,h),this.bindLightTargets(o),o}static registerGeometry(t,e){aw[t]=e}parseShapes(t){let e={};if(void 0!==t)for(let i=0,r=t.length;i<r;i++){let r=new sO().fromJSON(t[i]);e[r.uuid]=r}return e}parseSkeletons(t,e){let i={},r={};if(e.traverse(function(t){t.isBone&&(r[t.uuid]=t)}),void 0!==t)for(let e=0,s=t.length;e<s;e++){let s=new iQ().fromJSON(t[e],r);i[s.uuid]=s}return i}parseGeometries(t,e){let i={};if(void 0!==t){let r=new av;for(let s=0,n=t.length;s<n;s++){let n,a=t[s];switch(a.type){case"BufferGeometry":case"InstancedBufferGeometry":n=r.parse(a);break;default:a.type in nr?n=nr[a.type].fromJSON(a,e):a.type in aw?n=aw[a.type].fromJSON(a,e):B(`ObjectLoader: Unknown geometry type "${a.type}". Use .registerGeometry() before starting the deserialization process.`)}n.uuid=a.uuid,void 0!==a.name&&(n.name=a.name),void 0!==a.userData&&(n.userData=a.userData),i[a.uuid]=n}}return i}parseMaterials(t,e){let i={},r={};if(void 0!==t){let s=new ag;s.setTextures(e);for(let e=0,n=t.length;e<n;e++){let n=t[e];void 0===i[n.uuid]&&(i[n.uuid]=s.parse(n)),r[n.uuid]=i[n.uuid]}}return r}parseAnimations(t){let e={};if(void 0!==t)for(let i=0;i<t.length;i++){let r=t[i],s=nD.parse(r);e[s.uuid]=s}return e}parseImages(t,e){let i,r=this,s={};function n(t){if("string"==typeof t){var e;return e=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:r.resourcePath+t,r.manager.itemStart(e),i.load(e,function(){r.manager.itemEnd(e)},void 0,function(){r.manager.itemError(e),r.manager.itemEnd(e)})}return t.data?{data:S(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){(i=new nK(new nW(e))).setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e<i;e++){let i=t[e],r=i.url;if(Array.isArray(r)){let t=[];for(let e=0,i=r.length;e<i;e++){let i=n(r[e]);null!==i&&(i instanceof HTMLImageElement?t.push(i):t.push(new iY(i.data,i.width,i.height)))}s[i.uuid]=new tu(t)}else{let t=n(i.url);s[i.uuid]=new tu(t)}}}return s}async parseImagesAsync(t){let e,i=this,r={};async function s(t){if("string"==typeof t){let r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:i.resourcePath+t;return await e.loadAsync(r)}return t.data?{data:S(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){(e=new nK(this.manager)).setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e<i;e++){let i=t[e],n=i.url;if(Array.isArray(n)){let t=[];for(let e=0,i=n.length;e<i;e++){let i=n[e],r=await s(i);null!==r&&(r instanceof HTMLImageElement?t.push(r):t.push(new iY(r.data,r.width,r.height)))}r[i.uuid]=new tu(t)}else{let t=await s(i.url);r[i.uuid]=new tu(t)}}}return r}parseTextures(t,e){function i(t,e){return"number"==typeof t?t:(B("ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}let r={};if(void 0!==t)for(let s=0,n=t.length;s<n;s++){let n,a=t[s];void 0===a.image&&B('ObjectLoader: No "image" specified for',a.uuid),void 0===e[a.image]&&B("ObjectLoader: Undefined image",a.image);let o=e[a.image],h=o.data;Array.isArray(h)?(n=new r0,6===h.length&&(n.needsUpdate=!0)):(n=h&&h.data?new iY:new tf,h&&(n.needsUpdate=!0)),n.source=o,n.uuid=a.uuid,void 0!==a.name&&(n.name=a.name),void 0!==a.mapping&&(n.mapping=i(a.mapping,aS)),void 0!==a.channel&&(n.channel=a.channel),void 0!==a.offset&&n.offset.fromArray(a.offset),void 0!==a.repeat&&n.repeat.fromArray(a.repeat),void 0!==a.center&&n.center.fromArray(a.center),void 0!==a.rotation&&(n.rotation=a.rotation),void 0!==a.wrap&&(n.wrapS=i(a.wrap[0],a_),n.wrapT=i(a.wrap[1],a_)),void 0!==a.format&&(n.format=a.format),void 0!==a.internalFormat&&(n.internalFormat=a.internalFormat),void 0!==a.type&&(n.type=a.type),void 0!==a.colorSpace&&(n.colorSpace=a.colorSpace),void 0!==a.minFilter&&(n.minFilter=i(a.minFilter,aA)),void 0!==a.magFilter&&(n.magFilter=i(a.magFilter,aA)),void 0!==a.anisotropy&&(n.anisotropy=a.anisotropy),void 0!==a.flipY&&(n.flipY=a.flipY),void 0!==a.generateMipmaps&&(n.generateMipmaps=a.generateMipmaps),void 0!==a.premultiplyAlpha&&(n.premultiplyAlpha=a.premultiplyAlpha),void 0!==a.unpackAlignment&&(n.unpackAlignment=a.unpackAlignment),void 0!==a.compareFunction&&(n.compareFunction=a.compareFunction),void 0!==a.normalized&&(n.normalized=a.normalized),void 0!==a.userData&&(n.userData=a.userData),r[a.uuid]=n}return r}parseObject(t,e,i,r,s){let n,a,o;function h(t){return void 0===e[t]&&B("ObjectLoader: Undefined geometry",t),e[t]}function l(t){if(void 0!==t){if(Array.isArray(t)){let e=[];for(let r=0,s=t.length;r<s;r++){let s=t[r];void 0===i[s]&&B("ObjectLoader: Undefined material",s),e.push(i[s])}return e}return void 0===i[t]&&B("ObjectLoader: Undefined material",t),i[t]}}function u(t){return void 0===r[t]&&B("ObjectLoader: Undefined texture",t),r[t]}switch(t.type){case"Scene":n=new t8,void 0!==t.background&&(Number.isInteger(t.background)?n.background=new t3(t.background):n.background=u(t.background)),void 0!==t.environment&&(n.environment=u(t.environment)),void 0!==t.fog&&("Fog"===t.fog.type?n.fog=new t6(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(n.fog=new t4(t.fog.color,t.fog.density)),""!==t.fog.name&&(n.fog.name=t.fog.name)),void 0!==t.backgroundBlurriness&&(n.backgroundBlurriness=t.backgroundBlurriness),void 0!==t.backgroundIntensity&&(n.backgroundIntensity=t.backgroundIntensity),void 0!==t.backgroundRotation&&n.backgroundRotation.fromArray(t.backgroundRotation),void 0!==t.environmentIntensity&&(n.environmentIntensity=t.environmentIntensity),void 0!==t.environmentRotation&&n.environmentRotation.fromArray(t.environmentRotation);break;case"PerspectiveCamera":n=new an(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(n.focus=t.focus),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.filmGauge&&(n.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(n.filmOffset=t.filmOffset),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new au(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new ap(t.color,t.intensity);break;case"DirectionalLight":(n=new ad(t.color,t.intensity)).target=t.target||"";break;case"PointLight":n=new al(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new af(t.color,t.intensity,t.width,t.height);break;case"SpotLight":(n=new ao(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay)).target=t.target||"";break;case"HemisphereLight":n=new n3(t.color,t.groundColor,t.intensity);break;case"LightProbe":n=new ay(new am().fromArray(t.sh),t.intensity);break;case"SkinnedMesh":n=new iX(a=h(t.geometry),o=l(t.material)),void 0!==t.bindMode&&(n.bindMode=t.bindMode),void 0!==t.bindMatrix&&n.bindMatrix.fromArray(t.bindMatrix),void 0!==t.skeleton&&(n.skeleton=t.skeleton);break;case"Mesh":n=new iL(a=h(t.geometry),o=l(t.material));break;case"InstancedMesh":a=h(t.geometry),o=l(t.material);let c=t.count,d=t.instanceMatrix,p=t.instanceColor;(n=new i9(a,o,c)).instanceMatrix=new i0(new Float32Array(d.array),16),void 0!==p&&(n.instanceColor=new i0(new Float32Array(p.array),p.itemSize));break;case"BatchedMesh":a=h(t.geometry),o=l(t.material),(n=new rT(t.maxInstanceCount,t.maxVertexCount,t.maxIndexCount,o)).geometry=a,n.perObjectFrustumCulled=t.perObjectFrustumCulled,n.sortObjects=t.sortObjects,n._drawRanges=t.drawRanges,n._reservedRanges=t.reservedRanges,n._geometryInfo=t.geometryInfo.map(t=>{let e=null,i=null;return void 0!==t.boundingBox&&(e=new ed().fromJSON(t.boundingBox)),void 0!==t.boundingSphere&&(i=new eJ().fromJSON(t.boundingSphere)),{...t,boundingBox:e,boundingSphere:i}}),n._instanceInfo=t.instanceInfo,n._availableInstanceIds=t._availableInstanceIds,n._availableGeometryIds=t._availableGeometryIds,n._nextIndexStart=t.nextIndexStart,n._nextVertexStart=t.nextVertexStart,n._geometryCount=t.geometryCount,n._maxInstanceCount=t.maxInstanceCount,n._maxVertexCount=t.maxVertexCount,n._maxIndexCount=t.maxIndexCount,n._geometryInitialized=t.geometryInitialized,n._matricesTexture=u(t.matricesTexture.uuid),n._indirectTexture=u(t.indirectTexture.uuid),void 0!==t.colorsTexture&&(n._colorsTexture=u(t.colorsTexture.uuid)),void 0!==t.boundingSphere&&(n.boundingSphere=new eJ().fromJSON(t.boundingSphere)),void 0!==t.boundingBox&&(n.boundingBox=new ed().fromJSON(t.boundingBox));break;case"LOD":n=new iy;break;case"Line":n=new rP(h(t.geometry),l(t.material));break;case"LineLoop":n=new rD(h(t.geometry),l(t.material));break;case"LineSegments":n=new rj(h(t.geometry),l(t.material));break;case"PointCloud":case"Points":n=new rH(h(t.geometry),l(t.material));break;case"Sprite":n=new ic(l(t.material));break;case"Group":n=new tY;break;case"Bone":n=new i$;break;default:n=new t$}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.up&&n.up.fromArray(t.up),void 0!==t.pivot&&(n.pivot=new K().fromArray(t.pivot)),void 0!==t.morphTargetDictionary&&(n.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),void 0!==t.morphTargetInfluences&&(n.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.intensity&&(n.shadow.intensity=t.shadow.intensity),void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(n.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.static&&(n.static=t.static),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children){let a=t.children;for(let t=0;t<a.length;t++)n.add(this.parseObject(a[t],e,i,r,s))}if(void 0!==t.animations){let e=t.animations;for(let t=0;t<e.length;t++){let i=e[t];n.animations.push(s[i])}}if("LOD"===t.type){void 0!==t.autoUpdate&&(n.autoUpdate=t.autoUpdate);let e=t.levels;for(let t=0;t<e.length;t++){let i=e[t],r=n.getObjectByProperty("uuid",i.object);void 0!==r&&n.addLevel(r,i.distance,i.hysteresis)}}return n}bindSkeletons(t,e){0!==Object.keys(e).length&&t.traverse(function(t){if(!0===t.isSkinnedMesh&&void 0!==t.skeleton){let i=e[t.skeleton];void 0===i?B("ObjectLoader: No skeleton found with UUID:",t.skeleton):t.bind(i,t.bindMatrix)}})}bindLightTargets(t){t.traverse(function(e){if(e.isDirectionalLight||e.isSpotLight){let i=e.target,r=t.getObjectByProperty("uuid",i);void 0!==r?e.target=r:e.target=new t$}})}}let aS={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,CubeUVReflectionMapping:306},a_={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},aA={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008},aT=new WeakMap;class aC extends nG{constructor(t){super(t),this.isImageBitmapLoader=!0,"u"<typeof createImageBitmap&&B("ImageBitmapLoader: createImageBitmap() not supported."),"u"<typeof fetch&&B("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(t){return this.options=t,this}load(t,e,i,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let s=this,n=nU.get(`image-bitmap:${t}`);if(void 0!==n)return(s.manager.itemStart(t),n.then)?void n.then(i=>{!0===aT.has(n)?(r&&r(aT.get(n)),s.manager.itemError(t)):e&&e(i),s.manager.itemEnd(t)}):void setTimeout(function(){e&&e(n),s.manager.itemEnd(t)},0);let a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,a.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let o=fetch(t,a).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(i){nU.add(`image-bitmap:${t}`,i),e&&e(i),s.manager.itemEnd(t)}).catch(function(e){r&&r(e),aT.set(o,e),nU.remove(`image-bitmap:${t}`),s.manager.itemError(t),s.manager.itemEnd(t)});nU.add(`image-bitmap:${t}`,o),s.manager.itemStart(t)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class aE{static getContext(){return void 0===r&&(r=new(window.AudioContext||window.webkitAudioContext)),r}static setContext(t){r=t}}class aI extends nG{constructor(t){super(t)}load(t,e,i,r){let s=this,n=new nX(this.manager);function a(e){r?r(e):k(e),s.manager.itemError(t)}n.setResponseType("arraybuffer"),n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(t,function(i){try{let r=i.slice(0),n=aE.getContext(),o=t+"#decode";s.manager.itemStart(o),n.decodeAudioData(r,function(t){e(t),s.manager.itemEnd(o)}).catch(function(t){a(t),s.manager.itemEnd(o)})}catch(t){a(t)}},i,r)}}let aR=new tM,aO=new tM,az=new tM;class aB{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new an,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new an,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}}update(t){let e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){let i,r;e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep,az.copy(t.projectionMatrix);let s=e.eyeSep/2,n=s*e.near/e.focus,a=e.near*Math.tan(U*e.fov*.5)/e.zoom;aO.elements[12]=-s,aR.elements[12]=s,i=-a*e.aspect+n,r=a*e.aspect+n,az.elements[0]=2*e.near/(r-i),az.elements[8]=(r+i)/(r-i),this.cameraL.projectionMatrix.copy(az),i=-a*e.aspect-n,r=a*e.aspect-n,az.elements[0]=2*e.near/(r-i),az.elements[8]=(r+i)/(r-i),this.cameraR.projectionMatrix.copy(az)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(aO),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(aR)}}class ak extends t${constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new an(-90,1,t,e);r.layers=this.layers,this.add(r);const s=new an(-90,1,t,e);s.layers=this.layers,this.add(s);const n=new an(-90,1,t,e);n.layers=this.layers,this.add(n);const a=new an(-90,1,t,e);a.layers=this.layers,this.add(a);const o=new an(-90,1,t,e);o.layers=this.layers,this.add(o);const h=new an(-90,1,t,e);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[i,r,s,n,a,o]=e;for(let t of e)this.remove(t);if(2e3===t)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),n.up.set(0,0,1),n.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(2001===t)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),n.up.set(0,0,-1),n.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[s,n,a,o,h,l]=this.children,u=t.getRenderTarget(),c=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),p=t.xr.enabled;t.xr.enabled=!1;let f=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;let m=!1;m=!0===t.isWebGLRenderer?t.state.buffers.depth.getReversed():t.reversedDepthBuffer,t.setRenderTarget(i,0,r),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,s),t.setRenderTarget(i,1,r),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,n),t.setRenderTarget(i,2,r),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,a),t.setRenderTarget(i,3,r),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,o),t.setRenderTarget(i,4,r),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,h),i.texture.generateMipmaps=f,t.setRenderTarget(i,5,r),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,l),t.setRenderTarget(u,c,d),t.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class aP extends an{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}class aN{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(t){this._document=t,void 0!==t.hidden&&(this._pageVisibilityHandler=aL.bind(this),t.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){null!==this._pageVisibilityHandler&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(t){return this._timescale=t,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(t){return null!==this._pageVisibilityHandler&&!0===this._document.hidden?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(void 0!==t?t:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function aL(){!1===this._document.hidden&&this.reset()}let aF=new K,aj=new Z,aD=new K,aU=new K,aV=new K;class aW extends t${constructor(){super(),this.type="AudioListener",this.context=aE.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new aN}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(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t),this._timer.update();let e=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(aF,aj,aD),aU.set(0,0,-1).applyQuaternion(aj),aV.set(0,1,0).applyQuaternion(aj),e.positionX){let t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(aF.x,t),e.positionY.linearRampToValueAtTime(aF.y,t),e.positionZ.linearRampToValueAtTime(aF.z,t),e.forwardX.linearRampToValueAtTime(aU.x,t),e.forwardY.linearRampToValueAtTime(aU.y,t),e.forwardZ.linearRampToValueAtTime(aU.z,t),e.upX.linearRampToValueAtTime(aV.x,t),e.upY.linearRampToValueAtTime(aV.y,t),e.upZ.linearRampToValueAtTime(aV.z,t)}else e.setPosition(aF.x,aF.y,aF.z),e.setOrientation(aU.x,aU.y,aU.z,aV.x,aV.y,aV.z)}}class aq extends t${constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void B("Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void B("Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;let e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){return!1===this.hasPlaybackControl?void B("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(t=0){return!1===this.hasPlaybackControl?void B("Audio: this Audio has no playback control."):(this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+t),this.source.onended=null),this.isPlaying=!1,this)}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){return this.detune=t,!0===this.isPlaying&&void 0!==this.source.detune&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){return!1===this.hasPlaybackControl?void B("Audio: this Audio has no playback control."):(this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this)}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return!1===this.hasPlaybackControl?(B("Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){return!1===this.hasPlaybackControl?void B("Audio: this Audio has no playback control."):(this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this)}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}copy(t,e){return(super.copy(t,e),"buffer"!==t.sourceType)?B("Audio: Audio source type cannot be copied."):(this.autoplay=t.autoplay,this.buffer=t.buffer,this.detune=t.detune,this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this.offset=t.offset,this.duration=t.duration,this.playbackRate=t.playbackRate,this.hasPlaybackControl=t.hasPlaybackControl,this.sourceType=t.sourceType,this.filters=t.filters.slice()),this}clone(t){return new this.constructor(this.listener).copy(this,t)}}let aG=new K,aH=new Z,aJ=new K,aX=new K;class a$ extends aq{constructor(t){super(t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(t){return this.panner.refDistance=t,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(t){return this.panner.rolloffFactor=t,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(t){return this.panner.distanceModel=t,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(t){return this.panner.maxDistance=t,this}setDirectionalCone(t,e,i){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=i,this}updateMatrixWorld(t){if(super.updateMatrixWorld(t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(aG,aH,aJ),aX.set(0,0,1).applyQuaternion(aH);let e=this.panner;if(e.positionX){let t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(aG.x,t),e.positionY.linearRampToValueAtTime(aG.y,t),e.positionZ.linearRampToValueAtTime(aG.z,t),e.orientationX.linearRampToValueAtTime(aX.x,t),e.orientationY.linearRampToValueAtTime(aX.y,t),e.orientationZ.linearRampToValueAtTime(aX.z,t)}else e.setPosition(aG.x,aG.y,aG.z),e.setOrientation(aX.x,aX.y,aX.z)}}class aY{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0,e=this.getFrequencyData();for(let i=0;i<e.length;i++)t+=e[i];return t/e.length}}class aZ{constructor(t,e,i){let r,s,n;switch(this.binding=t,this.valueSize=i,e){case"quaternion":r=this._slerp,s=this._slerpAdditive,n=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,n=this._setAdditiveIdentityOther,this.buffer=Array(5*i);break;default:r=this._lerp,s=this._lerpAdditive,n=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=n,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){let i=this.buffer,r=this.valueSize,s=t*r+r,n=this.cumulativeWeight;if(0===n){for(let t=0;t!==r;++t)i[s+t]=i[t];n=e}else{n+=e;let t=e/n;this._mixBufferRegion(i,s,0,t,r)}this.cumulativeWeight=n}accumulateAdditive(t){let e=this.buffer,i=this.valueSize,r=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){let e=this.valueSize,i=this.buffer,r=t*e+e,s=this.cumulativeWeight,n=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){let t=e*this._origIndex;this._mixBufferRegion(i,r,t,1-s,e)}n>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*e,1,e);for(let t=e,s=e+e;t!==s;++t)if(i[t]!==i[t+e]){a.setValue(i,r);break}}saveOriginalState(){let t=this.binding,e=this.buffer,i=this.valueSize,r=i*this._origIndex;t.getValue(e,r);for(let t=i;t!==r;++t)e[t]=e[r+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){let t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,r,s){if(r>=.5)for(let r=0;r!==s;++r)t[e+r]=t[i+r]}_slerp(t,e,i,r){Z.slerpFlat(t,e,t,e,t,i,r)}_slerpAdditive(t,e,i,r,s){let n=this._workIndex*s;Z.multiplyQuaternionsFlat(t,n,t,e,t,i),Z.slerpFlat(t,e,t,e,t,n,r)}_lerp(t,e,i,r,s){let n=1-r;for(let a=0;a!==s;++a){let s=e+a;t[s]=t[s]*n+t[i+a]*r}}_lerpAdditive(t,e,i,r,s){for(let n=0;n!==s;++n){let s=e+n;t[s]=t[s]+t[i+n]*r}}}let aK="\\[\\]\\.:\\/",aQ=RegExp("["+aK+"]","g"),a0="[^"+aK+"]",a1="[^"+aK.replace("\\.","")+"]",a2=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",a0)+/(WCOD+)?/.source.replace("WCOD",a1)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",a0)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",a0)+"$"),a3=["material","materials","bones","map"];class a5{constructor(t,e,i){this.path=e,this.parsedPath=i||a5.parseTrackName(e),this.node=a5.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new a5.Composite(t,e,i):new a5(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(aQ,"")}static parseTrackName(t){let e=a2.exec(t);if(null===e)throw Error("PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){let t=i.nodeName.substring(r+1);-1!==a3.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){let i=function(t){for(let r=0;r<t.length;r++){let s=t[r];if(s.name===e||s.uuid===e)return s;let n=i(s.children);if(n)return n}return null},r=i(t.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)t[e++]=i[r]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,i=e.objectName,r=e.propertyName,s=e.propertyIndex;if(t||(t=a5.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void B("PropertyBinding: No target node found for track: "+this.path+".");if(i){let r=e.objectIndex;switch(i){case"materials":if(!t.material)return void k("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void k("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void k("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===r){r=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void k("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void k("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[i])return void k("PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==r){if(void 0===t[r])return void k("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[r]}}let n=t[r];if(void 0===n)return void k("PropertyBinding: Trying to update property for track: "+e.nodeName+"."+r+" but it wasn't found.",t);let a=this.Versioning.None;this.targetObject=t,!0===t.isMaterial?a=this.Versioning.NeedsUpdate:!0===t.isObject3D&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==s){if("morphTargetInfluences"===r){if(!t.geometry)return void k("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void k("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[s]&&(s=t.morphTargetDictionary[s])}o=this.BindingType.ArrayElement,this.resolvedProperty=n,this.propertyIndex=s}else void 0!==n.fromArray&&void 0!==n.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=n):Array.isArray(n)?(o=this.BindingType.EntireArray,this.resolvedProperty=n):this.propertyName=r;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}a5.Composite=class{constructor(t,e,i){const r=i||a5.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,r=this._bindings[i];void 0!==r&&r.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},a5.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},a5.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},a5.prototype.GetterByBindingType=[a5.prototype._getValue_direct,a5.prototype._getValue_array,a5.prototype._getValue_arrayElement,a5.prototype._getValue_toArray],a5.prototype.SetterByBindingTypeAndVersioning=[[a5.prototype._setValue_direct,a5.prototype._setValue_direct_setNeedsUpdate,a5.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[a5.prototype._setValue_array,a5.prototype._setValue_array_setNeedsUpdate,a5.prototype._setValue_array_setMatrixWorldNeedsUpdate],[a5.prototype._setValue_arrayElement,a5.prototype._setValue_arrayElement_setNeedsUpdate,a5.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[a5.prototype._setValue_fromArray,a5.prototype._setValue_fromArray_setNeedsUpdate,a5.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class a4{constructor(){this.isAnimationObjectGroup=!0,this.uuid=W(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let e=0,i=arguments.length;e!==i;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){let t=this._objects,e=this._indicesByUUID,i=this._paths,r=this._parsedPaths,s=this._bindings,n=s.length,a,o=t.length,h=this.nCachedObjects_;for(let l=0,u=arguments.length;l!==u;++l){let u=arguments[l],c=u.uuid,d=e[c];if(void 0===d){d=o++,e[c]=d,t.push(u);for(let t=0;t!==n;++t)s[t].push(new a5(u,i[t],r[t]))}else if(d<h){a=t[d];let o=--h,l=t[o];e[l.uuid]=d,t[d]=l,e[c]=o,t[o]=u;for(let t=0;t!==n;++t){let e=s[t],n=e[o],a=e[d];e[d]=n,void 0===a&&(a=new a5(u,i[t],r[t])),e[o]=a}}else t[d]!==a&&k("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=h}remove(){let t=this._objects,e=this._indicesByUUID,i=this._bindings,r=i.length,s=this.nCachedObjects_;for(let n=0,a=arguments.length;n!==a;++n){let a=arguments[n],o=a.uuid,h=e[o];if(void 0!==h&&h>=s){let n=s++,l=t[n];e[l.uuid]=h,t[h]=l,e[o]=n,t[n]=a;for(let t=0;t!==r;++t){let e=i[t],r=e[n],s=e[h];e[h]=r,e[n]=s}}}this.nCachedObjects_=s}uncache(){let t=this._objects,e=this._indicesByUUID,i=this._bindings,r=i.length,s=this.nCachedObjects_,n=t.length;for(let a=0,o=arguments.length;a!==o;++a){let o=arguments[a],h=o.uuid,l=e[h];if(void 0!==l)if(delete e[h],l<s){let a=--s,o=t[a],h=--n,u=t[h];e[o.uuid]=l,t[l]=o,e[u.uuid]=a,t[a]=u,t.pop();for(let t=0;t!==r;++t){let e=i[t],r=e[a],s=e[h];e[l]=r,e[a]=s,e.pop()}}else{let s=--n,a=t[s];s>0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0;t!==r;++t){let e=i[t];e[l]=e[s],e.pop()}}}this.nCachedObjects_=s}subscribe_(t,e){let i=this._bindingsIndicesByPath,r=i[t],s=this._bindings;if(void 0!==r)return s[r];let n=this._paths,a=this._parsedPaths,o=this._objects,h=o.length,l=this.nCachedObjects_,u=Array(h);r=s.length,i[t]=r,n.push(t),a.push(e),s.push(u);for(let i=l,r=o.length;i!==r;++i){let r=o[i];u[i]=new a5(r,t,e)}return u}unsubscribe_(t){let e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){let r=this._paths,s=this._parsedPaths,n=this._bindings,a=n.length-1,o=n[a];e[t[a]]=i,n[i]=o,n.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class a6{constructor(t,e,i=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=r;const s=e.tracks,n=s.length,a=Array(n),o={endingStart:2400,endingEnd:2400};for(let t=0;t!==n;++t){const e=s[t].createInterpolant(null);a[t]=e,e.settings&&Object.assign(o,e.settings),e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=Array(n),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,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}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(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i=!1){if(t.fadeOut(e),this.fadeIn(e),!0===i){let i=this._clip.duration,r=t._clip.duration;t.warp(1,r/i,e),this.warp(i/r,1,e)}return this}crossFadeTo(t,e,i=!1){return t.crossFadeFrom(this,e,i)}stopFading(){let t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){let r=this._mixer,s=r.time,n=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);let o=a.parameterPositions,h=a.sampleValues;return o[0]=s,o[1]=s+i,h[0]=t/n,h[1]=e/n,this}stopWarping(){let t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,r){if(!this.enabled)return void this._updateWeight(t);let s=this._startTime;if(null!==s){let r=(t-s)*i;r<0||0===i?e=0:(this._startTime=null,e=i*r)}e*=this._updateTimeScale(t);let n=this._updateTime(e),a=this._updateWeight(t);if(a>0){let t=this._interpolants,e=this._propertyBindings;if(2501===this.blendMode)for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(n),e[i].accumulateAdditive(a);else for(let i=0,s=t.length;i!==s;++i)t[i].evaluate(n),e[i].accumulate(r,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;let i=this._weightInterpolant;if(null!==i){let r=i.evaluate(t)[0];e*=r,t>i.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;let i=this._timeScaleInterpolant;null!==i&&(e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){let e=this._clip.duration,i=this.loop,r=this.time+t,s=this._loopCount,n=2202===i;if(0===t)return -1===s?r:n&&(1&s)==1?e-r:r;if(2200===i){-1===s&&(this._loopCount=0,this._setEndings(!0,!0,!1));s:{if(r>=e)r=e;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:t<0?-1:1})}}else{if(-1===s&&(t>=0?(s=0,this._setEndings(!0,0===this.repetitions,n)):this._setEndings(0===this.repetitions,!0,n)),r>=e||r<0){let i=Math.floor(r/e);r-=e*i,s+=Math.abs(i);let a=this.repetitions-s;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){let e=t<0;this._setEndings(e,!e,n)}else this._setEndings(!1,!1,n);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this._loopCount=s,this.time=r;if(n&&(1&s)==1)return e-r}return r}_setEndings(t,e,i){let r=this._interpolantSettings;i?(r.endingStart=2401,r.endingEnd=2401):(t?r.endingStart=this.zeroSlopeAtStart?2401:2400:r.endingStart=2402,e?r.endingEnd=this.zeroSlopeAtEnd?2401:2400:r.endingEnd=2402)}_scheduleFading(t,e,i){let r=this._mixer,s=r.time,n=this._weightInterpolant;null===n&&(n=r._lendControlInterpolant(),this._weightInterpolant=n);let a=n.parameterPositions,o=n.sampleValues;return a[0]=s,o[0]=e,a[1]=s+t,o[1]=i,this}}let a8=new Float32Array(1);class a9 extends F{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}_bindAction(t,e){let i=t._localRoot||this._root,r=t._clip.tracks,s=r.length,n=t._propertyBindings,a=t._interpolants,o=i.uuid,h=this._bindingsByRootAndName,l=h[o];void 0===l&&(l={},h[o]=l);for(let t=0;t!==s;++t){let s=r[t],h=s.name,u=l[h];if(void 0!==u)++u.referenceCount,n[t]=u;else{if(void 0!==(u=n[t])){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,o,h));continue}let r=e&&e._propertyBindings[t].binding.parsedPath;u=new aZ(a5.create(i,h,r),s.ValueTypeName,s.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,o,h),n[t]=u}a[t].resultBuffer=u.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){let e=(t._localRoot||this._root).uuid,i=t._clip.uuid,r=this._actionsByClip[i];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,i,e)}let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){let e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,i){let r=this._actions,s=this._actionsByClip,n=s[e];if(void 0===n)n={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,s[e]=n;else{let e=n.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=r.length,r.push(t),n.actionByRoot[i]=t}_removeInactiveAction(t){let e=this._actions,i=e[e.length-1],r=t._cacheIndex;i._cacheIndex=r,e[r]=i,e.pop(),t._cacheIndex=null;let s=t._clip.uuid,n=this._actionsByClip,a=n[s],o=a.knownActions,h=o[o.length-1],l=t._byClipCacheIndex;h._byClipCacheIndex=l,o[l]=h,o.pop(),t._byClipCacheIndex=null;let u=a.actionByRoot,c=(t._localRoot||this._root).uuid;delete u[c],0===o.length&&delete n[s],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(t){let e=this._actions,i=t._cacheIndex,r=this._nActiveActions++,s=e[r];t._cacheIndex=r,e[r]=t,s._cacheIndex=i,e[i]=s}_takeBackAction(t){let e=this._actions,i=t._cacheIndex,r=--this._nActiveActions,s=e[r];t._cacheIndex=r,e[r]=t,s._cacheIndex=i,e[i]=s}_addInactiveBinding(t,e,i){let r=this._bindingsByRootAndName,s=this._bindings,n=r[e];void 0===n&&(n={},r[e]=n),n[i]=t,t._cacheIndex=s.length,s.push(t)}_removeInactiveBinding(t){let e=this._bindings,i=t.binding,r=i.rootNode.uuid,s=i.path,n=this._bindingsByRootAndName,a=n[r],o=e[e.length-1],h=t._cacheIndex;o._cacheIndex=h,e[h]=o,e.pop(),delete a[s],0===Object.keys(a).length&&delete n[r]}_lendBinding(t){let e=this._bindings,i=t._cacheIndex,r=this._nActiveBindings++,s=e[r];t._cacheIndex=r,e[r]=t,s._cacheIndex=i,e[i]=s}_takeBackBinding(t){let e=this._bindings,i=t._cacheIndex,r=--this._nActiveBindings,s=e[r];t._cacheIndex=r,e[r]=t,s._cacheIndex=i,e[i]=s}_lendControlInterpolant(){let t=this._controlInterpolants,e=this._nActiveControlInterpolants++,i=t[e];return void 0===i&&((i=new nI(new Float32Array(2),new Float32Array(2),1,a8)).__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){let e=this._controlInterpolants,i=t.__cacheIndex,r=--this._nActiveControlInterpolants,s=e[r];t.__cacheIndex=r,e[r]=t,s.__cacheIndex=i,e[i]=s}clipAction(t,e,i){let r=e||this._root,s=r.uuid,n="string"==typeof t?nD.findByName(r,t):t,a=null!==n?n.uuid:t,o=this._actionsByClip[a],h=null;if(void 0===i&&(i=null!==n?n.blendMode:2500),void 0!==o){let t=o.actionByRoot[s];if(void 0!==t&&t.blendMode===i)return t;h=o.knownActions[0],null===n&&(n=h._clip)}if(null===n)return null;let l=new a6(this,n,e,i);return this._bindAction(l,h),this._addInactiveAction(l,a,s),l}existingAction(t,e){let i=e||this._root,r=i.uuid,s="string"==typeof t?nD.findByName(i,t):t,n=s?s.uuid:t,a=this._actionsByClip[n];return void 0!==a&&a.actionByRoot[r]||null}stopAllAction(){let t=this._actions,e=this._nActiveActions;for(let i=e-1;i>=0;--i)t[i].stop();return this}update(t){t*=this.timeScale;let e=this._actions,i=this._nActiveActions,r=this.time+=t,s=Math.sign(t),n=this._accuIndex^=1;for(let a=0;a!==i;++a)e[a]._update(r,t,s,n);let a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(n);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){let e=this._actions,i=t.uuid,r=this._actionsByClip,s=r[i];if(void 0!==s){let t=s.knownActions;for(let i=0,r=t.length;i!==r;++i){let r=t[i];this._deactivateAction(r);let s=r._cacheIndex,n=e[e.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,n._cacheIndex=s,e[s]=n,e.pop(),this._removeInactiveBindingsForAction(r)}delete r[i]}}uncacheRoot(t){let e=t.uuid,i=this._actionsByClip;for(let t in i){let r=i[t].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}let r=this._bindingsByRootAndName[e];if(void 0!==r)for(let t in r){let e=r[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){let i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class a7 extends ty{constructor(t=1,e=1,i=1,r={}){super(t,e,r),this.isRenderTarget3D=!0,this.depth=i,this.texture=new tv(null,t,e,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class ot{constructor(t){this.value=t}clone(){return new ot(void 0===this.value.clone?this.value:this.value.clone())}}let oe=0;class oi extends F{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:oe++}),this.name="",this.usage=35044,this.uniforms=[]}add(t){return this.uniforms.push(t),this}remove(t){let e=this.uniforms.indexOf(t);return -1!==e&&this.uniforms.splice(e,1),this}setName(t){return this.name=t,this}setUsage(t){return this.usage=t,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(t){this.name=t.name,this.usage=t.usage;let e=t.uniforms;this.uniforms.length=0;for(let t=0,i=e.length;t<i;t++){let i=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0;t<i.length;t++)this.uniforms.push(i[t].clone())}return this}clone(){return new this.constructor().copy(this)}}class or extends e2{constructor(t,e,i=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){let e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){let e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}class os{constructor(t,e,i,r,s,n=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=t,this.type=e,this.itemSize=i,this.elementSize=r,this.count=s,this.normalized=n,this.version=0}set needsUpdate(t){!0===t&&this.version++}setBuffer(t){return this.buffer=t,this}setType(t,e){return this.type=t,this.elementSize=e,this}setItemSize(t){return this.itemSize=t,this}setCount(t){return this.count=t,this}}let on=new tM;class oa{constructor(t,e,i=0,r=1/0){this.ray=new i_(t,e),this.near=i,this.far=r,this.camera=null,this.layers=new tB,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):k("Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return on.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(on),this}intersectObject(t,e=!0,i=[]){return oh(t,this,i,e),i.sort(oo),i}intersectObjects(t,e=!0,i=[]){for(let r=0,s=t.length;r<s;r++)oh(t[r],this,i,e);return i.sort(oo),i}}function oo(t,e){return t.distance-e.distance}function oh(t,e,i,r){let s=!0;if(t.layers.test(e.layers)&&!1===t.raycast(e,i)&&(s=!1),!0===s&&!0===r){let r=t.children;for(let t=0,s=r.length;t<s;t++)oh(r[t],e,i,!0)}}class ol{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,B("Clock: This module has been deprecated. Please use THREE.Timer instead.")}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 t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let e=performance.now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}class ou{constructor(t=1,e=0,i=0){this.radius=t,this.phi=e,this.theta=i}set(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=q(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(q(e/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class oc{constructor(t=1,e=0,i=0){this.radius=t,this.theta=e,this.y=i}set(t,e,i){return this.radius=t,this.theta=e,this.y=i,this}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+i*i),this.theta=Math.atan2(t,i),this.y=e,this}clone(){return new this.constructor().copy(this)}}class od{static{od.prototype.isMatrix2=!0}constructor(t,e,i,r){this.elements=[1,0,0,1],void 0!==t&&this.set(t,e,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(t,e=0){for(let i=0;i<4;i++)this.elements[i]=t[i+e];return this}set(t,e,i,r){let s=this.elements;return s[0]=t,s[2]=e,s[1]=i,s[3]=r,this}}let op=new Y;class of{constructor(t=new Y(Infinity,Infinity),e=new Y(-1/0,-1/0)){this.isBox2=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let i=op.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=Infinity,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,op).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}let om=new K,oy=new K,og=new K,ox=new K,ob=new K,ov=new K,ow=new K;class oM{constructor(t=new K,e=new K){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){om.subVectors(t,this.start),oy.subVectors(this.end,this.start);let i=oy.dot(oy);if(0===i)return 0;let r=oy.dot(om)/i;return e&&(r=q(r,0,1)),r}closestPointToPoint(t,e,i){let r=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(r).add(this.start)}distanceSqToLine3(t,e=ov,i=ow){let r,s,n=1e-8*1e-8,a=this.start,o=t.start,h=this.end,l=t.end;og.subVectors(h,a),ox.subVectors(l,o),ob.subVectors(a,o);let u=og.dot(og),c=ox.dot(ox),d=ox.dot(ob);if(u<=n&&c<=n)return e.copy(a),i.copy(o),e.sub(i),e.dot(e);if(u<=n)r=0,s=q(s=d/c,0,1);else{let t=og.dot(ob);if(c<=n)s=0,r=q(-t/u,0,1);else{let e=og.dot(ox),i=u*c-e*e;r=0!==i?q((e*d-t*c)/i,0,1):0,(s=(e*r+d)/c)<0?(s=0,r=q(-t/u,0,1)):s>1&&(s=1,r=q((e-t)/u,0,1))}}return e.copy(a).addScaledVector(og,r),i.copy(o).addScaledVector(ox,s),e.distanceToSquared(i)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}let oS=new K;class o_ extends t${constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const i=new e1,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 t=0,e=1;t<32;t++,e++){const i=t/32*Math.PI*2,s=e/32*Math.PI*2;r.push(Math.cos(i),Math.sin(i),1,Math.cos(s),Math.sin(s),1)}i.setAttribute("position",new eW(r,3));const s=new rC({fog:!1,toneMapped:!1});this.cone=new rj(i,s),this.add(this.cone),this.update()}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 t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),oS.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(oS),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}let oA=new K,oT=new tM,oC=new tM;class oE extends rj{constructor(t){const e=function t(e){let i=[];!0===e.isBone&&i.push(e);for(let r=0;r<e.children.length;r++)i.push(...t(e.children[r]));return i}(t),i=new e1,r=[],s=[];for(let t=0;t<e.length;t++){const i=e[t];i.parent&&i.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(0,0,0),s.push(0,0,0))}i.setAttribute("position",new eW(r,3)),i.setAttribute("color",new eW(s,3)),super(i,new rC({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1;const n=new t3(255),a=new t3(65280);this.setColors(n,a)}updateMatrixWorld(t){let e=this.bones,i=this.geometry,r=i.getAttribute("position");oC.copy(this.root.matrixWorld).invert();for(let t=0,i=0;t<e.length;t++){let s=e[t];s.parent&&s.parent.isBone&&(oT.multiplyMatrices(oC,s.matrixWorld),oA.setFromMatrixPosition(oT),r.setXYZ(i,oA.x,oA.y,oA.z),oT.multiplyMatrices(oC,s.parent.matrixWorld),oA.setFromMatrixPosition(oT),r.setXYZ(i+1,oA.x,oA.y,oA.z),i+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}setColors(t,e){let i=this.geometry.getAttribute("color");for(let r=0;r<i.count;r+=2)i.setXYZ(r,t.r,t.g,t.b),i.setXYZ(r+1,e.r,e.g,e.b);return i.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class oI extends iL{constructor(t,e,i){super(new s6(e,4,2),new iA({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}let oR=new K,oO=new t3,oz=new t3;class oB extends t${constructor(t,e,i){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const r=new s2(e);r.rotateY(.5*Math.PI),this.material=new iA({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const s=new Float32Array(3*r.getAttribute("position").count);r.setAttribute("color",new ek(s,3)),this.add(new iL(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){let t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{let e=t.geometry.getAttribute("color");oO.copy(this.light.color),oz.copy(this.light.groundColor);for(let t=0,i=e.count;t<i;t++){let r=t<i/2?oO:oz;e.setXYZ(t,r.r,r.g,r.b)}e.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),t.lookAt(oR.setFromMatrixPosition(this.light.matrixWorld).negate())}}class ok extends rj{constructor(t=10,e=10,i=4473924,r=8947848){i=new t3(i),r=new t3(r);const s=e/2,n=t/e,a=t/2,o=[],h=[];for(let t=0,l=0,u=-a;t<=e;t++,u+=n){o.push(-a,0,u,a,0,u),o.push(u,0,-a,u,0,a);const e=t===s?i:r;e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3}const l=new e1;l.setAttribute("position",new eW(o,3)),l.setAttribute("color",new eW(h,3)),super(l,new rC({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class oP extends rj{constructor(t=10,e=16,i=8,r=64,s=4473924,n=8947848){s=new t3(s),n=new t3(n);const a=[],o=[];if(e>1)for(let i=0;i<e;i++){const r=i/e*(2*Math.PI),h=Math.sin(r)*t,l=Math.cos(r)*t;a.push(0,0,0),a.push(h,0,l);const u=1&i?s:n;o.push(u.r,u.g,u.b),o.push(u.r,u.g,u.b)}for(let e=0;e<i;e++){const h=1&e?s:n,l=t-t/i*e;for(let t=0;t<r;t++){let e=t/r*(2*Math.PI),i=Math.sin(e)*l,s=Math.cos(e)*l;a.push(i,0,s),o.push(h.r,h.g,h.b),i=Math.sin(e=(t+1)/r*(2*Math.PI))*l,s=Math.cos(e)*l,a.push(i,0,s),o.push(h.r,h.g,h.b)}}const h=new e1;h.setAttribute("position",new eW(a,3)),h.setAttribute("color",new eW(o,3)),super(h,new rC({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}let oN=new K,oL=new K,oF=new K;class oj extends t${constructor(t,e,i){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",void 0===e&&(e=1);let r=new e1;r.setAttribute("position",new eW([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const s=new rC({fog:!1,toneMapped:!1});this.lightPlane=new rP(r,s),this.add(this.lightPlane),(r=new e1).setAttribute("position",new eW([0,0,0,0,0,1],3)),this.targetLine=new rP(r,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),oN.setFromMatrixPosition(this.light.matrixWorld),oL.setFromMatrixPosition(this.light.target.matrixWorld),oF.subVectors(oL,oN),this.lightPlane.lookAt(oL),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(oL),this.targetLine.scale.z=oF.length()}}let oD=new K,oU=new ae;class oV extends rj{constructor(t){const e=new e1,i=new rC({color:0xffffff,vertexColors:!0,toneMapped:!1}),r=[],s=[],n={};function a(t,e){o(t),o(e)}function o(t){r.push(0,0,0),s.push(0,0,0),void 0===n[t]&&(n[t]=[]),n[t].push(r.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),e.setAttribute("position",new eW(r,3)),e.setAttribute("color",new eW(s,3)),super(e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=n,this.update();const h=new t3(0xffaa00),l=new t3(0xff0000),u=new t3(43775),c=new t3(0xffffff),d=new t3(3355443);this.setColors(h,l,u,c,d)}setColors(t,e,i,r,s){let n=this.geometry.getAttribute("color");return n.setXYZ(0,t.r,t.g,t.b),n.setXYZ(1,t.r,t.g,t.b),n.setXYZ(2,t.r,t.g,t.b),n.setXYZ(3,t.r,t.g,t.b),n.setXYZ(4,t.r,t.g,t.b),n.setXYZ(5,t.r,t.g,t.b),n.setXYZ(6,t.r,t.g,t.b),n.setXYZ(7,t.r,t.g,t.b),n.setXYZ(8,t.r,t.g,t.b),n.setXYZ(9,t.r,t.g,t.b),n.setXYZ(10,t.r,t.g,t.b),n.setXYZ(11,t.r,t.g,t.b),n.setXYZ(12,t.r,t.g,t.b),n.setXYZ(13,t.r,t.g,t.b),n.setXYZ(14,t.r,t.g,t.b),n.setXYZ(15,t.r,t.g,t.b),n.setXYZ(16,t.r,t.g,t.b),n.setXYZ(17,t.r,t.g,t.b),n.setXYZ(18,t.r,t.g,t.b),n.setXYZ(19,t.r,t.g,t.b),n.setXYZ(20,t.r,t.g,t.b),n.setXYZ(21,t.r,t.g,t.b),n.setXYZ(22,t.r,t.g,t.b),n.setXYZ(23,t.r,t.g,t.b),n.setXYZ(24,e.r,e.g,e.b),n.setXYZ(25,e.r,e.g,e.b),n.setXYZ(26,e.r,e.g,e.b),n.setXYZ(27,e.r,e.g,e.b),n.setXYZ(28,e.r,e.g,e.b),n.setXYZ(29,e.r,e.g,e.b),n.setXYZ(30,e.r,e.g,e.b),n.setXYZ(31,e.r,e.g,e.b),n.setXYZ(32,i.r,i.g,i.b),n.setXYZ(33,i.r,i.g,i.b),n.setXYZ(34,i.r,i.g,i.b),n.setXYZ(35,i.r,i.g,i.b),n.setXYZ(36,i.r,i.g,i.b),n.setXYZ(37,i.r,i.g,i.b),n.setXYZ(38,r.r,r.g,r.b),n.setXYZ(39,r.r,r.g,r.b),n.setXYZ(40,s.r,s.g,s.b),n.setXYZ(41,s.r,s.g,s.b),n.setXYZ(42,s.r,s.g,s.b),n.setXYZ(43,s.r,s.g,s.b),n.setXYZ(44,s.r,s.g,s.b),n.setXYZ(45,s.r,s.g,s.b),n.setXYZ(46,s.r,s.g,s.b),n.setXYZ(47,s.r,s.g,s.b),n.setXYZ(48,s.r,s.g,s.b),n.setXYZ(49,s.r,s.g,s.b),n.needsUpdate=!0,this}update(){let t,e,i=this.geometry,r=this.pointMap;if(oU.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),!0===this.camera.reversedDepth)t=1,e=0;else if(2e3===this.camera.coordinateSystem)t=-1,e=1;else if(2001===this.camera.coordinateSystem)t=0,e=1;else throw Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);oW("c",r,i,oU,0,0,t),oW("t",r,i,oU,0,0,e),oW("n1",r,i,oU,-1,-1,t),oW("n2",r,i,oU,1,-1,t),oW("n3",r,i,oU,-1,1,t),oW("n4",r,i,oU,1,1,t),oW("f1",r,i,oU,-1,-1,e),oW("f2",r,i,oU,1,-1,e),oW("f3",r,i,oU,-1,1,e),oW("f4",r,i,oU,1,1,e),oW("u1",r,i,oU,.7,1.1,t),oW("u2",r,i,oU,-.7,1.1,t),oW("u3",r,i,oU,0,2,t),oW("cf1",r,i,oU,-1,0,e),oW("cf2",r,i,oU,1,0,e),oW("cf3",r,i,oU,0,-1,e),oW("cf4",r,i,oU,0,1,e),oW("cn1",r,i,oU,-1,0,t),oW("cn2",r,i,oU,1,0,t),oW("cn3",r,i,oU,0,-1,t),oW("cn4",r,i,oU,0,1,t),i.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function oW(t,e,i,r,s,n,a){oD.set(s,n,a).unproject(r);let o=e[t];if(void 0!==o){let t=i.getAttribute("position");for(let e=0,i=o.length;e<i;e++)t.setXYZ(o[e],oD.x,oD.y,oD.z)}}let oq=new ed;class oG extends rj{constructor(t,e=0xffff00){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),s=new e1;s.setIndex(new ek(i,1)),s.setAttribute("position",new ek(r,3)),super(s,new rC({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(void 0!==this.object&&oq.setFromObject(this.object),oq.isEmpty())return;let t=oq.min,e=oq.max,i=this.geometry.attributes.position,r=i.array;r[0]=e.x,r[1]=e.y,r[2]=e.z,r[3]=t.x,r[4]=e.y,r[5]=e.z,r[6]=t.x,r[7]=t.y,r[8]=e.z,r[9]=e.x,r[10]=t.y,r[11]=e.z,r[12]=e.x,r[13]=e.y,r[14]=t.z,r[15]=t.x,r[16]=e.y,r[17]=t.z,r[18]=t.x,r[19]=t.y,r[20]=t.z,r[21]=e.x,r[22]=t.y,r[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,e){return super.copy(t,e),this.object=t.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class oH extends rj{constructor(t,e=0xffff00){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new e1;r.setIndex(new ek(i,1)),r.setAttribute("position",new eW([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(r,new rC({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){let e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){this.geometry.dispose(),this.material.dispose()}}class oJ extends rP{constructor(t,e=1,i=0xffff00){const r=new e1;r.setAttribute("position",new eW([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),r.computeBoundingSphere(),super(r,new rC({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const s=new e1;s.setAttribute("position",new eW([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),s.computeBoundingSphere(),this.add(new iL(s,new iA({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(t)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}let oX=new K;class o$ extends t${constructor(t=new K(0,0,1),e=new K(0,0,0),i=1,r=0xffff00,a=.2*i,o=.2*a){super(),this.type="ArrowHelper",void 0===s&&((s=new e1).setAttribute("position",new eW([0,0,0,0,1,0],3)),(n=new st(.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new rP(s,new rC({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new iL(n,new iA({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,a,o)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{oX.set(t.z,0,-t.x).normalize();let e=Math.acos(t.y);this.quaternion.setFromAxisAngle(oX,e)}}setLength(t,e=.2*t,i=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class oY extends rj{constructor(t=1){const e=new e1;e.setAttribute("position",new eW([0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],3)),e.setAttribute("color",new eW([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(e,new rC({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,i){let r=new t3,s=this.geometry.attributes.color.array;return r.set(t),r.toArray(s,0),r.toArray(s,3),r.set(e),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class oZ{constructor(){this.type="ShapePath",this.color=new t3,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new sR,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,r){return this.currentPath.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,s,n){return this.currentPath.bezierCurveTo(t,e,i,r,s,n),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){let e,i,r,s,n,a=s$.isClockWise,o=this.subPaths;if(0===o.length)return[];let h=[];if(1===o.length)return i=o[0],(r=new sO).curves=i.curves,h.push(r),h;let l=!a(o[0].getPoints());l=t?!l:l;let u=[],c=[],d=[],p=0;c[0]=void 0,d[p]=[];for(let r=0,n=o.length;r<n;r++)e=a(s=(i=o[r]).getPoints()),(e=t?!e:e)?(!l&&c[p]&&p++,c[p]={s:new sO,p:s},c[p].s.curves=i.curves,l&&p++,d[p]=[]):d[p].push({h:i,p:s[0]});if(!c[0])return function(t){let e=[];for(let i=0,r=t.length;i<r;i++){let r=t[i],s=new sO;s.curves=r.curves,e.push(s)}return e}(o);if(c.length>1){let t=!1,e=0;for(let t=0,e=c.length;t<e;t++)u[t]=[];for(let i=0,r=c.length;i<r;i++){let r=d[i];for(let s=0;s<r.length;s++){let n=r[s],a=!0;for(let r=0;r<c.length;r++)(function(t,e){let i=e.length,r=!1;for(let s=i-1,n=0;n<i;s=n++){let i=e[s],a=e[n],o=a.x-i.x,h=a.y-i.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(i=e[n],o=-o,a=e[s],h=-h),t.y<i.y||t.y>a.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{let e=h*(t.x-i.x)-o*(t.y-i.y);if(0===e)return!0;if(e<0)continue;r=!r}}else{if(t.y!==i.y)continue;if(a.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=a.x)return!0}}return r})(n.p,c[r].p)&&(i!==r&&e++,a?(a=!1,u[r].push(n)):t=!0);a&&u[i].push(n)}}e>0&&!1===t&&(d=u)}for(let t=0,e=c.length;t<e;t++){r=c[t].s,h.push(r),n=d[t];for(let t=0,e=n.length;t<e;t++)r.holes.push(n[t].h)}return h}}class oK extends F{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){void 0===t?B("Controls: connect() now requires an element."):(null!==this.domElement&&this.disconnect(),this.domElement=t)}disconnect(){}dispose(){}update(){}}function oQ(t,e,i,r){let s=function(t){switch(t){case 1009:case 1010:return{byteLength:1,components:1};case 1012:case 1011:case 1016:return{byteLength:2,components:1};case 1017:case 1018:return{byteLength:2,components:4};case 1014:case 1013:case 1015:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw Error(`Unknown texture type ${t}.`)}(r);switch(i){case 1021:return t*e;case 1028:case 1029:return t*e/s.components*s.byteLength;case 1030:case 1031:return t*e*2/s.components*s.byteLength;case 1022:return t*e*3/s.components*s.byteLength;case 1023:case 1033:return t*e*4/s.components*s.byteLength;case 33776:case 33777:case 36196:case 37492:case 37488:case 37489:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case 33778:case 33779:case 37496:case 37490:case 37491:case 37808:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case 35841:case 35843:return Math.max(t,16)*Math.max(e,8)/4;case 35840:case 35842:return Math.max(t,8)*Math.max(e,8)/2;case 37809:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case 37810:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case 37811:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case 37812:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case 37813:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case 37814:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case 37815:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case 37816:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case 37817:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case 37818:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case 37819:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case 37820:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case 37821:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case 36492:case 36494:case 36495:case 36285:case 36286:return Math.ceil(t/4)*Math.ceil(e/4)*16;case 36283:case 36284:return Math.ceil(t/4)*Math.ceil(e/4)*8}throw Error(`Unable to determine texture byte length for ${i} format.`)}class o0{static contain(t,e){let i;return(i=t.image&&t.image.width?t.image.width/t.image.height:1)>e?(t.repeat.x=1,t.repeat.y=i/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/i,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}static cover(t,e){let i;return(i=t.image&&t.image.width?t.image.width/t.image.height:1)>e?(t.repeat.x=e/i,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=i/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}static fill(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}static getByteLength(t,e,i,r){return oQ(t,e,i,r)}}"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"184"}})),"u">typeof window&&(window.__THREE__?B("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="184"),t.s(["ACESFilmicToneMapping",()=>4,"AddEquation",()=>100,"AddOperation",()=>2,"AdditiveAnimationBlendMode",()=>2501,"AdditiveBlending",()=>2,"AgXToneMapping",()=>6,"AlphaFormat",()=>1021,"AlwaysCompare",()=>519,"AlwaysDepth",()=>1,"AlwaysStencilFunc",()=>519,"AmbientLight",()=>ap,"AnimationAction",()=>a6,"AnimationClip",()=>nD,"AnimationLoader",()=>n$,"AnimationMixer",()=>a9,"AnimationObjectGroup",()=>a4,"AnimationUtils",()=>nT,"ArcCurve",()=>su,"ArrayCamera",()=>aP,"ArrowHelper",()=>o$,"AttachedBindMode",()=>d,"Audio",()=>aq,"AudioAnalyser",()=>aY,"AudioContext",()=>aE,"AudioListener",()=>aW,"AudioLoader",()=>aI,"AxesHelper",()=>oY,"BackSide",()=>1,"BasicDepthPacking",()=>3200,"BasicShadowMap",()=>0,"BatchedMesh",()=>rT,"BezierInterpolant",()=>nO,"Bone",()=>i$,"BooleanKeyframeTrack",()=>nB,"Box2",()=>of,"Box3",()=>ed,"Box3Helper",()=>oH,"BoxGeometry",()=>r6,"BoxHelper",()=>oG,"BufferAttribute",()=>ek,"BufferGeometry",()=>e1,"BufferGeometryLoader",()=>av,"ByteType",()=>1010,"Cache",()=>nU,"Camera",()=>ae,"CameraHelper",()=>oV,"CanvasTexture",()=>r1,"CapsuleGeometry",()=>r8,"CatmullRomCurve3",()=>sg,"CineonToneMapping",()=>3,"CircleGeometry",()=>r9,"ClampToEdgeWrapping",()=>1001,"Clock",()=>ol,"Color",()=>t3,"ColorKeyframeTrack",()=>nk,"ColorManagement",()=>tn,"Compatibility",()=>w,"CompressedArrayTexture",()=>rK,"CompressedCubeTexture",()=>rQ,"CompressedTexture",()=>rZ,"CompressedTextureLoader",()=>nY,"ConeGeometry",()=>st,"ConstantAlphaFactor",()=>213,"ConstantColorFactor",()=>211,"Controls",()=>oK,"CubeCamera",()=>ak,"CubeDepthTexture",()=>r5,"CubeReflectionMapping",()=>301,"CubeRefractionMapping",()=>302,"CubeTexture",()=>r0,"CubeTextureLoader",()=>nQ,"CubeUVReflectionMapping",()=>306,"CubicBezierCurve",()=>sw,"CubicBezierCurve3",()=>sM,"CubicInterpolant",()=>nE,"CullFaceBack",()=>1,"CullFaceFront",()=>2,"CullFaceFrontBack",()=>3,"CullFaceNone",()=>0,"Curve",()=>sh,"CurvePath",()=>sI,"CustomBlending",()=>5,"CustomToneMapping",()=>5,"CylinderGeometry",()=>r7,"Cylindrical",()=>oc,"Data3DTexture",()=>tv,"DataArrayTexture",()=>tx,"DataTexture",()=>iY,"DataTextureLoader",()=>n0,"DataUtils",()=>eR,"DecrementStencilOp",()=>7683,"DecrementWrapStencilOp",()=>34056,"DefaultLoadingManager",()=>nq,"DepthFormat",()=>1026,"DepthStencilFormat",()=>1027,"DepthTexture",()=>r3,"DetachedBindMode",()=>p,"DirectionalLight",()=>ad,"DirectionalLightHelper",()=>oj,"DiscreteInterpolant",()=>nR,"DodecahedronGeometry",()=>si,"DoubleSide",()=>2,"DstAlphaFactor",()=>206,"DstColorFactor",()=>208,"DynamicCopyUsage",()=>35050,"DynamicDrawUsage",()=>35048,"DynamicReadUsage",()=>35049,"EdgesGeometry",()=>so,"EllipseCurve",()=>sl,"EqualCompare",()=>514,"EqualDepth",()=>4,"EqualStencilFunc",()=>514,"EquirectangularReflectionMapping",()=>303,"EquirectangularRefractionMapping",()=>304,"Euler",()=>tz,"EventDispatcher",()=>F,"ExternalTexture",()=>r4,"ExtrudeGeometry",()=>sK,"FileLoader",()=>nX,"Float16BufferAttribute",()=>eV,"Float32BufferAttribute",()=>eW,"FloatType",()=>1015,"Fog",()=>t6,"FogExp2",()=>t4,"FramebufferTexture",()=>rY,"FrontSide",()=>0,"Frustum",()=>ra,"FrustumArray",()=>rl,"GLBufferAttribute",()=>os,"GLSL1",()=>"100","GLSL3",()=>"300 es","GreaterCompare",()=>516,"GreaterDepth",()=>6,"GreaterEqualCompare",()=>518,"GreaterEqualDepth",()=>5,"GreaterEqualStencilFunc",()=>518,"GreaterStencilFunc",()=>516,"GridHelper",()=>ok,"Group",()=>tY,"HTMLTexture",()=>r2,"HalfFloatType",()=>1016,"HemisphereLight",()=>n3,"HemisphereLightHelper",()=>oB,"IcosahedronGeometry",()=>s0,"ImageBitmapLoader",()=>aC,"ImageLoader",()=>nK,"ImageUtils",()=>th,"IncrementStencilOp",()=>7682,"IncrementWrapStencilOp",()=>34055,"InstancedBufferAttribute",()=>i0,"InstancedBufferGeometry",()=>ab,"InstancedInterleavedBuffer",()=>or,"InstancedMesh",()=>i9,"Int16BufferAttribute",()=>eF,"Int32BufferAttribute",()=>eD,"Int8BufferAttribute",()=>eP,"IntType",()=>1013,"InterleavedBuffer",()=>e2,"InterleavedBufferAttribute",()=>e5,"Interpolant",()=>nC,"InterpolateBezier",()=>2303,"InterpolateDiscrete",()=>2300,"InterpolateLinear",()=>2301,"InterpolateSmooth",()=>2302,"InterpolationSamplingMode",()=>v,"InterpolationSamplingType",()=>b,"InvertStencilOp",()=>5386,"KeepStencilOp",()=>7680,"KeyframeTrack",()=>nz,"LOD",()=>iy,"LatheGeometry",()=>s1,"Layers",()=>tB,"LessCompare",()=>513,"LessDepth",()=>2,"LessEqualCompare",()=>515,"LessEqualDepth",()=>3,"LessEqualStencilFunc",()=>515,"LessStencilFunc",()=>513,"Light",()=>n2,"LightProbe",()=>ay,"Line",()=>rP,"Line3",()=>oM,"LineBasicMaterial",()=>rC,"LineCurve",()=>sS,"LineCurve3",()=>s_,"LineDashedMaterial",()=>nw,"LineLoop",()=>rD,"LineSegments",()=>rj,"LinearFilter",()=>1006,"LinearInterpolant",()=>nI,"LinearMipMapLinearFilter",()=>1008,"LinearMipMapNearestFilter",()=>1007,"LinearMipmapLinearFilter",()=>1008,"LinearMipmapNearestFilter",()=>1007,"LinearSRGBColorSpace",()=>m,"LinearToneMapping",()=>1,"LinearTransfer",()=>y,"Loader",()=>nG,"LoaderUtils",()=>ax,"LoadingManager",()=>nW,"LoopOnce",()=>2200,"LoopPingPong",()=>2202,"LoopRepeat",()=>2201,"MOUSE",()=>u,"Material",()=>e6,"MaterialBlending",()=>6,"MaterialLoader",()=>ag,"MathUtils",()=>$,"Matrix2",()=>od,"Matrix3",()=>te,"Matrix4",()=>tM,"MaxEquation",()=>104,"Mesh",()=>iL,"MeshBasicMaterial",()=>iA,"MeshDepthMaterial",()=>nx,"MeshDistanceMaterial",()=>nb,"MeshLambertMaterial",()=>ng,"MeshMatcapMaterial",()=>nv,"MeshNormalMaterial",()=>ny,"MeshPhongMaterial",()=>nf,"MeshPhysicalMaterial",()=>np,"MeshStandardMaterial",()=>nd,"MeshToonMaterial",()=>nm,"MinEquation",()=>103,"MirroredRepeatWrapping",()=>1002,"MixOperation",()=>1,"MultiplyBlending",()=>4,"MultiplyOperation",()=>0,"NearestFilter",()=>1003,"NearestMipMapLinearFilter",()=>1005,"NearestMipMapNearestFilter",()=>1004,"NearestMipmapLinearFilter",()=>1005,"NearestMipmapNearestFilter",()=>1004,"NeutralToneMapping",()=>7,"NeverCompare",()=>512,"NeverDepth",()=>0,"NeverStencilFunc",()=>512,"NoBlending",()=>0,"NoColorSpace",()=>"","NoNormalPacking",()=>"","NoToneMapping",()=>0,"NormalAnimationBlendMode",()=>2500,"NormalBlending",()=>1,"NormalGAPacking",()=>"ga","NormalRGPacking",()=>"rg","NotEqualCompare",()=>517,"NotEqualDepth",()=>7,"NotEqualStencilFunc",()=>517,"NumberKeyframeTrack",()=>nP,"Object3D",()=>t$,"ObjectLoader",()=>aM,"ObjectSpaceNormalMap",()=>1,"OctahedronGeometry",()=>s2,"OneFactor",()=>201,"OneMinusConstantAlphaFactor",()=>214,"OneMinusConstantColorFactor",()=>212,"OneMinusDstAlphaFactor",()=>207,"OneMinusDstColorFactor",()=>209,"OneMinusSrcAlphaFactor",()=>205,"OneMinusSrcColorFactor",()=>203,"OrthographicCamera",()=>au,"PCFShadowMap",()=>1,"PCFSoftShadowMap",()=>2,"Path",()=>sR,"PerspectiveCamera",()=>an,"Plane",()=>ri,"PlaneGeometry",()=>s3,"PlaneHelper",()=>oJ,"PointLight",()=>al,"PointLightHelper",()=>oI,"Points",()=>rH,"PointsMaterial",()=>rU,"PolarGridHelper",()=>oP,"PolyhedronGeometry",()=>se,"PositionalAudio",()=>a$,"PropertyBinding",()=>a5,"PropertyMixer",()=>aZ,"QuadraticBezierCurve",()=>sA,"QuadraticBezierCurve3",()=>sT,"Quaternion",()=>Z,"QuaternionKeyframeTrack",()=>nL,"QuaternionLinearInterpolant",()=>nN,"R11_EAC_Format",()=>37488,"RAD2DEG",()=>V,"RED_GREEN_RGTC2_Format",()=>36285,"RED_RGTC1_Format",()=>36283,"REVISION",()=>"184","RG11_EAC_Format",()=>37490,"RGBADepthPacking",()=>3201,"RGBAFormat",()=>1023,"RGBAIntegerFormat",()=>1033,"RGBA_ASTC_10x10_Format",()=>37819,"RGBA_ASTC_10x5_Format",()=>37816,"RGBA_ASTC_10x6_Format",()=>37817,"RGBA_ASTC_10x8_Format",()=>37818,"RGBA_ASTC_12x10_Format",()=>37820,"RGBA_ASTC_12x12_Format",()=>37821,"RGBA_ASTC_4x4_Format",()=>37808,"RGBA_ASTC_5x4_Format",()=>37809,"RGBA_ASTC_5x5_Format",()=>37810,"RGBA_ASTC_6x5_Format",()=>37811,"RGBA_ASTC_6x6_Format",()=>37812,"RGBA_ASTC_8x5_Format",()=>37813,"RGBA_ASTC_8x6_Format",()=>37814,"RGBA_ASTC_8x8_Format",()=>37815,"RGBA_BPTC_Format",()=>36492,"RGBA_ETC2_EAC_Format",()=>37496,"RGBA_PVRTC_2BPPV1_Format",()=>35843,"RGBA_PVRTC_4BPPV1_Format",()=>35842,"RGBA_S3TC_DXT1_Format",()=>33777,"RGBA_S3TC_DXT3_Format",()=>33778,"RGBA_S3TC_DXT5_Format",()=>33779,"RGBDepthPacking",()=>3202,"RGBFormat",()=>1022,"RGBIntegerFormat",()=>1032,"RGB_BPTC_SIGNED_Format",()=>36494,"RGB_BPTC_UNSIGNED_Format",()=>36495,"RGB_ETC1_Format",()=>36196,"RGB_ETC2_Format",()=>37492,"RGB_PVRTC_2BPPV1_Format",()=>35841,"RGB_PVRTC_4BPPV1_Format",()=>35840,"RGB_S3TC_DXT1_Format",()=>33776,"RGDepthPacking",()=>3203,"RGFormat",()=>1030,"RGIntegerFormat",()=>1031,"RawShaderMaterial",()=>nc,"Ray",()=>i_,"Raycaster",()=>oa,"RectAreaLight",()=>af,"RedFormat",()=>1028,"RedIntegerFormat",()=>1029,"ReinhardToneMapping",()=>2,"RenderTarget",()=>ty,"RenderTarget3D",()=>a7,"RepeatWrapping",()=>1e3,"ReplaceStencilOp",()=>7681,"ReverseSubtractEquation",()=>102,"ReversedDepthFuncs",()=>L,"RingGeometry",()=>s5,"SIGNED_R11_EAC_Format",()=>37489,"SIGNED_RED_GREEN_RGTC2_Format",()=>36286,"SIGNED_RED_RGTC1_Format",()=>36284,"SIGNED_RG11_EAC_Format",()=>37491,"SRGBColorSpace",()=>f,"SRGBTransfer",()=>g,"Scene",()=>t8,"ShaderMaterial",()=>nu,"ShadowMaterial",()=>ns,"Shape",()=>sO,"ShapeGeometry",()=>s4,"ShapePath",()=>oZ,"ShapeUtils",()=>s$,"ShortType",()=>1011,"Skeleton",()=>iQ,"SkeletonHelper",()=>oE,"SkinnedMesh",()=>iX,"Source",()=>tu,"Sphere",()=>eJ,"SphereGeometry",()=>s6,"Spherical",()=>ou,"SphericalHarmonics3",()=>am,"SplineCurve",()=>sC,"SpotLight",()=>ao,"SpotLightHelper",()=>o_,"Sprite",()=>ic,"SpriteMaterial",()=>e8,"SrcAlphaFactor",()=>204,"SrcAlphaSaturateFactor",()=>210,"SrcColorFactor",()=>202,"StaticCopyUsage",()=>35046,"StaticDrawUsage",()=>35044,"StaticReadUsage",()=>35045,"StereoCamera",()=>aB,"StreamCopyUsage",()=>35042,"StreamDrawUsage",()=>35040,"StreamReadUsage",()=>35041,"StringKeyframeTrack",()=>nF,"SubtractEquation",()=>101,"SubtractiveBlending",()=>3,"TOUCH",()=>c,"TangentSpaceNormalMap",()=>0,"TetrahedronGeometry",()=>s8,"Texture",()=>tf,"TextureLoader",()=>n1,"TextureUtils",()=>o0,"Timer",()=>aN,"TimestampQuery",()=>x,"TorusGeometry",()=>s9,"TorusKnotGeometry",()=>s7,"Triangle",()=>ec,"TriangleFanDrawMode",()=>2,"TriangleStripDrawMode",()=>1,"TrianglesDrawMode",()=>0,"TubeGeometry",()=>nt,"UVMapping",()=>300,"Uint16BufferAttribute",()=>ej,"Uint32BufferAttribute",()=>eU,"Uint8BufferAttribute",()=>eN,"Uint8ClampedBufferAttribute",()=>eL,"Uniform",()=>ot,"UniformsGroup",()=>oi,"UniformsUtils",()=>nl,"UnsignedByteType",()=>1009,"UnsignedInt101111Type",()=>35899,"UnsignedInt248Type",()=>1020,"UnsignedInt5999Type",()=>35902,"UnsignedIntType",()=>1014,"UnsignedShort4444Type",()=>1017,"UnsignedShort5551Type",()=>1018,"UnsignedShortType",()=>1012,"VSMShadowMap",()=>3,"Vector2",()=>Y,"Vector3",()=>K,"Vector4",()=>tm,"VectorKeyframeTrack",()=>nj,"VideoFrameTexture",()=>r$,"VideoTexture",()=>rX,"WebGL3DRenderTarget",()=>tw,"WebGLArrayRenderTarget",()=>tb,"WebGLCoordinateSystem",()=>2e3,"WebGLRenderTarget",()=>tg,"WebGPUCoordinateSystem",()=>2001,"WebXRController",()=>tK,"WireframeGeometry",()=>ne,"WrapAroundEnding",()=>2402,"ZeroCurvatureEnding",()=>2400,"ZeroFactor",()=>200,"ZeroSlopeEnding",()=>2401,"ZeroStencilOp",()=>0,"cloneUniforms",()=>nn,"createCanvasElement",()=>T,"createElementNS",()=>A,"error",()=>k,"getByteLength",()=>oQ,"getConsoleFunction",()=>R,"getUnlitUniformColorSpace",()=>nh,"log",()=>O,"mergeUniforms",()=>na,"probeAsync",()=>N,"setConsoleFunction",()=>I,"warn",()=>B,"warnOnce",()=>P])},16265,t=>{"use strict";var e=t.i(22441),i=t.i(70089),r=t.i(21348);let s={x:.5,y:.5,inside:!1},n=(0,i.createContext)(null),a=()=>{let t=(0,i.useContext)(n);if(!t)throw Error("usePointer must be used within PointerProvider");return t};function o({children:t}){let a=(0,i.useMemo)(()=>new r.Vector2(.5,.5),[]),o=(0,i.useRef)(!1),h=(0,i.useRef)(s),l=(0,i.useRef)(new Set),u=(0,i.useRef)(null),c=(0,i.useMemo)(()=>({uv:a,insideRef:o,subscribe:t=>(l.current.add(t),()=>{l.current.delete(t)}),getSnapshot:()=>h.current,getServerSnapshot:()=>s}),[a]);return(0,i.useEffect)(()=>{let t=()=>{for(let t of(u.current=null,l.current))t()},e=e=>{let i=h.current;(i.x!==e.x||i.y!==e.y||i.inside!==e.inside)&&(h.current=e,o.current=e.inside,a.set(e.x,e.y),null===u.current&&(u.current=window.requestAnimationFrame(t)))},i=t=>{let i=Math.max(1,window.innerWidth),r=Math.max(1,window.innerHeight);e({x:t.clientX/i,y:1-t.clientY/r,inside:!0})},r=()=>{e({x:.5,y:.5,inside:!1})},s={capture:!0,passive:!0};return window.addEventListener("pointermove",i,s),window.addEventListener("pointerdown",i,s),window.addEventListener("pointerover",i,s),window.addEventListener("blur",r,s),document.addEventListener("mouseleave",r,s),document.addEventListener("visibilitychange",r,s),()=>{window.removeEventListener("pointermove",i,!0),window.removeEventListener("pointerdown",i,!0),window.removeEventListener("pointerover",i,!0),window.removeEventListener("blur",r,!0),document.removeEventListener("mouseleave",r,!0),document.removeEventListener("visibilitychange",r,!0),null!==u.current&&window.cancelAnimationFrame(u.current)}},[o,a]),(0,e.jsx)(n.Provider,{value:c,children:t})}t.s(["PointerProvider",()=>o,"usePointer",0,a,"usePointerPosition",0,()=>{let t=a();return(0,i.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot)}])},90975,t=>{"use strict";var e=t.i(22441),i=t.i(70089);let r=(0,i.createContext)(void 0);function s(){let t=(0,i.useContext)(r);if(!t)throw Error("useThemeMode must be used within ThemeModeProvider");return t}function n({children:t,defaultTheme:s="system"}){let[n,a]=(0,i.useState)(s),[o,h]=(0,i.useState)("light"),[l,u]=(0,i.useState)(!1);(0,i.useEffect)(()=>{u(!0)},[]),(0,i.useEffect)(()=>{if(!l)return;let t=localStorage.getItem("theme");t&&["light","dark","system"].includes(t)&&a(t)},[l]),(0,i.useEffect)(()=>{if(!l)return;localStorage.setItem("theme",n);let t=()=>"system"===n?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n,e=t();h(e);let i=document.documentElement;if(i.classList.remove("light","dark"),i.classList.add(e),"system"===n){let e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{let e=t();h(e),i.classList.remove("light","dark"),i.classList.add(e)};return e.addEventListener("change",r),()=>e.removeEventListener("change",r)}},[n,l]);let c=(0,i.useMemo)(()=>({theme:n,setTheme:a,resolvedTheme:o}),[n,o]);return(0,e.jsx)(r.Provider,{value:c,children:t})}t.s(["ThemeModeProvider",()=>n,"useThemeMode",()=>s])},23525,t=>{"use strict";var e=t.i(22441),i=t.i(70089);let r=(0,i.createContext)(void 0),s="sound";function n(){let t=(0,i.useContext)(r);if(!t)throw Error("useShellMedia must be used within ShellMediaProvider");return t}function a({children:t}){let[n,a]=(0,i.useState)(!1),[o,h]=(0,i.useState)(!1),[l,u]=(0,i.useState)(!0),c=(0,i.useRef)(null),[d,p]=(0,i.useState)(!1),f=n&&o,m=(0,i.useCallback)(t=>{u(t),localStorage.setItem(s,t?"on":"off")},[]);(0,i.useEffect)(()=>{p(!0)},[]),(0,i.useEffect)(()=>{if(!d)return;let t=localStorage.getItem(s);"off"===t?u(!1):"on"===t&&u(!0)},[d]),(0,i.useEffect)(()=>{d&&t().then(t=>{a(!!t)}).catch(t=>{console.warn("Failed to load fonts:",t),a(!1)});async function t(){try{let t=`url(${document.baseURI.replace(/\/[^/]*$/,"")}/assets/fonts/TikTokSans.ttf)`,e=new FontFace("tiktok",t,{display:"block",weight:"100 900"});await e.load(),document.fonts.add(e);let i=`url(${document.baseURI.replace(/\/[^/]*$/,"")}/assets/fonts/GeistMono[wght].ttf)`,r=new FontFace("mono",i,{display:"block",weight:"100 900"});await r.load(),document.fonts.add(r);let s=`url(${document.baseURI.replace(/\/[^/]*$/,"")}/assets/fonts/DepartureMono-Regular.otf)`,n=new FontFace("tronica-mono",s,{display:"block",weight:"400"});return await n.load(),document.fonts.add(n),!0}catch(t){return console.warn("Failed to load fonts:",t),!1}}},[d]),(0,i.useEffect)(()=>{if(!d)return;h(!1);let t=!1,e=document.baseURI.replace(/\/[^/]*$/,""),i=new Audio;i.preload="auto",i.loop=!0,i.volume=.35,i.src=`${e}/assets/bgm.mp3`;let r=!1,s=()=>{i.removeEventListener("canplaythrough",o),i.removeEventListener("loadeddata",l),i.removeEventListener("error",u)},n=window.setTimeout(()=>{t||r||(r=!0,s(),console.warn("BGM load timed out"),h(!1))},45e3),a=()=>{t||r||(r=!0,window.clearTimeout(n),s(),c.current=i,h(!0))},o=()=>a(),l=()=>{i.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA&&a()},u=()=>void(!t&&!r&&(r=!0,window.clearTimeout(n),s(),console.warn("Failed to load BGM"),h(!1)));return i.addEventListener("canplaythrough",o),i.addEventListener("loadeddata",l),i.addEventListener("error",u),i.load(),()=>{t=!0,window.clearTimeout(n),s(),c.current===i&&(c.current=null),i.pause(),i.removeAttribute("src"),i.load()}},[d]);let y=(0,i.useRef)(l);return y.current=l,(0,i.useEffect)(()=>{if(!d)return;let t=t=>{t.defaultPrevented||t.repeat||t.metaKey||t.ctrlKey||t.altKey||(t=>{if(!(t instanceof HTMLElement))return!1;let e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||t.isContentEditable})(t.target)||"s"===t.key.toLowerCase()&&m(!y.current)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[d,m]),(0,i.useEffect)(()=>{if(!d||!f)return;let t=c.current;if(!t)return;if(!l)return void t.pause();let e=()=>{t.play().catch(()=>{})};e();let i=()=>{e(),document.removeEventListener("pointerdown",i)};return document.addEventListener("pointerdown",i,{passive:!0}),()=>document.removeEventListener("pointerdown",i)},[d,f,l]),(0,e.jsx)(r.Provider,{value:{fontsAssetReady:n,bgmAssetReady:o,fontsLoaded:f,soundEnabled:l,setSoundEnabled:m},children:t})}t.s(["ShellMediaProvider",()=>a,"useShellMedia",()=>n])},11818,t=>{"use strict";t.i(25469);var e=t.i(22441),i=t.i(70089),r=t.i(20575),s=t.i(87775),n=t.i(197),a=t.i(10008),o=t.i(61427),h=i,l=t.i(64896);function u(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}class c extends h.Component{getSnapshotBeforeUpdate(t){let e=this.props.childRef.current;if((0,o.isHTMLElement)(e)&&t.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let t=e.offsetParent,i=(0,o.isHTMLElement)(t)&&t.offsetWidth||0,r=(0,o.isHTMLElement)(t)&&t.offsetHeight||0,s=getComputedStyle(e),n=this.props.sizeRef.current;n.height=parseFloat(s.height),n.width=parseFloat(s.width),n.top=e.offsetTop,n.left=e.offsetLeft,n.right=i-n.width-n.left,n.bottom=r-n.height-n.top,n.direction=s.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function d({children:t,isPresent:r,anchorX:s,anchorY:n,root:a,pop:o}){let d=(0,h.useId)(),p=(0,h.useRef)(null),f=(0,h.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:m}=(0,h.useContext)(l.MotionConfigContext),y=function(...t){return i.useCallback(function(...t){return e=>{let i=!1,r=t.map(t=>{let r=u(t,e);return i||"function"!=typeof r||(i=!0),r});if(i)return()=>{for(let e=0;e<r.length;e++){let i=r[e];"function"==typeof i?i():u(t[e],null)}}}}(...t),t)}(p,t.props?.ref??t?.ref);return(0,h.useInsertionEffect)(()=>{let{width:t,height:e,top:i,left:h,right:l,bottom:u,direction:c}=f.current;if(r||!1===o||!p.current||!t||!e)return;let y="rtl"===c,g="left"===s?y?`right: ${l}`:`left: ${h}`:y?`left: ${h}`:`right: ${l}`,x="bottom"===n?`bottom: ${u}`:`top: ${i}`;p.current.dataset.motionPopId=d;let b=document.createElement("style");m&&(b.nonce=m);let v=a??document.head;return v.appendChild(b),b.sheet&&b.sheet.insertRule(`
          [data-motion-pop-id="${d}"] {
            position: absolute !important;
            width: ${t}px !important;
            height: ${e}px !important;
            ${g}px !important;
            ${x}px !important;
          }
        `),()=>{p.current?.removeAttribute("data-motion-pop-id"),v.contains(b)&&v.removeChild(b)}},[r]),(0,e.jsx)(c,{isPresent:r,childRef:p,sizeRef:f,pop:o,children:!1===o?t:h.cloneElement(t,{ref:y})})}let p=({children:t,initial:r,isPresent:n,onExitComplete:o,custom:h,presenceAffectsLayout:l,mode:u,anchorX:c,anchorY:p,root:m})=>{let y=(0,s.useConstant)(f),g=(0,i.useId)(),x=!0,b=(0,i.useMemo)(()=>(x=!1,{id:g,initial:r,isPresent:n,custom:h,onExitComplete:t=>{for(let e of(y.set(t,!0),y.values()))if(!e)return;o&&o()},register:t=>(y.set(t,!1),()=>y.delete(t))}),[n,y,o]);return l&&x&&(b={...b}),(0,i.useMemo)(()=>{y.forEach((t,e)=>y.set(e,!1))},[n]),i.useEffect(()=>{n||y.size||!o||o()},[n]),t=(0,e.jsx)(d,{pop:"popLayout"===u,isPresent:n,anchorX:c,anchorY:p,root:m,children:t}),(0,e.jsx)(a.PresenceContext.Provider,{value:b,children:t})};function f(){return new Map}var m=t.i(30385);let y=t=>t.key||"";function g(t){let e=[];return i.Children.forEach(t,t=>{(0,i.isValidElement)(t)&&e.push(t)}),e}let x=({children:t,custom:a,initial:o=!0,onExitComplete:h,presenceAffectsLayout:l=!0,mode:u="sync",propagate:c=!1,anchorX:d="left",anchorY:f="top",root:x})=>{let[b,v]=(0,m.usePresence)(c),w=(0,i.useMemo)(()=>g(t),[t]),M=c&&!b?[]:w.map(y),S=(0,i.useRef)(!0),_=(0,i.useRef)(w),A=(0,s.useConstant)(()=>new Map),T=(0,i.useRef)(new Set),[C,E]=(0,i.useState)(w),[I,R]=(0,i.useState)(w);(0,n.useIsomorphicLayoutEffect)(()=>{S.current=!1,_.current=w;for(let t=0;t<I.length;t++){let e=y(I[t]);M.includes(e)?(A.delete(e),T.current.delete(e)):!0!==A.get(e)&&A.set(e,!1)}},[I,M.length,M.join("-")]);let O=[];if(w!==C){let t=[...w];for(let e=0;e<I.length;e++){let i=I[e],r=y(i);M.includes(r)||(t.splice(e,0,i),O.push(i))}return"wait"===u&&O.length&&(t=O),R(g(t)),E(w),null}let{forceRender:z}=(0,i.useContext)(r.LayoutGroupContext);return(0,e.jsx)(e.Fragment,{children:I.map(t=>{let i=y(t),r=(!c||!!b)&&(w===I||M.includes(i));return(0,e.jsx)(p,{isPresent:r,initial:(!S.current||!!o)&&void 0,custom:a,presenceAffectsLayout:l,mode:u,root:x,onExitComplete:r?void 0:()=>{if(T.current.has(i)||!A.has(i))return;T.current.add(i),A.set(i,!0);let t=!0;A.forEach(e=>{e||(t=!1)}),t&&(z?.(),R(_.current),c&&v?.(),h&&h())},anchorX:d,anchorY:f,children:t},i)})})};t.s(["AnimatePresence",()=>x],11818)},88380,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r={assign:function(){return h},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return o}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});function n(t){let e={};for(let[i,r]of t.entries()){let t=e[i];void 0===t?e[i]=r:Array.isArray(t)?t.push(r):e[i]=[t,r]}return e}function a(t){return"string"==typeof t?t:("number"!=typeof t||isNaN(t))&&"boolean"!=typeof t?"":String(t)}function o(t){let e=new URLSearchParams;for(let[i,r]of Object.entries(t))if(Array.isArray(r))for(let t of r)e.append(i,a(t));else e.set(i,a(r));return e}function h(t,...e){for(let i of e){for(let e of i.keys())t.delete(e);for(let[e,r]of i.entries())t.append(e,r)}return t}},61618,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r={formatUrl:function(){return o},formatWithValidation:function(){return l},urlObjectKeys:function(){return h}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=t.r(44066)._(t.r(88380)),a=/https?|ftp|gopher|file/;function o(t){let{auth:e,hostname:i}=t,r=t.protocol||"",s=t.pathname||"",o=t.hash||"",h=t.query||"",l=!1;e=e?encodeURIComponent(e).replace(/%3A/i,":")+"@":"",t.host?l=e+t.host:i&&(l=e+(~i.indexOf(":")?`[${i}]`:i),t.port&&(l+=":"+t.port)),h&&"object"==typeof h&&(h=String(n.urlQueryToSearchParams(h)));let u=t.search||h&&`?${h}`||"";return r&&!r.endsWith(":")&&(r+=":"),t.slashes||(!r||a.test(r))&&!1!==l?(l="//"+(l||""),s&&"/"!==s[0]&&(s="/"+s)):l||(l=""),o&&"#"!==o[0]&&(o="#"+o),u&&"?"!==u[0]&&(u="?"+u),s=s.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${r}${l}${s}${u}${o}`}let h=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(t){return o(t)}},46711,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"useMergedRef",{enumerable:!0,get:function(){return s}});let r=t.r(70089);function s(t,e){let i=(0,r.useRef)(null),s=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let t=i.current;t&&(i.current=null,t());let e=s.current;e&&(s.current=null,e())}else t&&(i.current=n(t,r)),e&&(s.current=n(e,r))},[t,e])}function n(t,e){if("function"!=typeof t)return t.current=e,()=>{t.current=null};{let i=t(e);return"function"==typeof i?i:()=>t(null)}}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),e.exports=i.default)},82213,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return v},NormalizeError:function(){return x},PageNotFoundError:function(){return b},SP:function(){return m},ST:function(){return y},WEB_VITALS:function(){return n},execOnce:function(){return a},getDisplayName:function(){return c},getLocationOrigin:function(){return l},getURL:function(){return u},isAbsoluteUrl:function(){return h},isResSent:function(){return d},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return M}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function a(t){let e,i=!1;return(...r)=>(i||(i=!0,e=t(...r)),e)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,h=t=>o.test(t);function l(){let{protocol:t,hostname:e,port:i}=window.location;return`${t}//${e}${i?":"+i:""}`}function u(){let{href:t}=window.location,e=l();return t.substring(e.length)}function c(t){return"string"==typeof t?t:t.displayName||t.name||"Unknown"}function d(t){return t.finished||t.headersSent}function p(t){let e=t.split("?");return e[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(e[1]?`?${e.slice(1).join("?")}`:"")}async function f(t,e){let i=e.res||e.ctx&&e.ctx.res;if(!t.getInitialProps)return e.ctx&&e.Component?{pageProps:await f(e.Component,e.ctx)}:{};let r=await t.getInitialProps(e);if(i&&d(i))return r;if(!r)throw Object.defineProperty(Error(`"${c(t)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r}let m="u">typeof performance,y=m&&["mark","measure","getEntriesByName"].every(t=>"function"==typeof performance[t]);class g extends Error{}class x extends Error{}class b extends Error{constructor(t){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${t}`}}class v extends Error{constructor(t,e){super(),this.message=`Failed to load static file for page: ${t} ${e}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function M(t){return JSON.stringify({message:t.message,stack:t.stack})}},68630,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"isLocalURL",{enumerable:!0,get:function(){return n}});let r=t.r(82213),s=t.r(5673);function n(t){if(!(0,r.isAbsoluteUrl)(t))return!0;try{let e=(0,r.getLocationOrigin)(),i=new URL(t,e);return i.origin===e&&(0,s.hasBasePath)(i.pathname)}catch(t){return!1}}},68328,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"errorOnce",{enumerable:!0,get:function(){return r}});let r=t=>{}},49936,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r={default:function(){return g},useLinkStatus:function(){return b}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=t.r(44066),a=t.r(22441),o=n._(t.r(70089)),h=t.r(61618),l=t.r(32283),u=t.r(46711),c=t.r(82213),d=t.r(94562);t.r(94394);let p=t.r(29734),f=t.r(68630),m=t.r(41581);function y(t){return"string"==typeof t?t:(0,h.formatUrl)(t)}function g(e){var i;let r,s,n,[h,g]=(0,o.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,o.useRef)(null),{href:v,as:w,children:M,prefetch:S=null,passHref:_,replace:A,shallow:T,scroll:C,onClick:E,onMouseEnter:I,onTouchStart:R,legacyBehavior:O=!1,onNavigate:z,ref:B,unstable_dynamicOnHover:k,...P}=e;r=M,O&&("string"==typeof r||"number"==typeof r)&&(r=(0,a.jsx)("a",{children:r}));let N=o.default.useContext(l.AppRouterContext),L=!1!==S,F=!1!==S?null===(i=S)||"auto"===i?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,{href:j,as:D}=o.default.useMemo(()=>{let t=y(v);return{href:t,as:w?y(w):t}},[v,w]);if(O){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});s=o.default.Children.only(r)}let U=O?s&&"object"==typeof s&&s.ref:B,V=o.default.useCallback(t=>(null!==N&&(b.current=(0,p.mountLinkInstance)(t,j,N,F,L,g)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(t)}),[L,j,N,F,g]),W={ref:(0,u.useMergedRef)(V,U),onClick(e){O||"function"!=typeof E||E(e),O&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(e),!N||e.defaultPrevented||function(e,i,r,s,n,a,h){if("u">typeof window){let l,{nodeName:u}=e.currentTarget;if("A"===u.toUpperCase()&&((l=e.currentTarget.getAttribute("target"))&&"_self"!==l||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)||e.currentTarget.hasAttribute("download"))return;if(!(0,f.isLocalURL)(i)){n&&(e.preventDefault(),location.replace(i));return}if(e.preventDefault(),h){let t=!1;if(h({preventDefault:()=>{t=!0}}),t)return}let{dispatchNavigateAction:c}=t.r(4938);o.default.startTransition(()=>{c(r||i,n?"replace":"push",a??!0,s.current)})}}(e,j,D,b,A,C,z)},onMouseEnter(t){O||"function"!=typeof I||I(t),O&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(t),N&&L&&(0,p.onNavigationIntent)(t.currentTarget,!0===k)},onTouchStart:function(t){O||"function"!=typeof R||R(t),O&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(t),N&&L&&(0,p.onNavigationIntent)(t.currentTarget,!0===k)}};return(0,c.isAbsoluteUrl)(D)?W.href=D:O&&!_&&("a"!==s.type||"href"in s.props)||(W.href=(0,d.addBasePath)(D)),n=O?o.default.cloneElement(s,W):(0,a.jsx)("a",{...P,...W,children:r}),(0,a.jsx)(x.Provider,{value:h,children:n})}t.r(68328);let x=(0,o.createContext)(p.IDLE_LINK_STATUS),b=()=>(0,o.useContext)(x);("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),e.exports=i.default)},41242,t=>{"use strict";t.s(["DOTTED_BORDER_ACTIVE_BOTTOM",0,"before:border-b-l1","DOTTED_BORDER_ACTIVE_BOTTOM_WHITE",0,"before:border-b-white","DOTTED_BORDER_BASE",0,"relative before:content-[''] before:absolute before:inset-0 before:border-2 before:border-dotted before:border-transparent before:pointer-events-none before:transition-colors before:duration-200 lg:hover:before:border-l1","DOTTED_BORDER_BASE_WHITE",0,"relative before:content-[''] before:absolute before:inset-0 before:border-2 before:border-dotted before:border-transparent before:pointer-events-none before:transition-colors before:duration-200 lg:hover:before:border-white"])},80894,t=>{"use strict";var e=t.i(22441),i=t.i(49936),r=t.i(76973),s=t.i(73475),n=t.i(29680),a=t.i(41242);function o({href:t,children:o,className:h,dotted:l=!1,dottedTone:u="default",useActiveClass:c=!1,activeClass:d,style:p,onClick:f,...m}){let{startNavigation:y}=(0,s.useRouteTransitionController)(),g=(0,r.usePathname)(),x="string"==typeof t?t:t?.pathname||"",b="white"===u?a.DOTTED_BORDER_BASE_WHITE:a.DOTTED_BORDER_BASE,v="white"===u?a.DOTTED_BORDER_ACTIVE_BOTTOM_WHITE:a.DOTTED_BORDER_ACTIVE_BOTTOM,w=[l&&b,l&&x===g&&c&&(void 0!==d?d:v),h].filter(Boolean).join(" ");return(0,e.jsx)(i.default,{href:t,className:w,style:p,onClick:e=>{if("function"==typeof f&&f(e),!e.defaultPrevented&&0===e.button&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)){e.preventDefault();let i="string"==typeof t?t:t?.pathname||"";if(i){if(i===g)return void n.scrollEnv.lenisScrollTo(0,{lerp:.1});y(i)}}},...m,children:o})}t.s(["default",()=>o])},71358,19668,t=>{"use strict";var e=t.i(22441),i=t.i(70089);function r(t){let{once:e=!0,threshold:r=.1,root:s=null,rootMargin:n}=t??{},[a,o]=(0,i.useState)(null),[h,l]=(0,i.useState)(!1),u=(0,i.useCallback)(t=>{o(t)},[]);return(0,i.useEffect)(()=>{if(!a||e&&h)return;let t=new IntersectionObserver(i=>{let[r]=i;r&&(r.isIntersecting?(l(!0),e&&t.disconnect()):e||l(!1))},{threshold:r,root:s,rootMargin:n});return t.observe(a),()=>{t.disconnect()}},[a,e,h,r,s,n]),{ref:u,hasEnteredViewport:h}}t.s(["useHasEnteredViewport",()=>r],19668);var s=t.i(90975),n=t.i(73475);let a="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*+-=?/<>[]{}",o={light:["#c0fe04","#607F02"],dark:["#c0fe04","#DFFF81"]},h=new Set,l=null,u=()=>{let t=Math.floor(Math.random()*a.length);return a[t]},c=t=>t.map((t,i)=>{if("text"===t.kind){let r,s;return(0,e.jsx)("span",{children:(r=t.value,s=`text-${i}`,r.split("\n").flatMap((t,i,r)=>i<r.length-1?[t,(0,e.jsx)("br",{},`${s}-br-${i}`)]:[t]))},`text-${i}`)}return(0,e.jsx)("span",{children:t.settled},`slot-${i}`)});function d({text:t,parts:a,className:d,style:p,onClick:f,onMouseEnter:m,onMouseLeave:y,onPointerEnter:g,onPointerLeave:x,onPointerDown:b,onFocus:v,onBlur:w,colors:M=o,startDelayMs:S=0,letterDelayMs:_=80,reverse:A=!1,scrambleColors:T=!0}){let[C,E]=(0,i.useState)(0),[I,R]=(0,i.useState)(!1),{resolvedTheme:O}=(0,s.useThemeMode)(),{allowScrambleLines:z}=(0,n.useRouteTransitionController)(),{ref:B,hasEnteredViewport:k}=r({threshold:.1}),P=(0,i.useRef)(0),N=(0,i.useRef)(!1),L=(0,i.useMemo)(()=>(a??[t??""]).map(t=>{if("string"==typeof t)return{kind:"text",value:t};let e=t.scramble??(t.length>0?" ".repeat(t.length):"");return{kind:"slot",length:t.length,scramble:e.slice(0,t.length).padEnd(t.length," "),settled:t.settled,className:t.className}}),[a,t]),F=(0,i.useMemo)(()=>L.reduce((t,e)=>t+("text"===e.kind?e.value.length:e.length),0),[L]),j=2*_,D=2*j,U=(0,i.useMemo)(()=>S+(F>0?(F-1)*_:0)+D,[F,S,_,D]);(0,i.useEffect)(()=>{var t;if(I||!k||!z||N.current)return;N.current=!0,P.current=performance.now(),E(P.current);let e=(t=t=>{E(t),t-P.current>=U&&(R(!0),e?.(),e=null)},h.add(t),null===l&&(l=window.setInterval(()=>{let t=performance.now();for(let e of h)e(t)},40)),()=>{h.delete(t),h.size>0||null===l||(window.clearInterval(l),l=null)});return()=>{e?.(),e=null}},[k,z,U,I]);let V=Math.max(0,C-(P.current+S)),W=z&&k&&C>=P.current+S,q=(0,i.useMemo)(()=>Array.isArray(M)?M:"dark"===O?M.dark??M.light??[]:M.light??M.dark??[],[M,O]),G={onClick:f,onMouseEnter:m,onMouseLeave:y,onPointerEnter:g,onPointerLeave:x,onPointerDown:b,onFocus:v,onBlur:w};if(I)return(0,e.jsx)("span",{ref:B,className:d,style:p,...G,children:c(L)});if(!W)return(0,e.jsx)("span",{ref:B,className:d,style:{...p,opacity:0},...G,children:c(L)});let H=0;return(0,e.jsx)("span",{ref:B,className:d,style:p,...G,children:L.map((t,i)=>{if("text"===t.kind){let r=t.value.split("");return(0,e.jsx)("span",{children:r.map((t,r)=>{if("\n"===t)return H+=1,(0,e.jsx)("br",{},`newline-${i}-${r}`);let s=A?F-1-H:H;if(H+=1," "===t)return(0,e.jsx)("span",{children:" "},`space-${i}-${r}`);let n=s*_,a=n+D;if(V<n)return(0,e.jsx)("span",{style:{opacity:0},children:t},`char-${i}-${r}`);if(V<a){let t=Math.min(1,Math.floor((V-n)/j)),s=T?q[t]:void 0;return(0,e.jsx)("span",{style:s?{color:s}:void 0,children:u()},`char-${i}-${r}`)}return(0,e.jsx)("span",{children:t},`char-${i}-${r}`)})},`text-${i}`)}let r=t.scramble.split("");return(0,e.jsx)("span",{className:t.className,children:r.map((t,r)=>{let s=A?F-1-H:H;H+=1;let n=s*_,a=n+D;if(V<n)return(0,e.jsx)("span",{style:{opacity:0},children:t},`slot-char-${i}-${r}`);if(V<a){let t=Math.min(1,Math.floor((V-n)/j)),s=T?q[t]:void 0;return(0,e.jsx)("span",{style:s?{color:s}:void 0,children:u()},`slot-char-${i}-${r}`)}return(0,e.jsx)("span",{children:t},`slot-char-${i}-${r}`)})},`slot-${i}`)})})}t.s(["default",()=>d],71358)},93691,(t,e,i)=>{var r={675:function(t,e){"use strict";e.byteLength=function(t){var e=h(t),i=e[0],r=e[1];return(i+r)*3/4-r},e.toByteArray=function(t){var e,i,n=h(t),a=n[0],o=n[1],l=new s((a+o)*3/4-o),u=0,c=o>0?a-4:a;for(i=0;i<c;i+=4)e=r[t.charCodeAt(i)]<<18|r[t.charCodeAt(i+1)]<<12|r[t.charCodeAt(i+2)]<<6|r[t.charCodeAt(i+3)],l[u++]=e>>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===o&&(e=r[t.charCodeAt(i)]<<2|r[t.charCodeAt(i+1)]>>4,l[u++]=255&e),1===o&&(e=r[t.charCodeAt(i)]<<10|r[t.charCodeAt(i+1)]<<4|r[t.charCodeAt(i+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l},e.fromByteArray=function(t){for(var e,r=t.length,s=r%3,n=[],a=0,o=r-s;a<o;a+=16383)n.push(function(t,e,r){for(var s,n=[],a=e;a<r;a+=3)s=(t[a]<<16&0xff0000)+(t[a+1]<<8&65280)+(255&t[a+2]),n.push(i[s>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return n.join("")}(t,a,a+16383>o?o:a+16383));return 1===s?n.push(i[(e=t[r-1])>>2]+i[e<<4&63]+"=="):2===s&&n.push(i[(e=(t[r-2]<<8)+t[r-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),n.join("")};for(var i=[],r=[],s="u">typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=n.length;a<o;++a)i[a]=n[a],r[n.charCodeAt(a)]=a;function h(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");-1===i&&(i=e);var r=i===e?0:4-i%4;return[i,r]}r[45]=62,r[95]=63},72:function(t,e,i){"use strict";var r=i(675),s=i(783),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,i){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return u(t)}return h(t,e,i)}function h(t,e,i){if("string"==typeof t){var r=t,s=e;if(("string"!=typeof s||""===s)&&(s="utf8"),!o.isEncoding(s))throw TypeError("Unknown encoding: "+s);var n=0|p(r,s),h=a(n),l=h.write(r,s);return l!==n&&(h=h.slice(0,l)),h}if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(I(t,ArrayBuffer)||t&&I(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(I(t,SharedArrayBuffer)||t&&I(t.buffer,SharedArrayBuffer)))return function(t,e,i){var r;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===e&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,e):new Uint8Array(t,e,i),o.prototype),r}(t,e,i);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var u=t.valueOf&&t.valueOf();if(null!=u&&u!==t)return o.from(u,e,i);var f=function(t){if(o.isBuffer(t)){var e=0|d(t.length),i=a(e);return 0===i.length||t.copy(i,0,0,e),i}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?a(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(f)return f;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return l(t),a(t<0?0:0|d(t))}function c(t){for(var e=t.length<0?0:0|d(t.length),i=a(e),r=0;r<e;r+=1)i[r]=255&t[r];return i}e.Buffer=o,e.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(t,e,i){return h(t,e,i)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,i){return(l(t),t<=0)?a(t):void 0!==e?"string"==typeof i?a(t).fill(e,i):a(t).fill(e):a(t)},o.allocUnsafe=function(t){return u(t)},o.allocUnsafeSlow=function(t){return u(t)};function d(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||I(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var i=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;for(var s=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return A(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return C(t).length;default:if(s)return r?-1:A(t).length;e=(""+e).toLowerCase(),s=!0}}function f(t,e,i){var s,n,a,o=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0||(i>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,i){var r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);for(var s="",n=e;n<i;++n)s+=R[t[n]];return s}(this,e,i);case"utf8":case"utf-8":return x(this,e,i);case"ascii":return function(t,e,i){var r="";i=Math.min(t.length,i);for(var s=e;s<i;++s)r+=String.fromCharCode(127&t[s]);return r}(this,e,i);case"latin1":case"binary":return function(t,e,i){var r="";i=Math.min(t.length,i);for(var s=e;s<i;++s)r+=String.fromCharCode(t[s]);return r}(this,e,i);case"base64":return s=this,n=e,a=i,0===n&&a===s.length?r.fromByteArray(s):r.fromByteArray(s.slice(n,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,i){for(var r=t.slice(e,i),s="",n=0;n<r.length;n+=2)s+=String.fromCharCode(r[n]+256*r[n+1]);return s}(this,e,i);default:if(o)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function m(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function y(t,e,i,r,s){var n;if(0===t.length)return -1;if("string"==typeof i?(r=i,i=0):i>0x7fffffff?i=0x7fffffff:i<-0x80000000&&(i=-0x80000000),(n=i*=1)!=n&&(i=s?0:t.length-1),i<0&&(i=t.length+i),i>=t.length)if(s)return -1;else i=t.length-1;else if(i<0)if(!s)return -1;else i=0;if("string"==typeof e&&(e=o.from(e,r)),o.isBuffer(e))return 0===e.length?-1:g(t,e,i,r,s);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(s)return Uint8Array.prototype.indexOf.call(t,e,i);else return Uint8Array.prototype.lastIndexOf.call(t,e,i);return g(t,[e],i,r,s)}throw TypeError("val must be string, number or Buffer")}function g(t,e,i,r,s){var n,a=1,o=t.length,h=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return -1;a=2,o/=2,h/=2,i/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(s){var u=-1;for(n=i;n<o;n++)if(l(t,n)===l(e,-1===u?0:n-u)){if(-1===u&&(u=n),n-u+1===h)return u*a}else -1!==u&&(n-=n-u),u=-1}else for(i+h>o&&(i=o-h),n=i;n>=0;n--){for(var c=!0,d=0;d<h;d++)if(l(t,n+d)!==l(e,d)){c=!1;break}if(c)return n}return -1}o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(I(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),I(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var i=t.length,r=e.length,s=0,n=Math.min(i,r);s<n;++s)if(t[s]!==e[s]){i=t[s],r=e[s];break}return i<r?-1:+(r<i)},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);if(void 0===e)for(i=0,e=0;i<t.length;++i)e+=t[i].length;var i,r=o.allocUnsafe(e),s=0;for(i=0;i<t.length;++i){var n=t[i];if(I(n,Uint8Array)&&(n=o.from(n)),!o.isBuffer(n))throw TypeError('"list" argument must be an Array of Buffers');n.copy(r,s),s+=n.length}return r},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},o.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?x(this,0,t):f.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(t,e,i,r,s){if(I(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),e<0||i>t.length||r<0||s>this.length)throw RangeError("out of range index");if(r>=s&&e>=i)return 0;if(r>=s)return -1;if(e>=i)return 1;if(e>>>=0,i>>>=0,r>>>=0,s>>>=0,this===t)return 0;for(var n=s-r,a=i-e,h=Math.min(n,a),l=this.slice(r,s),u=t.slice(e,i),c=0;c<h;++c)if(l[c]!==u[c]){n=l[c],a=u[c];break}return n<a?-1:+(a<n)},o.prototype.includes=function(t,e,i){return -1!==this.indexOf(t,e,i)},o.prototype.indexOf=function(t,e,i){return y(this,t,e,i,!0)},o.prototype.lastIndexOf=function(t,e,i){return y(this,t,e,i,!1)};function x(t,e,i){i=Math.min(t.length,i);for(var r=[],s=e;s<i;){var n,a,o,h,l=t[s],u=null,c=l>239?4:l>223?3:l>191?2:1;if(s+c<=i)switch(c){case 1:l<128&&(u=l);break;case 2:(192&(n=t[s+1]))==128&&(h=(31&l)<<6|63&n)>127&&(u=h);break;case 3:n=t[s+1],a=t[s+2],(192&n)==128&&(192&a)==128&&(h=(15&l)<<12|(63&n)<<6|63&a)>2047&&(h<55296||h>57343)&&(u=h);break;case 4:n=t[s+1],a=t[s+2],o=t[s+3],(192&n)==128&&(192&a)==128&&(192&o)==128&&(h=(15&l)<<18|(63&n)<<12|(63&a)<<6|63&o)>65535&&h<1114112&&(u=h)}null===u?(u=65533,c=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),s+=c}var d=r,p=d.length;if(p<=4096)return String.fromCharCode.apply(String,d);for(var f="",m=0;m<p;)f+=String.fromCharCode.apply(String,d.slice(m,m+=4096));return f}function b(t,e,i){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>i)throw RangeError("Trying to access beyond buffer length")}function v(t,e,i,r,s,n){if(!o.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<n)throw RangeError('"value" argument is out of bounds');if(i+r>t.length)throw RangeError("Index out of range")}function w(t,e,i,r,s,n){if(i+r>t.length||i<0)throw RangeError("Index out of range")}function M(t,e,i,r,n){return e*=1,i>>>=0,n||w(t,e,i,4,34028234663852886e22,-34028234663852886e22),s.write(t,e,i,r,23,4),i+4}function S(t,e,i,r,n){return e*=1,i>>>=0,n||w(t,e,i,8,17976931348623157e292,-17976931348623157e292),s.write(t,e,i,r,52,8),i+8}o.prototype.write=function(t,e,i,r){if(void 0===e)r="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)r=e,i=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,n,a,o,h,l,u,c,d=this.length-e;if((void 0===i||i>d)&&(i=d),t.length>0&&(i<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var p=!1;;)switch(r){case"hex":return function(t,e,i,r){i=Number(i)||0;var s=t.length-i;r?(r=Number(r))>s&&(r=s):r=s;var n=e.length;r>n/2&&(r=n/2);for(var a=0;a<r;++a){var o,h=parseInt(e.substr(2*a,2),16);if((o=h)!=o)break;t[i+a]=h}return a}(this,t,e,i);case"utf8":case"utf-8":return s=e,n=i,E(A(t,this.length-s),this,s,n);case"ascii":return a=e,o=i,E(T(t),this,a,o);case"latin1":case"binary":return function(t,e,i,r){return E(T(e),t,i,r)}(this,t,e,i);case"base64":return h=e,l=i,E(C(t),this,h,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=e,c=i,E(function(t,e){for(var i,r,s=[],n=0;n<t.length&&!((e-=2)<0);++n)r=(i=t.charCodeAt(n))>>8,s.push(i%256),s.push(r);return s}(t,this.length-u),this,u,c);default:if(p)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),p=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(t,e){var i=this.length;t=~~t,e=void 0===e?i:~~e,t<0?(t+=i)<0&&(t=0):t>i&&(t=i),e<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t);var r=this.subarray(t,e);return Object.setPrototypeOf(r,o.prototype),r},o.prototype.readUIntLE=function(t,e,i){t>>>=0,e>>>=0,i||b(t,e,this.length);for(var r=this[t],s=1,n=0;++n<e&&(s*=256);)r+=this[t+n]*s;return r},o.prototype.readUIntBE=function(t,e,i){t>>>=0,e>>>=0,i||b(t,e,this.length);for(var r=this[t+--e],s=1;e>0&&(s*=256);)r+=this[t+--e]*s;return r},o.prototype.readUInt8=function(t,e){return t>>>=0,e||b(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||b(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||b(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||b(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||b(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||b(t,e,this.length);for(var r=this[t],s=1,n=0;++n<e&&(s*=256);)r+=this[t+n]*s;return r>=(s*=128)&&(r-=Math.pow(2,8*e)),r},o.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||b(t,e,this.length);for(var r=e,s=1,n=this[t+--r];r>0&&(s*=256);)n+=this[t+--r]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*e)),n},o.prototype.readInt8=function(t,e){return(t>>>=0,e||b(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||b(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?0xffff0000|i:i},o.prototype.readInt16BE=function(t,e){t>>>=0,e||b(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?0xffff0000|i:i},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||b(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||b(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||b(t,4,this.length),s.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||b(t,4,this.length),s.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||b(t,8,this.length),s.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||b(t,8,this.length),s.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,i,r){if(t*=1,e>>>=0,i>>>=0,!r){var s=Math.pow(2,8*i)-1;v(this,t,e,i,s,0)}var n=1,a=0;for(this[e]=255&t;++a<i&&(n*=256);)this[e+a]=t/n&255;return e+i},o.prototype.writeUIntBE=function(t,e,i,r){if(t*=1,e>>>=0,i>>>=0,!r){var s=Math.pow(2,8*i)-1;v(this,t,e,i,s,0)}var n=i-1,a=1;for(this[e+n]=255&t;--n>=0&&(a*=256);)this[e+n]=t/a&255;return e+i},o.prototype.writeUInt8=function(t,e,i){return t*=1,e>>>=0,i||v(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,i){return t*=1,e>>>=0,i||v(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUInt16BE=function(t,e,i){return t*=1,e>>>=0,i||v(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUInt32LE=function(t,e,i){return t*=1,e>>>=0,i||v(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUInt32BE=function(t,e,i){return t*=1,e>>>=0,i||v(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,i,r){if(t*=1,e>>>=0,!r){var s=Math.pow(2,8*i-1);v(this,t,e,i,s-1,-s)}var n=0,a=1,o=0;for(this[e]=255&t;++n<i&&(a*=256);)t<0&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/a|0)-o&255;return e+i},o.prototype.writeIntBE=function(t,e,i,r){if(t*=1,e>>>=0,!r){var s=Math.pow(2,8*i-1);v(this,t,e,i,s-1,-s)}var n=i-1,a=1,o=0;for(this[e+n]=255&t;--n>=0&&(a*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/a|0)-o&255;return e+i},o.prototype.writeInt8=function(t,e,i){return t*=1,e>>>=0,i||v(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,i){return t*=1,e>>>=0,i||v(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,i){return t*=1,e>>>=0,i||v(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,i){return t*=1,e>>>=0,i||v(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,i){return t*=1,e>>>=0,i||v(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,i){return M(this,t,e,!0,i)},o.prototype.writeFloatBE=function(t,e,i){return M(this,t,e,!1,i)},o.prototype.writeDoubleLE=function(t,e,i){return S(this,t,e,!0,i)},o.prototype.writeDoubleBE=function(t,e,i){return S(this,t,e,!1,i)},o.prototype.copy=function(t,e,i,r){if(!o.isBuffer(t))throw TypeError("argument should be a Buffer");if(i||(i=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<i&&(r=i),r===i||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-i&&(r=t.length-e+i);var s=r-i;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,i,r);else if(this===t&&i<e&&e<r)for(var n=s-1;n>=0;--n)t[n+e]=this[n+i];else Uint8Array.prototype.set.call(t,this.subarray(i,r),e);return s},o.prototype.fill=function(t,e,i,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===t.length){var s,n=t.charCodeAt(0);("utf8"===r&&n<128||"latin1"===r)&&(t=n)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<i)throw RangeError("Out of range index");if(i<=e)return this;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(s=e;s<i;++s)this[s]=t;else{var a=o.isBuffer(t)?t:o.from(t,r),h=a.length;if(0===h)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<i-e;++s)this[s+e]=a[s%h]}return this};var _=/[^+/0-9A-Za-z-_]/g;function A(t,e){e=e||1/0;for(var i,r=t.length,s=null,n=[],a=0;a<r;++a){if((i=t.charCodeAt(a))>55295&&i<57344){if(!s){if(i>56319||a+1===r){(e-=3)>-1&&n.push(239,191,189);continue}s=i;continue}if(i<56320){(e-=3)>-1&&n.push(239,191,189),s=i;continue}i=(s-55296<<10|i-56320)+65536}else s&&(e-=3)>-1&&n.push(239,191,189);if(s=null,i<128){if((e-=1)<0)break;n.push(i)}else if(i<2048){if((e-=2)<0)break;n.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;n.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((e-=4)<0)break;n.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return n}function T(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}function C(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(_,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function E(t,e,i,r){for(var s=0;s<r&&!(s+i>=e.length)&&!(s>=t.length);++s)e[s+i]=t[s];return s}function I(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var R=function(){for(var t="0123456789abcdef",e=Array(256),i=0;i<16;++i)for(var r=16*i,s=0;s<16;++s)e[r+s]=t[i]+t[s];return e}()},783:function(t,e){e.read=function(t,e,i,r,s){var n,a,o=8*s-r-1,h=(1<<o)-1,l=h>>1,u=-7,c=i?s-1:0,d=i?-1:1,p=t[e+c];for(c+=d,n=p&(1<<-u)-1,p>>=-u,u+=o;u>0;n=256*n+t[e+c],c+=d,u-=8);for(a=n&(1<<-u)-1,n>>=-u,u+=r;u>0;a=256*a+t[e+c],c+=d,u-=8);if(0===n)n=1-l;else{if(n===h)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),n-=l}return(p?-1:1)*a*Math.pow(2,n-r)},e.write=function(t,e,i,r,s,n){var a,o,h,l=8*n-s-1,u=(1<<l)-1,c=u>>1,d=5960464477539062e-23*(23===s),p=r?0:n-1,f=r?1:-1,m=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(o=+!!isNaN(e),a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),a+c>=1?e+=d/h:e+=d*Math.pow(2,1-c),e*h>=2&&(a++,h/=2),a+c>=u?(o=0,a=u):a+c>=1?(o=(e*h-1)*Math.pow(2,s),a+=c):(o=e*Math.pow(2,c-1)*Math.pow(2,s),a=0));s>=8;t[i+p]=255&o,p+=f,o/=256,s-=8);for(a=a<<s|o,l+=s;l>0;t[i+p]=255&a,p+=f,a/=256,l-=8);t[i+p-f]|=128*m}}},s={};function n(t){var e=s[t];if(void 0!==e)return e.exports;var i=s[t]={exports:{}},a=!0;try{r[t](i,i.exports,n),a=!1}finally{a&&delete s[t]}return i.exports}n.ab="/ROOT/node_modules/.pnpm/next@16.1.6_@babel+core@7.29.7_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/buffer/",e.exports=n(72)},95428,96716,92959,50620,t=>{"use strict";let e,i,r,s;var n,a,o,h,l=t.i(22441),u=t.i(70089),c=t.i(90975),d=t.i(71358);let p=["light","dark","system"];function f({light:t="1",dark:e="2",system:i="3",onClick:r,onKeyDown:s,onMouseEnter:n,onMouseLeave:a,onFocus:o,onBlur:h,startDelayMs:f=600,scrambleColors:m=!0,...y}){let{theme:g,setTheme:x}=(0,c.useThemeMode)(),[b,v]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let t=t=>{if(t.defaultPrevented||t.repeat||t.metaKey||t.ctrlKey||t.altKey||(t=>{if(!(t instanceof HTMLElement))return!1;let e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||t.isContentEditable})(t.target))return;let e=t.key.toLowerCase();"l"===e?(v(!0),x("light")):"d"===e?(v(!0),x("dark")):"a"===e&&(v(!0),x("system"))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[x]);let w=()=>{let t=p.indexOf(g);x(p[(t+1)%p.length])},M="light"===g?t:"dark"===g?e:i;return(0,l.jsx)("span",{role:"button",tabIndex:0,"aria-label":`Theme: ${g}`,onClick:t=>{r?.(t),t.defaultPrevented||(v(!0),w())},onKeyDown:t=>{s?.(t),t.defaultPrevented||("Enter"===t.key||" "===t.key)&&(t.preventDefault(),v(!0),w())},onMouseEnter:n,onMouseLeave:a,onFocus:o,onBlur:h,...y,children:(0,l.jsx)(d.default,{text:M,startDelayMs:b?100:f,scrambleColors:m},g)})}t.s(["ASCIIThemeToggle",()=>f],95428);var m=t.i(23525);let y=["|","/","-","\\"];function g({onClick:t,onKeyDown:e,onMouseEnter:i,onMouseLeave:r,onFocus:s,onBlur:n,className:a,startDelayMs:o=600,scrambleColors:h=!0,...c}){let{soundEnabled:p,setSoundEnabled:f}=(0,m.useShellMedia)(),[g,x]=(0,u.useState)(!1),[b,v]=(0,u.useState)(0),[w,M]=(0,u.useState)(0),S=(0,u.useRef)(!0);(0,u.useEffect)(()=>{if(S.current){S.current=!1;return}M(t=>t+1)},[p]),(0,u.useEffect)(()=>{if(!p)return void v(0);let t=window.setInterval(()=>{v(t=>(t+1)%y.length)},130);return()=>window.clearInterval(t)},[p]);let _=p?y[b]:"·",A=g?100:o;return(0,l.jsx)("span",{role:"button",tabIndex:0,"aria-label":p?"Sound playing, click to pause":"Sound paused, click to play","aria-pressed":p,onClick:e=>{t?.(e),e.defaultPrevented||(x(!0),f(!p))},onKeyDown:t=>{e?.(t),t.defaultPrevented||("Enter"===t.key||" "===t.key)&&(t.preventDefault(),x(!0),f(!p))},onMouseEnter:i,onMouseLeave:r,onFocus:s,onBlur:n,className:`inline-flex shrink-0 items-baseline gap-0 ${a??""} normal-case`,...c,children:p?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(d.default,{text:`SOUND[${_}]`,startDelayMs:A,letterDelayMs:80,scrambleColors:h},`sound-on-${w}`)}):(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(d.default,{text:`SOUND[\xb7]`,startDelayMs:A,letterDelayMs:80,scrambleColors:h},`sound-off-${w}`)})})}t.s(["ASCIISoundToggle",()=>g],96716);let x=(t,e)=>{let i=t.find(({brand:t})=>e.test(t));return i?.brand??null};t.s(["useBrowserName",0,()=>{let[t,e]=(0,u.useState)("Unknown");return(0,u.useEffect)(()=>{e((()=>{if("u"<typeof navigator)return"Unknown";let t=navigator.userAgent,e=(()=>{if("u"<typeof navigator)return[];let t=navigator.userAgentData?.brands;return Array.isArray(t)?t:[]})();for(let t of[/Microsoft Edge/i,/Opera/i,/Brave/i,/Arc/i,/Vivaldi/i,/Samsung Internet/i,/Yandex/i,/Firefox/i,/Google Chrome/i,/Chromium/i,/Safari/i]){let i=x(e,t);if(i)return i}return/Edg\//.test(t)?"Microsoft Edge":/OPR\//.test(t)?"Opera":/Brave\//.test(t)?"Brave":/Arc\//.test(t)?"Arc":/Vivaldi\//.test(t)?"Vivaldi":/SamsungBrowser\//.test(t)?"Samsung Internet":/YaBrowser\//.test(t)?"Yandex Browser":/Firefox\//.test(t)||/FxiOS\//.test(t)?"Firefox":/Chrome\/|CriOS\//.test(t)?"Google Chrome":/Safari\//.test(t)?"Safari":"Unknown"})())},[]),t}],92959);var b=t.i(25469);function v(t,e){return function(){return t.apply(e,arguments)}}let{toString:w}=Object.prototype,{getPrototypeOf:M}=Object,{iterator:S,toStringTag:_}=Symbol,A=(e=Object.create(null),t=>{let i=w.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())}),T=t=>(t=t.toLowerCase(),e=>A(e)===t),C=t=>e=>typeof e===t,{isArray:E}=Array,I=C("undefined");function R(t){return null!==t&&!I(t)&&null!==t.constructor&&!I(t.constructor)&&B(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}let O=T("ArrayBuffer"),z=C("string"),B=C("function"),k=C("number"),P=t=>null!==t&&"object"==typeof t,N=t=>{if("object"!==A(t))return!1;let e=M(t);return(null===e||e===Object.prototype||null===Object.getPrototypeOf(e))&&!(_ in t)&&!(S in t)},L=T("Date"),F=T("File"),j=T("Blob"),D=T("FileList"),U="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:t.g,V=void 0!==U.FormData?U.FormData:void 0,W=T("URLSearchParams"),[q,G,H,J]=["ReadableStream","Request","Response","Headers"].map(T);function X(t,e,{allOwnKeys:i=!1}={}){let r,s;if(null!=t)if("object"!=typeof t&&(t=[t]),E(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{let s;if(R(t))return;let n=i?Object.getOwnPropertyNames(t):Object.keys(t),a=n.length;for(r=0;r<a;r++)s=n[r],e.call(null,t[s],s,t)}}function $(t,e){let i;if(R(t))return null;e=e.toLowerCase();let r=Object.keys(t),s=r.length;for(;s-- >0;)if(e===(i=r[s]).toLowerCase())return i;return null}let Y="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:t.g,Z=t=>!I(t)&&t!==Y,K=(i="u">typeof Uint8Array&&M(Uint8Array),t=>i&&t instanceof i),Q=T("HTMLFormElement"),tt=(({hasOwnProperty:t})=>(e,i)=>t.call(e,i))(Object.prototype),te=T("RegExp"),ti=(t,e)=>{let i=Object.getOwnPropertyDescriptors(t),r={};X(i,(i,s)=>{let n;!1!==(n=e(i,s,t))&&(r[s]=n||i)}),Object.defineProperties(t,r)},tr=T("AsyncFunction"),ts=(n="function"==typeof setImmediate,a=B(Y.postMessage),n?setImmediate:a?(o=`axios@${Math.random()}`,h=[],Y.addEventListener("message",({source:t,data:e})=>{t===Y&&e===o&&h.length&&h.shift()()},!1),t=>{h.push(t),Y.postMessage(o,"*")}):t=>setTimeout(t)),tn="u">typeof queueMicrotask?queueMicrotask.bind(Y):void 0!==b.default&&b.default.nextTick||ts,ta={isArray:E,isArrayBuffer:O,isBuffer:R,isFormData:t=>{if(!t)return!1;if(V&&t instanceof V)return!0;let e=M(t);if(!e||e===Object.prototype||!B(t.append))return!1;let i=A(t);return"formdata"===i||"object"===i&&B(t.toString)&&"[object FormData]"===t.toString()},isArrayBufferView:function(t){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&O(t.buffer)},isString:z,isNumber:k,isBoolean:t=>!0===t||!1===t,isObject:P,isPlainObject:N,isEmptyObject:t=>{if(!P(t)||R(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:q,isRequest:G,isResponse:H,isHeaders:J,isUndefined:I,isDate:L,isFile:F,isReactNativeBlob:t=>!!(t&&void 0!==t.uri),isReactNative:t=>t&&void 0!==t.getParts,isBlob:j,isRegExp:te,isFunction:B,isStream:t=>P(t)&&B(t.pipe),isURLSearchParams:W,isTypedArray:K,isFileList:D,forEach:X,merge:function t(...e){let{caseless:i,skipUndefined:r}=Z(this)&&this||{},s={},n=(e,n)=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;let a=i&&$(s,n)||n,o=tt(s,a)?s[a]:void 0;N(o)&&N(e)?s[a]=t(o,e):N(e)?s[a]=t({},e):E(e)?s[a]=e.slice():r&&I(e)||(s[a]=e)};for(let t=0,i=e.length;t<i;t++)e[t]&&X(e[t],n);return s},extend:(t,e,i,{allOwnKeys:r}={})=>(X(e,(e,r)=>{i&&B(e)?Object.defineProperty(t,r,{__proto__:null,value:v(e,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{__proto__:null,value:e,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,i,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:e.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,e,i,r)=>{let s,n,a,o={};if(e=e||{},null==t)return e;do{for(n=(s=Object.getOwnPropertyNames(t)).length;n-- >0;)a=s[n],(!r||r(a,t,e))&&!o[a]&&(e[a]=t[a],o[a]=!0);t=!1!==i&&M(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype)return e},kindOf:A,kindOfTest:T,endsWith:(t,e,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=e.length;let r=t.indexOf(e,i);return -1!==r&&r===i},toArray:t=>{if(!t)return null;if(E(t))return t;let e=t.length;if(!k(e))return null;let i=Array(e);for(;e-- >0;)i[e]=t[e];return i},forEachEntry:(t,e)=>{let i,r=(t&&t[S]).call(t);for(;(i=r.next())&&!i.done;){let r=i.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let i,r=[];for(;null!==(i=t.exec(e));)r.push(i);return r},isHTMLForm:Q,hasOwnProperty:tt,hasOwnProp:tt,reduceDescriptors:ti,freezeMethods:t=>{ti(t,(e,i)=>{if(B(t)&&["arguments","caller","callee"].includes(i))return!1;if(B(t[i])){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},toObjectSet:(t,e)=>{let i={};return(E(t)?t:String(t).split(e)).forEach(t=>{i[t]=!0}),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,i){return e.toUpperCase()+i}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t*=1)?t:e,findKey:$,global:Y,isContextDefined:Z,isSpecCompliantForm:function(t){return!!(t&&B(t.append)&&"FormData"===t[_]&&t[S])},toJSONObject:t=>{let e=new WeakSet,i=t=>{if(P(t)){if(e.has(t))return;if(R(t))return t;if(!("toJSON"in t)){e.add(t);let r=E(t)?[]:{};return X(t,(t,e)=>{let s=i(t);I(s)||(r[e]=s)}),e.delete(t),r}}return t};return i(t)},isAsyncFn:tr,isThenable:t=>t&&(P(t)||B(t))&&B(t.then)&&B(t.catch),setImmediate:ts,asap:tn,isIterable:t=>null!=t&&B(t[S])};var to=t.i(93691);let th=ta.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tl=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),tu=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function tc(t,e){return ta.isArray(t)?t.map(t=>tc(t,e)):function(t){let e=0,i=t.length;for(;e<i;){let i=t.charCodeAt(e);if(9!==i&&32!==i)break;e+=1}for(;i>e;){let e=t.charCodeAt(i-1);if(9!==e&&32!==e)break;i-=1}return 0===e&&i===t.length?t:t.slice(e,i)}(String(t).replace(e,""))}function td(t){let e=Object.create(null);return ta.forEach(t.toJSON(),(t,i)=>{e[i]=tc(t,tu)}),e}let tp=Symbol("internals");function tf(t){return t&&String(t).trim().toLowerCase()}function tm(t){return!1===t||null==t?t:ta.isArray(t)?t.map(tm):tc(String(t),tl)}function ty(t,e,i,r,s){if(ta.isFunction(r))return r.call(this,e,i);if(s&&(e=i),ta.isString(e)){if(ta.isString(r))return -1!==e.indexOf(r);if(ta.isRegExp(r))return r.test(e)}}class tg{constructor(t){t&&this.set(t)}set(t,e,i){let r=this;function s(t,e,i){let s=tf(e);if(!s)throw Error("header name must be a non-empty string");let n=ta.findKey(r,s);n&&void 0!==r[n]&&!0!==i&&(void 0!==i||!1===r[n])||(r[n||e]=tm(t))}let n=(t,e)=>ta.forEach(t,(t,i)=>s(t,i,e));if(ta.isPlainObject(t)||t instanceof this.constructor)n(t,e);else{let r;if(ta.isString(t)&&(t=t.trim())&&(r=t,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()))){var a;let i,r,s,o;n((o={},(a=t)&&a.split("\n").forEach(function(t){s=t.indexOf(":"),i=t.substring(0,s).trim().toLowerCase(),r=t.substring(s+1).trim(),!i||o[i]&&th[i]||("set-cookie"===i?o[i]?o[i].push(r):o[i]=[r]:o[i]=o[i]?o[i]+", "+r:r)}),o),e)}else if(ta.isObject(t)&&ta.isIterable(t)){let i={},r,s;for(let e of t){if(!ta.isArray(e))throw TypeError("Object iterator must return a key-value pair");i[s=e[0]]=(r=i[s])?ta.isArray(r)?[...r,e[1]]:[r,e[1]]:e[1]}n(i,e)}else null!=t&&s(e,t,i)}return this}get(t,e){if(t=tf(t)){let i=ta.findKey(this,t);if(i){let t=this[i];if(!e)return t;if(!0===e){let e,i=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;e=r.exec(t);)i[e[1]]=e[2];return i}if(ta.isFunction(e))return e.call(this,t,i);if(ta.isRegExp(e))return e.exec(t);throw TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=tf(t)){let i=ta.findKey(this,t);return!!(i&&void 0!==this[i]&&(!e||ty(this,this[i],i,e)))}return!1}delete(t,e){let i=this,r=!1;function s(t){if(t=tf(t)){let s=ta.findKey(i,t);s&&(!e||ty(i,i[s],s,e))&&(delete i[s],r=!0)}}return ta.isArray(t)?t.forEach(s):s(t),r}clear(t){let e=Object.keys(this),i=e.length,r=!1;for(;i--;){let s=e[i];(!t||ty(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){let e=this,i={};return ta.forEach(this,(r,s)=>{let n=ta.findKey(i,s);if(n){e[n]=tm(r),delete e[s];return}let a=t?s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,i)=>e.toUpperCase()+i):String(s).trim();a!==s&&delete e[s],e[a]=tm(r),i[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let e=Object.create(null);return ta.forEach(this,(i,r)=>{null!=i&&!1!==i&&(e[r]=t&&ta.isArray(i)?i.join(", "):i)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){let i=new this(t);return e.forEach(t=>i.set(t)),i}static accessor(t){let e=(this[tp]=this[tp]={accessors:{}}).accessors,i=this.prototype;function r(t){let r=tf(t);if(!e[r]){let s;s=ta.toCamelCase(" "+t),["get","set","has"].forEach(e=>{Object.defineProperty(i,e+s,{__proto__:null,value:function(i,r,s){return this[e].call(this,t,i,r,s)},configurable:!0})}),e[r]=!0}}return ta.isArray(t)?t.forEach(r):r(t),this}}tg.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ta.reduceDescriptors(tg.prototype,({value:t},e)=>{let i=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[i]=t}}}),ta.freezeMethods(tg);class tx extends Error{static from(t,e,i,r,s,n){let a=new tx(t.message,e||t.code,i,r,s);return a.cause=t,a.name=t.name,null!=t.status&&null==a.status&&(a.status=t.status),n&&Object.assign(a,n),a}constructor(t,e,i,r,s){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,e&&(this.code=e),i&&(this.config=i),r&&(this.request=r),s&&(this.response=s,this.status=s.status)}toJSON(){let t,e,i,r=this.config,s=r&&ta.hasOwnProp(r,"redact")?r.redact:void 0,n=ta.isArray(s)&&s.length>0?(t=new Set(s.map(t=>String(t).toLowerCase())),e=[],(i=r=>{let s;if(null===r||"object"!=typeof r||ta.isBuffer(r))return r;if(-1===e.indexOf(r)){if(r instanceof tg&&(r=r.toJSON()),e.push(r),ta.isArray(r))s=[],r.forEach((t,e)=>{let r=i(t);ta.isUndefined(r)||(s[e]=r)});else{if(!ta.isPlainObject(r)&&function(t){if(ta.hasOwnProp(t,"toJSON"))return!0;let e=Object.getPrototypeOf(t);for(;e&&e!==Object.prototype;){if(ta.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}(r))return e.pop(),r;for(let[e,n]of(s=Object.create(null),Object.entries(r))){let r=t.has(e.toLowerCase())?"[REDACTED ****]":i(n);ta.isUndefined(r)||(s[e]=r)}}return e.pop(),s}})(r)):ta.toJSONObject(r);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}tx.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",tx.ERR_BAD_OPTION="ERR_BAD_OPTION",tx.ECONNABORTED="ECONNABORTED",tx.ETIMEDOUT="ETIMEDOUT",tx.ECONNREFUSED="ECONNREFUSED",tx.ERR_NETWORK="ERR_NETWORK",tx.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",tx.ERR_DEPRECATED="ERR_DEPRECATED",tx.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",tx.ERR_BAD_REQUEST="ERR_BAD_REQUEST",tx.ERR_CANCELED="ERR_CANCELED",tx.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",tx.ERR_INVALID_URL="ERR_INVALID_URL",tx.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let tb=tx;function tv(t){return ta.isPlainObject(t)||ta.isArray(t)}function tw(t){return ta.endsWith(t,"[]")?t.slice(0,-2):t}function tM(t,e,i){return t?t.concat(e).map(function(t,e){return t=tw(t),!i&&e?"["+t+"]":t}).join(i?".":""):e}let tS=ta.toFlatObject(ta,{},null,function(t){return/^is[A-Z]/.test(t)}),t_=function(t,e,i){if(!ta.isObject(t))throw TypeError("target must be an object");e=e||new FormData;let r=(i=ta.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!ta.isUndefined(e[t])})).metaTokens,s=i.visitor||c,n=i.dots,a=i.indexes,o=i.Blob||"u">typeof Blob&&Blob,h=void 0===i.maxDepth?100:i.maxDepth,l=o&&ta.isSpecCompliantForm(e);if(!ta.isFunction(s))throw TypeError("visitor must be a function");function u(t){if(null===t)return"";if(ta.isDate(t))return t.toISOString();if(ta.isBoolean(t))return t.toString();if(!l&&ta.isBlob(t))throw new tb("Blob is not supported. Use a Buffer instead.");return ta.isArrayBuffer(t)||ta.isTypedArray(t)?l&&"function"==typeof Blob?new Blob([t]):to.Buffer.from(t):t}function c(t,i,s){let o=t;if(ta.isReactNative(e)&&ta.isReactNativeBlob(t))return e.append(tM(s,i,n),u(t)),!1;if(t&&!s&&"object"==typeof t)if(ta.endsWith(i,"{}"))i=r?i:i.slice(0,-2),t=JSON.stringify(t);else{var h;if(ta.isArray(t)&&(h=t,ta.isArray(h)&&!h.some(tv))||(ta.isFileList(t)||ta.endsWith(i,"[]"))&&(o=ta.toArray(t)))return i=tw(i),o.forEach(function(t,r){ta.isUndefined(t)||null===t||e.append(!0===a?tM([i],r,n):null===a?i:i+"[]",u(t))}),!1}return!!tv(t)||(e.append(tM(s,i,n),u(t)),!1)}let d=[],p=Object.assign(tS,{defaultVisitor:c,convertValue:u,isVisitable:tv});if(!ta.isObject(t))throw TypeError("data must be an object");return!function t(i,r,n=0){if(!ta.isUndefined(i)){if(n>h)throw new tb("Object is too deeply nested ("+n+" levels). Max depth: "+h,tb.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==d.indexOf(i))throw Error("Circular reference detected in "+r.join("."));d.push(i),ta.forEach(i,function(i,a){!0===(!(ta.isUndefined(i)||null===i)&&s.call(e,i,ta.isString(a)?a.trim():a,r,p))&&t(i,r?r.concat(a):[a],n+1)}),d.pop()}}(t),e};function tA(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(t){return e[t]})}function tT(t,e){this._pairs=[],t&&t_(t,this,e)}let tC=tT.prototype;function tE(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function tI(t,e,i){let r;if(!e)return t;let s=i&&i.encode||tE,n=ta.isFunction(i)?{serialize:i}:i,a=n&&n.serialize;if(r=a?a(e,n):ta.isURLSearchParams(e)?e.toString():new tT(e,n).toString(s)){let e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t}tC.append=function(t,e){this._pairs.push([t,e])},tC.toString=function(t){let e=t?function(e){return t.call(this,e,tA)}:tA;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};let tR=class{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ta.forEach(this.handlers,function(e){null!==e&&t(e)})}},tO={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},tz="u">typeof URLSearchParams?URLSearchParams:tT,tB="u">typeof FormData?FormData:null,tk="u">typeof Blob?Blob:null,tP="u">typeof window&&"u">typeof document,tN="object"==typeof navigator&&navigator||void 0,tL=tP&&(!tN||0>["ReactNative","NativeScript","NS"].indexOf(tN.product)),tF="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,tj=tP&&window.location.href||"http://localhost";t.s(["hasBrowserEnv",()=>tP,"hasStandardBrowserEnv",()=>tL,"hasStandardBrowserWebWorkerEnv",()=>tF,"navigator",()=>tN,"origin",()=>tj],43682);let tD={...t.i(43682),isBrowser:!0,classes:{URLSearchParams:tz,FormData:tB,Blob:tk},protocols:["http","https","file","blob","url","data"]},tU=function(t){if(ta.isFormData(t)&&ta.isFunction(t.entries)){let e={};return ta.forEachEntry(t,(t,i)=>{!function t(e,i,r,s){let n=e[s++];if("__proto__"===n)return!0;let a=Number.isFinite(+n),o=s>=e.length;return(n=!n&&ta.isArray(r)?r.length:n,o)?ta.hasOwnProp(r,n)?r[n]=ta.isArray(r[n])?r[n].concat(i):[r[n],i]:r[n]=i:(ta.hasOwnProp(r,n)&&ta.isObject(r[n])||(r[n]=[]),t(e,i,r[n],s)&&ta.isArray(r[n])&&(r[n]=function(t){let e,i,r={},s=Object.keys(t),n=s.length;for(e=0;e<n;e++)r[i=s[e]]=t[i];return r}(r[n]))),!a}(ta.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0]),i,e,0)}),e}return null},tV=(t,e)=>null!=t&&ta.hasOwnProp(t,e)?t[e]:void 0,tW={transitional:tO,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){let i,r=e.getContentType()||"",s=r.indexOf("application/json")>-1,n=ta.isObject(t);if(n&&ta.isHTMLForm(t)&&(t=new FormData(t)),ta.isFormData(t))return s?JSON.stringify(tU(t)):t;if(ta.isArrayBuffer(t)||ta.isBuffer(t)||ta.isStream(t)||ta.isFile(t)||ta.isBlob(t)||ta.isReadableStream(t))return t;if(ta.isArrayBufferView(t))return t.buffer;if(ta.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(n){let e=tV(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return t_(t,new tD.classes.URLSearchParams,{visitor:function(t,e,i,r){return tD.isNode&&ta.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e}).toString();if((i=ta.isFileList(t))||r.indexOf("multipart/form-data")>-1){let r=tV(this,"env"),s=r&&r.FormData;return t_(i?{"files[]":t}:t,s&&new s,e)}}if(n||s){e.setContentType("application/json",!1);var a=t;if(ta.isString(a))try{return(0,JSON.parse)(a),ta.trim(a)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(a)}return t}],transformResponse:[function(t){let e=tV(this,"transitional")||tW.transitional,i=e&&e.forcedJSONParsing,r=tV(this,"responseType"),s="json"===r;if(ta.isResponse(t)||ta.isReadableStream(t))return t;if(t&&ta.isString(t)&&(i&&!r||s)){let i=e&&e.silentJSONParsing;try{return JSON.parse(t,tV(this,"parseReviver"))}catch(t){if(!i&&s){if("SyntaxError"===t.name)throw tb.from(t,tb.ERR_BAD_RESPONSE,this,null,tV(this,"response"));throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:tD.classes.FormData,Blob:tD.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function tq(t,e){let i=this||tW,r=e||i,s=tg.from(r.headers),n=r.data;return ta.forEach(t,function(t){n=t.call(i,n,s.normalize(),e?e.status:void 0)}),s.normalize(),n}function tG(t){return!!(t&&t.__CANCEL__)}ta.forEach(["delete","get","head","post","put","patch","query"],t=>{tW.headers[t]={}});let tH=class extends tb{constructor(t,e,i){super(null==t?"canceled":t,tb.ERR_CANCELED,e,i),this.name="CanceledError",this.__CANCEL__=!0}};function tJ(t,e,i){let r=i.config.validateStatus;!i.status||!r||r(i.status)?t(i):e(new tb("Request failed with status code "+i.status,i.status>=400&&i.status<500?tb.ERR_BAD_REQUEST:tb.ERR_BAD_RESPONSE,i.config,i.request,i))}let tX=function(t,e){let i,r=Array(t=t||10),s=Array(t),n=0,a=0;return e=void 0!==e?e:1e3,function(o){let h=Date.now(),l=s[a];i||(i=h),r[n]=o,s[n]=h;let u=a,c=0;for(;u!==n;)c+=r[u++],u%=t;if((n=(n+1)%t)===a&&(a=(a+1)%t),h-i<e)return;let d=l&&h-l;return d?Math.round(1e3*c/d):void 0}},t$=function(t,e){let i,r,s=0,n=1e3/e,a=(e,n=Date.now())=>{s=n,i=null,r&&(clearTimeout(r),r=null),t(...e)};return[(...t)=>{let e=Date.now(),o=e-s;o>=n?a(t,e):(i=t,r||(r=setTimeout(()=>{r=null,a(i)},n-o)))},()=>i&&a(i)]},tY=(t,e,i=3)=>{let r=0,s=tX(50,250);return t$(i=>{if(!i||"number"!=typeof i.loaded)return;let n=i.loaded,a=i.lengthComputable?i.total:void 0,o=null!=a?Math.min(n,a):n,h=Math.max(0,o-r),l=s(h);r=Math.max(r,o),t({loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:l||void 0,estimated:l&&a?(a-o)/l:void 0,event:i,lengthComputable:null!=a,[e?"download":"upload"]:!0})},i)},tZ=(t,e)=>{let i=null!=t;return[r=>e[0]({lengthComputable:i,total:t,loaded:r}),e[1]]},tK=t=>(...e)=>ta.asap(()=>t(...e)),tQ=tD.hasStandardBrowserEnv?(r=new URL(tD.origin),s=tD.navigator&&/(msie|trident)/i.test(tD.navigator.userAgent),t=>(t=new URL(t,tD.origin),r.protocol===t.protocol&&r.host===t.host&&(s||r.port===t.port))):()=>!0,t0=tD.hasStandardBrowserEnv?{write(t,e,i,r,s,n,a){if("u"<typeof document)return;let o=[`${t}=${encodeURIComponent(e)}`];ta.isNumber(i)&&o.push(`expires=${new Date(i).toUTCString()}`),ta.isString(r)&&o.push(`path=${r}`),ta.isString(s)&&o.push(`domain=${s}`),!0===n&&o.push("secure"),ta.isString(a)&&o.push(`SameSite=${a}`),document.cookie=o.join("; ")},read(t){if("u"<typeof document)return null;let e=document.cookie.split(";");for(let i=0;i<e.length;i++){let r=e[i].replace(/^\s+/,""),s=r.indexOf("=");if(-1!==s&&r.slice(0,s)===t)return decodeURIComponent(r.slice(s+1))}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function t1(t,e,i){let r=!("string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e));return t&&(r||!1===i)?e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t:e}let t2=t=>t instanceof tg?{...t}:t;function t3(t,e){e=e||{};let i=Object.create(null);function r(t,e,i,r){return ta.isPlainObject(t)&&ta.isPlainObject(e)?ta.merge.call({caseless:r},t,e):ta.isPlainObject(e)?ta.merge({},e):ta.isArray(e)?e.slice():e}function s(t,e,i,s){return ta.isUndefined(e)?ta.isUndefined(t)?void 0:r(void 0,t,i,s):r(t,e,i,s)}function n(t,e){if(!ta.isUndefined(e))return r(void 0,e)}function a(t,e){return ta.isUndefined(e)?ta.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function o(i,s,n){return ta.hasOwnProp(e,n)?r(i,s):ta.hasOwnProp(t,n)?r(void 0,i):void 0}Object.defineProperty(i,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let h={url:n,method:n,data:n,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:o,headers:(t,e,i)=>s(t2(t),t2(e),i,!0)};return ta.forEach(Object.keys({...t,...e}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;let n=ta.hasOwnProp(h,r)?h[r]:s,a=n(ta.hasOwnProp(t,r)?t[r]:void 0,ta.hasOwnProp(e,r)?e[r]:void 0,r);ta.isUndefined(a)&&n!==o||(i[r]=a)}),i}let t5=["content-type","content-length"],t4=t=>{let e=t3({},t),i=t=>ta.hasOwnProp(e,t)?e[t]:void 0,r=i("data"),s=i("withXSRFToken"),n=i("xsrfHeaderName"),a=i("xsrfCookieName"),o=i("headers"),h=i("auth"),l=i("baseURL"),u=i("allowAbsoluteUrls"),c=i("url");if(e.headers=o=tg.from(o),e.url=tI(t1(l,c,u),t.params,t.paramsSerializer),h&&o.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?encodeURIComponent(h.password).replace(/%([0-9A-F]{2})/gi,(t,e)=>String.fromCharCode(parseInt(e,16))):""))),ta.isFormData(r))if(tD.hasStandardBrowserEnv||tD.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else{var d,p;ta.isFunction(r.getHeaders)&&(d=o,p=r.getHeaders(),"content-only"!==i("formDataHeaderPolicy")?d.set(p):Object.entries(p).forEach(([t,e])=>{t5.includes(t.toLowerCase())&&d.set(t,e)}))}if(tD.hasStandardBrowserEnv&&(ta.isFunction(s)&&(s=s(e)),!0===s||null==s&&tQ(e.url))){let t=n&&a&&t0.read(a);t&&o.set(n,t)}return e},t6="u">typeof XMLHttpRequest&&function(t){return new Promise(function(e,i){var r;let s,n,a,o,h,l,u=t4(t),c=u.data,d=tg.from(u.headers).normalize(),{responseType:p,onUploadProgress:f,onDownloadProgress:m}=u;function y(){o&&o(),h&&h(),u.cancelToken&&u.cancelToken.unsubscribe(s),u.signal&&u.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function x(){if(!g)return;let r=tg.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());tJ(function(t){e(t),y()},function(t){i(t),y()},{data:p&&"text"!==p&&"json"!==p?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:t,request:g}),g=null}g.open(u.method.toUpperCase(),u.url,!0),g.timeout=u.timeout,"onloadend"in g?g.onloadend=x:g.onreadystatechange=function(){!g||4!==g.readyState||(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(x)},g.onabort=function(){g&&(i(new tb("Request aborted",tb.ECONNABORTED,t,g)),y(),g=null)},g.onerror=function(e){let r=new tb(e&&e.message?e.message:"Network Error",tb.ERR_NETWORK,t,g);r.event=e||null,i(r),y(),g=null},g.ontimeout=function(){let e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",r=u.transitional||tO;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),i(new tb(e,r.clarifyTimeoutError?tb.ETIMEDOUT:tb.ECONNABORTED,t,g)),y(),g=null},void 0===c&&d.setContentType(null),"setRequestHeader"in g&&ta.forEach(td(d),function(t,e){g.setRequestHeader(e,t)}),ta.isUndefined(u.withCredentials)||(g.withCredentials=!!u.withCredentials),p&&"json"!==p&&(g.responseType=u.responseType),m&&([a,h]=tY(m,!0),g.addEventListener("progress",a)),f&&g.upload&&([n,o]=tY(f),g.upload.addEventListener("progress",n),g.upload.addEventListener("loadend",o)),(u.cancelToken||u.signal)&&(s=e=>{g&&(i(!e||e.type?new tH(null,t,g):e),g.abort(),y(),g=null)},u.cancelToken&&u.cancelToken.subscribe(s),u.signal&&(u.signal.aborted?s():u.signal.addEventListener("abort",s)));let b=(r=u.url,(l=/^([-+\w]{1,25}):(?:\/\/)?/.exec(r))&&l[1]||"");b&&!tD.protocols.includes(b)?i(new tb("Unsupported protocol "+b+":",tb.ERR_BAD_REQUEST,t)):g.send(c||null)})},t8=function*(t,e){let i,r=t.byteLength;if(!e||r<e)return void(yield t);let s=0;for(;s<r;)i=s+e,yield t.slice(s,i),s=i},t9=async function*(t,e){for await(let i of t7(t))yield*t8(i,e)},t7=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);let e=t.getReader();try{for(;;){let{done:t,value:i}=await e.read();if(t)break;yield i}}finally{await e.cancel()}},et=(t,e,i,r)=>{let s,n=t9(t,e),a=0,o=t=>{!s&&(s=!0,r&&r(t))};return new ReadableStream({async pull(t){try{let{done:e,value:r}=await n.next();if(e){o(),t.close();return}let s=r.byteLength;if(i){let t=a+=s;i(t)}t.enqueue(new Uint8Array(r))}catch(t){throw o(t),t}},cancel:t=>(o(t),n.return())},{highWaterMark:2})},ee="1.16.1",{isFunction:ei}=ta,er=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},es=t=>{let e,i=void 0!==ta.global&&null!==ta.global?ta.global:globalThis,{ReadableStream:r,TextEncoder:s}=i,{fetch:n,Request:a,Response:o}=t=ta.merge.call({skipUndefined:!0},{Request:i.Request,Response:i.Response},t),h=n?ei(n):"function"==typeof fetch,l=ei(a),u=ei(o);if(!h)return!1;let c=h&&ei(r),d=h&&("function"==typeof s?(e=new s,t=>e.encode(t)):async t=>new Uint8Array(await new a(t).arrayBuffer())),p=l&&c&&er(()=>{let t=!1,e=new a(tD.origin,{body:new r,method:"POST",get duplex(){return t=!0,"half"}}),i=e.headers.has("Content-Type");return null!=e.body&&e.body.cancel(),t&&!i}),f=u&&c&&er(()=>ta.isReadableStream(new o("").body)),m={stream:f&&(t=>t.body)};h&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{m[t]||(m[t]=(e,i)=>{let r=e&&e[t];if(r)return r.call(e);throw new tb(`Response type '${t}' is not supported`,tb.ERR_NOT_SUPPORT,i)})});let y=async t=>{if(null==t)return 0;if(ta.isBlob(t))return t.size;if(ta.isSpecCompliantForm(t)){let e=new a(tD.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return ta.isArrayBufferView(t)||ta.isArrayBuffer(t)?t.byteLength:(ta.isURLSearchParams(t)&&(t+=""),ta.isString(t))?(await d(t)).byteLength:void 0},g=async(t,e)=>{let i=ta.toFiniteNumber(t.getContentLength());return null==i?y(e):i};return async t=>{let e,{url:i,method:r,data:h,signal:u,cancelToken:c,timeout:d,onDownloadProgress:y,onUploadProgress:x,responseType:b,headers:v,withCredentials:w="same-origin",fetchOptions:M,maxContentLength:S,maxBodyLength:_}=t4(t),A=ta.isNumber(S)&&S>-1,T=ta.isNumber(_)&&_>-1,C=n||fetch;b=b?(b+"").toLowerCase():"text";let E=((t,e)=>{if(t=t?t.filter(Boolean):[],!e&&!t.length)return;let i=new AbortController,r=!1,s=function(t){if(!r){r=!0,a();let e=t instanceof Error?t:this.reason;i.abort(e instanceof tb?e:new tH(e instanceof Error?e.message:e))}},n=e&&setTimeout(()=>{n=null,s(new tb(`timeout of ${e}ms exceeded`,tb.ETIMEDOUT))},e),a=()=>{t&&(n&&clearTimeout(n),n=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(s):t.removeEventListener("abort",s)}),t=null)};t.forEach(t=>t.addEventListener("abort",s));let{signal:o}=i;return o.unsubscribe=()=>ta.asap(a),o})([u,c&&c.toAbortSignal()],d),I=null,R=E&&E.unsubscribe&&(()=>{E.unsubscribe()});try{if(A&&"string"==typeof i&&i.startsWith("data:")&&function(t){if(!t||"string"!=typeof t||!t.startsWith("data:"))return 0;let e=t.indexOf(",");if(e<0)return 0;let i=t.slice(5,e),r=t.slice(e+1);if(/;base64/i.test(i)){let t=r.length,e=r.length;for(let i=0;i<e;i++)if(37===r.charCodeAt(i)&&i+2<e){let e=r.charCodeAt(i+1),s=r.charCodeAt(i+2);(e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102)&&(s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102)&&(t-=2,i+=2)}let i=0,s=e-1,n=t=>t>=2&&37===r.charCodeAt(t-2)&&51===r.charCodeAt(t-1)&&(68===r.charCodeAt(t)||100===r.charCodeAt(t));s>=0&&(61===r.charCodeAt(s)?(i++,s--):n(s)&&(i++,s-=3)),1===i&&s>=0&&(61===r.charCodeAt(s)?i++:n(s)&&i++);let a=3*Math.floor(t/4)-(i||0);return a>0?a:0}if(void 0!==to.Buffer&&"function"==typeof to.Buffer.byteLength)return to.Buffer.byteLength(r,"utf8");let s=0;for(let t=0,e=r.length;t<e;t++){let i=r.charCodeAt(t);if(i<128)s+=1;else if(i<2048)s+=2;else if(i>=55296&&i<=56319&&t+1<e){let e=r.charCodeAt(t+1);e>=56320&&e<=57343?(s+=4,t++):s+=3}else s+=3}return s}(i)>S)throw new tb("maxContentLength size of "+S+" exceeded",tb.ERR_BAD_RESPONSE,t,I);if(T&&"get"!==r&&"head"!==r){let e=await g(v,h);if("number"==typeof e&&isFinite(e)&&e>_)throw new tb("Request body larger than maxBodyLength limit",tb.ERR_BAD_REQUEST,t,I)}if(x&&p&&"get"!==r&&"head"!==r&&0!==(e=await g(v,h))){let t,r=new a(i,{method:"POST",body:h,duplex:"half"});if(ta.isFormData(h)&&(t=r.headers.get("content-type"))&&v.setContentType(t),r.body){let[t,i]=tZ(e,tY(tK(x)));h=et(r.body,65536,t,i)}}ta.isString(w)||(w=w?"include":"omit");let n=l&&"credentials"in a.prototype;if(ta.isFormData(h)){let t=v.getContentType();t&&/^multipart\/form-data/i.test(t)&&!/boundary=/i.test(t)&&v.delete("content-type")}v.set("User-Agent","axios/"+ee,!1);let u={...M,signal:E,method:r.toUpperCase(),headers:td(v.normalize()),body:h,duplex:"half",credentials:n?w:void 0};I=l&&new a(i,u);let c=await (l?C(I,M):C(i,u));if(A){let e=ta.toFiniteNumber(c.headers.get("content-length"));if(null!=e&&e>S)throw new tb("maxContentLength size of "+S+" exceeded",tb.ERR_BAD_RESPONSE,t,I)}let d=f&&("stream"===b||"response"===b);if(f&&c.body&&(y||A||d&&R)){let e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});let i=ta.toFiniteNumber(c.headers.get("content-length")),[r,s]=y&&tZ(i,tY(tK(y),!0))||[];c=new o(et(c.body,65536,e=>{if(A&&e>S)throw new tb("maxContentLength size of "+S+" exceeded",tb.ERR_BAD_RESPONSE,t,I);r&&r(e)},()=>{s&&s(),R&&R()}),e)}b=b||"text";let O=await m[ta.findKey(m,b)||"text"](c,t);if(A&&!f&&!d){let e;if(null!=O&&("number"==typeof O.byteLength?e=O.byteLength:"number"==typeof O.size?e=O.size:"string"==typeof O&&(e="function"==typeof s?new s().encode(O).byteLength:O.length)),"number"==typeof e&&e>S)throw new tb("maxContentLength size of "+S+" exceeded",tb.ERR_BAD_RESPONSE,t,I)}return!d&&R&&R(),await new Promise((e,i)=>{tJ(e,i,{data:O,headers:tg.from(c.headers),status:c.status,statusText:c.statusText,config:t,request:I})})}catch(e){if(R&&R(),E&&E.aborted&&E.reason instanceof tb){let i=E.reason;throw i.config=t,I&&(i.request=I),e!==i&&(i.cause=e),i}if(e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new tb("Network Error",tb.ERR_NETWORK,t,I,e&&e.response),{cause:e.cause||e});throw tb.from(e,e&&e.code,t,I,e&&e.response)}}},en=new Map,ea=t=>{let e=t&&t.env||{},{fetch:i,Request:r,Response:s}=e,n=[r,s,i],a=n.length,o,h,l=en;for(;a--;)o=n[a],void 0===(h=l.get(o))&&l.set(o,h=a?new Map:es(e)),l=h;return h};ea();let eo={http:null,xhr:t6,fetch:{get:ea}};ta.forEach(eo,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:e})}catch(t){}Object.defineProperty(t,"adapterName",{__proto__:null,value:e})}});let eh=t=>`- ${t}`,el=t=>ta.isFunction(t)||null===t||!1===t,eu=function(t,e){let i,r,{length:s}=t=ta.isArray(t)?t:[t],n={};for(let a=0;a<s;a++){let s;if(r=i=t[a],!el(i)&&void 0===(r=eo[(s=String(i)).toLowerCase()]))throw new tb(`Unknown adapter '${s}'`);if(r&&(ta.isFunction(r)||(r=r.get(e))))break;n[s||"#"+a]=r}if(!r){let t=Object.entries(n).map(([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));throw new tb("There is no suitable adapter to dispatch the request "+(s?t.length>1?"since :\n"+t.map(eh).join("\n"):" "+eh(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function ec(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new tH(null,t)}function ed(t){return ec(t),t.headers=tg.from(t.headers),t.data=tq.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),eu(t.adapter||tW.adapter,t)(t).then(function(e){ec(t),t.response=e;try{e.data=tq.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=tg.from(e.headers),e},function(e){if(!tG(e)&&(ec(t),e&&e.response)){t.response=e.response;try{e.response.data=tq.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=tg.from(e.response.headers)}return Promise.reject(e)})}let ep={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ep[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});let ef={};ep.transitional=function(t,e,i){function r(t,e){return"[Axios v"+ee+"] Transitional option '"+t+"'"+e+(i?". "+i:"")}return(i,s,n)=>{if(!1===t)throw new tb(r(s," has been removed"+(e?" in "+e:"")),tb.ERR_DEPRECATED);return e&&!ef[s]&&(ef[s]=!0,console.warn(r(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(i,s,n)}},ep.spelling=function(t){return(e,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};let em=function(t,e,i){if("object"!=typeof t)throw new tb("options must be an object",tb.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),s=r.length;for(;s-- >0;){let n=r[s],a=Object.prototype.hasOwnProperty.call(e,n)?e[n]:void 0;if(a){let e=t[n],i=void 0===e||a(e,n,t);if(!0!==i)throw new tb("option "+n+" must be "+i,tb.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new tb("Unknown option "+n,tb.ERR_BAD_OPTION)}};class ey{constructor(t){this.defaults=t||{},this.interceptors={request:new tR,response:new tR}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=Error();let i=(()=>{if(!e.stack)return"";let t=e.stack.indexOf("\n");return -1===t?"":e.stack.slice(t+1)})();try{if(t.stack){if(i){let e=i.indexOf("\n"),r=-1===e?-1:i.indexOf("\n",e+1),s=-1===r?"":i.slice(r+1);String(t.stack).endsWith(s)||(t.stack+="\n"+i)}}else t.stack=i}catch(t){}}throw t}}_request(t,e){let i,r;"string"==typeof t?(e=e||{}).url=t:e=t||{};let{transitional:s,paramsSerializer:n,headers:a}=e=t3(this.defaults,e);void 0!==s&&em(s,{silentJSONParsing:ep.transitional(ep.boolean),forcedJSONParsing:ep.transitional(ep.boolean),clarifyTimeoutError:ep.transitional(ep.boolean),legacyInterceptorReqResOrdering:ep.transitional(ep.boolean)},!1),null!=n&&(ta.isFunction(n)?e.paramsSerializer={serialize:n}:em(n,{encode:ep.function,serialize:ep.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),em(e,{baseUrl:ep.spelling("baseURL"),withXsrfToken:ep.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=a&&ta.merge(a.common,a[e.method]);a&&ta.forEach(["delete","get","head","post","put","patch","query","common"],t=>{delete a[t]}),e.headers=tg.concat(o,a);let h=[],l=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(e))return;l=l&&t.synchronous;let i=e.transitional||tO;i&&i.legacyInterceptorReqResOrdering?h.unshift(t.fulfilled,t.rejected):h.push(t.fulfilled,t.rejected)});let u=[];this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let c=0;if(!l){let t=[ed.bind(this),void 0];for(t.unshift(...h),t.push(...u),r=t.length,i=Promise.resolve(e);c<r;)i=i.then(t[c++],t[c++]);return i}r=h.length;let d=e;for(;c<r;){let t=h[c++],e=h[c++];try{d=t(d)}catch(t){e.call(this,t);break}}try{i=ed.call(this,d)}catch(t){return Promise.reject(t)}for(c=0,r=u.length;c<r;)i=i.then(u[c++],u[c++]);return i}getUri(t){return tI(t1((t=t3(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}ta.forEach(["delete","get","head","options"],function(t){ey.prototype[t]=function(e,i){return this.request(t3(i||{},{method:t,url:e,data:(i||{}).data}))}}),ta.forEach(["post","put","patch","query"],function(t){function e(e){return function(i,r,s){return this.request(t3(s||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}ey.prototype[t]=e(),"query"!==t&&(ey.prototype[t+"Form"]=e(!0))});class eg{constructor(t){let e;if("function"!=typeof t)throw TypeError("executor must be a function.");this.promise=new Promise(function(t){e=t});const i=this;this.promise.then(t=>{if(!i._listeners)return;let e=i._listeners.length;for(;e-- >0;)i._listeners[e](t);i._listeners=null}),this.promise.then=t=>{let e,r=new Promise(t=>{i.subscribe(t),e=t}).then(t);return r.cancel=function(){i.unsubscribe(e)},r},t(function(t,r,s){i.reason||(i.reason=new tH(t,r,s),e(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){let t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new eg(function(e){t=e}),cancel:t}}}let ex={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,ford:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ex).forEach(([t,e])=>{ex[e]=t});let eb=function t(e){let i=new ey(e),r=v(ey.prototype.request,i);return ta.extend(r,ey.prototype,i,{allOwnKeys:!0}),ta.extend(r,i,null,{allOwnKeys:!0}),r.create=function(i){return t(t3(e,i))},r}(tW);eb.Axios=ey,eb.CanceledError=tH,eb.CancelToken=eg,eb.isCancel=tG,eb.VERSION=ee,eb.toFormData=t_,eb.AxiosError=tb,eb.Cancel=eb.CanceledError,eb.all=function(t){return Promise.all(t)},eb.spread=function(t){return function(e){return t.apply(null,e)}},eb.isAxiosError=function(t){return ta.isObject(t)&&!0===t.isAxiosError},eb.mergeConfig=t3,eb.AxiosHeaders=tg,eb.formToJSON=t=>tU(ta.isHTMLForm(t)?new FormData(t):t),eb.getAdapter=eu,eb.HttpStatusCode=ex,eb.default=eb;let ev=async()=>{try{return{now:{temp:"19"}}}catch{return}};function ew(){let[t,e]=(0,u.useState)(void 0);return(0,u.useEffect)(()=>{ev().then(e)},[]),t}t.s(["useWeather",()=>ew],50620)},30468,t=>{"use strict";var e=t.i(34655);t.s(["useWindowSize",0,()=>{let{width:t,height:i}=(0,e.useViewport)();return{width:t,height:i}}])},54262,97839,13717,t=>{"use strict";var e=t.i(22441),i=t.i(70089),r=t.i(19668);let s="M24 23C11.8497 23 2 18.0751 2 12C2 5.92487 11.8497 1 24 1",n={stroke:"currentColor",strokeWidth:1,vectorEffect:"non-scaling-stroke"};function a({className:t}){let{ref:a,hasEnteredViewport:o}=(0,r.useHasEnteredViewport)({threshold:.1}),h=function(){let[t,e]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let t=window.matchMedia("(prefers-reduced-motion: reduce)"),i=()=>e(t.matches);return i(),t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[]),t}();return(0,e.jsx)("div",{ref:a,className:t,style:h?void 0:{opacity:+!!o,transitionProperty:"opacity",transitionDuration:"300ms",transitionTimingFunction:"ease",transitionDelay:o?"600ms":"0ms",willChange:"opacity"},children:(0,e.jsxs)("svg",{width:"48",height:"24",viewBox:"0 0 48 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,e.jsx)("ellipse",{...n,strokeWidth:1,cx:"24",cy:"12",rx:"22",ry:"11"}),(0,e.jsx)("path",{...n,d:"M2 12H46"}),h||!o?(0,e.jsx)("path",{...n,d:s}):Array.from({length:6},(t,i)=>(0,e.jsx)("g",{transform:"translate(24 12)",children:(0,e.jsxs)("g",{children:[(0,e.jsx)("animateTransform",{attributeName:"transform",type:"scale",dur:"2600ms",repeatCount:"indefinite",values:"1 1;-1 1",keyTimes:"0;1",calcMode:"spline",keySplines:"0.42 0 0.58 1",begin:`-${2600*i/6}ms`}),(0,e.jsx)("path",{...n,d:s,transform:"translate(-24 -12)"})]})},`m-${i}`))]})})}t.s(["RotatingGlobe",()=>a],54262);var o=t.i(76973),h=t.i(73475);function l(){let t=(0,o.usePathname)(),{readyToLoadHeavy:e}=(0,h.useRouteTransitionController)();return"/"===t&&!e}t.s(["useHomeLoadingGate",()=>l],97839);var u=t.i(30468);let c="rgba(255, 255, 255, 0.1)";t.s(["default",0,()=>{let{width:t,height:r}=(0,u.useWindowSize)(),s=l(),n=t<1024?16:56,{verticalPath:a,horizontalPath:o,crossPath:h}=(0,i.useMemo)(()=>{let e=Math.max(0,t-2*n),i=Math.max(0,r/3-12),s=i+24,a=s+i,o=t<1280?2:3,h=Array.from({length:o+1},(t,i)=>n+i/o*e).map(t=>Math.round(t)+.5),l=[{startY:0,endY:i},{startY:s,endY:a},{startY:a+24,endY:r}],u=[i+12,a+12],c=l.map(({startY:t,endY:e})=>h.map(i=>`M${i} ${t}V${e}`).join("")).join("");return{verticalPath:c,horizontalPath:u.map(e=>{if(h.length<2)return"";let i=h[0],r=h[h.length-1],s=h.slice(0,-1).map((t,i)=>{let r=h[i+1];return`M${t+12} ${e}H${r-12}`});return[`M0 ${e}H${i-12}`,...s,`M${r+12} ${e}H${t}`].join("")}).join(""),crossPath:h.flatMap(t=>u.flatMap(e=>[`M${t} ${e-6}V${e+6}`,`M${t-6} ${e}H${t+6}`])).join("")}},[r,n,t]);return s?null:(0,e.jsx)("div",{className:"z-20 fixed inset-0 w-full h-full pointer-events-none mix-blend-difference",children:(0,e.jsxs)("svg",{viewBox:`0 0 ${t} ${r}`,className:"block shape-rendering-crispEdges",children:[(0,e.jsx)("path",{d:a,stroke:c,strokeWidth:"1",fill:"none"}),(0,e.jsx)("path",{d:o,stroke:c,strokeWidth:"1",fill:"none"}),(0,e.jsx)("path",{d:h,stroke:"#FFFFFF",strokeWidth:"1",fill:"none",opacity:.4})]})})}],13717)},35231,t=>{"use strict";var e=t.i(70089),i=t.i(90270),r=t.i(29680);let s=()=>0,n=()=>(0,i.getLenisScrollSnapshot)().scrollTop,a=()=>(0,e.useSyncExternalStore)(i.subscribeLenisScroll,n,s),o=()=>r.scrollEnv.getScrollTopPx(),h=t=>{let e=(0,i.subscribeLenisScroll)(t),s=null,n=e=>{s?.();let i=e??window;i.addEventListener("scroll",t,{passive:!0}),s=()=>{i.removeEventListener("scroll",t)}};n(r.scrollEnv.getContainerEl());let a=r.scrollEnv.subscribeContainerEl(e=>{n(e),t()});return()=>{e(),a(),s?.(),s=null}},l=()=>1,u=()=>(0,i.getLenisScrollSnapshot)().limit,c=()=>1,d=()=>(0,i.getLenisScrollSnapshot)().viewportHeight;t.s(["useLenisScrollTop",0,a,"useNearBottom",0,(t=.5)=>{let r=a(),s=(0,e.useSyncExternalStore)(i.subscribeLenisScroll,u,l),n=(0,e.useSyncExternalStore)(i.subscribeLenisScroll,d,c);return(0,e.useMemo)(()=>Math.max(0,s-r)<=n*Math.min(1,Math.max(0,t)),[s,r,n,t])},"useScrollTopPx",0,()=>(0,e.useSyncExternalStore)(h,o,s)])},72443,t=>{"use strict";var e=t.i(22441),i=t.i(70089),r=t.i(29680),s=t.i(35231);function n(t,e,i){return Math.min(i,Math.max(e,t))}let a=2e3;t.s(["default",0,({hidden:t=!1})=>{let o,h=r.scrollEnv.useContainerEl(),l=(0,s.useScrollTopPx)(),[u,c]=(0,i.useState)(0),[d,p]=(0,i.useState)(!1),[f,m]=(0,i.useState)(0),[y,g]=(0,i.useState)(0),[x,b]=(0,i.useState)(6),[v,w]=(0,i.useState)(!1),M=(0,i.useRef)(!1),[S,_]=(0,i.useState)(!1),[A,T]=(0,i.useState)(!1),C=(0,i.useRef)(null),E=(0,i.useRef)(null),I=(0,i.useRef)(null),R=(0,i.useRef)(!1),O=(0,i.useRef)(!1),z=(0,i.useRef)({startY:0,startScrollTop:0});(0,i.useLayoutEffect)(()=>()=>{E.current?.abort(),E.current=null,null!=I.current&&(cancelAnimationFrame(I.current),I.current=null)},[]);let B=(0,i.useCallback)((t=a)=>{_(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{_(!1)},t)},[]);(0,i.useEffect)(()=>{if(h)return M.current||(M.current=!0,w(!0)),B(3e3),R.current||(R.current=!0,I.current=requestAnimationFrame(()=>{T(!0)})),()=>{C.current&&clearTimeout(C.current)}},[h,B]),(0,i.useEffect)(()=>{if(!h)return;let t=()=>c(t=>t+1),e="u">typeof ResizeObserver?new ResizeObserver(()=>{t()}):null;e?.observe(h);let i=h.firstElementChild;i instanceof HTMLElement&&e?.observe(i);let r=[],s=3,n=()=>{t(),(s-=1)>0&&r.push(requestAnimationFrame(n))};r.push(requestAnimationFrame(n));let a=()=>t();return window.addEventListener("load",a,{passive:!0}),()=>{for(let t of(e?.disconnect(),window.removeEventListener("load",a),r))cancelAnimationFrame(t)}},[h]),(0,i.useEffect)(()=>{let t,e;if(!M.current)return;let i=l>=36;p(t=>t===i?t:i),h?(t=Math.max(1,h.scrollHeight),e=Math.max(1,h.clientHeight)):(t=Math.max(1,document.body.scrollHeight||document.documentElement.scrollHeight||1),e=Math.max(1,window.innerHeight||document.documentElement.clientHeight||1));let r=n(l/Math.max(1,t-e),0,1),s=100*r;m(t=>Math.abs(t-s)>.001?s:t);let o=Math.max(20,188*(t>0?n(e/t,0,1):1)),u=6+r*(188-o);g(t=>Math.abs(t-o)>.001?o:t),b(t=>Math.abs(t-u)>.001?u:t),O.current||B(a)},[u,h,l,B]);let{circumference:k,strokeDashoffset:P}={circumference:o=2*Math.PI*12,strokeDashoffset:o-f/100*o},N=(0,i.useCallback)(()=>{r.scrollEnv.scrollToTop("smooth")},[]),L=(0,i.useCallback)(()=>{let t=r.scrollEnv.getContainerEl(),e=t?t.scrollHeight:Math.max(document.documentElement.scrollHeight,document.body.scrollHeight,1),i=t?t.clientHeight:Math.max(1,window.innerHeight||document.documentElement.clientHeight||1);return{el:t,totalH:e,clientH:i,validH:Math.max(1,e-i)}},[]),F=(0,i.useCallback)(t=>{if(!O.current)return;let e=t.clientY-z.current.startY,{totalH:i,clientH:s,validH:a}=L(),o=188-Math.max(20,188*(i>0?n(s/i,0,1):1));if(o<=0)return;let h=z.current.startScrollTop+a/o*e;r.scrollEnv.lenisScrollTo(h,{immediate:!0})},[L]),j=(0,i.useCallback)(()=>{O.current=!1,E.current?.abort(),E.current=null,document.body.style.userSelect="",C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{_(!1)},a)},[]);return(0,e.jsxs)(e.Fragment,{children:[v&&(0,e.jsx)("div",{className:`pointer-events-auto top-1/2 right-0 bottom-0 z-30 fixed w-14 px-3 h-50 -translate-y-1/2 hidden lg:block ${A?"transition-opacity duration-500":""} ${S?"opacity-100":"opacity-0"}${t?" hidden!":""}`,"aria-hidden":t,onMouseEnter:()=>{_(!0),C.current&&clearTimeout(C.current)},onMouseLeave:()=>{C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{_(!1)},a)},children:(0,e.jsxs)("svg",{width:"32",height:"200",viewBox:"0 0 32 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:t=>{let e=t.currentTarget.getBoundingClientRect(),i=(n((t.clientY-e.top)*(200/e.height),6,194)-6)/188,{validH:s}=L();r.scrollEnv.lenisScrollTo(i*s,{immediate:!1})},children:[(0,e.jsx)("path",{d:"M 16 6 V 194",stroke:"currentColor",strokeOpacity:.2,strokeWidth:"6",strokeLinejoin:"round",strokeLinecap:"round"}),(0,e.jsx)("path",{d:`M 16 ${x} V ${x+y}`,stroke:"currentColor",strokeWidth:"6",strokeLinejoin:"round",strokeLinecap:"round",onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),O.current=!0,z.current={startY:t.clientY,startScrollTop:r.scrollEnv.getScrollTopPx()},C.current&&clearTimeout(C.current),_(!0),document.body.style.userSelect="none",E.current?.abort(),E.current=new AbortController;let e=E.current.signal;document.addEventListener("mousemove",F,{signal:e}),document.addEventListener("mouseup",j,{signal:e})},onClick:t=>t.stopPropagation()})]})}),v&&(0,e.jsx)("div",{className:`pointer-events-auto lg:hidden right-0 bottom-0 z-30 fixed flex justify-center items-center px-6 py-6${t?" hidden":""}`,role:"button",tabIndex:t?-1:0,"aria-label":"Scroll to top","aria-hidden":t,onClick:N,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),N())},children:(0,e.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 32 32",className:`${d?"scale-100":"scale-50"} transition-all duration-[0.66s] ease-66 pointer-events-none`,children:[(0,e.jsx)("circle",{r:"12",cy:"16",cx:"16",fill:"none",strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:d?"4":"8",stroke:"currentColor",strokeOpacity:d?.2:1,transform:"rotate(-90 16 16)",style:{transition:"stroke-opacity 0.66s cubic-bezier(0.66, 0, 0.01, 1), stroke-width 0.66s cubic-bezier(0.66, 0, 0.01, 1)"}}),(0,e.jsx)("circle",{r:"12",cy:"16",cx:"16",fill:"none",strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:d?"4":"8",stroke:"currentColor",strokeDashoffset:P,strokeDasharray:k,transform:"rotate(-90 16 16)",style:{transition:"stroke-opacity 0.66s cubic-bezier(0.66, 0, 0.01, 1), stroke-width 0.66s cubic-bezier(0.66, 0, 0.01, 1)"}})]})})]})}])},45556,t=>{"use strict";var e=t.i(22441),i=t.i(70089),r=t.i(80894),s=t.i(4278),n=t.i(83039);let a="selected-work",o={};function h({onImagesChange:t}){let[h,l]=(0,i.useState)(()=>({...o})),[u,c]=(0,i.useState)(0),d=(0,i.useRef)(null),p=(0,s.usePasscodeAccessLookup)(),f=(0,i.useMemo)(()=>n.WORK_ITEMS.filter(t=>!t.passcodeProtected||p(t.href)),[p]),m=(0,i.useMemo)(()=>f.reduce((t,e)=>(t[e.href]=(0,i.createRef)(),t),{}),[f]),y=(0,i.useMemo)(()=>f.map(t=>({href:t.href,imageUrl:t.imageUrl,hoverImageUrl:t.hoverImageUrl,targetRef:m[t.href]})),[f,m]);return(0,i.useEffect)(()=>(t?.(y),()=>{t?.([])}),[t,y]),(0,i.useEffect)(()=>{let t=d.current;if(!t)return;let e=()=>{c(t.clientWidth/12)};e();let i=new ResizeObserver(()=>{e()});return i.observe(t),()=>{i.disconnect()}},[]),(0,i.useEffect)(()=>{let t=!1,e=(e,i,r)=>{if(t||i<=0||r<=0)return;let s=`${i} / ${r}`;o[e]!==s&&(o[e]=s),l(t=>t[e]===s?t:{...t,[e]:s})},i=f.map(t=>{let i=new window.Image;return i.decoding="async",i.onload=()=>{e(t.imageUrl,i.naturalWidth,i.naturalHeight)},i.src=t.imageUrl,i.complete&&i.naturalWidth>0&&i.naturalHeight>0&&e(t.imageUrl,i.naturalWidth,i.naturalHeight),i});return()=>{for(let e of(t=!0,i))e.onload=null}},[f]),(0,e.jsx)("section",{id:a,className:"px-4 lg:px-14 py-18 lg:py-24 w-full",children:(0,e.jsx)("div",{ref:d,className:"grid grid-cols-12 w-full",style:{rowGap:`${u}px`},children:f.map(t=>{var i;let s=(i=t.href).startsWith("http://")||i.startsWith("https://"),n=t.href,a=t.type,o="group block space-y-3 p-2",l=s?`${t.name} - ${t.year} (external)`:`${t.name} - ${t.year}`,u=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{ref:m[t.href],"aria-hidden":"true",className:"relative w-full pointer-events-none select-none",style:{aspectRatio:h[t.imageUrl]??"1 / 1"},children:t.codingProject&&(0,e.jsx)("span",{className:"top-0 right-0 z-10 absolute bg-selection px-1 font-mono-2 text-black text-xs uppercase pointer-events-none select-none","aria-hidden":"true",children:"Open Source"})}),(0,e.jsxs)("div",{className:"flex justify-between items-center gap-3 min-w-0 text-xs lg:text-sm uppercase",children:[(0,e.jsx)("span",{className:"flex-1 min-w-0 truncate",children:t.name}),(0,e.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3 font-mono-2 tabular-nums whitespace-nowrap shrink-0",children:[(0,e.jsx)("span",{children:t.year}),"post"!==a&&(0,e.jsxs)("span",{className:"hidden lg:inline-flex items-center gap-1","aria-hidden":"true",children:[(0,e.jsx)("span",{children:a}),(0,e.jsx)("span",{children:"↗"})]})]})]})]});return(0,e.jsx)("article",{className:t.gridClass??"col-span-12 lg:col-span-6 xl:col-span-4",children:s?(0,e.jsx)("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:o,"aria-label":l,children:u}):(0,e.jsx)(r.default,{href:n,className:o,"aria-label":l,children:u})},t.href)})})})}t.s(["SELECTED_WORK_SECTION_ID",0,a,"default",()=>h])},28192,t=>{"use strict";var e=t.i(22441),i=t.i(70089),r=t.i(49936),s=t.i(71358);let n="contact",a=(0,i.forwardRef)(function(t,i){return new Date().getFullYear(),(0,e.jsxs)("footer",{id:n,ref:i,className:"z-10 relative flex flex-col justify-center p-6 lg:p-16 w-full h-dvh lg:h-screen pointer-events-none",children:[(0,e.jsxs)("div",{className:"gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] uppercase leading-none",style:{fontVariationSettings:'"wdth" 120'},children:[(0,e.jsx)(s.default,{text:"Design",className:"col-span-6 md:col-span-5 xl:col-span-4 md:col-start-2 xl:col-start-3 text-left pointer-events-auto",startDelayMs:300}),(0,e.jsx)(s.default,{text:"for",className:"col-span-6 md:col-span-5 xl:col-span-4 text-right pointer-events-auto",startDelayMs:300,reverse:!0})]}),(0,e.jsx)("div",{className:"gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] uppercase leading-none",style:{fontVariationSettings:'"wdth" 120'},children:(0,e.jsx)(s.default,{text:"Everyone",className:"col-span-12 md:col-start-2 xl:col-start-3 text-left pointer-events-auto",startDelayMs:300})}),(0,e.jsx)("div",{className:"gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] uppercase leading-none",style:{fontVariationSettings:'"wdth" 120'},children:(0,e.jsx)(s.default,{text:"With Agents",className:"col-span-12 md:col-end-12 xl:col-end-11 text-right pointer-events-auto",startDelayMs:300,reverse:!0})}),(0,e.jsx)("div",{className:"absolute inset-0 flex flex-col justify-end px-4 lg:px-14 py-18 lg:py-24 font-mono-2 text-sm lg:text-base",children:(0,e.jsxs)("div",{className:"flex lg:flex-row flex-col justify-between w-full",children:[(0,e.jsx)(r.default,{className:"block before:absolute relative before:inset-0 p-2 lg:hover:before:border-l1 before:border-2 before:border-transparent active:before:border-l1 before:border-dotted uppercase before:content-[''] before:transition-colors before:duration-200 cursor-pointer pointer-events-auto before:pointer-events-none",href:"mailto:hi@open-design.ai",children:(0,e.jsx)(s.default,{text:"hi@open-design.ai",startDelayMs:300})}),(0,e.jsx)("div",{className:"flex flex-row items-center gap-2 lg:gap-4",children:[{href:"https://x.com/OpenDesignHQ",label:"Twitter/X"},{href:"https://discord.gg/mHAjSMV6gz",label:"Discord"},{href:"https://github.com/nexu-io/open-design",label:"GitHub"}].map(({href:t,label:i})=>(0,e.jsx)(r.default,{className:"block before:absolute relative before:inset-0 p-2 lg:hover:before:border-l1 before:border-2 before:border-transparent active:before:border-l1 before:border-dotted uppercase before:content-[''] before:transition-colors before:duration-200 cursor-pointer pointer-events-auto before:pointer-events-none",href:t,target:"_blank",rel:"noopener noreferrer",children:(0,e.jsx)(s.default,{text:i,startDelayMs:300})},t))})]})})]})});t.s(["CONTACT_SECTION_ID",0,n,"default",0,a])},62291,1111,t=>{"use strict";var e=t.i(34655);t.s(["useIsMobileWidth",0,()=>(0,e.useIsMobile)()],62291);var i=t.i(70089);function r(t,e,i){return"gte"===t?e>=i:e<=i}let s=0,n=new Set;function a(){for(let t of n)t()}let o={getSnapshot:()=>s,subscribe:t=>(n.add(t),()=>{n.delete(t)}),setDampedScaleT(t){let e=Math.min(1,Math.max(0,t));.001>=Math.abs(e-s)||(s=e,a())},reset(){0!==s&&(s=0,a())}};function h(t=.5){return o.getSnapshot()>=t}function l(t=.5,e){return function(t,e,s){let n=s?.mode??"gte",a=s?.getServerSnapshot??(()=>r(n,0,e)),{subscribe:o,getSnapshot:h}=t;return(0,i.useSyncExternalStore)((0,i.useCallback)(t=>{let i=r(n,h(),e);return o(()=>{let s=r(n,h(),e);s!==i&&(i=s,t())})},[o,h,e,n]),()=>r(n,h(),e),a)}(o,t,e)}t.s(["ARROW_FULLSCREEN_DOM_COLOR_TRANSITION",0,"transition-colors duration-300 ease-out motion-reduce:transition-none","arrowFullscreenProgressStore",0,o,"readArrowFullscreenPastThreshold",()=>h,"useArrowFullscreenPastThreshold",()=>l],1111)},88106,t=>{"use strict";var e=t.i(22441),i=t.i(70089),r=t.i(11818),s=t.i(50245),n=t.i(76973),a=t.i(80894),o=t.i(41242),h=t.i(95428),l=t.i(96716),u=t.i(73475),c=t.i(71358),d=t.i(92959),p=t.i(50620),f=t.i(16265),m=t.i(30468),y=t.i(54262),g=t.i(29680),x=t.i(13717),b=t.i(72443),v=t.i(45556),w=t.i(28192),M=t.i(97839),S=t.i(23525),_=t.i(90975),A=t.i(35231),T=t.i(62291),C=t.i(1111);let E="hq:pendingScrollAnchor",I=new Set(["l","d","a","s","t","b"]);function R(){let t=(0,n.usePathname)(),{menuOpen:R,setMenuOpen:O}=(0,u.useFullscreenTransitionController)(),{startNavigation:z}=(0,u.useRouteTransitionController)(),B=(0,M.useHomeLoadingGate)(),k=(0,i.useRef)(!1),[P,N]=(0,i.useState)(0),L=(0,i.useCallback)(()=>{N(t=>t+1)},[]),F=(0,i.useCallback)(()=>{N(t=>Math.max(0,t-1))},[]),j=(0,i.useCallback)(()=>{N(0)},[]),{theme:D}=(0,_.useThemeMode)(),{soundEnabled:U}=(0,S.useShellMedia)(),V=(0,i.useRef)({theme:D,soundEnabled:U});(0,i.useEffect)(()=>{let t=V.current;(t.theme!==D||t.soundEnabled!==U)&&(V.current={theme:D,soundEnabled:U},N(t=>t>0?0:t))},[D,U]),(0,i.useEffect)(()=>{R||(k.current=!1)},[R]),(0,i.useEffect)(()=>{let t=t=>{if(t.defaultPrevented||t.metaKey||t.ctrlKey||t.altKey||(t=>{if(!(t instanceof HTMLElement))return!1;let e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||t.isContentEditable})(t.target))return;let e=1===t.key.length?t.key.toLowerCase():"";I.has(e)&&j()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[j]);let W=(0,f.usePointerPosition)(),{width:q,height:G}=(0,m.useWindowSize)(),H=(0,T.useIsMobileWidth)(),J=(0,d.useBrowserName)(),X=(0,C.useArrowFullscreenPastThreshold)(),$=X?o.DOTTED_BORDER_BASE_WHITE:o.DOTTED_BORDER_BASE,Y=R?"bg-l1":X?"bg-white":"bg-l1",Z=`h-0.5 ${Y} absolute transition-all duration-[1200ms] ease-66`,K=R&&k.current,Q=K?o.DOTTED_BORDER_BASE_WHITE:o.DOTTED_BORDER_BASE,tt=`${o.DOTTED_BORDER_BASE} p-2 text-l1 uppercase cursor-pointer pointer-events-auto ${C.ARROW_FULLSCREEN_DOM_COLOR_TRANSITION}`,te=(0,A.useNearBottom)(.5);g.scrollEnv.useScrollEdgeShortcuts();let ti=e=>{(O(!1),"/"===t)?g.scrollEnv.lenisScrollTo(e,{lerp:.1}):(sessionStorage.setItem(E,e),z("/"))};(0,i.useEffect)(()=>{B&&O(!1)},[B,O]),(0,i.useEffect)(()=>{H||O(!1)},[H,O]);let tr=Math.round(W.x*q),ts=Math.round((1-W.y)*G),tn=tr.toString().padStart(4,"0"),ta=ts.toString().padStart(4,"0"),[to,th]=(0,i.useState)("--:--");(0,i.useEffect)(()=>{let t=()=>{let t=new Date,e=t.getHours().toString().padStart(2,"0"),i=t.getMinutes().toString().padStart(2,"0");th(`${e}:${i}`)};t();let e=window.setInterval(t,6e4);return()=>window.clearInterval(e)},[]);let tl=new Date().getFullYear(),tu=(0,p.useWeather)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("header",{className:`z-50 fixed inset-0 flex flex-col justify-between font-mono-2 pointer-events-none ${C.ARROW_FULLSCREEN_DOM_COLOR_TRANSITION} ${X?"text-white":"text-l1"}`,children:[(0,e.jsxs)("div",{className:"flex justify-between items-center px-4 lg:px-14 py-4 lg:py-7 text-base",children:[(0,e.jsxs)(a.default,{dotted:!0,dottedTone:R?"default":X?"white":"default",className:`p-2 font-sans font-bold uppercase pointer-events-auto ${C.ARROW_FULLSCREEN_DOM_COLOR_TRANSITION} ${R?"text-l1":""}`,style:{fontVariationSettings:'"wght" 700, "wdth" 120'},href:"/",children:[(0,e.jsx)(c.default,{text:"open design",startDelayMs:300,scrambleColors:!1}),(0,e.jsx)(c.default,{text:"-ai",startDelayMs:300,scrambleColors:!1})]}),(0,e.jsxs)("div",{className:"hidden lg:flex flex-wrap justify-between items-center gap-x-3 gap-y-2 pointer-events-auto basis-1/2 xl:basis-1/3",children:[(0,e.jsx)("button",{type:"button",className:`${$} p-2 uppercase cursor-pointer`,onClick:()=>ti(`#${v.SELECTED_WORK_SECTION_ID}`),children:(0,e.jsx)(c.default,{text:"Work",startDelayMs:300,scrambleColors:!1})}),(0,e.jsx)("button",{type:"button",className:`${$} p-2 uppercase cursor-pointer`,onClick:()=>ti(`#${w.CONTACT_SECTION_ID}`),children:(0,e.jsx)(c.default,{text:"Contact",startDelayMs:300,scrambleColors:!1})}),(0,e.jsx)(h.ASCIIThemeToggle,{className:`${$} p-2 uppercase cursor-pointer pointer-events-auto`,light:"THEME[L]",dark:"THEME[D]",system:"THEME[A]",startDelayMs:300,scrambleColors:!1,onPointerEnter:L,onPointerLeave:F,onPointerDown:j}),(0,e.jsx)(l.ASCIISoundToggle,{className:`${$} p-2 uppercase cursor-pointer pointer-events-auto`,startDelayMs:300,scrambleColors:!1,onPointerEnter:L,onPointerLeave:F,onPointerDown:j})]}),!B&&(0,e.jsx)("div",{className:"lg:hidden flex flex-row justify-end items-center gap-4 col-span-6 p-2 cursor-pointer pointer-events-auto",onClick:()=>O(t=>{let e=!t;return e&&(k.current=(0,C.readArrowFullscreenPastThreshold)()),e}),children:(0,e.jsxs)("div",{className:"relative w-6 h-6",children:[(0,e.jsx)("div",{className:`${R?"w-0 delay-150 opacity-0":"w-6"} top-1.5 ${Z}`}),(0,e.jsx)("div",{className:`${R?"w-0 opacity-0":"w-6 delay-150"} bottom-1.5 ${Z}`}),(0,e.jsx)("div",{className:`${R?"w-6 delay-150":"w-0 opacity-0"} right-0 rotate-45 ${Z} top-2.75`}),(0,e.jsx)("div",{className:`${R?"w-6":"w-0 opacity-0 delay-150"} right-0 -rotate-45 ${Z} bottom-2.75`})]})})]}),(0,e.jsxs)("div",{className:"flex justify-between px-4 lg:px-14 py-4 lg:py-7",children:["/"===t&&te?(0,e.jsx)(c.default,{className:"p-2 uppercase",text:`Haoqi (c) ${tl}`,startDelayMs:300,letterDelayMs:40,scrambleColors:!1},"copy"):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(c.default,{className:`lg:hidden p-2 uppercase ${C.ARROW_FULLSCREEN_DOM_COLOR_TRANSITION} ${R?"text-l1":""}`,text:`${to}${tu?.now?.temp!=null?` ${tu.now.temp}\xb0C`:""}`,startDelayMs:300,letterDelayMs:40,scrambleColors:!1},"time-mobile"),(0,e.jsx)(c.default,{className:"hidden lg:inline p-2 uppercase",text:`GMT-7 LA ${to}${tu?.now?.temp!=null?` ${tu.now.temp}\xb0C`:""}`,startDelayMs:300,letterDelayMs:40,scrambleColors:!1},"time-desktop")]}),(0,e.jsx)(c.default,{className:`${$} hidden lg:inline lg:bottom-7 lg:left-1/2 lg:fixed p-2 lg:-translate-x-1/2 cursor-pointer pointer-events-auto`,onClick:()=>g.scrollEnv.scrollToTop("smooth"),onPointerEnter:L,onPointerLeave:F,onPointerDown:j,text:`${tn} X ${ta} Y`,startDelayMs:300,letterDelayMs:40,scrambleColors:!1}),!B&&(0,e.jsx)(y.RotatingGlobe,{className:"hidden lg:block p-2 shrink-0"}),R&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(h.ASCIIThemeToggle,{className:tt,light:"THEME[L]",dark:"THEME[D]",system:"THEME[A]",startDelayMs:300,scrambleColors:!1}),(0,e.jsx)(l.ASCIISoundToggle,{className:tt,startDelayMs:300,scrambleColors:!1})]})]}),!B&&(0,e.jsx)(b.default,{hidden:R})]}),"/"===t&&(0,e.jsx)(x.default,{}),(0,e.jsx)(r.AnimatePresence,{children:P>0&&(0,e.jsx)(s.motion.div,{className:"hidden top-24 right-0 left-0 z-50 fixed lg:flex flex-row-reverse px-4 lg:px-14 w-full pointer-events-none",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.4,ease:[.25,1,.5,1]},children:(0,e.jsxs)("div",{className:"*:z-1 *:relative flex flex-col bg-be p-2 font-mono-2 text-l1 xl:basis-1/3 basis-1/2",children:[(0,e.jsx)(c.default,{text:"Press [L] for light mode, [D] for dark mode, [A] for auto mode, or click THEME. Press [S] to pause or resume background music, or click SOUND; your choice is saved in this browser. [T] scroll to top, [B] scroll to bottom.",startDelayMs:0,letterDelayMs:10}),(0,e.jsx)("br",{}),(0,e.jsxs)("span",{className:"flex flex-row justify-between",children:[(0,e.jsx)(c.default,{text:J,startDelayMs:200,letterDelayMs:10}),(0,e.jsx)(c.default,{text:`${q} \xd7 ${G}`,startDelayMs:200,letterDelayMs:10})]})]})},"nav-hint-panel")}),R&&(0,e.jsxs)("div",{className:"lg:hidden z-40 fixed inset-0 flex flex-col justify-center items-start px-6 lg:px-16 py-6 lg:py-8 font-mono-2 text-[10svw] text-l1",children:[(0,e.jsx)(a.default,{dotted:!0,dottedTone:K?"white":"default",useActiveClass:!0,href:"/",activeClass:"",className:"uppercase",onClick:()=>O(!1),children:(0,e.jsx)(c.default,{text:"Home",startDelayMs:300})}),(0,e.jsx)("button",{type:"button",className:`${Q} uppercase text-left cursor-pointer`,onClick:()=>ti(`#${v.SELECTED_WORK_SECTION_ID}`),children:(0,e.jsx)(c.default,{text:"Work",startDelayMs:400})}),(0,e.jsx)("button",{type:"button",className:`${Q} uppercase text-left cursor-pointer`,onClick:()=>ti(`#${w.CONTACT_SECTION_ID}`),children:(0,e.jsx)(c.default,{text:"Contact",startDelayMs:500})})]})]})}t.s(["PENDING_SCROLL_ANCHOR_SESSION_KEY",0,E,"default",()=>R])}]);
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall