PageSourceSearch

https://www.myposter.de/_nuxt/CXJqLWYu.js

js myposter.de collected 2026-10-01 12:22:26 UTC 1,131,723 bytes, 4,350 lines download raw bytes

1import{c as e,l as t,u as n}from"./DlwYmI-E.js";import{B as r,C as i,D as a,En as o,H as s,Ht as c,J as l,Kt as u,L as d,Lt as f,On as p,Qn as m,Tn as h,Ut as g,_,_n as v,an as y,b,bn as x,ct as S,et as C,ft as w,g as T,gn as E,gt as D,it as O,k,l as A,mt as j,o as M,pn as N,qt as P,st as ee,tr as te,tt as ne,un as re,v as F,vn as I,xn as L,xt as ie,y as ae}from"./DBq4UlV4.js";import{t as oe}from"./DSJ9I3OW.js";import{Bn as se}from"./ChQdSMSK.js";import{A as ce,P as le,k as ue}from"./DlTq1xPB.js";import{m as de,p as fe}from"./90xg2Rc1.js";function pe(e,t={},n){for(let r in e){let i=e[r],a=n?`${n}:${r}`:r;typeof i==`object`&&i?pe(i,t,a):typeof i==`function`&&(t[a]=i)}return t}var me={run:e=>e()},he=console.createTask===void 0?()=>me:console.createTask;function ge(e,t){let n=he(t.shift());return e.reduce((e,r)=>e.then(()=>n.run(()=>r(...t))),Promise.resolve())}function R(e,t){let n=he(t.shift());return Promise.all(e.map(e=>n.run(()=>e(...t))))}function _e(e,t){for(let n of[...e])n(t)}var ve=class{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,t,n={}){if(!e||typeof t!=`function`)return()=>{};let r=e,i;for(;this._deprecatedHooks[e];)i=this._deprecatedHooks[e],e=i.to;if(i&&!n.allowDeprecated){let e=i.message;e||=`${r} hook has been deprecated`+(i.to?`, please use ${i.to}`:``),this._deprecatedMessages||=new Set,this._deprecatedMessages.has(e)||(console.warn(e),this._deprecatedMessages.add(e))}if(!t.name)try{Object.defineProperty(t,"name",{get:()=>`_`+e.replace(/\W+/g,`_`)+`_hook_cb`,configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&=(this.removeHook(e,t),void 0)}}hookOnce(e,t){let n,r=(...e)=>(typeof n==`function`&&n(),n=void 0,r=void 0,t(...e));return n=this.hook(e,r),n}removeHook(e,t){if(this._hooks[e]){let n=this._hooks[e].indexOf(t);n!==-1&&this._hooks[e].splice(n,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,t){this._deprecatedHooks[e]=typeof t==`string`?{to:t}:t;let n=this._hooks[e]||[];delete this._hooks[e];for(let t of n)this.hook(e,t)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(let t in e)this.deprecateHook(t,e[t])}addHooks(e){let t=pe(e),n=Object.keys(t).map(e=>this.hook(e,t[e]));return()=>{for(let e of n.splice(0,n.length))e()}}removeHooks(e){let t=pe(e);for(let e in t)this.removeHook(e,t[e])}removeAllHooks(){for(let e in this._hooks)delete this._hooks[e]}callHook(e,...t){return t.unshift(e),this.callHookWith(ge,e,...t)}callHookParallel(e,...t){return t.unshift(e),this.callHookWith(R,e,...t)}callHookWith(e,t,...n){let r=this._before||this._after?{name:t,args:n,context:{}}:void 0;this._before&&_e(this._before,r);let i=e(t in this._hooks?[...this._hooks[t]]:[],n);return i instanceof Promise?i.finally(()=>{this._after&&r&&_e(this._after,r)}):(this._after&&r&&_e(this._after,r),i)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){let t=this._before.indexOf(e);t!==-1&&this._before.splice(t,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){let t=this._after.indexOf(e);t!==-1&&this._after.splice(t,1)}}}};function ye(){return new ve}var z={"acrylglas-druckverfahren-direktdruck":`product-acrylglas-druckverfahren-direktdruck.glb`,"acrylglas-druckverfahren-fineart":`product-acrylglas-druckverfahren-direktdruck.glb`,"echtglas-default":`product-echtglas-default.glb`,"forexplatte-druckverfahren-direktdruck":`product-forexplatte-druckverfahren-direktdruck.glb`,"forexplatte-druckverfahren-fineart-glaenzend":`product-forexplatte-druckverfahren-fineart-glaenzend.glb`,"forexplatte-druckverfahren-fineart-matt":`product-forexplatte-druckverfahren-fineart-matt.glb`,"gallerybond-default":`product-gallerybond-default.glb`,"leinwand-keilrahmen-25mm":`product-leinwand-keilrahmen-25mm.glb`,"leinwand-keilrahmen-38mm":`product-leinwand-keilrahmen-38mm.glb`,"poster-laminierung-glaenzend":`product-poster-laminierung-glaenzend.glb`,"poster-laminierung-keine":`product-poster-laminierung-keine.glb`,"poster-laminierung-matt":`product-poster-laminierung-matt.glb`,"product-aludibond-druckverfahren-direktdruck":`product-aludibond-druckverfahren-direktdruck.glb`,"product-aludibond-druckverfahren-fineart-glaenzend":`product-aludibond-druckverfahren-fineart-glaenzend.glb`,"product-aludibond-druckverfahren-fineart-hahnemuehle":`product-aludibond-druckverfahren-fineart-hahnemuehle.glb`,"product-aludibond-druckverfahren-fineart-matt":`product-aludibond-druckverfahren-fineart-matt.glb`,"product-aludibond-materialausfuehrung-brushed":`product-aludibond-materialausfuehrung-brushed.glb`},be={alurahmen:{gapWidth:0,modelFile:`frame-a1.glb`,moldingWidth:10},artbox:{gapWidth:0,modelFile:`frame-b1.glb`,moldingWidth:4},holzrahmen:{gapWidth:0,modelFile:`frame-h16.glb`,moldingWidth:20},"schattenfuge-leinwand":{gapWidth:0,modelFile:`frame-l1.glb`,moldingWidth:13},"schattenfuge-platte":{gapWidth:10,modelFile:`frame-s1.glb`,moldingWidth:15}},B={"holzrahmen-gemasert-eiche-natur":{gapWidth:0,modelFile:`frame-h10.glb`,moldingWidth:20},"holzrahmen-schwarz-breit":{gapWidth:0,modelFile:`frame-h7.glb`,moldingWidth:41},"holzrahmen-weiss-breit":{gapWidth:0,modelFile:`frame-h7.glb`,moldingWidth:41}},xe=`alurahmen-eckig-gold.alurahmen-eckig-kupfer.alurahmen-eckig-schwarz.alurahmen-eckig-schwarz-matt.alurahmen-eckig-silber.alurahmen-eckig-silber-matt.alurahmen-eckig-weiss.artbox-eiche.artbox-natur.artbox-schwarz-lack.artbox-schwarz-struktur.artbox-weiss-lack.artbox-weiss-struktur.holzrahmen-eiche-natur-neu.holzrahmen-gemasert-buche-natur.holzrahmen-gemasert-eiche-natur.holzrahmen-gemasert-schwarz.holzrahmen-gemasert-weiss.holzrahmen-schwarz.holzrahmen-schwarz-breit.holzrahmen-weiss.holzrahmen-weiss-breit.
1schattenfuge-leinwand-eiche.schattenfuge-leinwand-natur.schattenfuge-leinwand-schwarz-lack.schattenfuge-leinwand-schwarz-struktur.schattenfuge-leinwand-weiss-lack.schattenfuge-leinwand-weiss-struktur.schattenfuge-platte-eiche.schattenfuge-platte-natur.schattenfuge-platte-schwarz-lack.schattenfuge-platte-schwarz-struktur.schattenfuge-platte-weiss-lack.schattenfuge-platte-weiss-struktur`.split(`.`),Se=Object.keys(be).sort((e,t)=>t.length-e.length),Ce=e=>Se.find(t=>e.startsWith(`${t}-`))??null,we=e=>xe.includes(e),Te=e=>{if(!we(e.frameType))return null;let t=Ce(e.frameType),n=B[e.frameType]??(t?be[t]:null);return n?{gapWidth:n.gapWidth,modelFile:n.modelFile,moldingWidth:e.moldingWidth??n.moldingWidth}:null},Ee={BLACK:`mat-schwarz`,CREME:`mat-creme`,NONE:`mat-none`,WHITE:`mat-weiss`},De={"mat-creme":`#FFFBE7`,"mat-schwarz":`#232428`,"mat-weiss":`#FFFFFF`},Oe=`passepartout.glb`,ke={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Ae={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},je=`attached`,Me=`detached`,Ne=1e3,Pe=1001,Fe=1002,Ie=1003,Le=1004,Re=1004,ze=1005,Be=1005,Ve=1006,He=1007,Ue=1007,We=1008,Ge=1008,Ke=1009,qe=1010,Je=1011,Ye=1012,Xe=1013,Ze=1014,Qe=1015,$e=1016,et=1017,tt=1018,nt=1020,rt=35902,it=35899,at=1021,ot=1022,st=1023,ct=1026,lt=1027,ut=1028,dt=1029,ft=1030,pt=1031,mt=1032,ht=1033,gt=33776,_t=33777,vt=33778,yt=33779,bt=35840,xt=35841,St=35842,Ct=35843,wt=36196,Tt=37492,Et=37496,Dt=37488,Ot=37489,kt=37490,At=37491,jt=37808,Mt=37809,Nt=37810,Pt=37811,Ft=37812,It=37813,Lt=37814,Rt=37815,zt=37816,Bt=37817,Vt=37818,Ht=37819,Ut=37820,Wt=37821,Gt=36492,Kt=36494,qt=36495,Jt=36283,Yt=36284,Xt=36285,Zt=36286,Qt=2200,$t=2201,en=2202,tn=2300,nn=2301,rn=2302,an=2303,on=2400,sn=2401,cn=2402,ln=2500,un=2501,dn=3200,fn=3201,pn=3202,mn=3203,hn=`srgb`,gn=`srgb-linear`,_n=`linear`,vn=`srgb`,yn=7680,bn=7681,xn=7682,Sn=7683,Cn=34055,wn=34056,Tn=5386,En=35044,Dn=35048,On=35040,kn=35045,An=35049,jn=35041,Mn=35046,Nn=35050,Pn=35042,Fn=`300 es`,In=2e3,Ln=2001,Rn={COMPUTE:`compute`,RENDER:`render`},zn={PERSPECTIVE:`perspective`,LINEAR:`linear`,FLAT:`flat`},Bn={NORMAL:`normal`,CENTROID:`centroid`,SAMPLE:`sample`,FIRST:`first`,EITHER:`either`},Vn={TEXTURE_COMPARE:`depthTextureCompare`};function Hn(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}var Un={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Wn(e,t){return new Un[e](t)}function Gn(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Kn(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function qn(){let e=Kn(`canvas`);return e.style.display=`block`,e}var Jn={},Yn=null;function Xn(e){Yn=e}function Zn(){return Yn}function Qn(...e){let t=`THREE.`+e.shift();Yn?Yn(`log`,t,...e):console.log(t,...e)}function $n(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.`}return e}function V(...e){e=$n(e);let t=`THREE.`+e.shift();if(Yn)Yn(`warn`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function H(...e){e=$n(e);let t=`THREE.`+e.shift();if(Yn)Yn(`error`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function er(...e){let t=e.join(` `);t in Jn||(Jn[t]=!0,V(...e))}function tr(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var nr={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},rr=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}},ir=`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.
1cd.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`.split(`.`),ar=1234567,or=Math.PI/180,sr=180/Math.PI;function cr(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(ir[e&255]+ir[e>>8&255]+ir[e>>16&255]+ir[e>>24&255]+`-`+ir[t&255]+ir[t>>8&255]+`-`+ir[t>>16&15|64]+ir[t>>24&255]+`-`+ir[n&63|128]+ir[n>>8&255]+`-`+ir[n>>16&255]+ir[n>>24&255]+ir[r&255]+ir[r>>8&255]+ir[r>>16&255]+ir[r>>24&255]).toLowerCase()}function U(e,t,n){return Math.max(t,Math.min(n,e))}function lr(e,t){return(e%t+t)%t}function ur(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function dr(e,t,n){return e===t?0:(n-e)/(t-e)}function fr(e,t,n){return(1-n)*e+n*t}function pr(e,t,n,r){return fr(e,t,1-Math.exp(-n*r))}function mr(e,t=1){return t-Math.abs(lr(e,t*2)-t)}function hr(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function gr(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function _r(e,t){return e+Math.floor(Math.random()*(t-e+1))}function vr(e,t){return e+Math.random()*(t-e)}function yr(e){return e*(.5-Math.random())}function br(e){e!==void 0&&(ar=e);let t=ar+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function xr(e){return e*or}function Sr(e){return e*sr}function Cr(e){return!(e&e-1)&&e!==0}function wr(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Tr(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function Er(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:V(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function Dr(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function Or(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`Invalid component type.`)}}var kr={DEG2RAD:or,RAD2DEG:sr,generateUUID:cr,clamp:U,euclideanModulo:lr,mapLinear:ur,inverseLerp:dr,lerp:fr,damp:pr,pingpong:mr,smoothstep:hr,smootherstep:gr,randInt:_r,randFloat:vr,randFloatSpread:yr,seededRandom:br,degToRad:xr,radToDeg:Sr,isPowerOfTwo:Cr,ceilPowerOfTwo:wr,floorPowerOfTwo:Tr,setQuaternionFromProperEuler:Er,normalize:Or,denormalize:Dr},W=class e{static{e.prototype.isVector2=!0}constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}
vendor: 5,070 bytes, line 1
1applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=U(this.x,e.x,t.x),this.y=U(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=U(this.x,e,t),this.y=U(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(U(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(U(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Ar=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:V(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>
vendor: 12,138 bytes, line 1
1Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(U(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},G=class e{static{e.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Mr.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Mr.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=U(this.x,e.x,t.x),this.y=U(this.y,e.y,t.y),this.z=U(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=U(this.x,e,t),this.y=U(this.y,e,t),this.z=U(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(U(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return jr.copy(this).projectOnVector(e),this.sub(jr)}reflect(e){return this.sub(jr.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(U(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},jr=new G,Mr=new Ar,Nr=class e{static{e.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Pr.makeScale(e,t)),this}rotate(e){return this.premultiply(Pr.makeRotation(-e)),this}translate(e,t){return this.premultiply(Pr.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},Pr=new Nr,Fr=new Nr().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ir=new Nr().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.20397
17,1.0569715);function Lr(){let e={enabled:!0,workingColorSpace:gn,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=zr(e.r),e.g=zr(e.g),e.b=zr(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=Br(e.r),e.g=Br(e.g),e.b=Br(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?_n:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return er(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return er(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[gn]:{primaries:t,whitePoint:r,transfer:_n,toXYZ:Fr,fromXYZ:Ir,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:hn},outputColorSpaceConfig:{drawingBufferColorSpace:hn}},[hn]:{primaries:t,whitePoint:r,transfer:vn,toXYZ:Fr,fromXYZ:Ir,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:hn}}}),e}var Rr=Lr();function zr(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function Br(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var Vr,Hr=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Vr===void 0&&(Vr=Kn(`canvas`)),Vr.width=e.width,Vr.height=e.height;let t=Vr.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=Vr}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=Kn(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=zr(i[e]/255)*255;return n.putImageData(r,0,0),t}if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(zr(t[e]/255)*255):t[e]=zr(t[e]);return{data:t,width:e.width,height:e.height}}return V(`ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.`),e}},Ur=0,Wr=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Ur++}),this.uuid=cr(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return typeof HTMLVideoElement<`u`&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<`u`&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t===null?e.set(0,0,0):e.set(t.width,t.height,t.depth||0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:``},r=this.data;if(r!==null){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(Gr(r[t].image)):e.push(Gr(r[t]))}else e=Gr(r);n.url=e}return t||(e.images[this.uuid]=n),n}};function Gr(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap?Hr.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(V(`Texture: Unable to serialize Texture.`),{})}var Kr=0,qr=new G,Jr=class e extends rr{constructor(t=e.DEFAULT_IMAGE,n=e.DEFAULT_MAPPING,r=Pe,i=Pe,a=Ve,o=We,s=st,c=Ke,l=e.DEFAULT_ANISOTROPY,u=``){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Kr++}),this.uuid=cr(),this.name=``,this.source=new Wr(t),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=a,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=c,this.offset=new W(0,0),this.repeat=new W(1,1),this.center=new W(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Nr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace
1=u,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(qr).x}get height(){return this.source.getSize(qr).y}get depth(){return this.source.getSize(qr).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){V(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){V(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ne:e.x-=Math.floor(e.x);break;case Pe:e.x=e.x<0?0:1;break;case Fe:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Ne:e.y-=Math.floor(e.y);break;case Pe:e.y=e.y<0?0:1;break;case Fe:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};Jr.DEFAULT_IMAGE=null,Jr.DEFAULT_MAPPING=300,Jr.DEFAULT_ANISOTROPY=1;var Yr=class e{static{e.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}
vendor: 5,497 bytes, line 1
1sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=U(this.x,e.x,t.x),this.y=U(this.y,e.y,t.y),this.z=U(this.z,e.z,t.z),this.w=U(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=U(this.x,e,t),this.y=U(this.y,e,t),this.z=U(this.z,e,t),this.w=U(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(U(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}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}},Xr=class extends rr{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ve,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Yr(0,0,e,t),this.scissorTest=!1,this.viewport=new Yr(0,0,e,t),this.textures=[];let r=new Jr({width:e,height:t,depth:n.depth}),i=n.count;for(let e=0;e<i;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){let t={minFilter:Ve,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace
vendor: 10,625 bytes, line 1
1=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++)this.textures[e].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new Wr(n)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this}dispose(){this.dispatchEvent({type:`dispose`})}},Zr=class extends Xr{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},Qr=class extends Jr{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Ie,this.minFilter=Ie,this.wrapR=Pe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},$r=class extends Zr{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new Qr(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}},ei=class extends Jr{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Ie,this.minFilter=Ie,this.wrapR=Pe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},ti=class extends Zr{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new ei(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}},K=class e{static{e.prototype.isMatrix4=!0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();let t=this.elements,n=e.elements,r=1/ni.setFromMatrixColumn(e,0).length(),i=1/ni.setFromMatrixColumn(e,1).length(),a=1/ni.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(ii,e,ai)}lookAt(e,t,n){let r=this.elements;return ci.subVectors(e,t),ci.lengthSq()===0&&(ci.z=1),ci.normalize(),oi.crossVectors(n,ci),oi.lengthSq()===0&&(Math.abs(n.z)===1?ci.x+=1e-4:ci.z+=1e-4,ci.normalize(),oi.crossVectors(n,ci)),oi.normalize(),si.crossVectors(ci,oi),r[0]=oi.x,r[4]=si.x,r[8]=ci.x,r[1]=oi.y,r[5]=si.y,r[9]=ci.y,r[2]=oi.z,r[6]=si.z,r[10]=ci.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],M=r[14],N=r[3],P=r[7],ee=r[11],te=r[15];return i[0]=a*x+o*T+s*k+c*N,i[4]=a*S+o*E+s*A+c*P,i[8]=a*C+o*D+s*j+c*ee,i[12]=a*w+o*O+s*M+c*te,i[1]=l*x+u*T+d*k+f*N,i[5]=l*S+u*E+d*A+f*P,i[9]=l*C+u*D+d*j+f*ee,i[13]=l*w+u*O+d*M+f*te,i[2]=p*x+m*T+h*k+g*N,i[6]=p*S+m*E+h*A+g*P,i[10]=p*C+m*D+h*j+g*ee,i[14]=p*w+m*O+h*M+g*te,i[3]=_*x+v*T+y*k+b*N,i[7]=_*S+v*E+y*A+b*P,i[11]=_*C+v*D+y*j+b*ee,i[15]=_*w+v*O+y*M+b*te,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m,O=d*g-f*h,k=_*O-v*D+y*E+b*T-x*w+S*C;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let A=1/k;return e[0]=(o*O-s*D+c*E)*A,e[1]=(r*D-n*O-i*E)*A,e[2]=(m*S-h*x+g*b)*A,e[3]=(d*x-u*S-f*b)*A,e[4]=(s*T-a*O-c*w)*A,e[5]=(t*O-r*T+i*w)*A,e[6]=(h*y-p*S-g*v)*A,e[7]=(l*S-d*y+f*v)*A,e[8]=(a*D-o*T+c*C)*A,e[9]=(n*T-t*D-i*C)*A,e[10]=(p*x-m*y+g*_)*A,e[11]=(u*y-l*x-f*_)*A,e[12]=(o*w-a*E-s*C)*A,e[13]=(t*E-n*w+r*C)*A,e[14]=(m*v-p*b-h*_)*A,e[15]=(l*b-u*v+d*_)*A,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];let i=this.determinant();if(i===0)return n.set(1,1,1),t.identity(),this;let a=ni.set(r[0],r[1],r[2]).length(),o=ni.set(r[4],r[5],r[6]).length(),s=ni.set(r[8],r[9],r[10]).length();i<0&&(a=-a),ri.copy(this);let c=1/a,l=1/o,u=1/s;return ri.elements[0]*=c,ri.elements[1]*=c,ri.elements[2]*=c,ri.elements[4]*=l,ri.elements[5]*=l,ri.elements[6]*=l,ri.elements[8]*=u,ri.elements[9]*=u,ri.elements[10]*=u,t.setFromRotationMatrix(ri),n.x=a,n.y=o,n.z=s,this}makePerspective(e,t,n,r,i,a,o=In,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}
vendor: 5,559 bytes, line 1
1makeOrthographic(e,t,n,r,i,a,o=In,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},ni=new G,ri=new K,ii=new G(0,0,0),ai=new G(1,1,1),oi=new G,si=new G,ci=new G,li=new K,ui=new Ar,di=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(U(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-U(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(U(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-U(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(U(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-U(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:V(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return li.makeRotationFromQuaternion(e),this.setFromRotationMatrix(li,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ui.setFromEuler(this),this.setFromQuaternion(ui,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};di.DEFAULT_ORDER=`XYZ`;var fi=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return!!(this.mask&(1<<e|0))}},pi=0,mi=new G,hi=new Ar,gi=new K,_i=new G,vi=new G,yi=new G,bi=new Ar,xi=new G(1,0,0),Si=new G(0,1,0),Ci=new G(0,0,1),wi={type:`added`},Ti={type:`removed`},Ei={type:`childadded`,child:null},Di={type:`childremoved`,child:null},Oi=class e extends rr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:pi++}),this.uuid=cr(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=e.DEFAULT_UP.clone();let t=new G,n=new di,r=new Ar,i=new G(1,1,1);function a(){r.setFromEuler(n,!1)}function o(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new K},normalMatrix:{value:new Nr}}),this.matrix=new K,this.matrixWorld=new K,this.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new fi,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(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}
vendor: 4,397 bytes, line 1
1setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return hi.setFromAxisAngle(e,t),this.quaternion.multiply(hi),this}rotateOnWorldAxis(e,t){return hi.setFromAxisAngle(e,t),this.quaternion.premultiply(hi),this}rotateX(e){return this.rotateOnAxis(xi,e)}rotateY(e){return this.rotateOnAxis(Si,e)}rotateZ(e){return this.rotateOnAxis(Ci,e)}translateOnAxis(e,t){return mi.copy(e).applyQuaternion(this.quaternion),this.position.add(mi.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(xi,e)}translateY(e){return this.translateOnAxis(Si,e)}translateZ(e){return this.translateOnAxis(Ci,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(gi.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?_i.copy(e):_i.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),vi.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?gi.lookAt(vi,_i,this.up):gi.lookAt(_i,vi,this.up),this.quaternion.setFromRotationMatrix(gi),r&&(gi.extractRotation(r.matrixWorld),hi.setFromRotationMatrix(gi),this.quaternion.premultiply(hi.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(H(`Object3D.add: object can't be added as a child of itself.`,e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(wi),Ei.child=e,this.dispatchEvent(Ei),Ei.child=null):H(`Object3D.add: object not an instance of THREE.Object3D.`,e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Ti),Di.child=e,this.dispatchEvent(Di),Di.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),gi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),gi.multiply(e.parent.matrixWorld)),e.applyMatrix4(gi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(wi),Ei.child=e,this.dispatchEvent(Ei),Ei.child=null,this}getObjectById(e){return this.getObjectByProperty(`id`,e)}getObjectByName(e){return this.getObjectByProperty(`name`,e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(vi,e,yi),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(vi,bi,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,r=e.z,i=this.matrix.elements;i[12]+=t-i[0]*t-i[4]*n-i[8]*r,i[13]+=n-i[1]*t-i[5]*n-i[9]*r,i[14]+=r-i[2]*t-i[6]*n-i[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){let n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix
vendor: 24,205 bytes, line 1
1):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){let e=this.children;for(let t=0,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){let t=e===void 0||typeof e==`string`,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:`Object`,generator:`Object3D.toJSON`});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==``&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(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(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0){if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material)}if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){let t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),c=a(e.skeletons),l=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot===null?null:e.pivot.clone(),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}};Oi.DEFAULT_UP=new G(0,1,0),Oi.DEFAULT_MATRIX_AUTO_UPDATE=!0,Oi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var ki=class extends Oi{constructor(){super(),this.isGroup=!0,this.type=`Group`}},Ai={type:`move`},ji=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ki,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ki,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ki,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:`connected`,data:e}),this}disconnect(e){return this.dispatchEvent({type:`disconnected`,data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Ai)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new ki;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},Mi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ni={h:0,s:0,l:0},Pi={h:0,s:0,l:0};function Fi(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var q=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=hn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Rr.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Rr.workingColorSpace){return this.r=e,this.g=t,this.b=n,Rr.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Rr.workingColorSpace){if(e=lr(e,1),t=U(t,0,1),n=U(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Fi(i,r,e+1/3),this.g=Fi(i,r,e),this.b=Fi(i,r,e-1/3)}return Rr.colorSpaceToWorking(this,r),this}setStyle(e,t=hn){function n(t){t!==void 0&&parseFloat(t)<1&&V(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:V(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);V(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=hn){let n=Mi[e.toLowerCase()];return n===void 0?V(`Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=zr(e.r),this.g=zr(e.g),this.b=zr(e.b),this}copyLinearToSRGB(e){return this.r=Br(e.r),this.g=Br(e.g),this.b=Br(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=hn){return Rr.workingToColorSpace(Ii.copy(this),e),Math.round(U(Ii.r*255,0,255))*65536+Math.round(U(Ii.g*255,0,255))*256+Math.round(U(Ii.b*255,0,255))}getHexString(e=hn){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Rr.workingColorSpace){Rr.workingToColorSpace(Ii.copy(this),t);let n=Ii.r,r=Ii.g,i=Ii.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4}s/=6}return e.h=s,e.s=c,e.l=l,e}getRGB(e,t=Rr.workingColorSpace){return Rr.workingToColorSpace(Ii.copy(this),t),e.r=Ii.r,e.g=Ii.g,e.b=Ii.b,e}getStyle(e=hn){Rr.workingToColorSpace(Ii.copy(this),e);let t=Ii.r,n=Ii.g,r=Ii.b;return e===`srgb`?`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`:`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`}offsetHSL(e,t,n){return this.getHSL(Ni),this.setHSL(Ni.h+e,Ni.s+t,Ni.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Ni),e.getHSL(Pi);let n=fr(Ni.h,Pi.h,t),r=fr(Ni.s,Pi.s,t),i=fr(Ni.l,Pi.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},Ii=new q;q.NAMES=Mi;var Li=class e{constructor(e,t=25e-5){this.isFogExp2=!0,this.name=``,this.color=new q(e),this.density=t}clone(){return new e(this.color,this.density)}toJSON(){return{type:`FogExp2`,name:this.name,color:this.color.getHex(),density:this.density}}},Ri=class e{constructor(e,t=1,n=1e3){this.isFog=!0,this.name=``,this.color=new q(e),this.near=t,this.far=n}clone(){return new e(this.color,this.near,this.far)}toJSON(){return{type:`Fog`,name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},zi=class extends Oi{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 di,this.environmentIntensity=1,this.environmentRotation=new di,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},Bi=new G,Vi=new G,Hi=new G,Ui=new G,Wi=new G,Gi=new G,Ki=new G,qi=new G,Ji=new G,Yi=new G,Xi=new Yr,Zi=new Yr,Qi=new Yr,$i=class e{constructor(e=new G,t=new G,n=new G){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Bi.subVectors(e,t),r.cross(Bi);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Bi.subVectors(r,t),Vi.subVectors(n,t),Hi.subVectors(e,t);let a=Bi.dot(Bi),o=Bi.dot(Vi),s=Bi.dot(Hi),c=Vi.dot(Vi),l=Vi.dot(Hi),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Ui)!==null&&Ui.x>=0&&Ui.y>=0&&Ui.x+Ui.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Ui)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Ui.x),s.addScaledVector(a,Ui.y),s.addScaledVector(o,Ui.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return Xi.setScalar(0),Zi.setScalar(0),Qi.setScalar(0),Xi.fromBufferAttribute(e,t),Zi.fromBufferAttribute(e,n),Qi.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Xi,i.x),a.addScaledVector(Zi,i.y),a.addScaledVector(Qi,i.z),a}static isFrontFacing(e,t,n,r){return Bi.subVectors(n,t),Vi.subVectors(e,t),Bi.cross(Vi).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Bi.subVectors(this.c,this.b),Vi.subVectors(this.a,this.b),Bi.cross(Vi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Wi.subVectors(r,n),Gi.subVectors(i,n),qi.subVectors(e,n);let s=Wi.dot(qi),c=Gi.dot(qi);if(s<=0&&c<=0)return t.copy(n);Ji.subVectors(e,r);let l=Wi.dot(Ji),u=Gi.dot(Ji);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Wi,a);Yi.subVectors(e,i);let f=Wi.dot(Yi),p=Gi.dot(Yi);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Gi,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return Ki.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(Ki,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Wi,a).addScaledVector(Gi,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},ea=class{constructor(e=new G(1/0,1/0,1/0),t=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(na.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(na.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=na.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,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(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(n!==void 0){let r=n.getAttribute(`position`);if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let t=0,n=r.count;t<n;t++)e.isMesh===!0?e.getVertexPosition(t,na):na.fromBufferAttribute(r,t),na.applyMatrix4(e.matrixWorld),this.expandByPoint(na);else e.boundingBox===void 0?(n.boundingBox===null&&n.computeBoundingBox(),ra.copy(n.boundingBox)):(e.boundingBox===null&&e.computeBoundingBox(),ra.copy(e.boundingBox)),ra.applyMatrix4(e.matrixWorld),this.union(ra)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,na),na.distanceToSquared(e.center)<=e.radius*e.radiu
vendor: 4,168 bytes, line 1
1s}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ua),da.subVectors(this.max,ua),ia.subVectors(e.a,ua),aa.subVectors(e.b,ua),oa.subVectors(e.c,ua),sa.subVectors(aa,ia),ca.subVectors(oa,aa),la.subVectors(ia,oa);let t=[0,-sa.z,sa.y,0,-ca.z,ca.y,0,-la.z,la.y,sa.z,0,-sa.x,ca.z,0,-ca.x,la.z,0,-la.x,-sa.y,sa.x,0,-ca.y,ca.x,0,-la.y,la.x,0];return!ma(t,ia,aa,oa,da)||(t=[1,0,0,0,1,0,0,0,1],!ma(t,ia,aa,oa,da))?!1:(fa.crossVectors(sa,ca),t=[fa.x,fa.y,fa.z],ma(t,ia,aa,oa,da))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,na).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(na).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ta[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ta[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ta[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ta[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ta[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ta[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ta[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ta[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ta),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},ta=[new G,new G,new G,new G,new G,new G,new G,new G],na=new G,ra=new ea,ia=new G,aa=new G,oa=new G,sa=new G,ca=new G,la=new G,ua=new G,da=new G,fa=new G,pa=new G;function ma(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){pa.fromArray(e,a);let o=i.x*Math.abs(pa.x)+i.y*Math.abs(pa.y)+i.z*Math.abs(pa.z),s=t.dot(pa),c=n.dot(pa),l=r.dot(pa);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var ha=ga();function ga(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function _a(e){Math.abs(e)>65504&&V(`DataUtils.toHalfFloat(): Value out of range.`),e=U(e,-65504,65504),ha.floatView[0]=e;let t=ha.uint32View[0],n=t>>23&511;return ha.baseTable[n]+((t&8388607)>>ha.shiftTable[n])}function va(e){let t=e>>10;return ha.uint32View[0]=ha.mantissaTable[ha.offsetTable[t]+(e&1023)]+ha.exponentTable[t],ha.floatView[0]}var ya=class{static toHalfFloat(e){return _a(e)}static fromHalfFloat(e){return va(e)}},ba=new G,xa=new W,Sa=0,Ca=class extends rr{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Sa++}
vendor: 19,232 bytes, line 1
1),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=En,this.updateRanges=[],this.gpuType=Qe,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)xa.fromBufferAttribute(this,t),xa.applyMatrix3(e),this.setXY(t,xa.x,xa.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)ba.fromBufferAttribute(this,t),ba.applyMatrix3(e),this.setXYZ(t,ba.x,ba.y,ba.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)ba.fromBufferAttribute(this,t),ba.applyMatrix4(e),this.setXYZ(t,ba.x,ba.y,ba.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ba.fromBufferAttribute(this,t),ba.applyNormalMatrix(e),this.setXYZ(t,ba.x,ba.y,ba.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ba.fromBufferAttribute(this,t),ba.transformDirection(e),this.setXYZ(t,ba.x,ba.y,ba.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Dr(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Or(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Dr(t,this.array)),t}setX(e,t){return this.normalized&&(t=Or(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Dr(t,this.array)),t}setY(e,t){return this.normalized&&(t=Or(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Dr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Or(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Dr(t,this.array)),t}setW(e,t){return this.normalized&&(t=Or(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Or(t,this.array),n=Or(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Or(t,this.array),n=Or(n,this.array),r=Or(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Or(t,this.array),n=Or(n,this.array),r=Or(r,this.array),i=Or(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==``&&(e.name=this.name),this.usage!==35044&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:`dispose`})}},wa=class extends Ca{constructor(e,t,n){super(new Int8Array(e),t,n)}},Ta=class extends Ca{constructor(e,t,n){super(new Uint8Array(e),t,n)}},Ea=class extends Ca{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}},Da=class extends Ca{constructor(e,t,n){super(new Int16Array(e),t,n)}},Oa=class extends Ca{constructor(e,t,n){super(new Uint16Array(e),t,n)}},ka=class extends Ca{constructor(e,t,n){super(new Int32Array(e),t,n)}},Aa=class extends Ca{constructor(e,t,n){super(new Uint32Array(e),t,n)}},ja=class extends Ca{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=va(this.array[e*this.itemSize]);return this.normalized&&(t=Dr(t,this.array)),t}setX(e,t){return this.normalized&&(t=Or(t,this.array)),this.array[e*this.itemSize]=_a(t),this}getY(e){let t=va(this.array[e*this.itemSize+1]);return this.normalized&&(t=Dr(t,this.array)),t}setY(e,t){return this.normalized&&(t=Or(t,this.array)),this.array[e*this.itemSize+1]=_a(t),this}getZ(e){let t=va(this.array[e*this.itemSize+2]);return this.normalized&&(t=Dr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Or(t,this.array)),this.array[e*this.itemSize+2]=_a(t),this}getW(e){let t=va(this.array[e*this.itemSize+3]);return this.normalized&&(t=Dr(t,this.array)),t}setW(e,t){return this.normalized&&(t=Or(t,this.array)),this.array[e*this.itemSize+3]=_a(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Or(t,this.array),n=Or(n,this.array)),this.array[e+0]=_a(t),this.array[e+1]=_a(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Or(t,this.array),n=Or(n,this.array),r=Or(r,this.array)),this.array[e+0]=_a(t),this.array[e+1]=_a(n),this.array[e+2]=_a(r),this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Or(t,this.array),n=Or(n,this.array),r=Or(r,this.array),i=Or(i,this.array)),this.array[e+0]=_a(t),this.array[e+1]=_a(n),this.array[e+2]=_a(r),this.array[e+3]=_a(i),this}},J=class extends Ca{constructor(e,t,n){super(new Float32Array(e),t,n)}},Ma=new ea,Na=new G,Pa=new G,Fa=class{constructor(e=new G,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?Ma.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Na.subVectors(e,this.center);let t=Na.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Na,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Pa.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Na.copy(e.center).add(Pa)),this.expandByPoint(Na.copy(e.center).sub(Pa))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},Ia=0,La=new K,Ra=new Oi,za=new G,Ba=new ea,Va=new ea,Ha=new G,Ua=class e extends rr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ia++}),this.uuid=cr(),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(e){return this.index=Array.isArray(e)?new(Hn(e)?Aa:Oa)(e,1):e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new Nr().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return La.makeRotationFromQuaternion(e),this.applyMatrix4(La),this}rotateX(e){return La.makeRotationX(e),this.applyMatrix4(La),this}rotateY(e){return La.makeRotationY(e),this.applyMatrix4(La),this}rotateZ(e){return La.makeRotationZ(e),this.applyMatrix4(La),this}translate(e,t,n){return La.makeTranslation(e,t,n),this.applyMatrix4(La),this}scale(e,t,n){return La.makeScale(e,t,n),this.applyMatrix4(La),this}lookAt(e){return Ra.lookAt(e),Ra.updateMatrix(),this.applyMatrix4(Ra.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(za).negate(),this.translate(za.x,za.y,za.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute(`position`,new J(t,3))}else{let n=Math.min(e.length,t.count);for(let r=0;r<n;r++){let n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&V(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ea);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){H(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new G(-1/0,-1/0,-1/0),new G(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Ba.setFromBufferAttribute(n),this.morphTargetsRelative?(Ha.addVectors(this.boundingBox.min,Ba.min),this.boundingBox.expandByPoint(Ha),Ha.addVectors(this.boundingBox.max,Ba.max),this.boundingBox.expandByPoint(Ha)):(this.boundingBox.expandByPoint(Ba.min),this.boundingBox.expandByPoint(Ba.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&H(`BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.`,this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Fa);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){H(`BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.`,this),this.boundingSphere.set(new G,1/0);return}if(e){let n=this.boundingSphere.center;if(Ba.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Va.setFromBufferAttribute(n),this.morphTargetsRelative?(Ha.addVectors(Ba.min,Va.min),Ba.expandByPoint(Ha),Ha.addVectors(Ba.max,Va.max),Ba.expandByPoint(Ha)):(Ba.expandByPoint(Va.min),Ba.expandByPoint(Va.max))}Ba.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Ha.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Ha));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)Ha.fromBufferAttribute(a,t),o&&(za.fromBufferAttribute(e,t),Ha.add(za)),r=Math.max(r,n.distanceToSquared(Ha))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&H(`BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.`,this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){H(`BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)`);return}let n=t.position,r=t.normal,i=t.uv;this.hasAttribute(`tangent`)===!1&&this.setAttribute(`tangent`,new Ca(new Float32Array(4*n.count),4));let a=this.getAttribute(`tangent`),o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new G,s[e]=new G;let c=new G,l=new G,u=new G,d=new W,f=new W,p=new W,m=new G,h=new G;function g(e,t,r){c.fromBufferAttribute(n,e),l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),f.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),l.sub(c),u.sub(c),f.sub(d),p.sub(d);let a=1/(f.x*p.y-p.x*f.y);isFinite(a)&&(m.copy(l).multiplyScalar(p.y).addScaledVector(u,-f.y).multiplyScalar(a),h.copy(u).multiplyScalar(f.x).addScaledVector(l,-p.x).multiplyScalar(a),o[e].add(m),o[t].add(m),o[r].add(m),s[e].add(h),s[t].add(h),s[r].add(h))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)g(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let v=new G,y=new G,b=new G,x=new G;function S(e){b.fromBufferAttribute(r,e),x.copy(b);let t=o[e];v.copy(t),v.sub(b.multiplyScalar(b.dot(t))).normalize(),y.crossVectors(x,t);let n=y.dot(s[e])<0?-1:1;a.setXYZW(e,v.x,v.y,v.z,n)}for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute(`position`);if(t!==void 0){let n=this.getAttribute(`normal`);if(n===void 0)n=new Ca(new Float32Array(t.count*3),3),this.setAttribute(`normal`,n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new G,i=new G,a=new G,o=new G,s=new G,c=new G,l=new G,u=new G;if(e)for(let d=0,f=e.count;d<f;d+=3){let f=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,f),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Ha.fromBufferAttribute(e,t),Ha.normalize(),e.setXYZ(t,Ha.x,Ha.y,Ha.z)}toNonIndexed(){function t(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,c=t.length;i<c;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new Ca(a,r,i)}if(this.index===null)return V(`BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.`),this;let n=new e,r=this.index.array,i=this.attributes;for(let e in i){let a=i[e],o=t(a,r);n.setAttribute(e,o)}let a=this.morphAttributes;for(let e in a){let i=[],o=a[e];for(let e=0,n=o.length;e<n;e++){let n=o[e],a=t(n,r);i.push(a)}n.morphAttributes[e]=i}n.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let e=0,t=o.length;e<t;e++){let t=o[e];n.addGroup(t.start,t.count,t.materialIndex)}return n}toJSON(){let e={metadata:{version:4.7,type:`BufferGeometry`,generator:`BufferGeometry.toJSON`}};if(e.uuid=this.uuid,e.type=this.type,this.name!==``&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());let s=e.boundingSphere;return s!==null&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:`dispose`})}},Wa=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=En,this.updateRanges=[],this.version=0,this.uuid=cr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=cr()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=cr()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},Ga=new G,Ka=class e{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name=``,this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}
vendor: 5,042 bytes, line 1
1get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Ga.fromBufferAttribute(this,t),Ga.applyMatrix4(e),this.setXYZ(t,Ga.x,Ga.y,Ga.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ga.fromBufferAttribute(this,t),Ga.applyNormalMatrix(e),this.setXYZ(t,Ga.x,Ga.y,Ga.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ga.fromBufferAttribute(this,t),Ga.transformDirection(e),this.setXYZ(t,Ga.x,Ga.y,Ga.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Dr(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Or(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Or(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Or(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Or(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Or(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Dr(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Dr(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Dr(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Dr(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Or(t,this.array),n=Or(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Or(t,this.array),n=Or(n,this.array),r=Or(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Or(t,this.array),n=Or(n,this.array),r=Or(r,this.array),i=Or(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(t){if(t===void 0){Qn(`InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new Ca(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new e(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){Qn(`InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},qa=0,Ja=class extends rr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:qa++}),this.uuid=cr(),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 q(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=yn,this.stencilZFail=yn,this.stencilZPass=yn,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(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){V(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){V
vendor: 10,041 bytes, line 1
1(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){e===!0&&this.version++}},
vendor: 4,719 bytes, line 1
1Ya=class extends Ja{constructor(e){super(),this.isSpriteMaterial=!0,this.type=`SpriteMaterial`,this.color=new q(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},Xa,Za=new G,Qa=new G,$a=new G,eo=new W,to=new W,no=new K,ro=new G,io=new G,ao=new G,oo=new W,so=new W,co=new W,lo=class extends Oi{constructor(e=new Ya){if(super(),this.isSprite=!0,this.type=`Sprite`,Xa===void 0){Xa=new Ua;let e=new Wa(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Xa.setIndex([0,1,2,0,2,3]),Xa.setAttribute(`position`,new Ka(e,3,0,!1)),Xa.setAttribute(`uv`,new Ka(e,2,3,!1))}this.geometry=Xa,this.material=e,this.center=new W(.5,.5),this.count=1}raycast(e,t){e.camera===null&&H(`Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.`),Qa.setFromMatrixScale(this.matrixWorld),no.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),$a.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Qa.multiplyScalar(-$a.z);let n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));let a=this.center;uo(ro.set(-.5,-.5,0),$a,a,Qa,r,i),uo(io.set(.5,-.5,0),$a,a,Qa,r,i),uo(ao.set(.5,.5,0),$a,a,Qa,r,i),oo.set(0,0),so.set(1,0),co.set(1,1);let o=e.ray.intersectTriangle(ro,io,ao,!1,Za);if(o===null&&(uo(io.set(-.5,.5,0),$a,a,Qa,r,i),so.set(0,1),o=e.ray.intersectTriangle(ro,ao,io,!1,Za),o===null))return;let s=e.ray.origin.distanceTo(Za);s<e.near||s>e.far||t.push({distance:s,point:Za.clone(),uv:$i.getInterpolation(Za,ro,io,ao,oo,so,co,new W),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};function uo(e,t,n,r,i,a){eo.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?to.copy(eo):(to.x=a*eo.x-i*eo.y,to.y=i*eo.x+a*eo.y),e.copy(t),e.x+=to.x,e.y+=to.y,e.applyMatrix4(no)}var fo=new G,po=new G,mo=class extends Oi{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type=`LOD`,Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,n=t.length;e<n;e++){let n=t[e];this.addLevel(n.object.clone(),n.distance,n.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);let r=this.levels,i=0;for(;i<r.length&&!(t<r[i].distance);i++);return r.splice(i,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){let t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){let e=t.splice(n,1);return this.remove(e[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){let t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r;n++){let r=t[n].distance;if(t[n].object.visible&&(r-=r*t[n].hysteresis),e<r)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){fo.setFromMatrixPosition(this.matrixWorld);let n=e.ray.origin.distanceTo(fo);this.getObjectForDistance(n).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){fo.setFromMatrixPosition(e.matrixWorld),po.setFromMatrixPosition(this.matrixWorld);let n=fo.distanceTo(po)/e.zoom;t[0].object.visible=!0;let r,i;for(r=1,i=t.length;r<i;r++){let e=t[r].distance;if(t[r].object.visible&&(e-=e*t[r].hysteresis),n>=e)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}}toJSON(e){let t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];let n=this.levels;for(let e=0,r=n.length;e<r;e++){let r=n[e];t.object.levels.push({object:r.object.uuid,distance:r.distance,hysteresis:r.hysteresis})}return t}},ho=new G,go=new G,_o=new G,vo=new G,yo=new G,bo=new G,xo=new G,So=class{constructor(e=new G,t=new G(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ho)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=ho.subVectors(e,this.origin).dot(this.direction);
vendor: 6,517 bytes, line 1
1return t<0?this.origin.distanceToSquared(e):(ho.copy(this.origin).addScaledVector(this.direction,t),ho.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){go.copy(e).add(t).multiplyScalar(.5),_o.copy(t).sub(e).normalize(),vo.copy(this.origin).sub(go);let i=e.distanceTo(t)*.5,a=-this.direction.dot(_o),o=vo.dot(this.direction),s=-vo.dot(_o),c=vo.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0){if(u=a*s-o,d=a*o-s,p=i*l,u>=0){if(d>=-p){if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c)}else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(go).addScaledVector(_o,d),f}intersectSphere(e,t){ho.subVectors(e.center,this.origin);let n=ho.dot(this.direction),r=ho.dot(ho)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,ho)!==null}intersectTriangle(e,t,n,r,i){yo.subVectors(t,e),bo.subVectors(n,e),xo.crossVectors(yo,bo);let a=this.direction.dot(xo),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;vo.subVectors(this.origin,e);let s=o*this.direction.dot(bo.crossVectors(vo,bo));if(s<0)return null;let c=o*this.direction.dot(yo.cross(vo));if(c<0||s+c>a)return null;let l=-o*vo.dot(xo);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Co=class extends Ja{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new q(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new di,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},wo=new K,To=new So,Eo=new Fa,Do=new G,Oo=new G,ko=new G,Ao=new G,jo=new G,Mo=new G,No=new G,Po=new G,Fo=class extends Oi{constructor(e=new Ua,t=new Co){super(),this.isMesh=!0,this.type=`Mesh`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){Mo.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];r!==0&&(jo.fromBufferAttribute(s,e),a?Mo.addScaledVector(jo,r):Mo.addScaledVector(jo.sub(t),r))}t.add(Mo)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Eo.copy(n.boundingSphere),Eo.applyMatrix4(i),To.copy(e.ray).recast(e.near),!(Eo.containsPoint(To.origin)===!1&&(To.intersectSphere(Eo,Do)===null||To.origin.distanceToSquared(Do)>(e.far-e.near)**2))&&(wo.copy(i).invert(),To.copy(e.ray).applyMatrix4(wo),(n.boundingBox===null||To.intersectsBox(n.boundingBox)!==!1)&&this._computeIntersections(e,t,To)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null){if(Array.isArray(a))for(let i=0,s=d.length;i<s;i++){let s=d[i],p=a[s.materialIndex],m=Math.max(s.start,f.start),h=Math.min(o.count,Math.min(s.start+s.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=o.getX(i),d=o.getX(i+1),f=o.getX(i+2);r=Lo(this,p,e,n,c,l,u,a,d,f),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),s=Math.min(o.count,f.start+f.count);for(let d=i,f=s;d<f;d+=3){let i=o.getX(d),s=o.getX(d+1),f=o.getX(d+2);r=Lo(this,a,e,n,c,l,u,i,s,f),r&&(r.faceIndex=Math.floor(d/3),t.pu
1sh(r))}}}else if(s!==void 0){if(Array.isArray(a))for(let i=0,o=d.length;i<o;i++){let o=d[i],p=a[o.materialIndex],m=Math.max(o.start,f.start),h=Math.min(s.count,Math.min(o.start+o.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=i,s=i+1,d=i+2;r=Lo(this,p,e,n,c,l,u,a,s,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),o=Math.min(s.count,f.start+f.count);for(let s=i,d=o;s<d;s+=3){let i=s,o=s+1,d=s+2;r=Lo(this,a,e,n,c,l,u,i,o,d),r&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}}};function Io(e,t,n,r,i,a,o,s){let c;if(c=t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===0,s),c===null)return null;Po.copy(s),Po.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(Po);return l<n.near||l>n.far?null:{distance:l,point:Po.clone(),object:e}}function Lo(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,Oo),e.getVertexPosition(c,ko),e.getVertexPosition(l,Ao);let u=Io(e,t,n,r,Oo,ko,Ao,No);if(u){let e=new G;$i.getBarycoord(No,Oo,ko,Ao,e),i&&(u.uv=$i.getInterpolatedAttribute(i,s,c,l,e,new W)),a&&(u.uv1=$i.getInterpolatedAttribute(a,s,c,l,e,new W)),o&&(u.normal=$i.getInterpolatedAttribute(o,s,c,l,e,new G),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new G,materialIndex:0};$i.getNormal(Oo,ko,Ao,t.normal),u.face=t,u.barycoord=e}return u}var Ro=new Yr,zo=new Yr,Bo=new Yr,Vo=new Yr,Ho=new K,Uo=new G,Wo=new Fa,Go=new K,Ko=new So,qo=class extends Fo{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type=`SkinnedMesh`,this.bindMode=je,this.bindMatrix=new K,this.bindMatrixInverse=new K,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new ea),this.boundingBox.makeEmpty();let t=e.getAttribute(`position`);for(let e=0;e<t.count;e++)this.getVertexPosition(e,Uo),this.boundingBox.expandByPoint(Uo)}computeBoundingSphere(){let e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Fa),this.boundingSphere.makeEmpty();let t=e.getAttribute(`position`);for(let e=0;e<t.count;e++)this.getVertexPosition(e,Uo),this.boundingSphere.expandByPoint(Uo)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let n=this.material,r=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Wo.copy(this.boundingSphere),Wo.applyMatrix4(r),e.ray.intersectsSphere(Wo)!==!1&&(Go.copy(r).invert(),Ko.copy(e.ray).applyMatrix4(Go),(this.boundingBox===null||Ko.intersectsBox(this.boundingBox)!==!1)&&this._computeIntersections(e,t,Ko)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new Yr,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);let r=1/e.manhattanLength();r===1/0?e.set(1,0,0,0):e.multiplyScalar(r),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===`attached`?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===`detached`?this.bindMatrixInverse.copy(this.bindMatrix).invert():V(`SkinnedMesh: Unrecognized bindMode: `+this.bindMode)}applyBoneTransform(e,t){let n=this.skeleton,r=this.geometry;zo.fromBufferAttribute(r.attributes.skinIndex,e),Bo.fromBufferAttribute(r.attributes.skinWeight,e),t.isVector4?(Ro.copy(t),t.set(0,0,0,0)):(Ro.set(...t,1),t.set(0,0,0)),Ro.applyMatrix4(this.bindMatrix);for(let e=0;e<4;e++){let r=Bo.getComponent(e);if(r!==0){let i=zo.getComponent(e);Ho.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(Vo.copy(Ro).applyMatrix4(Ho),r)}}
vendor: 6,316 bytes, line 1
1return t.isVector4&&(t.w=Ro.w),t.applyMatrix4(this.bindMatrixInverse)}},Jo=class extends Oi{constructor(){super(),this.isBone=!0,this.type=`Bone`}},Yo=class extends Jr{constructor(e=null,t=1,n=1,r,i,a,o,s,c=Ie,l=Ie,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Xo=new K,Zo=new K,Qo=class e{constructor(e=[],t=[]){this.uuid=cr(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){V(`Skeleton: Number of inverse bone matrices does not match amount of bones.`),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new K)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let t=new K;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){let e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=e.length;r<i;r++){let i=e[r]?e[r].matrixWorld:Zo;Xo.multiplyMatrices(i,t[r]),Xo.toArray(n,r*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new e(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let n=new Yo(t,e,e,st,Qe);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){let n=this.bones[t];if(n.name===e)return n}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){let r=e.bones[n],i=t[r];i===void 0&&(V(`Skeleton: No bone found with UUID:`,r),i=new Jo),this.bones.push(i),this.boneInverses.push(new K().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){let e={metadata:{version:4.7,type:`Skeleton`,generator:`Skeleton.toJSON`},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){let i=t[r];e.bones.push(i.uuid);let a=n[r];e.boneInverses.push(a.toArray())}return e}},$o=class extends Ca{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},es=new K,ts=new K,ns=[],rs=new ea,is=new K,as=new Fo,os=new Fa,ss=class extends Fo{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new $o(new Float32Array(n*16),16),this.previousInstanceMatrix=null,this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let e=0;e<n;e++)this.setMatrixAt(e,is)}computeBoundingBox(){let e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new ea),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,es),rs.copy(e.boundingBox).applyMatrix4(es),this.boundingBox.union(rs)}computeBoundingSphere(){let e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Fa),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,es),os.copy(e.boundingSphere).applyMatrix4(es),this.boundingSphere.union(os)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.previousInstanceMatrix!==null&&(this.previousInstanceMatrix=e.previousInstanceMatrix.clone()),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){return this.instanceColor===null?t.setRGB(1,1,1):t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){return t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){let n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,i=e*(n.length+1)+1;for(let e=0;e<n.length;e++)n[e]=r[i+e]}raycast(e,t){let n=this.matrixWorld,r=this.count;if(as.geometry=this.geometry,as.material=this.material,as.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),os.copy(this.boundingSphere),os.applyMatrix4(n),e.ray.intersectsSphere(os)!==!1))for(let i=0;i<r;i++){this.getMatrixAt(i,es),ts.multiplyMatrices(n,es),as.matrixWorld=ts,as.raycast(e,ns);for(let e=0,n=ns.length;e<n;e++){let n=ns[e];n.instanceId=i,n.object=this,t.push(n)}ns.length=0}}setColorAt(e,t){return this.instanceColor===null&&(this.instanceColor=new $o(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3),this}setMatrixAt(e,t){return t.toArray(this.instanceMatrix.array,e*16),this}setMorphAt(e,t){let n=t.morphTargetInfluences,r=n.length+1;this.morphTexture===null&&(this.morphTexture=new Yo(new Float32Array(r*this.count),r,this.count,ut,Qe));let i=this.morphTexture.source.data.data,a=0;for(let e=0;e<n.length;e++)a+=n[e];let o=this.geometry.morphTargetsRelative?1:1-a,s=r*e;return i[s]=o,i.set(n,s+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:`dispose`}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}},cs=new G,ls=new G,us=new Nr,ds=class{constructor(e=new G(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}
vendor: 7,533 bytes, line 1
1setFromCoplanarPoints(e,t,n){let r=cs.subVectors(n,t).cross(ls.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){let r=e.delta(cs),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/i;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||us.getNormalMatrix(e),r=this.coplanarPoint(cs).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},fs=new Fa,ps=new W(.5,.5),ms=new G,hs=class{constructor(e=new ds,t=new ds,n=new ds,r=new ds,i=new ds,a=new ds){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=In,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),fs.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),fs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(fs)}intersectsSprite(e){return fs.center.set(0,0,0),fs.radius=.7071067811865476+ps.distanceTo(e.center),fs.applyMatrix4(e.matrixWorld),this.intersectsSphere(fs)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(ms.x=r.normal.x>0?e.max.x:e.min.x,ms.y=r.normal.y>0?e.max.y:e.min.y,ms.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(ms)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},gs=new K,_s=new hs,vs=class e{constructor(){this.coordinateSystem=In}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){let r=t.cameras[n];if(gs.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),_s.setFromProjectionMatrix(gs,r.coordinateSystem,r.reversedDepth),_s.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){let r=t.cameras[n];if(gs.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),_s.setFromProjectionMatrix(gs,r.coordinateSystem,r.reversedDepth),_s.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){let r=t.cameras[n];if(gs.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),_s.setFromProjectionMatrix(gs,r.coordinateSystem,r.reversedDepth),_s.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){let r=t.cameras[n];if(gs.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),_s.setFromProjectionMatrix(gs,r.coordinateSystem,r.reversedDepth),_s.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){let r=t.cameras[n];if(gs.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),_s.setFromProjectionMatrix(gs,r.coordinateSystem,r.reversedDepth),_s.containsPoint(e))return!0}return!1}clone(){return new e}};function ys(e,t){return e-t}function bs(e,t){return e.z-t.z}function xs(e,t){return t.z-e.z}var Ss=class{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,r){let i=this.pool,a=this.list;this.index>=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});let o=i[this.index];a.push(o),this.index++,o.start=e,o.count=t,o.z=n,o.index=r}reset(){this.list.length=0,this.index=0}},Cs=new K,ws=new q(1,1,1),Ts=new hs,Es=new vs,Ds=new ea,Os=new Fa,ks=new G,As=new G,js=new G,Ms=new Ss,Ns=new Fo,Ps=[];function Fs(e,t,n=0){let r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){let i=e.count;for(let a=0;a<i;a++)for(let i=0;i<r;i++)t.setComponent(a+n,i,e.getComponent(a,i))}else t.array.set(e.array,n*r);t.needsUpdate=!0}function Is(e,t){if(e.constructor!==t.constructor){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)t[r]=e[r]}else{let n=Math.min(e.length,t.length);t.set(new e.constructor(e.buffer,0,n))}}var Ls=class extends Fo{constructor(e,t,n=t*2,r){super(new Ua,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=e,this._maxVertexCount=t,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),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 e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Yo(new Float32Array(e*e*4),e,e,st,Qe);this._matricesTexture=t}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);let t=new Yo(new Uint32Array(e*e),e,e,dt,Ze);this._indirectTexture=t}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);let t=new Yo(new Float32Array(e*e*4).fill(1),e,e,st,Qe);
1t.colorSpace=Rr.workingColorSpace,this._colorsTexture=t}_initializeGeometry(e){let t=this.geometry,n=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(let r in e.attributes){let{array:i,itemSize:a,normalized:o}=e.getAttribute(r),s=new Ca(new i.constructor(n*a),a,o);t.setAttribute(r,s)}if(e.getIndex()!==null){let e=n>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new Ca(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw Error(`THREE.BatchedMesh: All geometries must consistently have "index".`);for(let n in t.attributes){if(!e.hasAttribute(n))throw Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);let r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw Error(`THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.`)}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ea);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(t[n].active===!1)continue;let r=t[n].geometryIndex;this.getMatrixAt(n,Cs),this.getBoundingBoxAt(r,Ds).applyMatrix4(Cs),e.union(Ds)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Fa);let e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(t[n].active===!1)continue;let r=t[n].geometryIndex;this.getMatrixAt(n,Cs),this.getBoundingSphereAt(r,Os).applyMatrix4(Cs),e.union(Os)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw Error(`THREE.BatchedMesh: Maximum item count reached.`);let t={visible:!0,active:!0,geometryIndex:e},n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(ys),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=t):(n=this._instanceInfo.length,this._instanceInfo.push(t));let r=this._matricesTexture;Cs.identity().toArray(r.image.data,n*16),r.needsUpdate=!0;let i=this._colorsTexture;return i&&(ws.toArray(i.image.data,n*4),i.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);let r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},i=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute(`position`).count:t;let a=e.getIndex();if(a!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=n===-1?a.count:n),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw Error(`THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.`);let o;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(ys),o=this._availableGeometryIds.shift(),i[o]=r):(o=this._geometryCount,this._geometryCount++,i.push(r)),this.setGeometryAt(o,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,o}setGeometryAt(e,t){if(e>=this._geometryCount)throw Error(`THREE.BatchedMesh: Maximum geometry count reached.`);this._validateGeometry(t);let n=this.geometry,r=n.getIndex()!==null,i=n.getIndex(),a=t.getIndex(),o=this._geometryInfo[e];if(r&&a.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw Error(`THREE.BatchedMesh: Reserved space not large enough for provided geometry.`);let s=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=t.getAttribute(`position`).count;for(let e in n.attributes){let r=t.getAttribute(e),i=n.getAttribute(e);Fs(r,i,s);let a=r.itemSize;
vendor: 6,302 bytes, line 1
1for(let e=r.count,t=c;e<t;e++){let t=s+e;for(let e=0;e<a;e++)i.setComponent(t,e,0)}i.needsUpdate=!0,i.addUpdateRange(s*a,c*a)}if(r){let e=o.indexStart,n=o.reservedIndexCount;o.indexCount=t.getIndex().count;for(let t=0;t<a.count;t++)i.setX(e+t,s+a.getX(t));for(let t=a.count,r=n;t<r;t++)i.setX(e+t,s);i.needsUpdate=!0,i.addUpdateRange(e,o.reservedIndexCount)}return o.start=r?o.indexStart:o.vertexStart,o.count=r?o.indexCount:o.vertexCount,o.boundingBox=null,t.boundingBox!==null&&(o.boundingBox=t.boundingBox.clone()),o.boundingSphere=null,t.boundingSphere!==null&&(o.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){let t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;let n=this._instanceInfo;for(let t=0,r=n.length;t<r;t++)n[t].active&&n[t].geometryIndex===e&&this.deleteInstance(t);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0,n=this._geometryInfo,r=n.map((e,t)=>t).sort((e,t)=>n[e].vertexStart-n[t].vertexStart),i=this.geometry;for(let a=0,o=n.length;a<o;a++){let o=n[r[a]];if(o.active!==!1){if(i.index!==null){if(o.indexStart!==t){let{indexStart:n,vertexStart:r,reservedIndexCount:a}=o,s=i.index,c=s.array,l=e-r;for(let e=n;e<n+a;e++)c[e]=c[e]+l;s.array.copyWithin(t,n,n+a),s.addUpdateRange(t,a),s.needsUpdate=!0,o.indexStart=t}t+=o.reservedIndexCount}if(o.vertexStart!==e){let{vertexStart:t,reservedVertexCount:n}=o,r=i.attributes;for(let i in r){let a=r[i],{array:o,itemSize:s}=a;o.copyWithin(e*s,t*s,(t+n)*s),a.addUpdateRange(e*s,n*s),a.needsUpdate=!0}o.vertexStart=e}e+=o.reservedVertexCount,o.start=i.index?o.indexStart:o.vertexStart}}return this._nextIndexStart=t,this._nextVertexStart=e,this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){let e=new ea,t=n.index,i=n.attributes.position;for(let n=r.start,a=r.start+r.count;n<a;n++){let r=n;t&&(r=t.getX(r)),e.expandByPoint(ks.fromBufferAttribute(i,r))}r.boundingBox=e}return t.copy(r.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){let t=new Fa;this.getBoundingBoxAt(e,Ds),Ds.getCenter(t.center);let i=n.index,a=n.attributes.position,o=0;for(let e=r.start,n=r.start+r.count;e<n;e++){let n=e;i&&(n=i.getX(n)),ks.fromBufferAttribute(a,n),o=Math.max(o,t.center.distanceToSquared(ks))}t.radius=Math.sqrt(o),r.boundingSphere=t}return t.copy(r.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);let n=this._matricesTexture,r=this._matricesTexture.image.data;return t.toArray(r,e*16),n.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null?t.isVector4?t.set(1,1,1,1):t.setRGB(1,1,1):t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);let n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){let t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(ys);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(e<n.length)throw Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);let r=new Int32Array(e),i=new Int32Array(e);Is(this._multiDrawCounts,r),Is(this._multiDrawStarts,i),this._multiDrawCounts=r,this._multiDrawStarts=i,this._maxInstanceCount=e;let a=this._indirectTexture,o=this._matricesTexture,s=this._colorsTexture;a.dispose(),this._initIndirectTexture(),Is(a.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),Is(o.image.data,this._matricesTexture.image.data),s&&(s.dispose(),this._initColorsTexture(),Is(s.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){let n=[...this._geometryInfo].filter(e=>e.active);if(Math.max(...n.map(e=>e.vertexStart+e.reservedVertexCount))>e)throw Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(e=>e.indexStart+e.reservedIndexCount))>t)throw Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);let r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new Ua,this._initializeGeometry(r));let i=this.geometry;r.index&&Is(r.index.array,i.index.array);for(let e in r.attributes)Is(r.attributes[e].array,i.attributes[e].array)}raycast(e,t){let n=this._instanceInfo,r=this._geometryInfo,i=this.matrixWorld,a=this.geometry;Ns.material=this.material,Ns.geometry.index=a.index,Ns.geometry.attributes=a.attributes,Ns.geometry.boundingBox===null&&(Ns.geometry.boundingBox=new ea),Ns.geometry.boundingSphere===null&&(Ns.geometry.boundingSphere=new Fa);for(let a=0,o=n.length;a<o;a++){if(!n[a].visible||!n[a].active)continue;let o=n[a].geometryIndex,s=r[o];Ns.geometry.setDrawRange(s.start,s.count),this.getMatrixAt(a,Ns.matrixWorld).premultiply(i),this.getBoundingBoxAt(o,Ns.geometry.boundingBox),this.getBoundingSphereAt(o,Ns.geometry.boundingSphere),Ns.raycast(e,Ps);for(let e=0,n=Ps.length;e<n;e++){let n=Ps[e];
1n.object=this,n.batchId=a,t.push(n)}Ps.length=0}Ns.material=null,Ns.geometry.index=null,Ns.geometry.attributes={},Ns.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox===null?null:e.boundingBox.clone(),this.boundingSphere=e.boundingSphere===null?null:e.boundingSphere.clone(),this._geometryInfo=e._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox===null?null:e.boundingBox.clone(),boundingSphere:e.boundingSphere===null?null:e.boundingSphere.clone()})),this._instanceInfo=e._instanceInfo.map(e=>({...e})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,r,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let a=r.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,s=1;i.wireframe&&(s=2,o=r.attributes.position.count>65535?4:2);let c=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,d=this._geometryInfo,f=this.perObjectFrustumCulled,p=this._indirectTexture,m=p.image.data,h=n.isArrayCamera?Es:Ts;f&&!n.isArrayCamera&&(Cs.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),Ts.setFromProjectionMatrix(Cs,n.coordinateSystem,n.reversedDepth));let g=0;if(this.sortObjects){Cs.copy(this.matrixWorld).invert(),ks.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Cs),As.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(Cs);for(let e=0,t=c.length;e<t;e++)if(c[e].visible&&c[e].active){let t=c[e].geometryIndex;
vendor: 6,406 bytes, line 1
1this.getMatrixAt(e,Cs),this.getBoundingSphereAt(t,Os).applyMatrix4(Cs);let r=!1;if(f&&(r=!h.intersectsSphere(Os,n)),!r){let n=d[t],r=js.subVectors(Os.center,ks).dot(As);Ms.push(n.start,n.count,r,e)}}let e=Ms.list,t=this.customSort;t===null?e.sort(i.transparent?xs:bs):t.call(this,e,n);for(let t=0,n=e.length;t<n;t++){let n=e[t];l[g]=n.start*o*s,u[g]=n.count*s,m[g]=n.index,g++}Ms.reset()}else for(let e=0,t=c.length;e<t;e++)if(c[e].visible&&c[e].active){let t=c[e].geometryIndex,r=!1;if(f&&(this.getMatrixAt(e,Cs),this.getBoundingSphereAt(t,Os).applyMatrix4(Cs),r=!h.intersectsSphere(Os,n)),!r){let n=d[t];l[g]=n.start*o*s,u[g]=n.count*s,m[g]=e,g++}}p.needsUpdate=!0,this._multiDrawCount=g,this._visibilityChanged=!1}onBeforeShadow(e,t,n,r,i,a){this.onBeforeRender(e,null,r,i,a)}},Rs=class extends Ja{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new q(16777215),this.map=null,this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},zs=new G,Bs=new G,Vs=new K,Hs=new So,Us=new Fa,Ws=new G,Gs=new G,Ks=class extends Oi{constructor(e=new Ua,t=new Rs){super(),this.isLine=!0,this.type=`Line`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)zs.fromBufferAttribute(t,e-1),Bs.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=zs.distanceTo(Bs);e.setAttribute(`lineDistance`,new J(n,1))}else V(`Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Us.copy(n.boundingSphere),Us.applyMatrix4(r),Us.radius+=i,e.ray.intersectsSphere(Us)===!1)return;Vs.copy(r).invert(),Hs.copy(e.ray).applyMatrix4(Vs);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=this.isLineSegments?2:1,l=n.index,u=n.attributes.position;if(l!==null){let n=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=l.getX(i),r=l.getX(i+1),a=qs(this,e,Hs,s,n,r,i);a&&t.push(a)}if(this.isLineLoop){let i=l.getX(r-1),a=l.getX(n),o=qs(this,e,Hs,s,i,a,r-1);o&&t.push(o)}}else{let n=Math.max(0,a.start),r=Math.min(u.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=qs(this,e,Hs,s,i,i+1,i);n&&t.push(n)}if(this.isLineLoop){let i=qs(this,e,Hs,s,r-1,n,r-1);i&&t.push(i)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function qs(e,t,n,r,i,a,o){let s=e.geometry.attributes.position;if(zs.fromBufferAttribute(s,i),Bs.fromBufferAttribute(s,a),n.distanceSqToSegment(zs,Bs,Ws,Gs)>r)return;Ws.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(Ws);if(!(c<t.near||c>t.far))return{distance:c,point:Gs.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var Js=new G,Ys=new G,Xs=class extends Ks{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type=`LineSegments`}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)Js.fromBufferAttribute(t,e),Ys.fromBufferAttribute(t,e+1),n[e]=e===0?0:n[e-1],n[e+1]=n[e]+Js.distanceTo(Ys);e.setAttribute(`lineDistance`,new J(n,1))}else V(`LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}},Zs=class extends Ks{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type=`LineLoop`}},Qs=class extends Ja{constructor(e){super(),this.isPointsMaterial=!0,this.type=`PointsMaterial`,this.color=new q(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},$s=new K,ec=new So,tc=new Fa,nc=new G,rc=class extends Oi{constructor(e=new Ua,t=new Qs){super(),this.isPoints=!0,this.type=`Points`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),tc.copy(n.boundingSphere),tc.applyMatrix4(r),tc.radius+=i,e.ray.intersectsSphere(tc)===!1)return;$s.copy(r).invert(),ec.copy(e.ray).applyMatrix4($s);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=n.index,l=n.attributes.position;if(c!==null){let n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let a=n,o=i;a<o;a++){let n=c.getX(a);nc.fromBufferAttribute(l,n),ic(nc,n,s,r,e,t,this)}}else{let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);for(let a=n,o=i;a<o;a++)nc.fromBufferAttribute(l,a),ic(nc,a,s,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function ic(e,t,n,r,i,a,o){let s=ec.distanceSqToPoint(e);if(s<n){let n=new G;ec.closestPointToPoint(e,n),n.applyMatrix4(r);let c=i.ray.origin.distanceTo(n);if(c<i.near||c>i.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var ac=class extends Jr{constructor(e,t,n,r,i=Ve,a=Ve,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;let l=this;
1function u(){l.needsUpdate=!0,l._requestVideoFrameCallbackId=e.requestVideoFrameCallback(u)}`requestVideoFrameCallback`in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(u))}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!(`requestVideoFrameCallback`in e)&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}},oc=class extends ac{constructor(e,t,n,r,i,a,o,s){super({},e,t,n,r,i,a,o,s),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}},sc=class extends Jr{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Ie,this.minFilter=Ie,this.generateMipmaps=!1,this.needsUpdate=!0}},cc=class extends Jr{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},lc=class extends cc{constructor(e,t,n,r,i,a){super(e,t,n,i,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Pe,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},uc=class extends cc{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}},dc=class extends Jr{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},fc=class extends Jr{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},pc=class extends Jr{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isHTMLTexture=!0,this.generateMipmaps=!1,this.needsUpdate=!0;let l=e?e.parentNode:null;l!==null&&`requestPaint`in l&&(l.onpaint=()=>{this.needsUpdate=!0},l.requestPaint())}dispose(){let e=this.image?this.image.parentNode:null;e!==null&&`onpaint`in e&&(e.onpaint=null),super.dispose()}},mc=class extends Jr{constructor(e,t,n=Ze,r,i,a,o=Ie,s=Ie,c,l=ct,u=1){if(l!==1026&&l!==1027)throw Error(`DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Wr(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},hc=class extends mc{constructor(e,t=Ze,n=301,r,i,a=Ie,o=Ie,s,c=ct){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},gc=class extends Jr{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},_c=class e extends Ua{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new J(c,3)),this.setAttribute(`normal`,new J(l,3)),this.setAttribute(`uv`,new J(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new G;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)D[e]=(s*v-b)*r,D[t]=o*i,D[n]=S,c.push(D.x,D.y,D.z),D[e]=0,D[t]=0,D[n]=m>0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}},vc=class e extends Ua{constructor(e=1,t=1,n=4,r=8,i=1){super(),this.type=`CapsuleGeometry`,this.parameters={radiu
vendor: 12,300 bytes, line 1
1s:e,height:t,capSegments:n,radialSegments:r,heightSegments:i},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),r=Math.max(3,Math.floor(r)),i=Math.max(1,Math.floor(i));let a=[],o=[],s=[],c=[],l=t/2,u=Math.PI/2*e,d=t,f=2*u+d,p=n*2+i,m=r+1,h=new G,g=new G;for(let _=0;_<=p;_++){let v=0,y=0,b=0,x=0;if(_<=n){let t=_/n,r=t*Math.PI/2;y=-l-e*Math.cos(r),b=e*Math.sin(r),x=-e*Math.cos(r),v=t*u}else if(_<=n+i){let r=(_-n)/i;y=-l+r*t,b=e,x=0,v=u+r*d}else{let t=(_-n-i)/n,r=t*Math.PI/2;y=l+e*Math.sin(r),b=e*Math.cos(r),x=e*Math.sin(r),v=u+d+t*u}let S=Math.max(0,Math.min(1,v/f)),C=0;_===0?C=.5/r:_===p&&(C=-.5/r);for(let e=0;e<=r;e++){let t=e/r,n=t*Math.PI*2,i=Math.sin(n),a=Math.cos(n);g.x=-b*a,g.y=y,g.z=b*i,o.push(g.x,g.y,g.z),h.set(-b*a,x,b*i),h.normalize(),s.push(h.x,h.y,h.z),c.push(t+C,S)}if(_>0){let e=(_-1)*m;for(let t=0;t<r;t++){let n=e+t,r=e+t+1,i=_*m+t,o=_*m+t+1;a.push(n,r,i),a.push(r,o,i)}}}this.setIndex(a),this.setAttribute(`position`,new J(o,3)),this.setAttribute(`normal`,new J(s,3)),this.setAttribute(`uv`,new J(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radius,t.height,t.capSegments,t.radialSegments,t.heightSegments)}},yc=class e extends Ua{constructor(e=1,t=32,n=0,r=Math.PI*2){super(),this.type=`CircleGeometry`,this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);let i=[],a=[],o=[],s=[],c=new G,l=new W;a.push(0,0,0),o.push(0,0,1),s.push(.5,.5);for(let i=0,u=3;i<=t;i++,u+=3){let d=n+i/t*r;c.x=e*Math.cos(d),c.y=e*Math.sin(d),a.push(c.x,c.y,c.z),o.push(0,0,1),l.x=(a[u]/e+1)/2,l.y=(a[u+1]/e+1)/2,s.push(l.x,l.y)}for(let e=1;e<=t;e++)i.push(e,e+1,0);this.setIndex(i),this.setAttribute(`position`,new J(a,3)),this.setAttribute(`normal`,new J(o,3)),this.setAttribute(`uv`,new J(s,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radius,t.segments,t.thetaStart,t.thetaLength)}},bc=class e extends Ua{constructor(e=1,t=1,n=1,r=32,i=1,a=!1,o=0,s=Math.PI*2){super(),this.type=`CylinderGeometry`,this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};let c=this;r=Math.floor(r),i=Math.floor(i);let l=[],u=[],d=[],f=[],p=0,m=[],h=n/2,g=0;_(),a===!1&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new J(u,3)),this.setAttribute(`normal`,new J(d,3)),this.setAttribute(`uv`,new J(f,2));function _(){let a=new G,_=new G,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n<r;n++)for(let r=0;r<i;r++){let a=m[r][n],o=m[r+1][n],s=m[r+1][n+1],c=m[r][n+1];(e>0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new W,m=new G,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e<r;e++){let t=i+e,r=b+e;n===!0?l.push(r,r+1,t):l.push(r+1,r,t),_+=3}c.addGroup(g,_,n===!0?1:2),g+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},xc=class e extends bc{constructor(e=1,t=1,n=32,r=1,i=!1,a=0,o=Math.PI*2){super(0,e,t,n,r,i,a,o),this.type=`ConeGeometry`,this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}static fromJSON(t){return new e(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},Sc=class e extends Ua{constructor(e=[],t=[],n=1,r=0){super(),this.type=`PolyhedronGeometry`,this.parameters={vertices:e,indices:t,radius:n,detail:r};let i=[],a=[];o(r),c(n),l(),this.setAttribute(`position`,new J(i,3)),this.setAttribute(`normal`,new J(i.slice(),3)),this.setAttribute(`uv`,new J(a,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(e){let n=new G,r=new G,i=new G;for(let a=0;a<t.length;a+=3)f(t[a+0],n),f(t[a+1],r),f(t[a+2],i),s(n,r,i,e)}function s(e,t,n,r){let i=r+1,a=[];for(let r=0;r<=i;r++){a[r]=[];let o=e.clone().lerp(n,r/i),s=t.clone().lerp(n,r/i),c=i-r;for(let e=0;e<=c;e++)e===0&&r===i?a[r][e]=o:a[r][e]=o.clone().lerp(s,e/c)}for(let e=0;e<i;e++)for(let t=0;t<2*(i-e)-1;t++){let n=Math.floor(t/2);t%2==0?(d(a[e][n+1]),d(a[e+1][n]),d(a[e][n])):(d(a[e][n+1]),d(a[e+1][n+1]),d(a[e+1][n]))}}function c(e){let t=new G;for(let n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}function l(){let e=new G;for(let t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];let n=h(e)/2/Math.PI+.5,r=g(e)/Math.PI+.5;a.push(n,1-r)}p(),u()}function u(){for(let e=0;e<a.length;e+=6){let t=a[e+0],n=a[e+2],r=a[e+4];Math.max(t,n,r)>.9&&Math.min(t,n,r)<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}function d(e){i.push(e.x,e.y,e.z)}function f(t,n){let r=t*3;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function p(){let e=new G,t=new G,n=new G,r=new G,o=new W,s=new W,c=new W;for(let l=0,u=0;l<i.length;l+=9,u+=6){e.set(i[l+0],i[l+1],i[l+2]),t.set(i[l+3],i[l+4],i[l+5]),n.set(i[l+6],i[l+7],i[l+8]),o.set(a[u+0],a[u+1]),s.set(a[u+2],a[u+3]),c.set(a[u+4],a[u+5]),r.copy(e).add(t).add(n).divideScalar(3);let d=h(r);m(o,u+0,e,d),m(s,u+2,t,d),m(c,u+4,n,d)}}function m(e,t,n,r){r<0&&e.x===1&&(a[t]=e.x-1),n.x===0&&n.z===0&&(a[t]=r/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}function g(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.vertices,t.indices,t.radius,t.detail)}},Cc=class e extends Sc{constructor(e=1,t=0){let n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];super(i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type=`DodecahedronGeometry`,this.parameters={radius:e,detail:t}}static fromJSON(t){return new e(t.radius,t.detail)}},wc=new G,Tc=new G,Ec=new G,Dc=new $i,Oc=class extends Ua{constructor(e=null,t=1){if(super(),this.type=`EdgesGeometry`,this.parameters={geometry:e,thresholdAngle:t},e!==null){let n=1e4,r=Math.cos(or*t),i=e.getIndex(),a=e.getAttribute(`position`),o=i?i.count:a.count,s=[0,0,0],c=[`a`,`b`,`c`],l=[,,,],u={},d=[];for(let e=0;e<o;e+=3){i?(s[0]=i.getX(e),s[1]=i.getX(e+1),s[2]=i.getX(e+2)):(s[0]=e,s[1]=e+1,s[2]=e+2);let{a:t,b:o,c:f}=Dc;if(t.fromBufferAttribute(a,s[0]),o.fromBufferAttribute(a,s[1]),f.fromBufferAttribute(a,s[2]),Dc.getNormal(Ec),l[0]=`${Math.round(t.x*n)},${Math.round(t.y*n)},${Math.round(t.z*n)}`,l[1]=`${Math.round(o.x*n)},${Math.round(o.y*n)},${Math.round(o.z*n)}`,l[2]=`${Math.round(f.x*n)},${Math.round(f.y*n)},${Math.round(f.z*n)}`,l[0]!==l[1]&&l[1]!==l[2]&&l[2]!==l[0])for(let e=0;e<3;e++){let t=(e+1)%3,n=l[e],i=l[t],a=Dc[c[e]],o=Dc[c[t]],f=`${n}_${i}`,p=`${i}_${n}`;p in u&&u[p]?(Ec.dot(u[p].normal)<=r&&(d.push(a.x,a.y,a.z),d.push(o.x,o.y,o.z)),u[p]=null):f in u||(u[f]={index0:s[e],index1:s[t],normal:Ec.clone()})}}for(let e in u)if(u[e]){let{index0:t,index1:n}=u[e];wc.fromBufferAttribute(a,t),Tc.fromBufferAttribute(a,n),d.push(wc.x,wc.y,wc.z),d.push(Tc.x,Tc.y,Tc.z)}this.setAttribute(`position`,new J(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}},kc=class{constructor(){this.type=`Curve`,this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){V(`Curve: .getPoint() not implemented.`)}getPointAt(e,t){let n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],n,r=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){let n=this.getLengths(),r=0,i=n.length,a;a=t||e*n[i-1];let o=0,s=i-1,c;for(;o<=s;)if(r=Math.floor(o+(s-o)/2),c=n[r]-a,c<0)o=r+1;else if(c>0)s=r-1;else{s=r;break}if(r=s,n[r]===a)return r/(i-1);let l=n[r],u=n[r+1]-l,d=(a-l)/u;return(r+d)/(i-1)}getTangent(e,t){let n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);let a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new W:new G);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new G,r=[],i=[],a=[],o=new G,s=new K;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new G)}i[0]=new G,a[0]=new G;let c=Number.MAX_VALUE,l=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);l<=c&&(c=l,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>2**-52){o.normalize();let e=Math.acos(U(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(t===!0){let t=Math.acos(U(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:`Curve`,generator:`Curve.toJSON`}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},Ac=class extends kc{constructor(e=0,t=0,n=1,r=1,i=0,a=Math.PI*2,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type=`EllipseCurve`,this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e,t=new W){let n=t,r=Math.PI*2,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<2**-52;for(;i<0;)i+=r;for(;i>r;)i-=r;i<2**-52&&(i=a?0:r),this.aClockwise===!0&&!a&&(i===r?i=-r:i-=r);let o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,r=c-this.aY;s=n*e-r*t+this.aX,c=n*t+r*e+this.aY}return n.set(s,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},jc=class extends Ac{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.isArcCurve=!0,this.type=`ArcCurve`}};function Mc(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;
vendor: 4,093 bytes, line 1
1c*=o,l*=o,i(t,n,c,l)},calc:function(i){let a=i*i,o=a*i;return e+t*i+n*a+r*o}}}var Nc=new G,Pc=new G,Fc=new Mc,Ic=new Mc,Lc=new Mc,Rc=class extends kc{constructor(e=[],t=!1,n=`centripetal`,r=.5){super(),this.isCatmullRomCurve3=!0,this.type=`CatmullRomCurve3`,this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new G){let n=t,r=this.points,i=r.length,a=(i-+!this.closed)*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:s===0&&o===i-1&&(o=i-2,s=1);let c,l;this.closed||o>0?c=r[(o-1)%i]:(Pc.subVectors(r[0],r[1]).add(r[0]),c=Pc);let u=r[o%i],d=r[(o+1)%i];if(this.closed||o+2<i?l=r[(o+2)%i]:(Nc.subVectors(r[i-1],r[i-2]).add(r[i-1]),l=Nc),this.curveType===`centripetal`||this.curveType===`chordal`){let e=this.curveType===`chordal`?.5:.25,t=c.distanceToSquared(u)**+e,n=u.distanceToSquared(d)**+e,r=d.distanceToSquared(l)**+e;n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),Fc.initNonuniformCatmullRom(c.x,u.x,d.x,l.x,t,n,r),Ic.initNonuniformCatmullRom(c.y,u.y,d.y,l.y,t,n,r),Lc.initNonuniformCatmullRom(c.z,u.z,d.z,l.z,t,n,r)}else this.curveType===`catmullrom`&&(Fc.initCatmullRom(c.x,u.x,d.x,l.x,this.tension),Ic.initCatmullRom(c.y,u.y,d.y,l.y,this.tension),Lc.initCatmullRom(c.z,u.z,d.z,l.z,this.tension));return n.set(Fc.calc(s),Ic.calc(s),Lc.calc(s)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(new G().fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}};function zc(e,t,n,r,i){let a=(r-t)*.5,o=(i-n)*.5,s=e*e,c=e*s;return(2*n-2*r+a+o)*c+(-3*n+3*r-2*a-o)*s+a*e+n}function Bc(e,t){let n=1-e;return n*n*t}function Vc(e,t){return 2*(1-e)*e*t}function Hc(e,t){return e*e*t}function Uc(e,t,n,r){return Bc(e,t)+Vc(e,n)+Hc(e,r)}function Wc(e,t){let n=1-e;return n*n*n*t}function Gc(e,t){let n=1-e;return 3*n*n*e*t}function Kc(e,t){return 3*(1-e)*e*e*t}function qc(e,t){return e*e*e*t}function Jc(e,t,n,r,i){return Wc(e,t)+Gc(e,n)+Kc(e,r)+qc(e,i)}var Yc=class extends kc{constructor(e=new W,t=new W,n=new W,r=new W){super(),this.isCubicBezierCurve=!0,this.type=`CubicBezierCurve`,this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new W){let n=t,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Jc(e,r.x,i.x,a.x,o.x),Jc(e,r.y,i.y,a.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},Xc=class extends kc{constructor(e=new G,t=new G,n=new G,r=new G){super(),this.isCubicBezierCurve3=!0,this.type=`CubicBezierCurve3`,this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new G){let n=t,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Jc(e,r.x,i.x,a.x,o.x),Jc(e,r.y,i.y,a.y,o.y),Jc(e,r.z,i.z,a.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},Zc=class extends kc{constructor(e=new W,t=new W){super(),this.isLineCurve=!0,this.type=`LineCurve`,this.v1=e,this.v2=t}getPoint(e,t=new W){let n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}
vendor: 4,354 bytes, line 1
1getTangent(e,t=new W){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Qc=class extends kc{constructor(e=new G,t=new G){super(),this.isLineCurve3=!0,this.type=`LineCurve3`,this.v1=e,this.v2=t}getPoint(e,t=new G){let n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new G){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},$c=class extends kc{constructor(e=new W,t=new W,n=new W){super(),this.isQuadraticBezierCurve=!0,this.type=`QuadraticBezierCurve`,this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new W){let n=t,r=this.v0,i=this.v1,a=this.v2;return n.set(Uc(e,r.x,i.x,a.x),Uc(e,r.y,i.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},el=class extends kc{constructor(e=new G,t=new G,n=new G){super(),this.isQuadraticBezierCurve3=!0,this.type=`QuadraticBezierCurve3`,this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new G){let n=t,r=this.v0,i=this.v1,a=this.v2;return n.set(Uc(e,r.x,i.x,a.x),Uc(e,r.y,i.y,a.y),Uc(e,r.z,i.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},tl=class extends kc{constructor(e=[]){super(),this.isSplineCurve=!0,this.type=`SplineCurve`,this.points=e}getPoint(e,t=new W){let n=t,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[a===0?a:a-1],c=r[a],l=r[a>r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(zc(o,s.x,c.x,l.x,u.x),zc(o,s.y,c.y,l.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(new W().fromArray(n))}return this}},nl=Object.freeze({__proto__:null,ArcCurve:jc,CatmullRomCurve3:Rc,CubicBezierCurve:Yc,CubicBezierCurve3:Xc,EllipseCurve:Ac,LineCurve:Zc,LineCurve3:Qc,QuadraticBezierCurve:$c,QuadraticBezierCurve3:el,SplineCurve:tl}),rl=class extends kc{constructor(){super(),this.type=`CurvePath`,this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){let n=e.isVector2===!0?`LineCurve`:`LineCurve3`;this.curves.push(new nl[n](t,e))}return this}getPoint(e,t){let n=e*this.getLength(),r=this.getCurveLengths(),i=0;for(;i<r.length;){if(r[i]>=n){let e=r[i]-n,a=this.curves[i],o=a.getLength(),s=o===0?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){let t=[],n;for(let r=0,i=this.curves;r<i.length;r++){let a=i[r],o=a.isEllipseCurve?e*2:a.isLineCurve||a.isLineCurve3?1:a.isS
vendor: 4,453 bytes, line 1
1plineCurve?e*a.points.length:e,s=a.getPoints(o);for(let e=0;e<s.length;e++){let r=s[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){let n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){let n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){let n=e.curves[t];this.curves.push(new nl[n.type]().fromJSON(n))}return this}},il=class extends rl{constructor(e){super(),this.type=`Path`,this.currentPoint=new W,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let n=new Zc(this.currentPoint.clone(),new W(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){let i=new $c(this.currentPoint.clone(),new W(e,t),new W(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,a){let o=new Yc(this.currentPoint.clone(),new W(e,t),new W(n,r),new W(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}splineThru(e){let t=new tl([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,a){let o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this}absarc(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this}ellipse(e,t,n,r,i,a,o,s){let c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(e+c,t+l,n,r,i,a,o,s),this}absellipse(e,t,n,r,i,a,o,s){let c=new Ac(e,t,n,r,i,a,o,s);if(this.curves.length>0){let e=c.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(c);let l=c.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},al=class extends il{constructor(e){super(e),this.uuid=cr(),this.type=`Shape`,this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){let n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){let n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){let n=e.holes[t];this.holes.push(new il().fromJSON(n))}return this}};function ol(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length,a=sl(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;let s,c,l;if(r&&(a=ml(e,t,a,n)),e.length>80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;a<i;a+=n){let n=e[a],i=e[a+1];n<s&&(s=n),i<c&&(c=i),n>t&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return ll(a,o,n,s,c,l,0),o}function sl(e,t,n,r,i){let a;if(i===Rl(e,t,n,r)>0)for(let i=t;i<n;i+=r)a=Fl(i/r|0,e[i],e[i+1],a);else for(let i=n-r;i>=t;i-=r)a=Fl(i/r|0,e[i],e[i+1],a);return a&&Dl(a,a.next)&&(Il(a),a=a.next),a}function cl(e,t){if(!e)return e;t||=e;let n=e,r;do if(r=!1,!n.steiner&&(Dl(n,n.next)||El(n.prev,n,n.next)===0)){if(Il(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function ll(e,t,n,r,i,a,o){if(!e)return;!o&&a&&yl(e,r,i,a);let s=e;for(;e.prev!==e.next;){let c=e.prev,l=e.next;if(a?dl(e,r,i,a):ul(e)){t.push(c.i,e.i,l.i),Il(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=fl(cl(e),t),ll(e,t,n,r,i,a,2)):o===2&&pl(e,t,n,r,i,a):ll(cl(e),t,n,r,i,a,1);break}}}function ul(e){let t=e.prev,n=e,r=e.next;if(El(t,n,r)>=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&wl(i,s,a,c,o,l,m.x,m.y)&&El(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function dl(e,t,n,r){let i=e.prev,a=e,o=e.next;if(El(i,a,o)>=0)return!1;
vendor: 1,141 bytes, line 1
1let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=xl(p,m,t,n,r),v=xl(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&wl(s,u,c,d,l,f,y.x,y.y)&&El(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&wl(s,u,c,d,l,f,b.x,b.y)&&El(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&wl(s,u,c,d,l,f,y.x,y.y)&&El(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&wl(s,u,c,d,l,f,b.x,b.y)&&El(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function fl(e,t){let n=e;do{let r=n.prev,i=n.next.next;!Dl(r,i)&&Ol(r,n,n.next,i)&&Ml(r,i)&&Ml(i,r)&&(t.push(r.i,n.i,i.i),Il(n),Il(n.next),n=e=i),n=n.next}while(n!==e);return cl(n)}function pl(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Tl(o,e)){let s=Pl(o,e);o=cl(o,o.next),s=cl(s,s.next),ll(o,t,n,r,i,a,0),ll(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function ml(e,t,n,r){let i=[];for(let n=0,a=t.length;n<a;
vendor: 4,452 bytes, line 1
1n++){let o=sl(e,t[n]*r,n<a-1?t[n+1]*r:e.length,r,!1);o===o.next&&(o.steiner=!0),i.push(Sl(o))}i.sort(hl);for(let e=0;e<i.length;e++)n=gl(i[e],n);return n}function hl(e,t){let n=e.x-t.x;return n===0&&(n=e.y-t.y,n===0&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x))),n}function gl(e,t){let n=_l(e,t);if(!n)return t;let r=Pl(n,e);return cl(r,r.next),cl(n,n.next)}function _l(e,t){let n=t,r=e.x,i=e.y,a=-1/0,o;if(Dl(e,n))return n;do{if(Dl(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x<n.next.x?n:n.next,e===r))return o}n=n.next}while(n!==t);if(!o)return null;let s=o,c=o.x,l=o.y,u=1/0;n=o;do{if(r>=n.x&&n.x>=c&&r!==n.x&&Cl(i<l?r:a,i,c,l,i<l?a:r,i,n.x,n.y)){let t=Math.abs(i-n.y)/(r-n.x);Ml(n,e)&&(t<u||t===u&&(n.x>o.x||n.x===o.x&&vl(o,n)))&&(o=n,u=t)}n=n.next}while(n!==s);return o}function vl(e,t){return El(e.prev,e,t.prev)<0&&El(t.next,e,e.next)<0}function yl(e,t,n,r){let i=e;do i.z===0&&(i.z=xl(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,bl(i)}function bl(e){let t,n=1;do{let r=e,i;e=null;let a=null;for(t=0;r;){t++;let o=r,s=0;for(let e=0;e<n&&(s++,o=o.nextZ,o);e++);let c=n;for(;s>0||c>0&&o;)s!==0&&(c===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,s--):(i=o,o=o.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=o}a.nextZ=null,n*=2}while(t>1);return e}function xl(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Sl(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function Cl(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function wl(e,t,n,r,i,a,o,s){return(e!==o||t!==s)&&Cl(e,t,n,r,i,a,o,s)}function Tl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!jl(e,t)&&(Ml(e,t)&&Ml(t,e)&&Nl(e,t)&&(El(e.prev,e,t.prev)||El(e,t.prev,t))||Dl(e,t)&&El(e.prev,e,e.next)>0&&El(t.prev,t,t.next)>0)}function El(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Dl(e,t){return e.x===t.x&&e.y===t.y}function Ol(e,t,n,r){let i=Al(El(e,t,n)),a=Al(El(e,t,r)),o=Al(El(n,r,e)),s=Al(El(n,r,t));return!!(i!==a&&o!==s||i===0&&kl(e,n,t)||a===0&&kl(e,r,t)||o===0&&kl(n,e,r)||s===0&&kl(n,t,r))}function kl(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Al(e){return e>0?1:e<0?-1:0}function jl(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Ol(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Ml(e,t){return El(e.prev,e,e.next)<0?El(e,t,e.next)>=0&&El(e,e.prev,t)>=0:El(e,t,e.prev)<0||El(e,e.next,t)<0}function Nl(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function Pl(e,t){let n=Ll(e.i,e.x,e.y),r=Ll(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Fl(e,t,n,r){let i=Ll(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Il(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Ll(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Rl(e,t,n,r){let i=0;for(let a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}var zl=class{static triangulate(e,t,n=2){return ol(e,t,n)}},Bl=class e{static area(e){let t=e.length,n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return n*.5}static isClockWise(t){return e.area(t)<0}static triangulateShape(e,t){let n=[],r=[],i=[];Vl(e),Hl(n,e);let a=e.length;t.forEach(Vl);for(let e=0;e<t.length;e++)r.push(a),a+=t[e].length,Hl(n,t[e]);let o=zl.triangulate(n,r);for(let e=0;e<o.length;e+=3)i.push(o.slice(e,e+3));return i}};function Vl(e){let t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Hl(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}var Ul=class e extends Ua{constructor(e=new al([new W(.5,.5),new W(-.5,.5),new W(-.5,-.5),new W(.5,-.5)]),t={}){super(),this.type=`ExtrudeGeometry`,this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let n=this,r=[],i=[];for(let t=0,n=e.length;t<n;t++){let n=e[t];a(n)}
1this.setAttribute(`position`,new J(r,3)),this.setAttribute(`uv`,new J(i,2)),this.computeVertexNormals();function a(e){let a=[],o=t.curveSegments===void 0?12:t.curveSegments,s=t.steps===void 0?1:t.steps,c=t.depth===void 0?1:t.depth,l=t.bevelEnabled===void 0||t.bevelEnabled,u=t.bevelThickness===void 0?.2:t.bevelThickness,d=t.bevelSize===void 0?u-.1:t.bevelSize,f=t.bevelOffset===void 0?0:t.bevelOffset,p=t.bevelSegments===void 0?3:t.bevelSegments,m=t.extrudePath,h=t.UVGenerator===void 0?Wl:t.UVGenerator,g,_=!1,v,y,b,x;if(m){g=m.getSpacedPoints(s),_=!0,l=!1;let e=m.isCatmullRomCurve3?m.closed:!1;v=m.computeFrenetFrames(s,e),y=new G,b=new G,x=new G}l||(p=0,u=0,d=0,f=0);let S=e.extractPoints(o),C=S.shape,w=S.holes;if(!Bl.isClockWise(C)){C=C.reverse();for(let e=0,t=w.length;e<t;e++){let t=w[e];Bl.isClockWise(t)&&(w[e]=t.reverse())}}function T(e){let t=e[0];for(let n=1;n<=e.length;n++){let r=n%e.length,i=e[r],a=i.x-t.x,o=i.y-t.y,s=a*a+o*o,c=Math.max(Math.abs(i.x),Math.abs(i.y),Math.abs(t.x),Math.abs(t.y));if(s<=10000000000000001e-36*c*c){e.splice(r,1),n--;continue}t=i}}T(C),w.forEach(T);let E=w.length,D=C;for(let e=0;e<E;e++){let t=w[e];C=C.concat(t)}function O(e,t,n){return t||H(`ExtrudeGeometry: vec does not exist`),e.clone().addScaledVector(t,n)}let k=C.length;function A(e,t,n){let r,i,a,o=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,u=o*o+s*s,d=o*l-s*c;if(Math.abs(d)>2**-52){let d=Math.sqrt(u),f=Math.sqrt(c*c+l*l),p=t.x-s/d,m=t.y+o/d,h=n.x-l/f,g=n.y+c/f,_=((h-p)*l-(g-m)*c)/(o*l-s*c);r=p+o*_-e.x,i=m+s*_-e.y;let v=r*r+i*i;if(v<=2)return new W(r,i);a=Math.sqrt(v/2)}else{let e=!1;o>2**-52?c>2**-52&&(e=!0):o<-(2**-52)?c<-(2**-52)&&(e=!0):Math.sign(s)===Math.sign(l)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new W(r/a,i/a)}let j=[];for(let e=0,t=D.length,n=t-1,r=e+1;e<t;e++,n++,r++)n===t&&(n=0),r===t&&(r=0),j[e]=A(D[e],D[n],D[r]);let M=[],N,P=j.concat();for(let e=0,t=E;e<t;e++){let t=w[e];N=[];for(let e=0,n=t.length,r=n-1,i=e+1;e<n;e++,r++,i++)r===n&&(r=0),i===n&&(i=0),N[e]=A(t[e],t[r],t[i]);M.push(N),P=P.concat(N)}let ee;if(p===0)ee=Bl.triangulateShape(D,w);else{let e=[],t=[];for(let n=0;n<p;n++){let r=n/p,i=u*Math.cos(r*Math.PI/2),a=d*Math.sin(r*Math.PI/2)+f;for(let t=0,n=D.length;t<n;t++){let n=O(D[t],j[t],a);L(n.x,n.y,-i),r===0&&e.push(n)}for(let e=0,n=E;e<n;e++){let n=w[e];N=M[e];let o=[];for(let e=0,t=n.length;e<t;e++){let t=O(n[e],N[e],a);L(t.x,t.y,-i),r===0&&o.push(t)}r===0&&t.push(o)}}ee=Bl.triangulateShape(e,t)}let te=ee.length,ne=d+f;for(let e=0;e<k;e++){let t=l?O(C[e],P[e],ne):C[e];_?(b.copy(v.normals[0]).multiplyScalar(t.x),y.copy(v.binormals[0]).multiplyScalar(t.y),x.copy(g[0]).add(b).add(y),L(x.x,x.y,x.z)):L(t.x,t.y,0)}for(let e=1;e<=s;e++)for(let t=0;t<k;t++){let n=l?O(C[t],P[t],ne):C[t];_?(b.copy(v.normals[e]).multiplyScalar(n.x),y.copy(v.binormals[e]).multiplyScalar(n.y),x.copy(g[e]).add(b).add(y),L(x.x,x.y,x.z)):L(n.x,n.y,c/s*e)}for(let e=p-1;e>=0;e--){let t=e/p,n=u*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+f;for(let e=0,t=D.length;e<t;e++){let t=O(D[e],j[e],r);L(t.x,t.y,c+n)}for(let e=0,t=w.length;e<t;e++){let t=w[e];N=M[e];for(let e=0,i=t.length;e<i;e++){let i=O(t[e],N[e],r);_?L(i.x,i.y+g[s-1].y,g[s-1].x+n):L(i.x,i.y,c+n)}}}re(),F();function re(){let e=r.length/3;if(l){let e=0,t=k*e;for(let e=0;e<te;e++){let n=ee[e];ie(n[2]+t,n[1]+t,n[0]+t)}e=s+p*2,t=k*e;for(let e=0;e<te;e++){let n=ee[e];ie(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<te;e++){let t=ee[e];ie(t[2],t[1],t[0])}for(let e=0;e<te;e++){let t=ee[e];ie(t[0]+k*s,t[1]+k*s,t[2]+k*s)}}n.addGroup(e,r.length/3-e,0)}function F(){let e=r.length/3,t=0;I(D,t),t+=D.length;for(let e=0,n=w.length;e<n;e++){let n=w[e];I(n,t),t+=n.length}n.addGroup(e,r.length/3-e,1)}function I(e,t){let n=e.length;for(;--n>=0;){let r=n,i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+p*2;e<n;e++){let n=k*e,a=k*(e+1);ae(t+r+n,t+i+n,t+i+a,t+r+a)}}}function L(e,t,n){a.push(e),a.push(t),a.push(n)}function ie(e,t,i){oe(e),oe(t),oe(i);let a=r.length/3,o=h.generateTopUV(n,r,a-3,a-2,a-1);se(o[0]),se(o[1]),se(o[2])}function ae(e,t,i,a){oe(e),oe(t),oe(a),oe(t),oe(i),oe(a);let o=r.length/3,s=h.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);se(s[0]),se(s[1]),se(s[3]),se(s[1]),se(s[2]),se(s[3])}
vendor: 16,289 bytes, lines 1-5
1function oe(e){r.push(a[e*3+0]),r.push(a[e*3+1]),r.push(a[e*3+2])}function se(e){i.push(e.x),i.push(e.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return Gl(t,n,e)}static fromJSON(t,n){let r=[];for(let e=0,i=t.shapes.length;e<i;e++){let i=n[t.shapes[e]];r.push(i)}let i=t.options.extrudePath;return i!==void 0&&(t.options.extrudePath=new nl[i.type]().fromJSON(i)),new e(r,t.options)}},Wl={generateTopUV:function(e,t,n,r,i){let a=t[n*3],o=t[n*3+1],s=t[r*3],c=t[r*3+1],l=t[i*3],u=t[i*3+1];return[new W(a,o),new W(s,c),new W(l,u)]},generateSideWallUV:function(e,t,n,r,i,a){let o=t[n*3],s=t[n*3+1],c=t[n*3+2],l=t[r*3],u=t[r*3+1],d=t[r*3+2],f=t[i*3],p=t[i*3+1],m=t[i*3+2],h=t[a*3],g=t[a*3+1],_=t[a*3+2];return Math.abs(s-u)<Math.abs(o-l)?[new W(o,1-c),new W(l,1-d),new W(f,1-m),new W(h,1-_)]:[new W(s,1-c),new W(u,1-d),new W(p,1-m),new W(g,1-_)]}};function Gl(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,r=e.length;t<r;t++){let r=e[t];n.shapes.push(r.uuid)}else n.shapes.push(e.uuid);return n.options=Object.assign({},t),t.extrudePath!==void 0&&(n.options.extrudePath=t.extrudePath.toJSON()),n}var Kl=class e extends Sc{constructor(e=1,t=0){let n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];super(r,[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],e,t),this.type=`IcosahedronGeometry`,this.parameters={radius:e,detail:t}}static fromJSON(t){return new e(t.radius,t.detail)}},ql=class e extends Ua{constructor(e=[new W(0,-.5),new W(.5,0),new W(0,.5)],t=12,n=0,r=Math.PI*2){super(),this.type=`LatheGeometry`,this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=U(r,0,Math.PI*2);let i=[],a=[],o=[],s=[],c=[],l=1/t,u=new G,d=new W,f=new G,p=new G,m=new G,h=0,g=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:h=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,f.x=g*1,f.y=-h,f.z=g*0,m.copy(f),f.normalize(),s.push(f.x,f.y,f.z);break;case e.length-1:s.push(m.x,m.y,m.z);break;default:h=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,f.x=g*1,f.y=-h,f.z=g*0,p.copy(f),f.x+=m.x,f.y+=m.y,f.z+=m.z,f.normalize(),s.push(f.x,f.y,f.z),m.copy(p)}for(let i=0;i<=t;i++){let f=n+i*l*r,p=Math.sin(f),m=Math.cos(f);for(let n=0;n<=e.length-1;n++){u.x=e[n].x*p,u.y=e[n].y,u.z=e[n].x*m,a.push(u.x,u.y,u.z),d.x=i/t,d.y=n/(e.length-1),o.push(d.x,d.y);let r=s[3*n+0]*p,l=s[3*n+1],f=s[3*n+0]*m;c.push(r,l,f)}}for(let n=0;n<t;n++)for(let t=0;t<e.length-1;t++){let r=t+n*e.length,a=r,o=r+e.length,s=r+e.length+1,c=r+1;i.push(a,o,c),i.push(s,c,o)}this.setIndex(i),this.setAttribute(`position`,new J(a,3)),this.setAttribute(`uv`,new J(o,2)),this.setAttribute(`normal`,new J(c,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.points,t.segments,t.phiStart,t.phiLength)}},Jl=class e extends Sc{constructor(e=1,t=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],e,t),this.type=`OctahedronGeometry`,this.parameters={radius:e,detail:t}}static fromJSON(t){return new e(t.radius,t.detail)}},Yl=class e extends Ua{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e<l;e++){let t=e*d-a;for(let n=0;n<c;n++){let r=n*u-i;p.push(r,-t,0),m.push(0,0,1),h.push(n/o),h.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),a=t+1+c*e;f.push(n,r,a),f.push(r,i,a)}this.setIndex(f),this.setAttribute(`position`,new J(p,3)),this.setAttribute(`normal`,new J(m,3)),this.setAttribute(`uv`,new J(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.widthSegments,t.heightSegments)}},Xl=class e extends Ua{constructor(e=.5,t=1,n=32,r=1,i=0,a=Math.PI*2){super(),this.type=`RingGeometry`,this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},n=Math.max(3,n),r=Math.max(1,r);let o=[],s=[],c=[],l=[],u=e,d=(t-e)/r,f=new G,p=new W;for(let e=0;e<=r;e++){for(let e=0;e<=n;e++){let r=i+e/n*a;f.x=u*Math.cos(r),f.y=u*Math.sin(r),s.push(f.x,f.y,f.z),c.push(0,0,1),p.x=(f.x/t+1)/2,p.y=(f.y/t+1)/2,l.push(p.x,p.y)}u+=d}for(let e=0;e<r;e++){let t=e*(n+1);for(let e=0;e<n;e++){let r=e+t,i=r,a=r+n+1,s=r+n+2,c=r+1;o.push(i,a,c),o.push(a,s,c)}}this.setIndex(o),this.setAttribute(`position`,new J(s,3)),this.setAttribute(`normal`,new J(c,3)),this.setAttribute(`uv`,new J(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}},Zl=class e extends Ua{constructor(e=new al([new W(0,.5),new W(-.5,-.5),new W(.5,-.5)]),t=12){super(),this.type=`ShapeGeometry`,this.parameters={shapes:e,curveSegments:t};let n=[],r=[],i=[],a=[],o=0,s=0;if(Array.isArray(e)===!1)c(e);else for(let t=0;t<e.length;t++)c(e[t]),this.addGroup(o,s,t),o+=s,s=0;this.setIndex(n),this.setAttribute(`position`,new J(r,3)),this.setAttribute(`normal`,new J(i,3)),this.setAttribute(`uv`,new J(a,2));function c(e){let o=r.length/3,c=e.extractPoints(t),l=c.shape,u=c.holes;Bl.isClockWise(l)===!1&&(l=l.reverse());for(let e=0,t=u.length;e<t;e++){let t=u[e];Bl.isClockWise(t)===!0&&(u[e]=t.reverse())}let d=Bl.triangulateShape(l,u);for(let e=0,t=u.length;e<t;e++){let t=u[e];l=l.concat(t)}for(let e=0,t=l.length;e<t;e++){let t=l[e];r.push(t.x,t.y,0),i.push(0,0,1),a.push(t.x,t.y)}for(let e=0,t=d.length;e<t;e++){let t=d[e],r=t[0]+o,i=t[1]+o,a=t[2]+o;n.push(r,i,a),s+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON(),t=this.parameters.shapes;return Ql(t,e)}static fromJSON(t,n){let r=[];for(let e=0,i=t.shapes.length;e<i;e++){let i=n[t.shapes[e]];r.push(i)}return new e(r,t.curveSegments)}};function Ql(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,r=e.length;n<r;n++){let r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}var $l=class e extends Ua{constructor(e=1,t=32,n=16,r=0,i=Math.PI*2,a=0,o=Math.PI){super(),this.type=`SphereGeometry`,this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));let s=Math.min(a+o,Math.PI),c=0,l=[],u=new G,d=new G,f=[],p=[],m=[],h=[];for(let f=0;f<=n;f++){let g=[],_=f/n,v=0;f===0&&a===0?v=.5/t:f===n&&s===Math.PI&&(v=-.5/t);for(let n=0;n<=t;n++){let s=n/t;u.x=-e*Math.cos(r+s*i)*Math.sin(a+_*o),u.y=e*Math.cos(a+_*o),u.z=e*Math.sin(r+s*i)*Math.sin(a+_*o),p.push(u.x,u.y,u.z),d.copy(u).normalize(),m.push(d.x,d.y,d.z),h.push(s+v,1-_),g.push(c++)}l.push(g)}for(let e=0;e<n;e++)for(let r=0;r<t;r++){let t=l[e][r+1],i=l[e][r],o=l[e+1][r],c=l[e+1][r+1];(e!==0||a>0)&&f.push(t,i,c),(e!==n-1||s<Math.PI)&&f.push(i,o,c)}this.setIndex(f),this.setAttribute(`position`,new J(p,3)),this.setAttribute(`normal`,new J(m,3)),this.setAttribute(`uv`,new J(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}},eu=class e extends Sc{constructor(e=1,t=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],e,t),this.type=`TetrahedronGeometry`,this.parameters={radius:e,detail:t}}static fromJSON(t){return new e(t.radius,t.detail)}},tu=class e extends Ua{constructor(e=1,t=.4,n=12,r=48,i=Math.PI*2,a=0,o=Math.PI*2){super(),this.type=`TorusGeometry`,this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i,thetaStart:a,thetaLength:o},n=Math.floor(n),r=Math.floor(r);let s=[],c=[],l=[],u=[],d=new G,f=new G,p=new G;for(let s=0;s<=n;s++){let m=a+s/n*o;for(let a=0;a<=r;a++){let o=a/r*i;f.x=(e+t*Math.cos(m))*Math.cos(o),f.y=(e+t*Math.cos(m))*Math.sin(o),f.z=t*Math.sin(m),c.push(f.x,f.y,f.z),d.x=e*Math.cos(o),d.y=e*Math.sin(o),p.subVectors(f,d).normalize(),l.push(p.x,p.y,p.z),u.push(a/r),u.push(s/n)}}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){let n=(r+1)*e+t-1,i=(r+1)*(e-1)+t-1,a=(r+1)*(e-1)+t,o=(r+1)*e+t;s.push(n,i,o),s.push(i,a,o)}this.setIndex(s),this.setAttribute(`position`,new J(c,3)),this.setAttribute(`normal`,new J(l,3)),this.setAttribute(`uv`,new J(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}},nu=class e extends Ua{constructor(e=1,t=.4,n=64,r=8,i=2,a=3){super(),this.type=`TorusKnotGeometry`,this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},n=Math.floor(n),r=Math.floor(r);let o=[],s=[],c=[],l=[],u=new G,d=new G,f=new G,p=new G,m=new G,h=new G,g=new G;for(let o=0;o<=n;++o){let v=o/n*i*Math.PI*2;_(v,i,a,e,f),_(v+.01,i,a,e,p),h.subVectors(p,f),g.addVectors(p,f),m.crossVectors(h,g),g.crossVectors(m,h),m.normalize(),g.normalize();for(let e=0;e<=r;++e){let i=e/r*Math.PI*2,a=-t*Math.cos(i),p=t*Math.sin(i);u.x=f.x+(a*g.x+p*m.x),u.y=f.y+(a*g.y+p*m.y),u.z=f.z+(a*g.z+p*m.z),s.push(u.x,u.y,u.z),d.subVectors(u,f).normalize(),c.push(d.x,d.y,d.z),l.push(o/n),l.push(e/r)}}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){let n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),a=(r+1)*e+t,s=(r+1)*(e-1)+t;o.push(n,i,s),o.push(i,a,s)}this.setIndex(o),this.setAttribute(`position`,new J(s,3)),this.setAttribute(`normal`,new J(c,3)),this.setAttribute(`uv`,new J(l,2));function _(e,t,n,r,i){let a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}},ru=class e extends Ua{constructor(e=new el(new G(-1,-1,0),new G(-1,1,0),new G(1,1,0)),t=64,n=1,r=8,i=!1){super(),this.type=`TubeGeometry`,this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};let a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;let o=new G,s=new G,c=new W,l=new G,u=[],d=[],f=[],p=[];m(),this.setIndex(p),this.setAttribute(`position`,new J(u,3)),this.setAttribute(`normal`,new J(d,3)),this.setAttribute(`uv`,new J(f,2));function m(){for(let e=0;e<t;e++)h(e);h(i===!1?t:0),_(),g()}function h(i){l=e.getPointAt(i/t,l);let c=a.normals[i],f=a.binormals[i];for(let e=0;e<=r;e++){let t=e/r*Math.PI*2,i=Math.sin(t),a=-Math.cos(t);s.x=a*c.x+i*f.x,s.y=a*c.y+i*f.y,s.z=a*c.z+i*f.z,s.normalize(),d.push(s.x,s.y,s.z),o.x=l.x+n*s.x,o.y=l.y+n*s.y,o.z=l.z+n*s.z,u.push(o.x,o.y,o.z)}}function g(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){let n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),a=(r+1)*e+t,o=(r+1)*(e-1)+t;p.push(n,i,o),p.push(i,a,o)}}function _(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)c.x=e/t,c.y=n/r,f.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(t){return new e(new nl[t.path.type]().fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}},iu=class extends Ua{constructor(e=null){if(super(),this.type=`WireframeGeometry`,this.parameters={geometry:e},e!==null){let t=[],n=new Set,r=new G,i=new G;if(e.index!==null){let a=e.attributes.position,o=e.index,s=e.groups;s.length===0&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,c=s.length;e<c;++e){let c=s[e],l=c.start,u=c.count;for(let e=l,s=l+u;e<s;e+=3)for(let s=0;s<3;s++){let c=o.getX(e+s),l=o.getX(e+(s+1)%3);r.fromBufferAttribute(a,c),i.fromBufferAttribute(a,l),au(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{let a=e.attributes.position;for(let e=0,o=a.count/3;e<o;e++)for(let o=0;o<3;o++){let s=3*e+o,c=3*e+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,c),au(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute(`position`,new J(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}};function au(e,t,n){let r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return n.has(r)===!0||n.has(i)===!0?!1:(n.add(r),n.add(i),!0)}var ou=Object.freeze({__proto__:null,BoxGeometry:_c,CapsuleGeometry:vc,CircleGeometry:yc,ConeGeometry:xc,CylinderGeometry:bc,DodecahedronGeometry:Cc,EdgesGeometry:Oc,ExtrudeGeometry:Ul,IcosahedronGeometry:Kl,LatheGeometry:ql,OctahedronGeometry:Jl,PlaneGeometry:Yl,PolyhedronGeometry:Sc,RingGeometry:Xl,ShapeGeometry:Zl,SphereGeometry:$l,TetrahedronGeometry:eu,TorusGeometry:tu,TorusKnotGeometry:nu,TubeGeometry:ru,WireframeGeometry:iu}),su=class extends Ja{constructor(e){super(),this.isShadowMaterial=!0,this.type=`ShadowMaterial`,this.color=new q(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}};function cu(e){let t={};for(let n in e){t[n]={};for(let r in e[n]){let i=e[n][r];if(uu(i))i.isRenderTargetTexture?(V(`UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().`),t[n][r]=null):t[n][r]=i.clone();else if(Array.isArray(i)){if(uu(i[0])){let e=[];for(let t=0,n=i.length;t<n;t++)e[t]=i[t].clone();t[n][r]=e}else t[n][r]=i.slice()}else t[n][r]=i}}return t}function lu(e){let t={};for(let n=0;n<e.length;n++){let r=cu(e[n]);for(let e in r)t[e]=r[e]}return t}function uu(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function du(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function fu(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Rr.workingColorSpace}var pu={clone:cu,merge:lu},mu=`void main() {
2	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3}`,hu=`void main() {
4	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
5}`,gu=class extends Ja{constructor(e){super(),this.isShaderMaterial=!0,this.type=`ShaderMaterial`,this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=mu,this.fragmentShader=hu,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,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=cu(e.uniforms),this.uniformsGroups=du(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:`t`,value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:`c`,value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:`v2`,value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:`v3`,value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:`v4`,value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:`m3`,value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:`m4`,value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},_u=class extends gu{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type=`RawS
5haderMaterial`}},vu=class extends Ja{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type=`MeshStandardMaterial`,this.defines={STANDARD:``},this.color=new q(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new q(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new W(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 di,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:``},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},yu=class extends vu{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:``,PHYSICAL:``},this.type=`MeshPhysicalMaterial`,this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new W(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return U(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new q(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 q(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new q(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:``,PHYSICAL:``},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},bu=class extends Ja{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type=`MeshPhongMaterial`,this.color=new q(16777215),this.specular=new q(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new q(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new di,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(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},xu=class extends Ja{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:``},this.type=`MeshToonMaterial`,this.color=new q(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new q(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},Su=class extends Ja{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type=`MeshNormalMaterial`,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}},Cu=class extends Ja{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type=`MeshLambertMaterial`,this.color=new q(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new q(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new W(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new di,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(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},wu=class extends Ja{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=dn,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},Tu=class extends Ja{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type=`MeshDistanceMaterial`,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}
vendor: 6,935 bytes, line 5
5,Eu=class extends Ja{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:``},this.type=`MeshMatcapMaterial`,this.color=new q(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new W(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(e)}copy(e){return super.copy(e),this.defines={MATCAP:``},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}},Du=class extends Rs{constructor(e){super(),this.isLineDashedMaterial=!0,this.type=`LineDashedMaterial`,this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};function Ou(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}function ku(e){function t(t,n){return e[t]-e[n]}let n=e.length,r=Array(n);for(let e=0;e!==n;++e)r[e]=e;return r.sort(t),r}function Au(e,t,n){let r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){let r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i}function ju(e,t,n,r){let i=1,a=e[0];for(;a!==void 0&&a[r]===void 0;)a=e[i++];if(a===void 0)return;let o=a[r];if(o!==void 0){if(Array.isArray(o))do o=a[r],o!==void 0&&(t.push(a.time),n.push(...o)),a=e[i++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[r],o!==void 0&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++];while(a!==void 0);else do o=a[r],o!==void 0&&(t.push(a.time),n.push(o)),a=e[i++];while(a!==void 0)}}function Mu(e,t,n,r,i=30){let a=e.clone();a.name=t;let o=[];for(let e=0;e<a.tracks.length;++e){let t=a.tracks[e],s=t.getValueSize(),c=[],l=[];for(let e=0;e<t.times.length;++e){let a=t.times[e]*i;if(!(a<n||a>=r)){c.push(t.times[e]);for(let n=0;n<s;++n)l.push(t.values[e*s+n])}}c.length!==0&&(t.times=Ou(c,t.times.constructor),t.values=Ou(l,t.values.constructor),o.push(t))}a.tracks=o;let s=1/0;for(let e=0;e<a.tracks.length;++e)s>a.tracks[e].times[0]&&(s=a.tracks[e].times[0]);for(let e=0;e<a.tracks.length;++e)a.tracks[e].shift(-1*s);return a.resetDuration(),a}function Nu(e,t=0,n=e,r=30){r<=0&&(r=30);let i=n.tracks.length,a=t/r;for(let t=0;t<i;++t){let r=n.tracks[t],i=r.ValueTypeName;if(i===`bool`||i===`string`)continue;let o=e.tracks.find(function(e){return e.name===r.name&&e.ValueTypeName===i});if(o===void 0)continue;let s=0,c=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=c/3);let l=0,u=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=u/3);let d=r.times.length-1,f;if(a<=r.times[0]){let e=s,t=c-s;f=r.values.slice(e,t)}else if(a>=r.times[d]){let e=d*c+s,t=e+c-s;f=r.values.slice(e,t)}else{let e=r.createInterpolant(),t=s,n=c-s;e.evaluate(a),f=e.resultBuffer.slice(t,n)}i===`quaternion`&&new Ar().fromArray(f).normalize().conjugate().toArray(f);let p=o.times.length;for(let e=0;e<p;++e){let t=e*u+l;if(i===`quaternion`)Ar.multiplyQuaternionsFlat(o.values,t,f,0,o.values,t);else{let e=u-l*2;for(let n=0;n<e;++n)o.values[t+n]-=f[n]}}}return e.blendMode=un,e}var Pu=class{static convertArray(e,t){return Ou(e,t)}static isTypedArray(e){return Gn(e)}static getKeyframeOrder(e){return ku(e)}static sortedArray(e,t,n){return Au(e,t,n)}static flattenJSON(e,t,n,r){ju(e,t,n,r)}static subclip(e,t,n,r,i=30){return Mu(e,t,n,r,i)}static makeClipAdditive(e,t=0,n=e,r=30){return Nu(e,t,n,r)}},Fu=class{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{let a;linear_scan:{forward_scan:if(!(e<r)){for(let a=n+2;;){if(r===void 0){if(e<i)break forward_scan;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(i=r,r=t[++n],e<r)break seek}a=t.length;break linear_scan}if(!(e>=i)){let o=t[1];e<o&&(n=2,i=o);for(let a=n-2;;){if(i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(r=i,i=t[--n-1],e>=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n<a;){let r=n+a>>>1;e<t[r]?a=r:n=r+1}if(r=t[n],i=t[n-1],i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw Error(`call to abstract method`)}intervalChanged_(){}},Iu=class extends Fu{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:on,endingEnd:on}}intervalChanged_(e,t,n){let r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(o===void 0)switch(this.getSettings_().endingStart){case sn:i=e,o=2*t-n;break;case cn:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(s===void 0)switch(this.getSettings_().endingEnd){case sn:a=e,s=2*n-t;break;case cn:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}let c=(n-t)*.5,l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(n-t)/(r-t),m=p*p,h=m*p,g=-d*h+2*d*m-d*p,_=(1+d)*h+(-1.5-2*d)*m+(-.5+d)*p+1,v=(-1-f)*h+(1.5+f)*m+.5*p,y=f*h-f*m;for(let e=0;e!==o;++e)i[e]=g*a[l+e]+_*a[c+e]+v*a[s+e]+y*a[u+e];return i}},Lu=class extends Fu{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l;for(let e=0;e!==o;++e)i[e]=a[c+e]*u+a[s+e]*l;return i}},Ru=class extends Fu{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}},zu=class extends Fu{interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this.settings||this.DefaultSettings_,u=l.inTangents,d=l.outTangents;if(!u||!d){let e=(n-t)/(r-t),l=1-e;for(let t=0;t!==o;++t)i[t]=a[c+t]*l+a[s+t]*e;return i}let f=o*2,p=e-1;for(let l=0;l!==o;
5++l){let o=a[c+l],m=a[s+l],h=p*f+l*2,g=d[h],_=d[h+1],v=e*f+l*2,y=u[v],b=u[v+1],x=(n-t)/(r-t),S,C,w,T,E;for(let e=0;e<8;e++){S=x*x,C=S*x,w=1-x,T=w*w,E=T*w;let e=E*t+3*T*x*g+3*w*S*y+C*r-n;if(Math.abs(e)<1e-10)break;let i=3*T*(g-t)+6*w*x*(y-g)+3*S*(r-y);if(Math.abs(i)<1e-10)break;x-=e/i,x=Math.max(0,Math.min(1,x))}i[l]=E*o+3*T*x*_+3*w*S*b+C*m}return i}},Bu=class{constructor(e,t,n,r){if(e===void 0)throw Error(`THREE.KeyframeTrack: track name is undefined`);if(t===void 0||t.length===0)throw Error(`THREE.KeyframeTrack: no keyframes in track named `+e);this.name=e,this.times=Ou(t,this.TimeBufferType),this.values=Ou(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Ou(e.times,Array),values:Ou(e.values,Array)};let t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Ru(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Lu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Iu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){let t=new zu(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.settings=this.settings),t}setInterpolation(e){let t;switch(e){case tn:t=this.InterpolantFactoryMethodDiscrete;break;case nn:t=this.InterpolantFactoryMethodLinear;break;case rn:t=this.InterpolantFactoryMethodSmooth;break;case an:t=this.InterpolantFactoryMethodBezier}if(t===void 0){let t=`unsupported interpolation for `+this.ValueTypeName+` keyframe track named `+this.name;if(this.createInterpolant===void 0){if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t)}return V(`KeyframeTrack:`,t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return tn;case this.InterpolantFactoryMethodLinear:return nn;case this.InterpolantFactoryMethodSmooth:return rn;case this.InterpolantFactoryMethodBezier:return an}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){let n=this.times,r=n.length,i=0,a=r-1;for(;i!==r&&n[i]<e;)++i;for(;a!==-1&&n[a]>t;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(H(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(H(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){H(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){H(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&Gn(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){H(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===rn,i=e.length-1,a=1;for(let o=1;o<i;++o){let i=!1,s=e[o];if(s!==e[o+1]&&(o!==1||s!==e[0])){if(r)i=!0;else{let e=o*n,r=e-n,a=e+n;for(let o=0;o!==n;++o){let n=t[e+o];if(n!==t[r+o]||n!==t[a+o]){i=!0;break}}}}if(i){if(o!==a){e[a]=e[o];let r=o*n,i=a*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++a}}if(i>0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};Bu.prototype.ValueTypeName=``,Bu.prototype.TimeBufferType=Float32Array,Bu.prototype.ValueBufferType=Float32Array,Bu.prototype.DefaultInterpolation=nn;var Vu=class extends Bu{constructor(e,t,n){super(e,t,n)}};Vu.prototype.ValueTypeName=`bool`,Vu.prototype.ValueBufferType=Array,Vu.prototype.DefaultInterpolation=tn,Vu.prototype.InterpolantFactoryMethodLinear=void 0,Vu.prototype.InterpolantFactoryMethodSmooth=void 0;var Hu=class extends Bu{constructor(e,t,n,r){super(e,t,n,r)}};Hu.prototype.ValueTypeName=`color`;var Uu=class extends Bu{constructor(e,t,n,r){super(e,t,n,r)}};Uu.prototype.ValueTypeName=`number`;var Wu=class extends Fu{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;
vendor: 6,332 bytes, line 5
5c+=4)Ar.slerpFlat(i,0,a,c-o,a,c,s);return i}},Gu=class extends Bu{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new Wu(this.times,this.values,this.getValueSize(),e)}};Gu.prototype.ValueTypeName=`quaternion`,Gu.prototype.InterpolantFactoryMethodSmooth=void 0;var Ku=class extends Bu{constructor(e,t,n){super(e,t,n)}};Ku.prototype.ValueTypeName=`string`,Ku.prototype.ValueBufferType=Array,Ku.prototype.DefaultInterpolation=tn,Ku.prototype.InterpolantFactoryMethodLinear=void 0,Ku.prototype.InterpolantFactoryMethodSmooth=void 0;var qu=class extends Bu{constructor(e,t,n,r){super(e,t,n,r)}};qu.prototype.ValueTypeName=`vector`;var Ju=class{constructor(e=``,t=-1,n=[],r=ln){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=cr(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(Xu(n[e]).scale(r));let i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i.userData=JSON.parse(e.userData||`{}`),i}static toJSON(e){let t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,r=n.length;e!==r;++e)t.push(Bu.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){let i=t.length,a=[];for(let e=0;e<i;e++){let o=[],s=[];o.push((e+i-1)%i,e,(e+1)%i),s.push(0,1,0);let c=ku(o);o=Au(o,1,c),s=Au(s,1,c),!r&&o[0]===0&&(o.push(i),s.push(s[0])),a.push(new Uu(`.morphTargetInfluences[`+t[e].name+`]`,o,s).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){let t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){let r={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,n=e.length;t<n;t++){let n=e[t],a=n.name.match(i);if(a&&a.length>1){let e=a[1],t=r[e];t||(r[e]=t=[]),t.push(n)}}let a=[];for(let e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}static parseAnimation(e,t){if(V(`AnimationClip: parseAnimation() is deprecated and will be removed with r185`),!e)return H(`AnimationClip: No animation in JSONLoader data.`),null;let n=function(e,t,n,r,i){if(n.length!==0){let a=[],o=[];ju(n,a,o,r),a.length!==0&&i.push(new e(t,a,o))}},r=[],i=e.name||`default`,a=e.fps||30,o=e.blendMode,s=e.length||-1,c=e.hierarchy||[];for(let e=0;e<c.length;e++){let i=c[e].keys;if(i&&i.length!==0){if(i[0].morphTargets){let e={},t=0;for(;t<i.length;t++)if(i[t].morphTargets)for(let n=0;n<i[t].morphTargets.length;n++)e[i[t].morphTargets[n]]=-1;for(let n in e){let e=[],a=[];for(let r=0;r!==i[t].morphTargets.length;++r){let r=i[t];e.push(r.time),a.push(+(r.morphTarget===n))}r.push(new Uu(`.morphTargetInfluence[`+n+`]`,e,a))}s=e.length*a}else{let a=`.bones[`+t[e].name+`]`;n(qu,a+`.position`,i,`pos`,r),n(Gu,a+`.quaternion`,i,`rot`,r),n(qu,a+`.scale`,i,`scl`,r)}}}return r.length===0?null:new this(i,s,r,o)}resetDuration(){let e=this.tracks,t=0;for(let n=0,r=e.length;n!==r;++n){let e=this.tracks[n];t=Math.max(t,e.times[e.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e&&=this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());let t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}};function Yu(e){switch(e.toLowerCase()){case`scalar`:case`double`:case`float`:case`number`:case`integer`:return Uu;case`vector`:case`vector2`:case`vector3`:case`vector4`:return qu;case`color`:return Hu;case`quaternion`:return Gu;case`bool`:case`boolean`:return Vu;case`string`:return Ku}throw Error(`THREE.KeyframeTrack: Unsupported typeName: `+e)}function Xu(e){if(e.type===void 0)throw Error(`THREE.KeyframeTrack: track type undefined, can not parse`);let t=Yu(e.type);if(e.times===void 0){let t=[],n=[];ju(e.keys,t,n,`value`),e.times=t,e.values=n}return t.parse===void 0?new t(e.name,e.times,e.values,e.interpolation):t.parse(e)}var Zu={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(Qu(e)||(this.files[e]=t))},get:function(e){if(this.enabled!==!1&&!Qu(e))return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function Qu(e){try{let t=e.slice(e.indexOf(`:`)+1);return new URL(t).protocol===`blob:`}catch{return!1}}var $u=class{constructor(e,t,n){let r=this,i=!1,a=0,o=0,s,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){let t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=c.length;t<n;t+=2){let n=c[t],r=c[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||=new AbortController,this._abortController}},ed=new $u,td=class{constructor(e){this.manager=e===void 0?ed:e,this.crossOrigin=`anonymous`,this.withCredentials=!1,this.path=``,this.resourcePath=``,this.requestHeader={},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}load(){}loadAsync(e,t){let n=this;return new Promise(function(r,i){n.load(e,r,t,i)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}};td.DEFAULT_MATERIAL_NAME=`__DEFAULT`;var nd={}
vendor: 4,998 bytes, line 5
5,rd=class extends Error{constructor(e,t){super(e),this.response=t}},id=class extends td{constructor(e){super(e),this.mimeType=``,this.responseType=``,this._abortController=new AbortController}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=Zu.get(`file:${e}`);if(i!==void 0){this.manager.itemStart(e),setTimeout(()=>{t&&t(i),this.manager.itemEnd(e)},0);return}if(nd[e]!==void 0){nd[e].push({onLoad:t,onProgress:n,onError:r});return}nd[e]=[],nd[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`,signal:typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&V(`FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=nd[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){t();function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e<t;e++){let t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}},t=>{e.error(t)})}}});return new Response(c)}throw new rd(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>new DOMParser().parseFromString(e,o));case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{Zu.add(`file:${e}`,t);let n=nd[e];delete nd[e];for(let e=0,r=n.length;e<r;e++){let r=n[e];r.onLoad&&r.onLoad(t)}}).catch(t=>{let n=nd[e];if(n===void 0)throw this.manager.itemError(e),t;delete nd[e];for(let e=0,r=n.length;e<r;e++){let r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},ad=class extends td{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new id(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):H(t),i.manager.itemError(e)}},n,r)}parse(e){let t=[];for(let n=0;n<e.length;n++){let r=Ju.parse(e[n]);t.push(r)}return t}},od=class extends td{constructor(e){super(e)}load(e,t,n,r){let i=this,a=[],o=new cc,s=new id(this.manager);s.setPath(this.path),s.setResponseType(`arraybuffer`),s.setRequestHeader(this.requestHeader),s.setWithCredentials(i.withCredentials);let c=0;function l(l){s.load(e[l],function(e){let n=i.parse(e,!0);a[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},c+=1,c===6&&(n.mipmapCount===1&&(o.minFilter=Ve),o.image=a,o.format=n.format,o.needsUpdate=!0,t&&t(o))},n,r)}if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)l(t);else s.load(e,function(e){let n=i.parse(e,!0);if(n.isCubemap){let e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){a[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)a[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),a[t].format=n.format,a[t].width=n.width,a[t].height=n.height}o.image=a}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;n.mipmapCount===1&&(o.minFilter=Ve),o.format=n.format,o.needsUpdate=!0,t&&t(o)},n,r);return o}},sd=new WeakMap,cd=class extends td{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=Zu.get(`image:${e}`);if(a!==void 0){if(a.complete===!0)i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);else{let e=sd.get(a);e===void 0&&(e=[],sd.set(a,e)),e.push({onLoad:t,onError:r})}return a}let o=Kn(`img`);function s(){l(),t&&t(this);let n=sd.get(this)||[];for(let e=0;e<n.length;e++){let t=n[e];t.onLoad&&t.onLoad(this)}sd.delete(this),i.manager.itemEnd(e)}function c(t){l(),r&&r(t),Zu.remove(`image:${e}`);let n=sd.get(this)||[];for(let e=0;e<n.length;e++){let r=n[e];r.onError&&r.onError(t)}sd.delete(this),i.manager.itemError(e),i.manager.itemEnd(e)}function l(){o.removeEventListener(`load`,s,!1),o.removeEventListener(`error`,c,!1)}return o.addEventListener(`load`,s,!1),o.addEventListener(`error`,c,!1),e.slice(0,5)!==`data:`&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),Zu.add(`image:${e}`,o),i.manager.itemStart(e),o.src=e,o}},ld=class extends td{constructor(e){super(e)}load(e,t,n,r){let i=new dc;
5i.colorSpace=hn;let a=new cd(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let o=0;function s(n){a.load(e[n],function(e){i.images[n]=e,o++,o===6&&(i.needsUpdate=!0,t&&t(i))},void 0,r)}for(let t=0;t<e.length;++t)s(t);return i}},ud=class extends td{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new Yo,o=new id(this.manager);return o.setResponseType(`arraybuffer`),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(i.withCredentials),o.load(e,function(e){let n;try{n=i.parse(e)}catch(e){r===void 0?H(e):r(e);return}n.image===void 0?n.data!==void 0&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data):a.image=n.image,a.wrapS=n.wrapS===void 0?Pe:n.wrapS,a.wrapT=n.wrapT===void 0?Pe:n.wrapT,a.magFilter=n.magFilter===void 0?Ve:n.magFilter,a.minFilter=n.minFilter===void 0?Ve:n.minFilter,a.anisotropy=n.anisotropy===void 0?1:n.anisotropy,n.colorSpace!==void 0&&(a.colorSpace=n.colorSpace),n.flipY!==void 0&&(a.flipY=n.flipY),n.format!==void 0&&(a.format=n.format),n.type!==void 0&&(a.type=n.type),n.mipmaps!==void 0&&(a.mipmaps=n.mipmaps,a.minFilter=We),n.mipmapCount===1&&(a.minFilter=Ve),n.generateMipmaps!==void 0&&(a.generateMipmaps=n.generateMipmaps),a.needsUpdate=!0,t&&t(a,n)},n,r),a}},dd=class extends td{constructor(e){super(e)}load(e,t,n,r){let i=new Jr,a=new cd(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){i.image=e,i.needsUpdate=!0,t!==void 0&&t(i)},n,r),i}},fd=class extends Oi{constructor(e,t=1){super(),this.isLight=!0,this.type=`Light`,this.color=new q(e),this.intensity=t}dispose(){this.dispatchEvent({type:`dispose`})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}},pd=class extends fd{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type=`HemisphereLight`,this.position.copy(Oi.DEFAULT_UP),this.updateMatrix(),this.groundColor=new q(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){let t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}},md=new K,hd=new G,gd=new G,_d=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new W(512,512),this.mapType=Ke,this.map=null,this.mapPass=null,this.matrix=new K,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new hs,this._frameExtents=new W(1,1),this._viewportCount=1,this._viewports=[new Yr(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;hd.setFromMatrixPosition(e.matrixWorld),t.position.copy(hd),gd.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(gd),t.updateMatrixWorld(),md.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(md,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===2001||t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(md)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},vd=new G,yd=new Ar,bd=new G,xd=class extends Oi{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new K,this.projectionMatrix=new K,this.projectionMatrixInverse=new K,this.coordinateSystem=In,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(vd,yd,bd),bd.x===1&&bd.y===1&&bd.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(vd,yd,bd.set(1,1,1)).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorld.decompose(vd,yd,bd),bd.x===1&&bd.y===1&&bd.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(vd,yd,bd.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}},Sd=new G,Cd=new W,wd=new W,Td=class extends xd{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=sr*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(or*.5*this.fov);return .5*this.getFilmHeight()/e}
vendor: 4,950 bytes, line 5
5getEffectiveFOV(){return sr*2*Math.atan(Math.tan(or*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Sd.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Sd.x,Sd.y).multiplyScalar(-e/Sd.z),Sd.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Sd.x,Sd.y).multiplyScalar(-e/Sd.z)}getViewSize(e,t){return this.getViewBounds(e,Cd,wd),t.subVectors(wd,Cd)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(or*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},Ed=class extends _d{constructor(){super(new Td(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){let t=this.camera,n=sr*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,i=e.distance||t.far;(n!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},Dd=class extends fd{constructor(e,t,n=0,r=Math.PI/3,i=0,a=2){super(e,t),this.isSpotLight=!0,this.type=`SpotLight`,this.position.copy(Oi.DEFAULT_UP),this.updateMatrix(),this.target=new Oi,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new Ed}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}},Od=class extends _d{constructor(){super(new Td(90,1,.5,500)),this.isPointLightShadow=!0}},kd=class extends fd{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type=`PointLight`,this.distance=n,this.decay=r,this.shadow=new Od}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}},Ad=class extends xd{constructor(e=-1,t=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type=`OrthographicCamera`,this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}
vendor: 32,345 bytes, line 5
5this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},jd=class extends _d{constructor(){super(new Ad(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},Md=class extends fd{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type=`DirectionalLight`,this.position.copy(Oi.DEFAULT_UP),this.updateMatrix(),this.target=new Oi,this.shadow=new jd}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}},Nd=class extends fd{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type=`AmbientLight`}},Pd=class extends fd{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type=`RectAreaLight`,this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}},Fd=class{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new G)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){let n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){let n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){let n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){let n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){let n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}},Id=class extends fd{constructor(e=new Fd,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}},Ld=class e extends td{constructor(e){super(e),this.textures={}}load(e,t,n,r){let i=this,a=new id(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):H(t),i.manager.itemError(e)}},n,r)}parse(e){let t=this.textures;function n(e){return t[e]===void 0&&V(`MaterialLoader: Undefined texture`,e),t[e]}let r=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=e.sheen),e.sheenColor!==void 0&&(r.sheenColor=new q().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(r.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.specularIntensity!==void 0&&(r.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&r.specularColor!==void 0&&r.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(r.dispersion=e.dispersion),e.iridescence!==void 0&&(r.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(r.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(r.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(r.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(r.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(r.depthFunc=e.depthFunc),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(r.blendSrc=e.blendSrc),e.blendDst!==void 0&&(r.blendDst=e.blendDst),e.blendEquation!==void 0&&(r.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(r.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(r.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(r.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&r.blendColor!==void 0&&r.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(r.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==void 0&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(r.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(r.allowOverride=e.allowOverride),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(r.vertexColors=typeof e.vertexColors==`number`?e.vertexColors>0:e.vertexColors),e.uniforms!==void 0)for(let t in e.uniforms){let i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case`t`:r.uniforms[t].value=n(i.value);break;case`c`:r.uniforms[t].value=new q().setHex(i.value);break;case`v2`:r.uniforms[t].value=new W().fromArray(i.value);break;case`v3`:r.uniforms[t].value=new G().fromArray(i.value);break;case`v4`:r.uniforms[t].value=new Yr().fromArray(i.value);break;case`m3`:r.uniforms[t].value=new Nr().fromArray(i.value);break;case`m4`:r.uniforms[t].value=new K().fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(let t in e.extensions)r.extensions[t]=e.extensions[t];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=n(e.map)),e.matcap!==void 0&&(r.matcap=n(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),r.normalScale=new W().fromArray(t)}return e.displacementMap!==void 0&&(r.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=n(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new W().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(t){return e.createMaterialFromType(t)}static createMaterialFromType(e){return new{ShadowMaterial:su,SpriteMaterial:Ya,RawShaderMaterial:_u,ShaderMaterial:gu,PointsMaterial:Qs,MeshPhysicalMaterial:yu,MeshStandardMaterial:vu,MeshPhongMaterial:bu,MeshToonMaterial:xu,MeshNormalMaterial:Su,MeshLambertMaterial:Cu,MeshDepthMaterial:wu,MeshDistanceMaterial:Tu,MeshBasicMaterial:Co,MeshMatcapMaterial:Eu,LineDashedMaterial:Du,LineBasicMaterial:Rs,Material:Ja}[e]}},Rd=class{static extractUrlBase(e){let t=e.lastIndexOf(`/`);return t===-1?`./`:e.slice(0,t+1)}static resolveURL(e,t){return typeof e!=`string`||e===``?``:(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,`$1`)),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},zd=class extends Ua{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type=`InstancedBufferGeometry`,this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}},Bd=class extends td{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new id(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):H(t),i.manager.itemError(e)}},n,r)}parse(e){let t={},n={};function r(e,n){if(t[n]!==void 0)return t[n];let r=e.interleavedBuffers[n],a=i(e,r.buffer),o=new Wa(Wn(r.type,a),r.stride);return o.uuid=r.uuid,t[n]=o,o}function i(e,t){if(n[t]!==void 0)return n[t];let r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}let a=e.isInstancedBufferGeometry?new zd:new Ua,o=e.data.index;if(o!==void 0){let e=Wn(o.type,o.array);a.setIndex(new Ca(e,1))}let s=e.data.attributes;for(let t in s){let n=s[t],i;if(n.isInterleavedBufferAttribute)i=new Ka(r(e.data,n.data),n.itemSize,n.offset,n.normalized);else{let e=Wn(n.type,n.array);i=new(n.isInstancedBufferAttribute?$o:Ca)(e,n.itemSize,n.normalized)}n.name!==void 0&&(i.name=n.name),n.usage!==void 0&&i.setUsage(n.usage),a.setAttribute(t,i)}let c=e.data.morphAttributes;if(c)for(let t in c){let n=c[t],i=[];for(let t=0,a=n.length;t<a;t++){let a=n[t],o;o=a.isInterleavedBufferAttribute?new Ka(r(e.data,a.data),a.itemSize,a.offset,a.normalized):new Ca(Wn(a.type,a.array),a.itemSize,a.normalized),a.name!==void 0&&(o.name=a.name),i.push(o)}a.morphAttributes[t]=i}e.data.morphTargetsRelative&&(a.morphTargetsRelative=!0);let l=e.data.groups||e.data.drawcalls||e.data.offsets;if(l!==void 0)for(let e=0,t=l.length;e!==t;++e){let t=l[e];a.addGroup(t.start,t.count,t.materialIndex)}let u=e.data.boundingSphere;return u!==void 0&&(a.boundingSphere=new Fa().fromJSON(u)),e.name&&(a.name=e.name),e.userData&&(a.userData=e.userData),a}},Vd={},Hd=class extends td{constructor(e){super(e)}load(e,t,n,r){let i=this,a=this.path===``?Rd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;let o=new id(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(n){let a=null;try{a=JSON.parse(n)}catch(t){r!==void 0&&r(t),H(`ObjectLoader: Can't parse `+e+`.`,t.message);return}let o=a.metadata;if(o===void 0||o.type===void 0||o.type.toLowerCase()===`geometry`){r!==void 0&&r(Error(`THREE.ObjectLoader: Can't load `+e)),H(`ObjectLoader: Can't load `+e);return}i.parse(a,t)},n,r)}async loadAsync(e,t){let n=this,r=this.path===``?Rd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;let i=new id(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials);let a=await i.loadAsync(e,t),o;try{o=JSON.parse(a)}catch(t){throw Error(`ObjectLoader: Can't parse `+e+`. `+t.message)}let s=o.metadata;if(s===void 0||s.type===void 0||s.type.toLowerCase()===`geometry`)throw Error(`THREE.ObjectLoader: Can't load `+e);return await n.parseAsync(o)}parse(e,t){let n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),a=this.parseImages(e.images,function(){t!==void 0&&t(c)}),o=this.parseTextures(e.textures,a),s=this.parseMaterials(e.materials,o),c=this.parseObject(e.object,i,s,o,n),l=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,l),this.bindLightTargets(c),t!==void 0){let e=!1;for(let t in a)if(a[t].data instanceof HTMLImageElement){e=!0;break}e===!1&&t(c)}return c}async parseAsync(e){let t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),i=await this.parseImagesAsync(e.images),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o,a,t),c=this.parseSkeletons(e.skeletons,s);return this.bindSkeletons(s,c),this.bindLightTargets(s),s}static registerGeometry(e,t){Vd[e]=t}parseShapes(e){let t={};if(e!==void 0)for(let n=0,r=e.length;n<r;n++){let r=new al().fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){let n={},r={};if(t.traverse(function(e){e.isBone&&(r[e.uuid]=e)}),e!==void 0)for(let t=0,i=e.length;t<i;t++){let i=new Qo().fromJSON(e[t],r);n[i.uuid]=i}return n}parseGeometries(e,t){let n={};if(e!==void 0){let r=new Bd;for(let i=0,a=e.length;i<a;i++){let a,o=e[i];switch(o.type){case`BufferGeometry`:case`InstancedBufferGeometry`:a=r.parse(o);break;default:o.type in ou?a=ou[o.type].fromJSON(o,t):o.type in Vd?a=Vd[o.type].fromJSON(o,t):V(`ObjectLoader: Unknown geometry type "${o.type}". Use .registerGeometry() before starting the deserialization process.`)}a.uuid=o.uuid,o.name!==void 0&&(a.name=o.name),o.userData!==void 0&&(a.userData=o.userData),n[o.uuid]=a}}return n}parseMaterials(e,t){let n={},r={};if(e!==void 0){let i=new Ld;i.setTextures(t);for(let t=0,a=e.length;t<a;t++){let a=e[t];n[a.uuid]===void 0&&(n[a.uuid]=i.parse(a)),r[a.uuid]=n[a.uuid]}}return r}parseAnimations(e){let t={};if(e!==void 0)for(let n=0;n<e.length;n++){let r=e[n],i=Ju.parse(r);t[i.uuid]=i}return t}parseImages(e,t){let n=this,r={},i;function a(e){return n.manager.itemStart(e),i.load(e,function(){n.manager.itemEnd(e)},void 0,function(){n.manager.itemError(e),n.manager.itemEnd(e)})}function o(e){if(typeof e==`string`){let t=e;return a(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:Wn(e.type,e.data),width:e.width,height:e.height}:null}if(e!==void 0&&e.length>0){i=new cd(new $u(t)),i.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){let n=e[t],i=n.url;if(Array.isArray(i)){let e=[];for(let t=0,n=i.length;t<n;t++){let n=i[t],r=o(n);r!==null&&(r instanceof HTMLImageElement?e.push(r):e.push(new Yo(r.data,r.width,r.height)))}r[n.uuid]=new Wr(e)}else{let e=o(n.url);r[n.uuid]=new Wr(e)}}}return r}async parseImagesAsync(e){let t=this,n={},r;async function i(e){if(typeof e==`string`){let n=e,i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:t.resourcePath+n;return await r.loadAsync(i)}return e.data?{data:Wn(e.type,e.data),width:e.width,height:e.height}:null}if(e!==void 0&&e.length>0){r=new cd(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t<r;t++){let r=e[t],a=r.url;if(Array.isArray(a)){let e=[];for(let t=0,n=a.length;t<n;t++){let n=a[t],r=await i(n);r!==null&&(r instanceof HTMLImageElement?e.push(r):e.push(new Yo(r.data,r.width,r.height)))}n[r.uuid]=new Wr(e)}else{let e=await i(r.url);n[r.uuid]=new Wr(e)}}}return n}parseTextures(e,t){function n(e,t){return typeof e==`number`?e:(V(`ObjectLoader.parseTexture: Constant should be in numeric form.`,e),t[e])}let r={};if(e!==void 0)for(let i=0,a=e.length;i<a;i++){let a=e[i];a.image===void 0&&V(`ObjectLoader: No "image" specified for`,a.uuid),t[a.image]===void 0&&V(`ObjectLoader: Undefined image`,a.image);let o=t[a.image],s=o.data,c;Array.isArray(s)?(c=new dc,s.length===6&&(c.needsUpdate=!0)):(c=s&&s.data?new Yo:new Jr,s&&(c.needsUpdate=!0)),c.source=o,c.uuid=a.uuid,a.name!==void 0&&(c.name=a.name),a.mapping!==void 0&&(c.mapping=n(a.mapping,Ud)),a.channel!==void 0&&(c.channel=a.channel),a.offset!==void 0&&c.offset.fromArray(a.offset),a.repeat!==void 0&&c.repeat.fromArray(a.repeat),a.center!==void 0&&c.center.fromArray(a.center),a.rotation!==void 0&&(c.rotation=a.rotation),a.wrap!==void 0&&(c.wrapS=n(a.wrap[0],Wd),c.wrapT=n(a.wrap[1],Wd)),a.format!==void 0&&(c.format=a.format),a.internalFormat!==void 0&&(c.internalFormat=a.internalFormat),a.type!==void 0&&(c.type=a.type),a.colorSpace!==void 0&&(c.colorSpace=a.colorSpace),a.minFilter!==void 0&&(c.minFilter=n(a.minFilter,Gd)),a.magFilter!==void 0&&(c.magFilter=n(a.magFilter,Gd)),a.anisotropy!==void 0&&(c.anisotropy=a.anisotropy),a.flipY!==void 0&&(c.flipY=a.flipY),a.generateMipmaps!==void 0&&(c.generateMipmaps=a.generateMipmaps),a.premultiplyAlpha!==void 0&&(c.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(c.unpackAlignment=a.unpackAlignment),a.compareFunction!==void 0&&(c.compareFunction=a.compareFunction),a.normalized!==void 0&&(c.normalized=a.normalized),a.userData!==void 0&&(c.userData=a.userData),r[a.uuid]=c}return r}parseObject(e,t,n,r,i){let a;function o(e){return t[e]===void 0&&V(`ObjectLoader: Undefined geometry`,e),t[e]}function s(e){if(e!==void 0){if(Array.isArray(e)){let t=[];for(let r=0,i=e.length;r<i;r++){let i=e[r];n[i]===void 0&&V(`ObjectLoader: Undefined material`,i),t.push(n[i])}return t}return n[e]===void 0&&V(`ObjectLoader: Undefined material`,e),n[e]}}function c(e){return r[e]===void 0&&V(`ObjectLoader: Undefined texture`,e),r[e]}let l,u;switch(e.type){case`Scene`:a=new zi,e.background!==void 0&&(Number.isInteger(e.background)?a.background=new q(e.background):a.background=c(e.background)),e.environment!==void 0&&(a.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type===`Fog`?a.fog=new Ri(e.fog.color,e.fog.near,e.fog.far):e.fog.type===`FogExp2`&&(a.fog=new Li(e.fog.color,e.fog.density)),e.fog.name!==``&&(a.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(a.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(a.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&a.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(a.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&a.environmentRotation.fromArray(e.environmentRotation);break;case`PerspectiveCamera`:a=new Td(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(a.focus=e.focus),e.zoom!==void 0&&(a.zoom=e.zoom),e.filmGauge!==void 0&&(a.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(a.filmOffset=e.filmOffset),e.view!==void 0&&(a.view=Object.assign({},e.view));break;case`OrthographicCamera`:a=new Ad(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(a.zoom=e.zoom),e.view!==void 0&&(a.view=Object.assign({},e.view));break;case`AmbientLight`:a=new Nd(e.color,e.intensity);break;case`DirectionalLight`:a=new Md(e.color,e.intensity),a.target=e.target||``;break;case`PointLight`:a=new kd(e.color,e.intensity,e.distance,e.decay);break;case`RectAreaLight`:a=new Pd(e.color,e.intensity,e.width,e.height);break;case`SpotLight`:a=new Dd(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),a.target=e.target||``;break;case`HemisphereLight`:a=new pd(e.color,e.groundColor,e.intensity);break;case`LightProbe`:a=new Id(new Fd().fromArray(e.sh),e.intensity);break;case`SkinnedMesh`:l=o(e.geometry),u=s(e.material),a=new qo(l,u),e.bindMode!==void 0&&(a.bindMode=e.bindMode),e.bindMatrix!==void 0&&a.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(a.skeleton=e.skeleton);break;case`Mesh`:l=o(e.geometry),u=s(e.material),a=new Fo(l,u);break;case`InstancedMesh`:l=o(e.geometry),u=s(e.material);let t=e.count,n=e.instanceMatrix,r=e.instanceColor;a=new ss(l,u,t),a.instanceMatrix=new $o(new Float32Array(n.array),16),r!==void 0&&(a.instanceColor=new $o(new Float32Array(r.array),r.itemSize));break;case`BatchedMesh`:l=o(e.geometry),u=s(e.material),a=new Ls(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,u),a.geometry=l,a.perObjectFrustumCulled=e.perObjectFrustumCulled,a.sortObjects=e.sortObjects,a._drawRanges=e.drawRanges,a._reservedRanges=e.reservedRanges,a._geometryInfo=e.geometryInfo.map(e=>{let t=null,n=null;return e.boundingBox!==void 0&&(t=new ea().fromJSON(e.boundingBox)),e.boundingSphere!==void 0&&(n=new Fa().fromJSON(e.boundingSphere)),{...e,boundingBox:t,boundingSphere:n}}),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(a._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(a.boundingSphere=new Fa().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(a.boundingBox=new ea().fromJSON(e.boundingBox));break;case`LOD`:a=new mo;break;case`Line`:a=new Ks(o(e.geometry),s(e.material));break;case`LineLoop`:a=new Zs(o(e.geometry),s(e.material));break;case`LineSegments`:a=new Xs(o(e.geometry),s(e.material));break;case`PointCloud`:case`Points`:a=new rc(o(e.geometry),s(e.material));break;case`Sprite`:a=new lo(s(e.material));break;case`Group`:a=new ki;break;case`Bone`:a=new Jo;break;default:a=new Oi}if(a.uuid=e.uuid,e.name!==void 0&&(a.name=e.name),e.matrix===void 0?(e.position!==void 0&&a.position.fromArray(e.position),e.rotation!==void 0&&a.rotation.fromArray(e.rotation),e.quaternion!==void 0&&a.quaternion.fromArray(e.quaternion),e.scale!==void 0&&a.scale.fromArray(e.scale)):(a.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)),e.up!==void 0&&a.up.fromArray(e.up),e.pivot!==void 0&&(a.pivot=new G().fromArray(e.pivot)),e.morphTargetDictionary!==void 0&&(a.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),e.morphTargetInfluences!==void 0&&(a.morphTargetInfluences=e.morphTargetInfluences.slice()),e.castShadow!==void 0&&(a.castShadow=e.castShadow),e.receiveShadow!==void 0&&(a.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(a.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(a.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(a.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(a.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(a.visible=e.visible),e.frustumCulled!==void 0&&(a.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(a.renderOrder=e.renderOrder),e.static!==void 0&&(a.static=e.static),e.userData!==void 0&&(a.userData=e.userData),e.layers!==void 0&&(a.layers.mask=e.layers),e.children!==void 0){let o=e.children;for(let e=0;e<o.length;e++)a.add(this.parseObject(o[e],t,n,r,i))}if(e.animations!==void 0){let t=e.animations;for(let e=0;e<t.length;e++){let n=t[e];a.animations.push(i[n])}}if(e.type===`LOD`){e.autoUpdate!==void 0&&(a.autoUpdate=e.autoUpdate);let t=e.levels;for(let e=0;e<t.length;e++){let n=t[e],r=a.getObjectByProperty(`uuid`,n.object);r!==void 0&&a.addLevel(r,n.distance,n.hysteresis)}}return a}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(e){if(e.isSkinnedMesh===!0&&e.skeleton!==void 0){let n=t[e.skeleton];n===void 0?V(`ObjectLoader: No skeleton found with UUID:`,e.skeleton):e.bind(n,e.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){let n=t.target,r=e.getObjectByProperty(`uuid`,n);t.target=r===void 0?new Oi:r}})}},Ud={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,CubeUVReflectionMapping:306},Wd={RepeatWrapping:Ne,ClampToEdgeWrapping:Pe,MirroredRepeatWrapping:Fe},Gd={NearestFilter:Ie,NearestMipmapNearestFilter:Le,NearestMipmapLinearFilter:ze,LinearFilter:Ve,LinearMipmapNearestFilter:He,LinearMipmapLinearFilter:We},Kd=new WeakMap,qd=class extends td{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>`u`&&V(`ImageBitmapLoader: createImageBitmap() not supported.`),typeof fetch>`u`&&V(`ImageBitmapLoader: fetch() not supported.`),this.options={premultiplyAlpha:`none`},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=Zu.get(`image-bitmap:${e}`);if(a!==void 0){if(i.manager.itemStart(e),a.then){a.then(n=>{Kd.has(a)===!0?(r&&r(Kd.get(a)),i.manager.itemError(e),i.manager.itemEnd(e)):(t&&t(n),i.manager.itemEnd(e))});return}setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);return}let o={};o.credentials=this.crossOrigin===`anonymous`?`same-origin`:`include`,o.headers=this.requestHeader,o.signal=typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let s=fetch(e,o).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:`none`}))}).then(function(n){Zu.add(`image-bitmap:${e}`,n),t&&t(n),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),Kd.set(s,t),Zu.remove(`image-bitmap:${e}`),i.manager.itemError(e),i.manager.itemEnd(e)});Zu.add(`image-bitmap:${e}`,s),i.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},Jd,Yd=class{static getContext(){return Jd===void 0&&(Jd=new(window.AudioContext||window.webkitAudioContext)),Jd}static setContext(e){Jd=e}},Xd=class extends td{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new id(this.manager);a.setResponseType(`arraybuffer`),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{let r=n.slice(0),a=Yd.getContext(),s=e+`#decode`;i.manager.itemStart(s),a.decodeAudioData(r,function(e){t(e),i.manager.itemEnd(s)}).catch(function(e){o(e),i.manager.itemEnd(s)})}catch(e){o(e)}},n,r);function o(t){r?r(t):H(t),i.manager.itemError(e)}}},Zd=new K,Qd=new K,$d=new K,ef=class{constructor(){this.type=`StereoCamera`,this.aspect=1,this.eyeSep=.064,this.cameraL=new Td,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Td,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(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,$d.copy(e.projectionMatrix);let n=t.eyeSep/2,r=n*t.near/t.focus,i=t.near*Math.tan(or*t.fov*.5)/t.zoom,a,o;Qd.elements[12]=-n,Zd.elements[12]=n,a=-i*t.aspect+r,o=i*t.aspect+r,$d.elements[0]=2*t.near/(o-a),$d.elements[8]=(o+a)/(o-a),this.cameraL.projectionMatrix.copy($d),a=-i*t.aspect-r,o=i*t.aspect-r,$d.elements[0]=2*t.near/(o-a),$d.elements[8]=(o+a)/(o-a),this.cameraR.projectionMatrix.copy($d)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Qd),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Zd)}},tf=-90,nf=1,rf=class extends Oi{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new Td(tf,nf,e,t);r.layers=this.layers,this.add(r);let i=new Td(tf,nf,e,t);i.layers=this.layers,this.add(i);let a=new Td(tf,nf,e,t);a.layers=this.layers,this.add(a);let o=new Td(tf,nf,e,t);o.layers=this.layers,this.add(o);let s=new Td(tf,nf,e,t);s.layers=this.layers,this.add(s);let c=new Td(tf,nf,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);
5if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let h=!1;h=e.isWebGLRenderer===!0?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(n,0,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,i),e.setRenderTarget(n,1,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,4,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},af=class extends Td{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},of=class{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(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=sf.bind(this),e.addEventListener(`visibilitychange`,this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(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(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e===void 0?performance.now():e)-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}};function sf(){this._document.hidden===!1&&this.reset()}var cf=new G,lf=new Ar,uf=new G,df=new G,ff=new G,pf=class extends Oi{constructor(){super(),this.type=`AudioListener`,this.context=Yd.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new of}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter===null?this.gain.disconnect(this.context.destination):(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this._timer.update(
vendor: 9,042 bytes, line 5
5);let t=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(cf,lf,uf),df.set(0,0,-1).applyQuaternion(lf),ff.set(0,1,0).applyQuaternion(lf),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(cf.x,e),t.positionY.linearRampToValueAtTime(cf.y,e),t.positionZ.linearRampToValueAtTime(cf.z,e),t.forwardX.linearRampToValueAtTime(df.x,e),t.forwardY.linearRampToValueAtTime(df.y,e),t.forwardZ.linearRampToValueAtTime(df.z,e),t.upX.linearRampToValueAtTime(ff.x,e),t.upY.linearRampToValueAtTime(ff.y,e),t.upZ.linearRampToValueAtTime(ff.z,e)}else t.setPosition(cf.x,cf.y,cf.z),t.setOrientation(df.x,df.y,df.z,ff.x,ff.y,ff.z)}},mf=class extends Oi{constructor(e){super(),this.type=`Audio`,this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.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(e){return this.hasPlaybackControl=!1,this.sourceType=`audioNode`,this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType=`mediaNode`,this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType=`mediaStreamNode`,this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType=`buffer`,this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){V(`Audio: Audio is already playing.`);return}if(this.hasPlaybackControl===!1){V(`Audio: this Audio has no playback control.`);return}this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){V(`Audio: this Audio has no playback control.`);return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress%=this.duration||this.buffer.duration),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){V(`Audio: this Audio has no playback control.`);return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);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(e){return e||=[],this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){V(`Audio: this Audio has no playback control.`);return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(V(`Audio: this Audio has no playback control.`),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){V(`Audio: this Audio has no playback control.`);return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType===`buffer`?(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this):(V(`Audio: Audio source type cannot be copied.`),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}},hf=new G,gf=new Ar,_f=new G,vf=new G,yf=class extends mf{constructor(e){super(e),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(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(hf,gf,_f),vf.set(0,0,1).applyQuaternion(gf);let t=this.panner;if(t.positionX){let e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(hf.x,e),t.positionY.linearRampToValueAtTime(hf.y,e),t.positionZ.linearRampToValueAtTime(hf.z,e),t.orientationX.linearRampToValueAtTime(vf.x,e),t.orientationY.linearRampToValueAtTime(vf.y,e),t.orientationZ.linearRampToValueAtTime(vf.z,e)}else t.setPosition(hf.x,hf.y,hf.z),t.setOrientation(vf.x,vf.y,vf.z)}},bf=class{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0,t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}},xf=class{constructor(e,t,n){this.binding=e,this.valueSize=n;let r,i,a;switch(t){case`quaternion`:r=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case`string`:case`bool`:r=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=Array(n*5);break;default:r=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){let n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(a===0){for(let e=0;e!==r;++e)n[i+e]=n[e];a=t}else{a+=t;let e=t/a;this._mixBufferRegion(n,i,0,e,r)}this.cumulativeWeight=a}accumulateAdditive(e){let t=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){let e=t*this._origIndex;this._mixBufferRegion(n,r,e,1-i,t)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){o.setValue(n,r);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;
vendor: 4,437 bytes, line 5
5for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,i){if(r>=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){Ar.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){let a=this._workIndex*i;Ar.multiplyQuaternionsFlat(e,a,e,t,e,n),Ar.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,i){let a=1-r;for(let o=0;o!==i;++o){let i=t+o;e[i]=e[i]*a+e[n+o]*r}}_lerpAdditive(e,t,n,r,i){for(let a=0;a!==i;++a){let i=t+a;e[i]=e[i]+e[n+a]*r}}},Sf=`\\[\\]\\.:\\/`,Cf=RegExp(`[\\[\\]\\.:\\/]`,`g`),wf=`[^\\[\\]\\.:\\/]`,Tf=`[^`+Sf.replace(`\\.`,``)+`]`,Ef=`((?:WC+[\\/:])*)`.replace(`WC`,wf),Df=`(WCOD+)?`.replace(`WCOD`,Tf),Of=`(?:\\.(WC+)(?:\\[(.+)\\])?)?`.replace(`WC`,wf),kf=`\\.(WC+)(?:\\[(.+)\\])?`.replace(`WC`,wf),Af=RegExp(`^`+Ef+Df+Of+kf+`$`),jf=[`material`,`materials`,`bones`,`map`],Mf=class{constructor(e,t,n){let r=n||Nf.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},Nf=class e{constructor(t,n,r){this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(Cf,``)}static parseTrackName(e){let t=Af.exec(e);if(t===null)throw Error(`PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);jf.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(e){for(let r=0;r<e.length;r++){let i=e[r];if(i.name===t||i.uuid===t)return i;let a=n(i.children);if(a)return a}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}
vendor: 4,894 bytes, line 5
5_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let t=this.node,n=this.parsedPath,r=n.objectName,i=n.propertyName,a=n.propertyIndex;if(t||(t=e.findNode(this.rootNode,n.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){V(`PropertyBinding: No target node found for track: `+this.path+`.`);return}if(r){let e=n.objectIndex;switch(r){case`materials`:if(!t.material){H(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!t.material.materials){H(`PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.`,this);return}t=t.material.materials;break;case`bones`:if(!t.skeleton){H(`PropertyBinding: Can not bind to bones as node does not have a skeleton.`,this);return}t=t.skeleton.bones;for(let n=0;n<t.length;n++)if(t[n].name===e){e=n;break}break;case`map`:if(`map`in t){t=t.map;break}if(!t.material){H(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!t.material.map){H(`PropertyBinding: Can not bind to material.map as node.material does not have a map.`,this);return}t=t.material.map;break;default:if(t[r]===void 0){H(`PropertyBinding: Can not bind to objectName of node undefined.`,this);return}t=t[r]}if(e!==void 0){if(t[e]===void 0){H(`PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.`,this,t);return}t=t[e]}}let o=t[i];if(o===void 0){let e=n.nodeName;H(`PropertyBinding: Trying to update property for track: `+e+`.`+i+` but it wasn't found.`,t);return}let s=this.Versioning.None;this.targetObject=t,t.isMaterial===!0?s=this.Versioning.NeedsUpdate:t.isObject3D===!0&&(s=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(a!==void 0){if(i===`morphTargetInfluences`){if(!t.geometry){H(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.`,this);return}if(!t.geometry.morphAttributes){H(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.`,this);return}t.morphTargetDictionary[a]!==void 0&&(a=t.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=a}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Nf.Composite=Mf,Nf.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Nf.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Nf.prototype.GetterByBindingType=[Nf.prototype._getValue_direct,Nf.prototype._getValue_array,Nf.prototype._getValue_arrayElement,Nf.prototype._getValue_toArray],Nf.prototype.SetterByBindingTypeAndVersioning=[[Nf.prototype._setValue_direct,Nf.prototype._setValue_direct_setNeedsUpdate,Nf.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Nf.prototype._setValue_array,Nf.prototype._setValue_array_setNeedsUpdate,Nf.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Nf.prototype._setValue_arrayElement,Nf.prototype._setValue_arrayElement_setNeedsUpdate,Nf.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Nf.prototype._setValue_fromArray,Nf.prototype._setValue_fromArray_setNeedsUpdate,Nf.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Pf=class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=cr(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let e={};this._indicesByUUID=e;for(let t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){let e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,a=i.length,o,s=e.length,c=this.nCachedObjects_;for(let l=0,u=arguments.length;l!==u;++l){let u=arguments[l],d=u.uuid,f=t[d];if(f===void 0){f=s++,t[d]=f,e.push(u);for(let e=0,t=a;e!==t;++e)i[e].push(new Nf(u,n[e],r[e]))}else if(f<c){o=e[f];let s=--c,l=e[s];t[l.uuid]=f,e[f]=l,t[d]=s,e[s]=u;for(let e=0,t=a;e!==t;++e){let t=i[e],a=t[s],o=t[f];t[f]=a,o===void 0&&(o=new Nf(u,n[e],r[e])),t[s]=o}}else e[f]!==o&&H(`AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastru
5cture when reloading scenes.`)}this.nCachedObjects_=c}remove(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_;for(let a=0,o=arguments.length;a!==o;++a){let o=arguments[a],s=o.uuid,c=t[s];if(c!==void 0&&c>=i){let a=i++,l=e[a];t[l.uuid]=c,e[c]=l,t[s]=a,e[a]=o;for(let e=0,t=r;e!==t;++e){let t=n[e],r=t[a],i=t[c];t[c]=r,t[a]=i}}}this.nCachedObjects_=i}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=e.length;for(let o=0,s=arguments.length;o!==s;++o){let s=arguments[o].uuid,c=t[s];if(c!==void 0){if(delete t[s],c<i){let o=--i,s=e[o],l=--a,u=e[l];t[s.uuid]=c,e[c]=s,t[u.uuid]=o,e[o]=u,e.pop();for(let e=0,t=r;e!==t;++e){let t=n[e],r=t[o],i=t[l];t[c]=r,t[o]=i,t.pop()}}else{let i=--a,o=e[i];i>0&&(t[o.uuid]=c),e[c]=o,e.pop();for(let e=0,t=r;e!==t;++e){let t=n[e];t[c]=t[i],t.pop()}}}}this.nCachedObjects_=i}subscribe_(e,t){let n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(r!==void 0)return i[r];let a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(let n=l,r=s.length;n!==r;++n){let r=s[n];u[n]=new Nf(r,e,t)}return u}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],c=e[o];t[c]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}},Ff=class{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;let i=t.tracks,a=i.length,o=Array(a),s={endingStart:on,endingEnd:on};for(let e=0;e!==a;++e){let t=i[e].createInterpolant(null);o[e]=t,t.settings&&Object.assign(s,t.settings),t.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=$t,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&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){let n=this._clip.duration,r=e._clip.duration,i=r/n,a=n/r;e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let r=this._mixer,i=r.time,a=this.timeScale,o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);let s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/a,c[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled){this._updateWeight(e);return}let i=this._startTime;if(i!==null){let r=(e-i)*n;r<0||n===0?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);let a=this._updateTime(t),o=this._updateWeight(e);if(o>0){let e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case un:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);break;case ln:default:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;if(n!==null){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,a=n===en;if(e===0)return i===-1?r:a&&(i&1)==1?t-r:r;if(n===2200){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break handle_stop}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:`finished`,action:this,direction:e<0?-1:1})}}else{if(i===-1&&(e>=0?(i=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=t||r<0){let n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);let o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:`finished`,action:this,direction:e>0?1:-1});else{if(o===1){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:`loop`,action:this,loopDelta:n})}}else this._loopCount=i,this.time=r;if(a&&(i&1)==1)return t-r}return r}
vendor: 8,884 bytes, line 5
5_setEndings(e,t,n){let r=this._interpolantSettings;n?(r.endingStart=sn,r.endingEnd=sn):(r.endingStart=e?this.zeroSlopeAtStart?sn:on:cn,r.endingEnd=t?this.zeroSlopeAtEnd?sn:on:cn)}_scheduleFading(e,t,n){let r=this._mixer,i=r.time,a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);let o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}},If=new Float32Array(1),Lf=class extends rr{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}_bindAction(e,t){let n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];l===void 0&&(l={},c[s]=l);for(let e=0;e!==i;++e){let i=r[e],c=i.name,u=l[c];if(u!==void 0)++u.referenceCount,a[e]=u;else{if(u=a[e],u!==void 0){u._cacheIndex===null&&(++u.referenceCount,this._addInactiveBinding(u,s,c));continue}let r=t&&t._propertyBindings[e].binding.parsedPath;u=new xf(Nf.create(n,c,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,s,c),a[e]=u}o[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];n.useCount++===0&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];--n.useCount===0&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){let r=this._actions,i=this._actionsByClip,a=i[t];if(a===void 0)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{let t=a.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e}_removeInactiveAction(e){let t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;let i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null;let u=o.actionByRoot,d=(e._localRoot||this._root).uuid;delete u[d],s.length===0&&delete a[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];--n.referenceCount===0&&this._removeInactiveBinding(n)}}_lendAction(e){let t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackAction(e){let t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_addInactiveBinding(e,t,n){let r=this._bindingsByRootAndName,i=this._bindings,a=r[t];a===void 0&&(a={},r[t]=a),a[n]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){let t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[i],Object.keys(o).length===0&&delete a[r]}_lendBinding(e){let t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackBinding(e){let t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return n===void 0&&(n=new Lu(new Float32Array(2),new Float32Array(2),1,If),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){let t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i}clipAction(e,t,n){let r=t||this._root,i=r.uuid,a=typeof e==`string`?Ju.findByName(r,e):e,o=a===null?e:a.uuid,s=this._actionsByClip[o],c=null;if(n===void 0&&(n=a===null?ln:a.blendMode),s!==void 0){let e=s.actionByRoot[i];if(e!==void 0&&e.blendMode===n)return e;c=s.knownActions[0],a===null&&(a=c._clip)}if(a===null)return null;let l=new Ff(this,a,t,n);return this._bindAction(l,c),this._addInactiveAction(l,o,i),l}existingAction(e,t){let n=t||this._root,r=n.uuid,i=typeof e==`string`?Ju.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return o===void 0?null:o.actionByRoot[r]||null}stopAllAction(){let e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==n;++o)t[o]._update(r,e,i,a);let o=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)o[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(i!==void 0){let e=i.knownActions;for(let n=0,r=e.length;n!==r;++n){let r=e[n];this._deactivateAction(r);let i=r._cacheIndex,a=t[t.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,a._cacheIndex=i,t[i]=a,t.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}}uncacheRoot(e){let t=e.uuid,n=this._actionsByClip;for(let e in n){let r=n[e].actionByRoot[t];r!==void 0&&(this._deactivateAction(r),this._removeInactiveAction(r))}let r=this._bindingsByRootAndName[t];if(r!==void 0)for(let e in r){let t=r[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){let n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}},Rf=class extends Xr{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isRenderTarget3D=!0,this.depth=n,this.texture=new ei(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}},zf=class e{constructor(e){this.value=e}clone(){return new e(this.value.clone===void 0?this.value:this.value.clone())}},Bf=0,Vf=class extends rr{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:Bf++}),this.name=``,this.usage=En,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){let t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:`dispose`})}copy(e){this.name=e.name,this.usage=e.usage;let t=e.uniforms;this.uniforms.length=0;for(let e=0,n=t.length;e<n;e++){let n=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0;e<n.length;e++)this.uniforms.push(n[e].clone())}return this}clone(){return new this.constructor().copy(this)}},Hf=class extends Wa{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){let t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){let t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}},Uf=class{constructor(e,t,n,r,i,a=!1){this.isGLBufferAttribute=!0,this.name=``,this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.normalized=a,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}},Wf=new K,Gf=class{constructor(e,t,n=0,r=1/0){this.ray=new So(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new fi,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):H(`Raycaster: 
5Unsupported camera type: `+t.type)}setFromXRController(e){return Wf.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Wf),this}intersectObject(e,t=!0,n=[]){return qf(e,this,n,t),n.sort(Kf),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)qf(e[r],this,n,t);return n.sort(Kf),n}};function Kf(e,t){return e.distance-t.distance}function qf(e,t,n,r){let i=!0;if(e.layers.test(t.layers)&&e.raycast(t,n)===!1&&(i=!1),i===!0&&r===!0){let r=e.children;for(let e=0,i=r.length;e<i;e++)qf(r[e],t,n,!0)}}var Jf=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,V(`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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}},Yf=class{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){let e=1e-6;return this.phi=U(this.phi,e,Math.PI-e),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(U(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}},Xf=class{constructor(e=1,t=0,n=0){this.radius=e,this.theta=t,this.y=n}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}},Zf=class e{static{e.prototype.isMatrix2=!0}constructor(e,t,n,r){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){let i=this.elements;return i[0]=e,i[2]=t,i[1]=n,i[3]=r,this}},Qf=new W,$f=class{constructor(e=new W(1/0,1/0),t=new W(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=Qf.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Qf).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},ep=new G,tp=new G,np=new G,rp=new G,ip=new G,ap=new G,op=new G,sp=class{constructor(e=new G,t=new G){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){ep.subVectors(e,this.start),tp.subVectors(this.end,this.start);let n=tp.dot(tp);if(n===0)return 0;let r=tp.dot(ep)/n;return t&&(r=U(r,0,1)),r}closestPointToPoint(e,t,n){let r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}
vendor: 25,956 bytes, line 5
5distanceSqToLine3(e,t=ap,n=op){let r=1e-8*1e-8,i,a,o=this.start,s=e.start,c=this.end,l=e.end;np.subVectors(c,o),rp.subVectors(l,s),ip.subVectors(o,s);let u=np.dot(np),d=rp.dot(rp),f=rp.dot(ip);if(u<=r&&d<=r)return t.copy(o),n.copy(s),t.sub(n),t.dot(t);if(u<=r)i=0,a=f/d,a=U(a,0,1);else{let e=np.dot(ip);if(d<=r)a=0,i=U(-e/u,0,1);else{let t=np.dot(rp),n=u*d-t*t;i=n===0?0:U((t*f-e*d)/n,0,1),a=(t*i+f)/d,a<0?(a=0,i=U(-e/u,0,1)):a>1&&(a=1,i=U((t-e)/u,0,1))}}return t.copy(o).addScaledVector(np,i),n.copy(s).addScaledVector(rp,a),t.distanceToSquared(n)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},cp=new G,lp=class extends Oi{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type=`SpotLightHelper`;let n=new Ua,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1;e<32;e++,t++){let n=e/32*Math.PI*2,i=t/32*Math.PI*2;r.push(Math.cos(n),Math.sin(n),1,Math.cos(i),Math.sin(i),1)}n.setAttribute(`position`,new J(r,3));let i=new Rs({fog:!1,toneMapped:!1});this.cone=new Xs(n,i),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 e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),cp.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(cp),this.color===void 0?this.cone.material.color.copy(this.light.color):this.cone.material.color.set(this.color)}},up=new G,dp=new K,fp=new K,pp=class extends Xs{constructor(e){let t=mp(e),n=new Ua,r=[],i=[];for(let e=0;e<t.length;e++){let n=t[e];n.parent&&n.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(0,0,0),i.push(0,0,0))}n.setAttribute(`position`,new J(r,3)),n.setAttribute(`color`,new J(i,3));let a=new Rs({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,a),this.isSkeletonHelper=!0,this.type=`SkeletonHelper`,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;let o=new q(255),s=new q(65280);this.setColors(o,s)}updateMatrixWorld(e){let t=this.bones,n=this.geometry,r=n.getAttribute(`position`);fp.copy(this.root.matrixWorld).invert();for(let e=0,n=0;e<t.length;e++){let i=t[e];i.parent&&i.parent.isBone&&(dp.multiplyMatrices(fp,i.matrixWorld),up.setFromMatrixPosition(dp),r.setXYZ(n,up.x,up.y,up.z),dp.multiplyMatrices(fp,i.parent.matrixWorld),up.setFromMatrixPosition(dp),r.setXYZ(n+1,up.x,up.y,up.z),n+=2)}n.getAttribute(`position`).needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){let n=this.geometry.getAttribute(`color`);for(let r=0;r<n.count;r+=2)n.setXYZ(r,e.r,e.g,e.b),n.setXYZ(r+1,t.r,t.g,t.b);return n.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}};function mp(e){let t=[];e.isBone===!0&&t.push(e);for(let n=0;n<e.children.length;n++)t.push(...mp(e.children[n]));return t}var hp=class extends Fo{constructor(e,t,n){let r=new $l(t,4,2),i=new Co({wireframe:!0,fog:!1,toneMapped:!1});super(r,i),this.light=e,this.color=n,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),this.color===void 0?this.material.color.copy(this.light.color):this.material.color.set(this.color)}},gp=new G,_p=new q,vp=new q,yp=class extends Oi{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type=`HemisphereLightHelper`;let r=new Jl(t);r.rotateY(Math.PI*.5),this.material=new Co({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);let i=r.getAttribute(`position`),a=new Float32Array(i.count*3);r.setAttribute(`color`,new Ca(a,3)),this.add(new Fo(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){let e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{let t=e.geometry.getAttribute(`color`);_p.copy(this.light.color),vp.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){let r=e<n/2?_p:vp;t.setXYZ(e,r.r,r.g,r.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(gp.setFromMatrixPosition(this.light.matrixWorld).negate())}},bp=class extends Xs{constructor(e=10,t=10,n=4473924,r=8947848){n=new q(n),r=new q(r);let i=t/2,a=e/t,o=e/2,s=[],c=[];for(let e=0,l=0,u=-o;e<=t;e++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);let t=e===i?n:r;t.toArray(c,l),l+=3,t.toArray(c,l),l+=3,t.toArray(c,l),l+=3,t.toArray(c,l),l+=3}let l=new Ua;l.setAttribute(`position`,new J(s,3)),l.setAttribute(`color`,new J(c,3));let u=new Rs({vertexColors:!0,toneMapped:!1});super(l,u),this.type=`GridHelper`}dispose(){this.geometry.dispose(),this.material.dispose()}},xp=class extends Xs{constructor(e=10,t=16,n=8,r=64,i=4473924,a=8947848){i=new q(i),a=new q(a);let o=[],s=[];if(t>1)for(let n=0;n<t;n++){let r=n/t*(Math.PI*2),c=Math.sin(r)*e,l=Math.cos(r)*e;o.push(0,0,0),o.push(c,0,l);let u=n&1?i:a;s.push(u.r,u.g,u.b),s.push(u.r,u.g,u.b)}for(let t=0;t<n;t++){let c=t&1?i:a,l=e-e/n*t;for(let e=0;e<r;e++){let t=e/r*(Math.PI*2),n=Math.sin(t)*l,i=Math.cos(t)*l;o.push(n,0,i),s.push(c.r,c.g,c.b),t=(e+1)/r*(Math.PI*2),n=Math.sin(t)*l,i=Math.cos(t)*l,o.push(n,0,i),s.push(c.r,c.g,c.b)}}let c=new Ua;c.setAttribute(`position`,new J(o,3)),c.setAttribute(`color`,new J(s,3));let l=new Rs({vertexColors:!0,toneMapped:!1});super(c,l),this.type=`PolarGridHelper`}dispose(){this.geometry.dispose(),this.material.dispose()}},Sp=new G,Cp=new G,wp=new G,Tp=class extends Oi{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type=`DirectionalLightHelper`,t===void 0&&(t=1);let r=new Ua;r.setAttribute(`position`,new J([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));let i=new Rs({fog:!1,toneMapped:!1});this.lightPlane=new Ks(r,i),this.add(this.lightPlane),r=new Ua,r.setAttribute(`position`,new J([0,0,0,0,0,1],3)),this.targetLine=new Ks(r,i),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),Sp.setFromMatrixPosition(this.light.matrixWorld),Cp.setFromMatrixPosition(this.light.target.matrixWorld),wp.subVectors(Cp,Sp),this.lightPlane.lookAt(Cp),this.color===void 0?(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)):(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)),this.targetLine.lookAt(Cp),this.targetLine.scale.z=wp.length()}},Ep=new G,Dp=new xd,Op=class extends Xs{constructor(e){let t=new Ua,n=new Rs({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],a={};o(`n1`,`n2`),o(`n2`,`n4`),o(`n4`,`n3`),o(`n3`,`n1`),o(`f1`,`f2`),o(`f2`,`f4`),o(`f4`,`f3`),o(`f3`,`f1`),o(`n1`,`f1`),o(`n2`,`f2`),o(`n3`,`f3`),o(`n4`,`f4`),o(`p`,`n1`),o(`p`,`n2`),o(`p`,`n3`),o(`p`,`n4`),o(`u1`,`u2`),o(`u2`,`u3`),o(`u3`,`u1`),o(`c`,`t`),o(`p`,`c`),o(`cn1`,`cn2`),o(`cn3`,`cn4`),o(`cf1`,`cf2`),o(`cf3`,`cf4`);function o(e,t){s(e),s(t)}function s(e){r.push(0,0,0),i.push(0,0,0),a[e]===void 0&&(a[e]=[]),a[e].push(r.length/3-1)}t.setAttribute(`position`,new J(r,3)),t.setAttribute(`color`,new J(i,3)),super(t,n),this.type=`CameraHelper`,this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();let c=new q(16755200),l=new q(16711680),u=new q(43775),d=new q(16777215),f=new q(3355443);this.setColors(c,l,u,d,f)}setColors(e,t,n,r,i){let a=this.geometry.getAttribute(`color`);return a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,n.r,n.g,n.b),a.setXYZ(33,n.r,n.g,n.b),a.setXYZ(34,n.r,n.g,n.b),a.setXYZ(35,n.r,n.g,n.b),a.setXYZ(36,n.r,n.g,n.b),a.setXYZ(37,n.r,n.g,n.b),a.setXYZ(38,r.r,r.g,r.b),a.setXYZ(39,r.r,r.g,r.b),a.setXYZ(40,i.r,i.g,i.b),a.setXYZ(41,i.r,i.g,i.b),a.setXYZ(42,i.r,i.g,i.b),a.setXYZ(43,i.r,i.g,i.b),a.setXYZ(44,i.r,i.g,i.b),a.setXYZ(45,i.r,i.g,i.b),a.setXYZ(46,i.r,i.g,i.b),a.setXYZ(47,i.r,i.g,i.b),a.setXYZ(48,i.r,i.g,i.b),a.setXYZ(49,i.r,i.g,i.b),a.needsUpdate=!0,this}update(){let e=this.geometry,t=this.pointMap,n,r;if(Dp.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)n=1,r=0;else if(this.camera.coordinateSystem===2e3)n=-1,r=1;else if(this.camera.coordinateSystem===2001)n=0,r=1;else throw Error(`THREE.CameraHelper.update(): Invalid coordinate system: `+this.camera.coordinateSystem);kp(`c`,t,e,Dp,0,0,n),kp(`t`,t,e,Dp,0,0,r),kp(`n1`,t,e,Dp,-1,-1,n),kp(`n2`,t,e,Dp,1,-1,n),kp(`n3`,t,e,Dp,-1,1,n),kp(`n4`,t,e,Dp,1,1,n),kp(`f1`,t,e,Dp,-1,-1,r),kp(`f2`,t,e,Dp,1,-1,r),kp(`f3`,t,e,Dp,-1,1,r),kp(`f4`,t,e,Dp,1,1,r),kp(`u1`,t,e,Dp,.7,1.1,n),kp(`u2`,t,e,Dp,-.7,1.1,n),kp(`u3`,t,e,Dp,0,2,n),kp(`cf1`,t,e,Dp,-1,0,r),kp(`cf2`,t,e,Dp,1,0,r),kp(`cf3`,t,e,Dp,0,-1,r),kp(`cf4`,t,e,Dp,0,1,r),kp(`cn1`,t,e,Dp,-1,0,n),kp(`cn2`,t,e,Dp,1,0,n),kp(`cn3`,t,e,Dp,0,-1,n),kp(`cn4`,t,e,Dp,0,1,n),e.getAttribute(`position`).needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function kp(e,t,n,r,i,a,o){Ep.set(i,a,o).unproject(r);let s=t[e];if(s!==void 0){let e=n.getAttribute(`position`);for(let t=0,n=s.length;t<n;t++)e.setXYZ(s[t],Ep.x,Ep.y,Ep.z)}}var Ap=new ea,jp=class extends Xs{constructor(e,t=16776960){let n=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),i=new Ua;i.setIndex(new Ca(n,1)),i.setAttribute(`position`,new Ca(r,3)),super(i,new Rs({color:t,toneMapped:!1})),this.object=e,this.type=`BoxHelper`,this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&Ap.setFromObject(this.object),Ap.isEmpty())return;let e=Ap.min,t=Ap.max,n=this.geometry.attributes.position,r=n.array;r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=e.x,r[4]=t.y,r[5]=t.z,r[6]=e.x,r[7]=e.y,r[8]=t.z,r[9]=t.x,r[10]=e.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=e.z,r[15]=e.x,r[16]=t.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=t.x,r[22]=e.y,r[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Mp=class extends Xs{constructor(e,t=16776960){let n=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=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],i=new Ua;i.setIndex(new Ca(n,1)),i.setAttribute(`position`,new J(r,3)),super(i,new Rs({color:t,toneMapped:!1})),this.box=e,this.type=`Box3Helper`,this.geometry.computeBoundingSphere()}updateMatrixWorld(e){let t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}},Np=class extends Ks{constructor(e,t=1,n=16776960){let r=n,i=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],a=new Ua;a.setAttribute(`position`,new J(i,3)),a.computeBoundingSphere(),super(a,new Rs({color:r,toneMapped:!1})),this.type=`PlaneHelper`,this.plane=e,this.size=t;let o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],s=new Ua;s.setAttribute(`position`,new J(o,3)),s.computeBoundingSphere(),this.add(new Fo(s,new Co({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){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(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},Pp=new G,Fp,Ip,Lp=class extends Oi{constructor(e=new G(0,0,1),t=new G(0,0,0),n=1,r=16776960,i=n*.2,a=i*.2){super(),this.type=`ArrowHelper`,Fp===void 0&&(Fp=new Ua,Fp.setAttribute(`position`,new J([0,0,0,0,1,0],3)),Ip=new xc(.5,1,5,1),Ip.translate(0,-.5,0)),this.position.copy(t),this.line=new Ks(Fp,new Rs({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Fo(Ip,new Co({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Pp.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Pp,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},Rp=class extends Xs{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Ua;r.setAttribute(`position`,new J(t,3)),r.setAttribute(`color`,new J(n,3));let i=new Rs({vertexColors:!0,toneMapped:!1});super(r,i),this.type=`AxesHelper`}setColors(e,t,n){let r=new q,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},zp=class{constructor(){this.type=`ShapePath`,this.color=new q,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new il,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n],i=new al;i.curves=r.curves,t.push(i)}return t}function n(e,t){let n=t.length,r=!1;for(let i=n-1,a=0;a<n;i=a++){let n=t[i],o=t[a],s=o.x-n.x,c=o.y-n.y;if(Math.abs(c)>2**-52){if(c<0&&(n=t[a],s=-s,o=t[i],c=-c),e.y<n.y||e.y>o.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=c*(e.x-n.x)-s*(e.y-n.y);if(t===0)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}let r=Bl.isClockWise,i=this.subPaths;if(i.length===0)return[];let a,o,s,c=[];if(i.length===1)return o=i[0],s=new al,s.curves=o.curves,c.push(s),c;let l=!r(i[0].getPoints());l=e?!l:l;let u=[],d=[],f=[],p=0,m;d[p]=void 0,f[p]=[];for(let t=0,n=i.length;t<n;t++)o=i[t],m=o.getPoints(),a=r(m),a=e?!a:a,a?(!l&&d[p]&&p++,d[p]={s:new al,p:m},d[p].s.curves=o.curves,l&&p++,f[p]=[]):f[p].push({h:o,p:m[0]});if(!d[0])return t(i);if(d.length>1){let e=!1,t=0;for(let e=0,t=d.length;e<t;e++)u[e]=[];for(let r=0,i=d.length;r<i;r++){let i=f[r];for(let a=0;a<i.length;a++){let o=i[a],s=!0;for(let i=0;i<d.length;i++)n(o.p,d[i].p)&&(r!==i&&t++,s?(s=!1,u[i].push(o)):e=!0);s&&u[r].push(o)}}t>0&&e===!1&&(f=u)}let h;for(let e=0,t=d.length;e<t;e++){s=d[e].s,c.push(s),h=f[e];for(let e=0,t=h.length;e<t;e++)s.holes.push(h[e].h)}return c}},Bp=class extends rr{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){V(`Controls: connect() now requires an element.`);return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}};function Vp(e,t){let n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}function Hp(e,t){let n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}function Up(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}function Wp(e,t,n,r){let i=Gp(r);switch(n){case at:return e*t;case ut:return e*t/i.components*i.byteLength;case dt:return e*t/i.components*i.byteLength;case ft:return e*t*2/i.components*i.byteLength;case pt:return e*t*2/i.components*i.byteLength;case ot:return e*t*3/i.components*i.byteLength;case st:return e*t*4/i.components*i.byteLength;case ht:return e*t*4/i.components*i.byteLength;case gt:case _t:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case vt:case yt:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case xt:case Ct:return Math.max(e,16)*Math.max(t,8)/4;case bt:case St:return Math.max(e,8)*Math.max(t,8)/2;case wt:case Tt:case Dt:case Ot:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case Et:case kt:case At:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case jt:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Mt:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case Nt:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case Pt:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case Ft:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case It:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case Lt:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case Rt:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case zt:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case Bt:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case Vt:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case Ht:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case Ut:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case Wt:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case Gt:case Kt:case qt:return Math.ceil(e/4)*Math.ceil(t/4)*16;case Jt:case Yt:return Math.ceil(e/4)*Math.ceil(t/4)*8;case Xt:case Zt:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw Error(`Unable to determine texture byte length for ${n} format.`)}function Gp(e){switch(e){case Ke:case qe:return{byteLength:1,components:1};case Ye:case Je:case $e:return{byteLength:2,components:1};case et:case tt:return{byteLength:2,components:4};case Ze:case Xe:case Qe:return{byteLength:4,components:1};case rt:case it:return{byteLength:4,components:3}}throw Error(`Unknown texture type ${e}.`)}var Kp=class{static contain(e,t){return Vp(e,t)}static cover(e,t){return Hp(e,t)}static fill(e){return Up(e)}static getByteLength(e,t,n,r){return Wp(e,t,n,r)}};typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:`184`}})),typeof window<`u`&&(window.__THREE__?V(`WARNING: Multiple instances of Three.js being imported.`):window.__THREE__=`184`);var qp=t({ACESFilmicToneMapping:()=>4,AddEquation:()=>100,AddOperation:()=>2,AdditiveAnimationBlendMode:()=>un,AdditiveBlending:()=>2,AgXToneMapping:()=>6,AlphaFormat:()=>at,AlwaysCompare:()=>519,AlwaysDepth:()=>1,AlwaysStencilFunc:()=>519,AmbientLight:()=>Nd,AnimationAction:()=>Ff,AnimationClip:()=>Ju,AnimationLoader:()=>ad,AnimationMixer:()=>Lf,AnimationObjectGroup:()=>Pf,AnimationUtils:()=>Pu,ArcCurve:()=>jc,ArrayCamera:()=>af,ArrowHelper:()=>Lp,AttachedBindMode:()=>je,Audio:()=>mf,AudioAnalyser:()=>bf,AudioContext:()=>Yd,AudioListener:()=>pf,AudioLoader:()=>Xd,AxesHelper:()=>Rp,BackSide:()=>1,BasicDepthPacking:()=>dn,BasicShadowMap:()=>0,BatchedMesh:()=>Ls,BezierInterpolant:()=>zu,Bone:()=>Jo,BooleanKeyframeTrack:()=>Vu,Box2:()=>$f,Box3:()=>ea,Box3Helper:()=>Mp,BoxGeometry:()=>_c,BoxHelper:()=>jp,BufferAttribute:()=>Ca,BufferGeometry:()=>Ua,BufferGeometryLoader:()=>Bd,ByteType:()=>qe,Cache:()=>Zu,Camera:()=>xd,CameraHelper:()=>Op,CanvasTexture:()=>fc,CapsuleGeometry:()=>vc,CatmullRomCurve3:()=>Rc,CineonToneMapping:()=>3,CircleGeometry:()=>yc,ClampToEdgeWrapping:()=>Pe,Clock:()=>Jf,Color:()=>q,ColorKeyframeTrack:()=>Hu,ColorManagement:()=>Rr,Compatibility:()=>Vn,CompressedArrayTexture:()=>lc,CompressedCubeTexture:()=>uc,CompressedTexture:()=>cc,CompressedTextureLoader:()=>od,ConeGeometry:()=>xc,ConstantAlphaFactor:()=>213,ConstantColorFactor:()=>211,Controls:()=>Bp,CubeCamera:()=>rf,CubeDepthTexture:()=>hc,CubeReflectionMapping:()=>301,CubeRefractionMapping:()=>302,CubeTexture:()=>dc,CubeTextureLoader:()=>ld,CubeUVReflectionMapping:()=>306,CubicBezierCurve:()=>Yc,CubicBezierCurve3:()=>Xc,CubicInterpolant:()=>Iu,CullFaceBack:()=>1,CullFaceFront:()=>2,CullFaceFrontBack:()=>3,CullFaceNone:()=>0,Curve:()=>kc,CurvePath:()=>rl,CustomBlending:()=>5,CustomToneMapping:()=>5,CylinderGeometry:()=>bc,Cylindrical:()=>Xf,Data3DTexture:()=>ei,DataArrayTexture:()=>Qr,DataTexture:()=>Yo,DataTextureLoader:()=>ud,DataUtils:()=>ya,DecrementStencilOp:()=>Sn,DecrementWrapStencilOp:()=>wn,DefaultLoadingManager:()=>ed,DepthFormat:()=>ct,DepthStencilFormat:()=>lt,DepthTexture:()=>mc,DetachedBindMode:()=>Me,DirectionalLight:()=>Md,DirectionalLightHelper:()=>Tp,DiscreteInterpolant:()=>Ru,DodecahedronGeometry:()=>Cc,DoubleSide:()=>2,DstAlphaFactor:()=>206,DstColorFactor:()=>208,DynamicCopyUsage:()=>Nn,DynamicDrawUsage:()=>Dn,DynamicReadUsage:()=>An,EdgesGeometry:()=>Oc,EllipseCurve:()=>Ac,EqualCompare:()=>514,EqualDepth:()=>4,EqualStencilFunc:()=>514,EquirectangularReflectionMapping:()=>303,EquirectangularRefractionMapping:()=>304,Euler:()=>di,EventDispatcher:()=>rr,ExternalTexture:()=>gc,ExtrudeGeometry:()=>Ul,FileLoader:()=>id,Float16BufferAttribute:()=>ja,Float32BufferAttribute:()=>J,FloatType:()=>Qe,Fog:()=>Ri,FogExp2:()=>Li,FramebufferTexture:()=>sc,FrontSide:()=>0,Frustum:()=>hs,FrustumArray:()=>vs,GLBufferAttribute:()=>Uf,GLSL1:()=>`100`,GLSL3:()=>Fn,GreaterCompare:()=>516,GreaterDepth:()=>6,GreaterEqualCompare:()=>518,GreaterEqualDepth:()=>5,GreaterEqualStencilFunc:()=>518,GreaterStencilFunc:()=>516,GridHelper:()=>bp,Group:()=>ki,HTMLTexture:()=>pc,HalfFloatType:()=>$e,HemisphereLight:()=>pd,HemisphereLightHelper:()=>yp,IcosahedronGeometry:()=>Kl,ImageBitmapLoader:()=>qd,ImageLoader:()=>cd,ImageUtils:()=>Hr,IncrementStencilOp:()=>xn,IncrementWrapStencilOp:()=>Cn,InstancedBufferAttribute:()=>$o,InstancedBufferGeometry:()=>zd,InstancedInterleavedBuffer:()=>Hf,InstancedMesh:()=>ss,Int16BufferAttribute:()=>Da,Int32BufferAttribute:()=>ka,Int8BufferAttribute:()=>wa,IntType:()=>Xe,InterleavedBuffer:()=>Wa,InterleavedBufferAttribute:()=>Ka,Interpolant:()=>Fu,InterpolateBezier:()=>an,InterpolateDiscrete:()=>tn,InterpolateLinear:()=>nn,InterpolateSmooth:()=>rn,InterpolationSamplingMode:()=>Bn,InterpolationSamplingType:()=>zn,InvertStencilOp:()=>Tn,KeepStencilOp:()=>yn,KeyframeTrack:()=>Bu,LOD:()=>mo,LatheGeometry:()=>ql,Layers:()=>fi,LessCompare:()=>513,LessDepth:()=>2,LessEqualCompare:()=>515,LessEqualDepth:()=>3,LessEqualStencilFunc:()=>515,LessStencilFunc:()=>513,Light:()=>fd,LightProbe:()=>Id,Line:()=>Ks,Line3:()=>sp,LineBasicMaterial:()=>Rs,LineCurve:()=>Zc,LineCurve3:()=>Qc,LineDashedMaterial:()=>Du,LineLoop:()=>Zs,LineSegments:()=>Xs,LinearFilter:()=>Ve,LinearInterpolant:()=>Lu,LinearMipMapLinearFilter:()=>Ge,LinearMipMapNearestFilter:()=>Ue,LinearMipmapLinearFilter:()=>We,LinearMipmapNearestFilter:()=>He,LinearSRGBColorSpace:()=>gn,LinearToneMapping:()=>1,LinearTransfer:()=>_n,Loader:()=>td,LoaderUtils:()=>Rd,LoadingManager:()=>$u,LoopOnce:()=>Qt,LoopPingPong:()=>en,LoopRepeat:()=>$t,MOUSE:()=>ke,Material:()=>Ja,MaterialBlending:()=>6,MaterialLoader:()=>Ld,MathUtils:()=>kr,Matrix2:()=>Zf,Matrix3:()=>Nr,Matrix4:()=>K,MaxEquation:()=>104,Mesh:()=>Fo,MeshBasicMaterial:()=>Co,MeshDepthMaterial:()=>wu,MeshDistanceMaterial:()=>Tu,MeshLambertMaterial:()=>Cu,MeshMatcapMaterial:()=>Eu,MeshNormalMaterial:()=>Su,MeshPhongMaterial:()=>bu,MeshPhysicalMaterial:()=>yu,MeshStandardMaterial:()=>vu,MeshToonMaterial:()=>xu,MinEquation:()=>103,MirroredRepeatWrapping:()=>Fe,MixOperation:()=>1,MultiplyBlending:()=>4,MultiplyOperation:()=>0,NearestFilter:()=>Ie,NearestMipMapLinearFilter:()=>Be,NearestMipMapNearestFilter:()=>Re,NearestMipmapLinearFilter:()=>ze,NearestMipmapNearestFilter:()=>Le,NeutralToneMapping:()=>7,NeverCompare:()=>512,NeverDepth:()=>0,NeverStencilFunc:()=>512,NoBlending:()=>0,NoColorSpace:()=>``,NoNormalPacking:()=>``,NoToneMapping:()=>0,NormalAnimationBlendMode:()=>ln,NormalBlending:()=>1,NormalGAPacking:()=>`ga`,NormalRGPacking:()=>`rg`,NotEqualCompare:()=>517,NotEqualDepth:()=>7,NotEqualStencilFunc:()=>517,NumberKeyframeTrack:()=>Uu,Object3D:()=>Oi,ObjectLoader:()=>Hd,ObjectSpaceNormalMap:()=>1,OctahedronGeometry:()=>Jl,OneFactor:()=>201,OneMinusConstantAlphaFactor:()=>214,OneMinusConstantColorFactor:()=>212,OneMinusDstAlphaFactor:()=>207,OneMinusDstColorFactor:()=>209,OneMinusSrcAlphaFactor:()=>205,OneMinusSrcColorFactor:()=>
5203,OrthographicCamera:()=>Ad,PCFShadowMap:()=>1,PCFSoftShadowMap:()=>2,PMREMGenerator:()=>_m,Path:()=>il,PerspectiveCamera:()=>Td,Plane:()=>ds,PlaneGeometry:()=>Yl,PlaneHelper:()=>Np,PointLight:()=>kd,PointLightHelper:()=>hp,Points:()=>rc,PointsMaterial:()=>Qs,PolarGridHelper:()=>xp,PolyhedronGeometry:()=>Sc,PositionalAudio:()=>yf,PropertyBinding:()=>Nf,PropertyMixer:()=>xf,QuadraticBezierCurve:()=>$c,QuadraticBezierCurve3:()=>el,Quaternion:()=>Ar,QuaternionKeyframeTrack:()=>Gu,QuaternionLinearInterpolant:()=>Wu,R11_EAC_Format:()=>Dt,RED_GREEN_RGTC2_Format:()=>Xt,RED_RGTC1_Format:()=>Jt,REVISION:()=>`184`,RG11_EAC_Format:()=>kt,RGBADepthPacking:()=>fn,RGBAFormat:()=>st,RGBAIntegerFormat:()=>ht,RGBA_ASTC_10x10_Format:()=>Ht,RGBA_ASTC_10x5_Format:()=>zt,RGBA_ASTC_10x6_Format:()=>Bt,RGBA_ASTC_10x8_Format:()=>Vt,RGBA_ASTC_12x10_Format:()=>Ut,RGBA_ASTC_12x12_Format:()=>Wt,RGBA_ASTC_4x4_Format:()=>jt,RGBA_ASTC_5x4_Format:()=>Mt,RGBA_ASTC_5x5_Format:()=>Nt,RGBA_ASTC_6x5_Format:()=>Pt,RGBA_ASTC_6x6_Format:()=>Ft,RGBA_ASTC_8x5_Format:()=>It,RGBA_ASTC_8x6_Format:()=>Lt,RGBA_ASTC_8x8_Format:()=>Rt,RGBA_BPTC_Format:()=>Gt,RGBA_ETC2_EAC_Format:()=>Et,RGBA_PVRTC_2BPPV1_Format:()=>Ct,RGBA_PVRTC_4BPPV1_Format:()=>St,RGBA_S3TC_DXT1_Format:()=>_t,RGBA_S3TC_DXT3_Format:()=>vt,RGBA_S3TC_DXT5_Format:()=>yt,RGBDepthPacking:()=>pn,RGBFormat:()=>ot,RGBIntegerFormat:()=>mt,RGB_BPTC_SIGNED_Format:()=>Kt,RGB_BPTC_UNSIGNED_Format:()=>qt,RGB_ETC1_Format:()=>wt,RGB_ETC2_Format:()=>Tt,RGB_PVRTC_2BPPV1_Format:()=>xt,RGB_PVRTC_4BPPV1_Format:()=>bt,RGB_S3TC_DXT1_Format:()=>gt,RGDepthPacking:()=>mn,RGFormat:()=>ft,RGIntegerFormat:()=>pt,RawShaderMaterial:()=>_u,Ray:()=>So,Raycaster:()=>Gf,RectAreaLight:()=>Pd,RedFormat:()=>ut,RedIntegerFormat:()=>dt,ReinhardToneMapping:()=>2,RenderTarget:()=>Xr,RenderTarget3D:()=>Rf,RepeatWrapping:()=>Ne,ReplaceStencilOp:()=>bn,ReverseSubtractEquation:()=>102,RingGeometry:()=>Xl,SIGNED_R11_EAC_Format:()=>Ot,SIGNED_RED_GREEN_RGTC2_Format:()=>Zt,SIGNED_RED_RGTC1_Format:()=>Yt,SIGNED_RG11_EAC_Format:()=>At,SRGBColorSpace:()=>hn,SRGBTransfer:()=>vn,Scene:()=>zi,ShaderChunk:()=>Xp,ShaderLib:()=>Zp,ShaderMaterial:()=>gu,ShadowMaterial:()=>su,Shape:()=>al,ShapeGeometry:()=>Zl,ShapePath:()=>zp,ShapeUtils:()=>Bl,ShortType:()=>Je,Skeleton:()=>Qo,SkeletonHelper:()=>pp,SkinnedMesh:()=>qo,Source:()=>Wr,Sphere:()=>Fa,SphereGeometry:()=>$l,Spherical:()=>Yf,SphericalHarmonics3:()=>Fd,SplineCurve:()=>tl,SpotLight:()=>Dd,SpotLightHelper:()=>lp,Sprite:()=>lo,SpriteMaterial:()=>Ya,SrcAlphaFactor:()=>204,SrcAlphaSaturateFactor:()=>210,SrcColorFactor:()=>202,StaticCopyUsage:()=>Mn,StaticDrawUsage:()=>En,StaticReadUsage:()=>kn,StereoCamera:()=>ef,StreamCopyUsage:()=>Pn,StreamDrawUsage:()=>On,StreamReadUsage:()=>jn,StringKeyframeTrack:()=>Ku,SubtractEquation:()=>101,SubtractiveBlending:()=>3,TOUCH:()=>Ae,TangentSpaceNormalMap:()=>0,TetrahedronGeometry:()=>eu,Texture:()=>Jr,TextureLoader:()=>dd,TextureUtils:()=>Kp,Timer:()=>of,TimestampQuery:()=>Rn,TorusGeometry:()=>tu,TorusKnotGeometry:()=>nu,Triangle:()=>$i,TriangleFanDrawMode:()=>2,TriangleStripDrawMode:()=>1,TrianglesDrawMode:()=>0,TubeGeometry:()=>ru,UVMapping:()=>300,Uint16BufferAttribute:()=>Oa,Uint32BufferAttribute:()=>Aa,Uint8BufferAttribute:()=>Ta,Uint8ClampedBufferAttribute:()=>Ea,Uniform:()=>zf,UniformsGroup:()=>Vf,UniformsLib:()=>Y,UniformsUtils:()=>pu,UnsignedByteType:()=>Ke,UnsignedInt101111Type:()=>it,UnsignedInt248Type:()=>nt,UnsignedInt5999Type:()=>rt,UnsignedIntType:()=>Ze,UnsignedShort4444Type:()=>et,UnsignedShort5551Type:()=>tt,UnsignedShortType:()=>Ye,VSMShadowMap:()=>3,Vector2:()=>W,Vector3:()=>G,Vector4:()=>Yr,VectorKeyframeTrack:()=>qu,VideoFrameTexture:()=>oc,VideoTexture:()=>ac,WebGL3DRenderTarget:()=>ti,WebGLArrayRenderTarget:()=>$r,WebGLCoordinateSystem:()=>In,WebGLCubeRenderTarget:()=>Em,WebGLRenderTarget:()=>Zr,WebGLRenderer:()=>u_,WebGLUtils:()=>Qg,WebGPUCoordinateSystem:()=>Ln,WebXRController:()=>ji,WireframeGeometry:()=>iu,WrapAroundEnding:()=>cn,ZeroCurvatureEnding:()=>on,ZeroFactor:()=>200,ZeroSlopeEnding:()=>sn,ZeroStencilOp:()=>0,createCanvasElement:()=>qn,error:()=>H,getConsoleFunction:()=>Zn,log:()=>Qn,setConsoleFunction:()=>Xn,warn:()=>V,warnOnce:()=>er});function Jp(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&e!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e!==null&&e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Yp(e){let t=new WeakMap;function n(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(typeof Float16Array<`u`&&r instanceof Float16Array)s=e.HALF_FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function r(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>
vendor: 4,843 bytes, lines 5-103
5e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let n=a[t],r=a[e];r.start<=n.start+n.count+1?n.count=Math.max(n.count,r.start+r.count-n.start):(++t,a[t]=r)}a.length=t+1;for(let t=0,n=a.length;t<n;t++){let n=a[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}function i(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)}function a(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))}function o(e,i){if(e.isInterleavedBufferAttribute&&(e=e.data),e.isGLBufferAttribute){let n=t.get(e);(!n||n.version<e.version)&&t.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version});return}let a=t.get(e);if(a===void 0)t.set(e,n(e,i));else if(a.version<e.version){if(a.size!==e.array.byteLength)throw Error(`THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.`);r(a.buffer,e,i),a.version=e.version}}return{get:i,remove:a,update:o}}var Xp={alphahash_fragment:`#ifdef USE_ALPHAHASH
6	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
7#endif`,alphahash_pars_fragment:`#ifdef USE_ALPHAHASH
8	const float ALPHA_HASH_SCALE = 0.05;
9	float hash2D( vec2 value ) {
10		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
11	}
12	float hash3D( vec3 value ) {
13		return hash2D( vec2( hash2D( value.xy ), value.z ) );
14	}
15	float getAlphaHashThreshold( vec3 position ) {
16		float maxDeriv = max(
17			length( dFdx( position.xyz ) ),
18			length( dFdy( position.xyz ) )
19		);
20		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
21		vec2 pixScales = vec2(
22			exp2( floor( log2( pixScale ) ) ),
23			exp2( ceil( log2( pixScale ) ) )
24		);
25		vec2 alpha = vec2(
26			hash3D( floor( pixScales.x * position.xyz ) ),
27			hash3D( floor( pixScales.y * position.xyz ) )
28		);
29		float lerpFactor = fract( log2( pixScale ) );
30		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
31		float a = min( lerpFactor, 1.0 - lerpFactor );
32		vec3 cases = vec3(
33			x * x / ( 2.0 * a * ( 1.0 - a ) ),
34			( x - 0.5 * a ) / ( 1.0 - a ),
35			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
36		);
37		float threshold = ( x < ( 1.0 - a ) )
38			? ( ( x < a ) ? cases.x : cases.y )
39			: cases.z;
40		return clamp( threshold , 1.0e-6, 1.0 );
41	}
42#endif`,alphamap_fragment:`#ifdef USE_ALPHAMAP
43	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
44#endif`,alphamap_pars_fragment:`#ifdef USE_ALPHAMAP
45	uniform sampler2D alphaMap;
46#endif`,alphatest_fragment:`#ifdef USE_ALPHATEST
47	#ifdef ALPHA_TO_COVERAGE
48	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
49	if ( diffuseColor.a == 0.0 ) discard;
50	#else
51	if ( diffuseColor.a < alphaTest ) discard;
52	#endif
53#endif`,alphatest_pars_fragment:`#ifdef USE_ALPHATEST
54	uniform float alphaTest;
55#endif`,aomap_fragment:`#ifdef USE_AOMAP
56	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
57	reflectedLight.indirectDiffuse *= ambientOcclusion;
58	#if defined( USE_CLEARCOAT ) 
59		clearcoatSpecularIndirect *= ambientOcclusion;
60	#endif
61	#if defined( USE_SHEEN ) 
62		sheenSpecularIndirect *= ambientOcclusion;
63	#endif
64	#if defined( USE_ENVMAP ) && defined( STANDARD )
65		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
66		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
67	#endif
68#endif`,aomap_pars_fragment:`#ifdef USE_AOMAP
69	uniform sampler2D aoMap;
70	uniform float aoMapIntensity;
71#endif`,batching_pars_vertex:`#ifdef USE_BATCHING
72	#if ! defined( GL_ANGLE_multi_draw )
73	#define gl_DrawID _gl_DrawID
74	uniform int _gl_DrawID;
75	#endif
76	uniform highp sampler2D batchingTexture;
77	uniform highp usampler2D batchingIdTexture;
78	mat4 getBatchingMatrix( const in float i ) {
79		int size = textureSize( batchingTexture, 0 ).x;
80		int j = int( i ) * 4;
81		int x = j % size;
82		int y = j / size;
83		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
84		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
85		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
86		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
87		return mat4( v1, v2, v3, v4 );
88	}
89	float getIndirectIndex( const in int i ) {
90		int size = textureSize( batchingIdTexture, 0 ).x;
91		int x = i % size;
92		int y = i / size;
93		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
94	}
95#endif
96#ifdef USE_BATCHING_COLOR
97	uniform sampler2D batchingColorTexture;
98	vec4 getBatchingColor( const in float i ) {
99		int size = textureSize( batchingColorTexture, 0 ).x;
100		int j = int( i );
101		int x = j % size;
102		int y = j / size;
103		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 )
vendor: 6,787 bytes, lines 103-264
103;
104	}
105#endif`,batching_vertex:`#ifdef USE_BATCHING
106	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
107#endif`,begin_vertex:`vec3 transformed = vec3( position );
108#ifdef USE_ALPHAHASH
109	vPosition = vec3( position );
110#endif`,beginnormal_vertex:`vec3 objectNormal = vec3( normal );
111#ifdef USE_TANGENT
112	vec3 objectTangent = vec3( tangent.xyz );
113#endif`,bsdfs:`float G_BlinnPhong_Implicit( ) {
114	return 0.25;
115}
116float D_BlinnPhong( const in float shininess, const in float dotNH ) {
117	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
118}
119vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
120	vec3 halfDir = normalize( lightDir + viewDir );
121	float dotNH = saturate( dot( normal, halfDir ) );
122	float dotVH = saturate( dot( viewDir, halfDir ) );
123	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
124	float G = G_BlinnPhong_Implicit( );
125	float D = D_BlinnPhong( shininess, dotNH );
126	return F * ( G * D );
127} // validated`,iridescence_fragment:`#ifdef USE_IRIDESCENCE
128	const mat3 XYZ_TO_REC709 = mat3(
129		 3.2404542, -0.9692660,  0.0556434,
130		-1.5371385,  1.8760108, -0.2040259,
131		-0.4985314,  0.0415560,  1.0572252
132	);
133	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
134		vec3 sqrtF0 = sqrt( fresnel0 );
135		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
136	}
137	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
138		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
139	}
140	float IorToFresnel0( float transmittedIor, float incidentIor ) {
141		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
142	}
143	vec3 evalSensitivity( float OPD, vec3 shift ) {
144		float phase = 2.0 * PI * OPD * 1.0e-9;
145		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
146		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
147		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
148		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
149		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
150		xyz /= 1.0685e-7;
151		vec3 rgb = XYZ_TO_REC709 * xyz;
152		return rgb;
153	}
154	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
155		vec3 I;
156		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
157		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
158		float cosTheta2Sq = 1.0 - sinTheta2Sq;
159		if ( cosTheta2Sq < 0.0 ) {
160			return vec3( 1.0 );
161		}
162		float cosTheta2 = sqrt( cosTheta2Sq );
163		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
164		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
165		float T121 = 1.0 - R12;
166		float phi12 = 0.0;
167		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
168		float phi21 = PI - phi12;
169		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
170		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
171		vec3 phi23 = vec3( 0.0 );
172		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
173		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
174		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
175		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
176		vec3 phi = vec3( phi21 ) + phi23;
177		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
178		vec3 r123 = sqrt( R123 );
179		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
180		vec3 C0 = R12 + Rs;
181		I = C0;
182		vec3 Cm = Rs - T121;
183		for ( int m = 1; m <= 2; ++ m ) {
184			Cm *= r123;
185			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
186			I += Cm * Sm;
187		}
188		return max( I, vec3( 0.0 ) );
189	}
190#endif`,bumpmap_pars_fragment:`#ifdef USE_BUMPMAP
191	uniform sampler2D bumpMap;
192	uniform float bumpScale;
193	vec2 dHdxy_fwd() {
194		vec2 dSTdx = dFdx( vBumpMapUv );
195		vec2 dSTdy = dFdy( vBumpMapUv );
196		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
197		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
198		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
199		return vec2( dBx, dBy );
200	}
201	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
202		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
203		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
204		vec3 vN = surf_norm;
205		vec3 R1 = cross( vSigmaY, vN );
206		vec3 R2 = cross( vN, vSigmaX );
207		float fDet = dot( vSigmaX, R1 ) * faceDirection;
208		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
209		return normalize( abs( fDet ) * surf_norm - vGrad );
210	}
211#endif`,clipping_planes_fragment:`#if NUM_CLIPPING_PLANES > 0
212	vec4 plane;
213	#ifdef ALPHA_TO_COVERAGE
214		float distanceToPlane, distanceGradient;
215		float clipOpacity = 1.0;
216		#pragma unroll_loop_start
217		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
218			plane = clippingPlanes[ i ];
219			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
220			distanceGradient = fwidth( distanceToPlane ) / 2.0;
221			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
222			if ( clipOpacity == 0.0 ) discard;
223		}
224		#pragma unroll_loop_end
225		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
226			float unionClipOpacity = 1.0;
227			#pragma unroll_loop_start
228			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
229				plane = clippingPlanes[ i ];
230				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
231				distanceGradient = fwidth( distanceToPlane ) / 2.0;
232				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
233			}
234			#pragma unroll_loop_end
235			clipOpacity *= 1.0 - unionClipOpacity;
236		#endif
237		diffuseColor.a *= clipOpacity;
238		if ( diffuseColor.a == 0.0 ) discard;
239	#else
240		#pragma unroll_loop_start
241		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
242			plane = clippingPlanes[ i ];
243			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
244		}
245		#pragma unroll_loop_end
246		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
247			bool clipped = true;
248			#pragma unroll_loop_start
249			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
250				plane = clippingPlanes[ i ];
251				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
252			}
253			#pragma unroll_loop_end
254			if ( clipped ) discard;
255		#endif
256	#endif
257#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0
258	varying vec3 vClipPosition;
259	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
260#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0
261	varying vec3 vClipPosition;
262#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0
263	vClipPosition = - mvPosition.xyz;
264#endif`,color_fragment:`#if defined( USE_COLOR
264 ) || defined( USE_COLOR_ALPHA )
265	diffuseColor *= vColor;
266#endif`,color_pars_fragment:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
267	varying vec4 vColor;
268#endif`,color_pars_vertex:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
269	varying vec4 vColor;
270#endif`,color_vertex:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
271	vColor = vec4( 1.0 );
272#endif
273#ifdef USE_COLOR_ALPHA
274	vColor *= color;
275#elif defined( USE_COLOR )
276	vColor.rgb *= color;
277#endif
278#ifdef USE_INSTANCING_COLOR
279	vColor.rgb *= instanceColor.rgb;
280#endif
281#ifdef USE_BATCHING_COLOR
282	vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
283#endif`,common:`#define PI 3.141592653589793
284#define PI2 6.283185307179586
285#define PI_HALF 1.5707963267948966
286#define RECIPROCAL_PI 0.3183098861837907
287#define RECIPROCAL_PI2 0.15915494309189535
288#define EPSILON 1e-6
289#ifndef saturate
290#define saturate( a ) clamp( a, 0.0, 1.0 )
291#endif
292#define whiteComplement( a ) ( 1.0 - saturate( a ) )
293float pow2( const in float x ) { return x*x; }
294vec3 pow2( const in vec3 x ) { return x*x; }
295float pow3( const in float x ) { return x*x*x; }
296float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
297float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
298float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
299highp float rand( const in vec2 uv ) {
300	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
301	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
302	return fract( sin( sn ) * c );
303}
304#ifdef HIGH_PRECISION
305	float precisionSafeLength( vec3 v ) { return length( v ); }
306#else
307	float precisionSafeLength( vec3 v ) {
308		float maxComponent = max3( abs( v ) );
309		return length( v / maxComponent ) * maxComponent;
310	}
311#endif
312struct IncidentLight {
313	vec3 color;
314	vec3 direction;
315	bool visible;
316};
317struct ReflectedLight {
318	vec3 directDiffuse;
319	vec3 directSpecular;
320	vec3 indirectDiffuse;
321	vec3 indirectSpecular;
322};
323#ifdef USE_ALPHAHASH
324	varying vec3 vPosition;
325#endif
326vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
327	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
328}
329vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
330	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz )
vendor: 7,098 bytes, lines 330-512
330;
331}
332bool isPerspectiveMatrix( mat4 m ) {
333	return m[ 2 ][ 3 ] == - 1.0;
334}
335vec2 equirectUv( in vec3 dir ) {
336	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
337	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
338	return vec2( u, v );
339}
340vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
341	return RECIPROCAL_PI * diffuseColor;
342}
343vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
344	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
345	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
346}
347float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
348	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
349	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
350} // validated`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV
351	#define cubeUV_minMipLevel 4.0
352	#define cubeUV_minTileSize 16.0
353	float getFace( vec3 direction ) {
354		vec3 absDirection = abs( direction );
355		float face = - 1.0;
356		if ( absDirection.x > absDirection.z ) {
357			if ( absDirection.x > absDirection.y )
358				face = direction.x > 0.0 ? 0.0 : 3.0;
359			else
360				face = direction.y > 0.0 ? 1.0 : 4.0;
361		} else {
362			if ( absDirection.z > absDirection.y )
363				face = direction.z > 0.0 ? 2.0 : 5.0;
364			else
365				face = direction.y > 0.0 ? 1.0 : 4.0;
366		}
367		return face;
368	}
369	vec2 getUV( vec3 direction, float face ) {
370		vec2 uv;
371		if ( face == 0.0 ) {
372			uv = vec2( direction.z, direction.y ) / abs( direction.x );
373		} else if ( face == 1.0 ) {
374			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
375		} else if ( face == 2.0 ) {
376			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
377		} else if ( face == 3.0 ) {
378			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
379		} else if ( face == 4.0 ) {
380			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
381		} else {
382			uv = vec2( direction.x, direction.y ) / abs( direction.z );
383		}
384		return 0.5 * ( uv + 1.0 );
385	}
386	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
387		float face = getFace( direction );
388		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
389		mipInt = max( mipInt, cubeUV_minMipLevel );
390		float faceSize = exp2( mipInt );
391		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
392		if ( face > 2.0 ) {
393			uv.y += faceSize;
394			face -= 3.0;
395		}
396		uv.x += face * faceSize;
397		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
398		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
399		uv.x *= CUBEUV_TEXEL_WIDTH;
400		uv.y *= CUBEUV_TEXEL_HEIGHT;
401		#ifdef texture2DGradEXT
402			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
403		#else
404			return texture2D( envMap, uv ).rgb;
405		#endif
406	}
407	#define cubeUV_r0 1.0
408	#define cubeUV_m0 - 2.0
409	#define cubeUV_r1 0.8
410	#define cubeUV_m1 - 1.0
411	#define cubeUV_r4 0.4
412	#define cubeUV_m4 2.0
413	#define cubeUV_r5 0.305
414	#define cubeUV_m5 3.0
415	#define cubeUV_r6 0.21
416	#define cubeUV_m6 4.0
417	float roughnessToMip( float roughness ) {
418		float mip = 0.0;
419		if ( roughness >= cubeUV_r1 ) {
420			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
421		} else if ( roughness >= cubeUV_r4 ) {
422			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
423		} else if ( roughness >= cubeUV_r5 ) {
424			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
425		} else if ( roughness >= cubeUV_r6 ) {
426			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
427		} else {
428			mip = - 2.0 * log2( 1.16 * roughness );		}
429		return mip;
430	}
431	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
432		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
433		float mipF = fract( mip );
434		float mipInt = floor( mip );
435		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
436		if ( mipF == 0.0 ) {
437			return vec4( color0, 1.0 );
438		} else {
439			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
440			return vec4( mix( color0, color1, mipF ), 1.0 );
441		}
442	}
443#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal;
444#ifdef USE_TANGENT
445	vec3 transformedTangent = objectTangent;
446#endif
447#ifdef USE_BATCHING
448	mat3 bm = mat3( batchingMatrix );
449	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
450	transformedNormal = bm * transformedNormal;
451	#ifdef USE_TANGENT
452		transformedTangent = bm * transformedTangent;
453	#endif
454#endif
455#ifdef USE_INSTANCING
456	mat3 im = mat3( instanceMatrix );
457	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
458	transformedNormal = im * transformedNormal;
459	#ifdef USE_TANGENT
460		transformedTangent = im * transformedTangent;
461	#endif
462#endif
463transformedNormal = normalMatrix * transformedNormal;
464#ifdef FLIP_SIDED
465	transformedNormal = - transformedNormal;
466#endif
467#ifdef USE_TANGENT
468	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
469	#ifdef FLIP_SIDED
470		transformedTangent = - transformedTangent;
471	#endif
472#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP
473	uniform sampler2D displacementMap;
474	uniform float displacementScale;
475	uniform float displacementBias;
476#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP
477	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
478#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP
479	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
480	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
481		emissiveColor = sRGBTransferEOTF( emissiveColor );
482	#endif
483	totalEmissiveRadiance *= emissiveColor.rgb;
484#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP
485	uniform sampler2D emissiveMap;
486#endif`,colorspace_fragment:`gl_FragColor = linearToOutputTexel( gl_FragColor );`,colorspace_pars_fragment:`vec4 LinearTransferOETF( in vec4 value ) {
487	return value;
488}
489vec4 sRGBTransferEOTF( in vec4 value ) {
490	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
491}
492vec4 sRGBTransferOETF( in vec4 value ) {
493	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
494}`,envmap_fragment:`#ifdef USE_ENVMAP
495	#ifdef ENV_WORLDPOS
496		vec3 cameraToFrag;
497		if ( isOrthographic ) {
498			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
499		} else {
500			cameraToFrag = normalize( vWorldPosition - cameraPosition );
501		}
502		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
503		#ifdef ENVMAP_MODE_REFLECTION
504			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
505		#else
506			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
507		#endif
508	#else
509		vec3 reflectVec = vReflect;
510	#endif
511	#ifdef ENVMAP_TYPE_CUBE
512		vec4 envColor = textureCube( envMap, envMapRotation * 
512reflectVec );
513		#ifdef ENVMAP_BLENDING_MULTIPLY
514			outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
515		#elif defined( ENVMAP_BLENDING_MIX )
516			outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
517		#elif defined( ENVMAP_BLENDING_ADD )
518			outgoingLight += envColor.xyz * specularStrength * reflectivity;
519		#endif
520	#endif
521#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP
522	uniform float envMapIntensity;
523	uniform mat3 envMapRotation;
524	#ifdef ENVMAP_TYPE_CUBE
525		uniform samplerCube envMap;
526	#else
527		uniform sampler2D envMap;
528	#endif
529#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP
530	uniform float reflectivity;
531	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
532		#define ENV_WORLDPOS
533	#endif
534	#ifdef ENV_WORLDPOS
535		varying vec3 vWorldPosition;
536		uniform float refractionRatio;
537	#else
538		varying vec3 vReflect;
539	#endif
540#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP
541	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
542		#define ENV_WORLDPOS
543	#endif
544	#ifdef ENV_WORLDPOS
545		
546		varying vec3 vWorldPosition;
547	#else
548		varying vec3 vReflect;
549		uniform float refractionRatio;
550	#endif
551#endif`,envmap_physical_pars_fragment:`#ifdef USE_ENVMAP
552	vec3 getIBLIrradiance( const in vec3 normal ) {
553		#ifdef ENVMAP_TYPE_CUBE_UV
554			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
555			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
556			return PI * envMapColor.rgb * envMapIntensity;
557		#else
558			return vec3( 0.0 );
559		#endif
560	}
561	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
562		#ifdef ENVMAP_TYPE_CUBE_UV
563			vec3 reflectVec = reflect( - viewDir, normal );
564			reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) 
vendor: 8,183 bytes, lines 564-768
564) );
565			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
566			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
567			return envMapColor.rgb * envMapIntensity;
568		#else
569			return vec3( 0.0 );
570		#endif
571	}
572	#ifdef USE_ANISOTROPY
573		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
574			#ifdef ENVMAP_TYPE_CUBE_UV
575				vec3 bentNormal = cross( bitangent, viewDir );
576				bentNormal = normalize( cross( bentNormal, bitangent ) );
577				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
578				return getIBLRadiance( viewDir, bentNormal, roughness );
579			#else
580				return vec3( 0.0 );
581			#endif
582		}
583	#endif
584#endif`,envmap_vertex:`#ifdef USE_ENVMAP
585	#ifdef ENV_WORLDPOS
586		vWorldPosition = worldPosition.xyz;
587	#else
588		vec3 cameraToVertex;
589		if ( isOrthographic ) {
590			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
591		} else {
592			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
593		}
594		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
595		#ifdef ENVMAP_MODE_REFLECTION
596			vReflect = reflect( cameraToVertex, worldNormal );
597		#else
598			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
599		#endif
600	#endif
601#endif`,fog_vertex:`#ifdef USE_FOG
602	vFogDepth = - mvPosition.z;
603#endif`,fog_pars_vertex:`#ifdef USE_FOG
604	varying float vFogDepth;
605#endif`,fog_fragment:`#ifdef USE_FOG
606	#ifdef FOG_EXP2
607		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
608	#else
609		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
610	#endif
611	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
612#endif`,fog_pars_fragment:`#ifdef USE_FOG
613	uniform vec3 fogColor;
614	varying float vFogDepth;
615	#ifdef FOG_EXP2
616		uniform float fogDensity;
617	#else
618		uniform float fogNear;
619		uniform float fogFar;
620	#endif
621#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP
622	uniform sampler2D gradientMap;
623#endif
624vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
625	float dotNL = dot( normal, lightDirection );
626	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
627	#ifdef USE_GRADIENTMAP
628		return vec3( texture2D( gradientMap, coord ).r );
629	#else
630		vec2 fw = fwidth( coord ) * 0.5;
631		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
632	#endif
633}`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP
634	uniform sampler2D lightMap;
635	uniform float lightMapIntensity;
636#endif`,lights_lambert_fragment:`LambertMaterial material;
637material.diffuseColor = diffuseColor.rgb;
638material.specularStrength = specularStrength;`,lights_lambert_pars_fragment:`varying vec3 vViewPosition;
639struct LambertMaterial {
640	vec3 diffuseColor;
641	float specularStrength;
642};
643void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
644	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
645	vec3 irradiance = dotNL * directLight.color;
646	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
647}
648void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
649	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
650}
651#define RE_Direct				RE_Direct_Lambert
652#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,lights_pars_begin:`uniform bool receiveShadow;
653uniform vec3 ambientLightColor;
654#if defined( USE_LIGHT_PROBES )
655	uniform vec3 lightProbe[ 9 ];
656#endif
657vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
658	float x = normal.x, y = normal.y, z = normal.z;
659	vec3 result = shCoefficients[ 0 ] * 0.886227;
660	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
661	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
662	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
663	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
664	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
665	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
666	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
667	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
668	return result;
669}
670vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
671	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
672	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
673	return irradiance;
674}
675vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
676	vec3 irradiance = ambientLightColor;
677	return irradiance;
678}
679float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
680	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
681	if ( cutoffDistance > 0.0 ) {
682		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
683	}
684	return distanceFalloff;
685}
686float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
687	return smoothstep( coneCosine, penumbraCosine, angleCosine );
688}
689#if NUM_DIR_LIGHTS > 0
690	struct DirectionalLight {
691		vec3 direction;
692		vec3 color;
693	};
694	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
695	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
696		light.color = directionalLight.color;
697		light.direction = directionalLight.direction;
698		light.visible = true;
699	}
700#endif
701#if NUM_POINT_LIGHTS > 0
702	struct PointLight {
703		vec3 position;
704		vec3 color;
705		float distance;
706		float decay;
707	};
708	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
709	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
710		vec3 lVector = pointLight.position - geometryPosition;
711		light.direction = normalize( lVector );
712		float lightDistance = length( lVector );
713		light.color = pointLight.color;
714		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
715		light.visible = ( light.color != vec3( 0.0 ) );
716	}
717#endif
718#if NUM_SPOT_LIGHTS > 0
719	struct SpotLight {
720		vec3 position;
721		vec3 direction;
722		vec3 color;
723		float distance;
724		float decay;
725		float coneCos;
726		float penumbraCos;
727	};
728	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
729	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
730		vec3 lVector = spotLight.position - geometryPosition;
731		light.direction = normalize( lVector );
732		float angleCos = dot( light.direction, spotLight.direction );
733		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
734		if ( spotAttenuation > 0.0 ) {
735			float lightDistance = length( lVector );
736			light.color = spotLight.color * spotAttenuation;
737			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
738			light.visible = ( light.color != vec3( 0.0 ) );
739		} else {
740			light.color = vec3( 0.0 );
741			light.visible = false;
742		}
743	}
744#endif
745#if NUM_RECT_AREA_LIGHTS > 0
746	struct RectAreaLight {
747		vec3 color;
748		vec3 position;
749		vec3 halfWidth;
750		vec3 halfHeight;
751	};
752	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
753	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
754#endif
755#if NUM_HEMI_LIGHTS > 0
756	struct HemisphereLight {
757		vec3 direction;
758		vec3 skyColor;
759		vec3 groundColor;
760	};
761	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
762	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
763		float dotNL = dot( normal, hemiLight.direction );
764		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
765		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
766		return irradiance;
767	}
768#endif
768
769#include <lightprobes_pars_fragment>`,lights_toon_fragment:`ToonMaterial material;
770material.diffuseColor = diffuseColor.rgb;`,lights_toon_pars_fragment:`varying vec3 vViewPosition;
771struct ToonMaterial {
772	vec3 diffuseColor;
773};
774void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
775	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
776	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
777}
778void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
779	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
780}
781#define RE_Direct				RE_Direct_Toon
782#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,lights_phong_fragment:`BlinnPhongMaterial material;
783material.diffuseColor = diffuseColor.rgb;
784material.specularColor = specular;
785material.specularShininess = shininess;
786material.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition;
787struct BlinnPhongMaterial {
788	vec3 diffuseColor;
789	vec3 specularColor;
790	float specularShininess;
791	float specularStrength;
792};
793void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
794	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
795	vec3 irradiance = dotNL * directLight.color;
796	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
797	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
798}
799void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
800	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
801}
802#define RE_Direct				RE_Direct_BlinnPhong
803#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,lights_physical_fragment:`PhysicalMaterial material;
804material.diffuseColor = diffuseColor.rgb;
805material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
806material.metalness = metalnessFactor;
807vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
808float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
809material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
810material.roughness = min( material.roughness, 1.0 );
811#ifdef IOR
812	material.ior = ior;
813	#ifdef USE_SPECULAR
814		float specularIntensityFactor = specularIntensity;
815		vec3 specularColorFactor = specularColor;
816		#ifdef USE_SPECULAR_COLORMAP
817			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
818		#endif
819		#ifdef USE_SPECULAR_INTENSITYMAP
820			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
821		#endif
822		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
823	#else
824		float specularIntensityFactor = 1.0;
825		vec3 specularColorFactor = vec3( 1.0 );
826		material.specularF90 = 1.0;
827	#endif
828	material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;
829	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
830#else
831	material.specularColor = vec3( 0.04 );
832	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
833	material.specularF90 = 1.0;
834#endif
835#ifdef USE_CLEARCOAT
836	material.clearcoat = clearcoat;
837	material.clearcoatRoughness = clearcoatRoughness;
838	material.clearcoatF0 = vec3( 0.04 );
839	material.clearcoatF90 = 1.0;
840	#ifdef USE_CLEARCOATMAP
841		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
842	#endif
843	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
844		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
845	#endif
846	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
847	material.clearcoatRoughness += geometryRoughness;
848	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
849#endif
850#ifdef USE_DISPERSION
851	material.dispersion = dispersion;
852#endif
853#ifdef USE_IRIDESCENCE
854	material.iridescence = iridescence;
855	material.iridescenceIOR = iridescenceIOR;
856	#ifdef USE_IRIDESCENCEMAP
857		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
858	#endif
859	#ifdef USE_IRIDESCENCE_THICKNESSMAP
860		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
861	#else
862		material.iridescenceThickness = iridescenceThicknessMaximum;
863	#endif
864#endif
865#ifdef USE_SHEEN
866	material.sheenColor = sheenColor;
867	#ifdef USE_SHEEN_COLORMAP
868		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
869	#endif
870	material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );
871	#ifdef USE_SHEEN_ROUGHNESSMAP
872		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
873	#endif
874#endif
875#ifdef USE_ANISOTROPY
876	#ifdef USE_ANISOTROPYMAP
877		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
878		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
879		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
880	#else
881		vec2 anisotropyV = anisotropyVector;
882	#endif
883	material.anisotropy = length( anisotropyV );
884	if( material.anisotropy == 0.0 ) {
885		anisotropyV = vec2( 1.0, 0.0 );
886	} else {
887		anisotropyV /= material.anisotropy;
888		material.anisotropy = saturate( material.anisotropy );
889	}
890	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
891	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
892	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
893#endif`,lights_physical_pars_fragment:`uniform sampler2D dfgLUT;
894struct PhysicalMaterial {
895	vec3 diffuseColor;
896	vec3 diffuseContribution;
897	vec3 specularColor;
898	vec3 specularColorBlended;
899	float roughness;
900	float metalness;
901	float specularF90;
902	float dispersion;
903	#ifdef USE_CLEARCOAT
904		float clearcoat;
905		float clearcoatRoughness;
906		vec3 clearcoatF0;
907		float clearcoatF90;
908	#endif
909	#ifdef USE_IRIDESCENCE
910		float iridescence;
911		float iridescenceIOR;
912		float iridescenceThickness;
913		vec3 iridescenceFresnel;
914		vec3 iridescenceF0;
915		vec3 iridescenceFresnelDielectric;
916		vec3 iridescenceFresnelMetallic;
917	#endif
918	#ifdef USE_SHEEN
919		vec3 sheenColor;
920		float sheenRoughness;
921	#endif
922	#ifdef IOR
923		float ior;
924	#endif
925	#ifdef USE_TRANSMISSION
926		float transmission;
927		float transmissionAlpha;
928		float thickness;
929		float attenuationDistance;
930		vec3 attenuationColor;
931	#endif
932	#ifdef USE_ANISOTROPY
933		float anisotropy;
934		float alphaT;
935		vec3 anisotropyT;
936		vec3 anisotropyB;
937	#endif
938};
939vec3 clearcoatSpecularDirect = vec3( 0.0 );
940vec3 clearcoatSpecularIndirect = vec3( 0.0 );
941vec3 sheenSpecularDirect = vec3( 0.0 );
942vec3 sheenSpecularIndirect = vec3(0.0 );
943vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
944    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
945    float x2 = x * x;
946    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
947    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
948}
949float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
950	float a2 = pow2( alpha );
951	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
952	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
953	return 0.5 / max( gv + gl, EPSILON );
954}
955float D_GGX( const in float alpha, const in float dotNH ) {
956	float a2 = pow2( alpha );
957	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
958	return RECIPROCAL_PI * a2 / pow2( denom );
959}
960#ifdef USE_ANISOTROPY
961	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
962		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
963		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
964		return 0.5 / max( gv + gl, EPSILON )
vendor: 3,169 bytes, lines 964-1039
964;
965	}
966	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
967		float a2 = alphaT * alphaB;
968		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
969		highp float v2 = dot( v, v );
970		float w2 = a2 / v2;
971		return RECIPROCAL_PI * a2 * pow2 ( w2 );
972	}
973#endif
974#ifdef USE_CLEARCOAT
975	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
976		vec3 f0 = material.clearcoatF0;
977		float f90 = material.clearcoatF90;
978		float roughness = material.clearcoatRoughness;
979		float alpha = pow2( roughness );
980		vec3 halfDir = normalize( lightDir + viewDir );
981		float dotNL = saturate( dot( normal, lightDir ) );
982		float dotNV = saturate( dot( normal, viewDir ) );
983		float dotNH = saturate( dot( normal, halfDir ) );
984		float dotVH = saturate( dot( viewDir, halfDir ) );
985		vec3 F = F_Schlick( f0, f90, dotVH );
986		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
987		float D = D_GGX( alpha, dotNH );
988		return F * ( V * D );
989	}
990#endif
991vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
992	vec3 f0 = material.specularColorBlended;
993	float f90 = material.specularF90;
994	float roughness = material.roughness;
995	float alpha = pow2( roughness );
996	vec3 halfDir = normalize( lightDir + viewDir );
997	float dotNL = saturate( dot( normal, lightDir ) );
998	float dotNV = saturate( dot( normal, viewDir ) );
999	float dotNH = saturate( dot( normal, halfDir ) );
1000	float dotVH = saturate( dot( viewDir, halfDir ) );
1001	vec3 F = F_Schlick( f0, f90, dotVH );
1002	#ifdef USE_IRIDESCENCE
1003		F = mix( F, material.iridescenceFresnel, material.iridescence );
1004	#endif
1005	#ifdef USE_ANISOTROPY
1006		float dotTL = dot( material.anisotropyT, lightDir );
1007		float dotTV = dot( material.anisotropyT, viewDir );
1008		float dotTH = dot( material.anisotropyT, halfDir );
1009		float dotBL = dot( material.anisotropyB, lightDir );
1010		float dotBV = dot( material.anisotropyB, viewDir );
1011		float dotBH = dot( material.anisotropyB, halfDir );
1012		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1013		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1014	#else
1015		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1016		float D = D_GGX( alpha, dotNH );
1017	#endif
1018	return F * ( V * D );
1019}
1020vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1021	const float LUT_SIZE = 64.0;
1022	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1023	const float LUT_BIAS = 0.5 / LUT_SIZE;
1024	float dotNV = saturate( dot( N, V ) );
1025	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1026	uv = uv * LUT_SCALE + LUT_BIAS;
1027	return uv;
1028}
1029float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1030	float l = length( f );
1031	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1032}
1033vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1034	float x = dot( v1, v2 );
1035	float y = abs( x );
1036	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1037	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1038	float v = a / b;
1039	float theta_sintheta = ( x >
vendor: 4,203 bytes, lines 1039-1123
1039 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1040	return cross( v1, v2 ) * theta_sintheta;
1041}
1042vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1043	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1044	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1045	vec3 lightNormal = cross( v1, v2 );
1046	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1047	vec3 T1, T2;
1048	T1 = normalize( V - N * dot( V, N ) );
1049	T2 = - cross( N, T1 );
1050	mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
1051	vec3 coords[ 4 ];
1052	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1053	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1054	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1055	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1056	coords[ 0 ] = normalize( coords[ 0 ] );
1057	coords[ 1 ] = normalize( coords[ 1 ] );
1058	coords[ 2 ] = normalize( coords[ 2 ] );
1059	coords[ 3 ] = normalize( coords[ 3 ] );
1060	vec3 vectorFormFactor = vec3( 0.0 );
1061	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1062	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1063	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1064	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1065	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1066	return vec3( result );
1067}
1068#if defined( USE_SHEEN )
1069float D_Charlie( float roughness, float dotNH ) {
1070	float alpha = pow2( roughness );
1071	float invAlpha = 1.0 / alpha;
1072	float cos2h = dotNH * dotNH;
1073	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1074	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1075}
1076float V_Neubelt( float dotNV, float dotNL ) {
1077	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1078}
1079vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1080	vec3 halfDir = normalize( lightDir + viewDir );
1081	float dotNL = saturate( dot( normal, lightDir ) );
1082	float dotNV = saturate( dot( normal, viewDir ) );
1083	float dotNH = saturate( dot( normal, halfDir ) );
1084	float D = D_Charlie( sheenRoughness, dotNH );
1085	float V = V_Neubelt( dotNV, dotNL );
1086	return sheenColor * ( D * V );
1087}
1088#endif
1089float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1090	float dotNV = saturate( dot( normal, viewDir ) );
1091	float r2 = roughness * roughness;
1092	float rInv = 1.0 / ( roughness + 0.1 );
1093	float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;
1094	float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;
1095	float DG = exp( a * dotNV + b );
1096	return saturate( DG );
1097}
1098vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1099	float dotNV = saturate( dot( normal, viewDir ) );
1100	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1101	return specularColor * fab.x + specularF90 * fab.y;
1102}
1103#ifdef USE_IRIDESCENCE
1104void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
1105#else
1106void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
1107#endif
1108	float dotNV = saturate( dot( normal, viewDir ) );
1109	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1110	#ifdef USE_IRIDESCENCE
1111		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1112	#else
1113		vec3 Fr = specularColor;
1114	#endif
1115	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1116	float Ess = fab.x + fab.y;
1117	float Ems = 1.0 - Ess;
1118	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1119	singleScatter += FssEss;
1120	multiScatter += Fms * Ems;
1121}
1122vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1123	vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 6,009 bytes, lines 1124-1222
1124	float dotNL = saturate( dot( normal, lightDir ) );
1125	float dotNV = saturate( dot( normal, viewDir ) );
1126	vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;
1127	vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;
1128	vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;
1129	vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;
1130	float Ess_V = dfgV.x + dfgV.y;
1131	float Ess_L = dfgL.x + dfgL.y;
1132	float Ems_V = 1.0 - Ess_V;
1133	float Ems_L = 1.0 - Ess_L;
1134	vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;
1135	vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );
1136	float compensationFactor = Ems_V * Ems_L;
1137	vec3 multiScatter = Fms * compensationFactor;
1138	return singleScatter + multiScatter;
1139}
1140#if NUM_RECT_AREA_LIGHTS > 0
1141	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1142		vec3 normal = geometryNormal;
1143		vec3 viewDir = geometryViewDir;
1144		vec3 position = geometryPosition;
1145		vec3 lightPos = rectAreaLight.position;
1146		vec3 halfWidth = rectAreaLight.halfWidth;
1147		vec3 halfHeight = rectAreaLight.halfHeight;
1148		vec3 lightColor = rectAreaLight.color;
1149		float roughness = material.roughness;
1150		vec3 rectCoords[ 4 ];
1151		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1152		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1153		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1154		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1155		vec4 t1 = texture2D( ltc_1, uv );
1156		vec4 t2 = texture2D( ltc_2, uv );
1157		mat3 mInv = mat3(
1158			vec3( t1.x, 0, t1.y ),
1159			vec3(    0, 1,    0 ),
1160			vec3( t1.z, 0, t1.w )
1161		);
1162		vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );
1163		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1164		reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1165		#ifdef USE_CLEARCOAT
1166			vec3 Ncc = geometryClearcoatNormal;
1167			vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );
1168			vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );
1169			vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );
1170			mat3 mInvClearcoat = mat3(
1171				vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),
1172				vec3(             0, 1,             0 ),
1173				vec3( t1Clearcoat.z, 0, t1Clearcoat.w )
1174			);
1175			vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;
1176			clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );
1177		#endif
1178	}
1179#endif
1180void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1181	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1182	vec3 irradiance = dotNL * directLight.color;
1183	#ifdef USE_CLEARCOAT
1184		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1185		vec3 ccIrradiance = dotNLcc * directLight.color;
1186		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1187	#endif
1188	#ifdef USE_SHEEN
1189 
1190 		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1191 
1192 		float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1193 		float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );
1194 
1195 		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );
1196 
1197 		irradiance *= sheenEnergyComp;
1198 
1199 	#endif
1200	reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
1201	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );
1202}
1203void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1204	vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );
1205	#ifdef USE_SHEEN
1206		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1207		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1208		diffuse *= sheenEnergyComp;
1209	#endif
1210	reflectedLight.indirectDiffuse += diffuse;
1211}
1212void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
1213	#ifdef USE_CLEARCOAT
1214		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1215	#endif
1216	#ifdef USE_SHEEN
1217		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;
1218 	#endif
1219	vec3 singleScatteringDielectric = vec3( 0.0 );
1220	vec3 multiScatteringDielectric = vec3( 0.0 );
1221	vec3 singleScatteringMetallic = vec3( 0.0 );
1222	vec3 multiScatteringMetallic = vec3( 0.0 );
vendor: 8,137 bytes, lines 1223-1365
1223	#ifdef USE_IRIDESCENCE
1224		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1225		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1226	#else
1227		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1228		computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1229	#endif
1230	vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );
1231	vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );
1232	vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;
1233	vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );
1234	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1235	vec3 indirectSpecular = radiance * singleScattering;
1236	indirectSpecular += multiScattering * cosineWeightedIrradiance;
1237	vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;
1238	#ifdef USE_SHEEN
1239		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1240		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1241		indirectSpecular *= sheenEnergyComp;
1242		indirectDiffuse *= sheenEnergyComp;
1243	#endif
1244	reflectedLight.indirectSpecular += indirectSpecular;
1245	reflectedLight.indirectDiffuse += indirectDiffuse;
1246}
1247#define RE_Direct				RE_Direct_Physical
1248#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1249#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1250#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1251float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1252	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1253}`,lights_fragment_begin:`
1254vec3 geometryPosition = - vViewPosition;
1255vec3 geometryNormal = normal;
1256vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1257vec3 geometryClearcoatNormal = vec3( 0.0 );
1258#ifdef USE_CLEARCOAT
1259	geometryClearcoatNormal = clearcoatNormal;
1260#endif
1261#ifdef USE_IRIDESCENCE
1262	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1263	if ( material.iridescenceThickness == 0.0 ) {
1264		material.iridescence = 0.0;
1265	} else {
1266		material.iridescence = saturate( material.iridescence );
1267	}
1268	if ( material.iridescence > 0.0 ) {
1269		material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1270		material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );
1271		material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );
1272		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1273	}
1274#endif
1275IncidentLight directLight;
1276#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1277	PointLight pointLight;
1278	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1279	PointLightShadow pointLightShadow;
1280	#endif
1281	#pragma unroll_loop_start
1282	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1283		pointLight = pointLights[ i ];
1284		getPointLightInfo( pointLight, geometryPosition, directLight );
1285		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
1286		pointLightShadow = pointLightShadows[ i ];
1287		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1288		#endif
1289		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1290	}
1291	#pragma unroll_loop_end
1292#endif
1293#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1294	SpotLight spotLight;
1295	vec4 spotColor;
1296	vec3 spotLightCoord;
1297	bool inSpotLightMap;
1298	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1299	SpotLightShadow spotLightShadow;
1300	#endif
1301	#pragma unroll_loop_start
1302	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1303		spotLight = spotLights[ i ];
1304		getSpotLightInfo( spotLight, geometryPosition, directLight );
1305		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1306		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1307		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1308		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1309		#else
1310		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1311		#endif
1312		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1313			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1314			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1315			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1316			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1317		#endif
1318		#undef SPOT_LIGHT_MAP_INDEX
1319		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1320		spotLightShadow = spotLightShadows[ i ];
1321		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1322		#endif
1323		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1324	}
1325	#pragma unroll_loop_end
1326#endif
1327#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1328	DirectionalLight directionalLight;
1329	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1330	DirectionalLightShadow directionalLightShadow;
1331	#endif
1332	#pragma unroll_loop_start
1333	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1334		directionalLight = directionalLights[ i ];
1335		getDirectionalLightInfo( directionalLight, directLight );
1336		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1337		directionalLightShadow = directionalLightShadows[ i ];
1338		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1339		#endif
1340		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1341	}
1342	#pragma unroll_loop_end
1343#endif
1344#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1345	RectAreaLight rectAreaLight;
1346	#pragma unroll_loop_start
1347	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1348		rectAreaLight = rectAreaLights[ i ];
1349		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1350	}
1351	#pragma unroll_loop_end
1352#endif
1353#if defined( RE_IndirectDiffuse )
1354	vec3 iblIrradiance = vec3( 0.0 );
1355	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1356	#if defined( USE_LIGHT_PROBES )
1357		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1358	#endif
1359	#if ( NUM_HEMI_LIGHTS > 0 )
1360		#pragma unroll_loop_start
1361		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1362			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1363		}
1364		#pragma unroll_loop_end
1365	#endif
1366	#ifdef USE_LIGHT_PROBES_GRID
1367		vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;
1368		vec3 probeWorldNormal = inverseTransformDirection( geometryNormal, viewMatrix );
1369		irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );
1370	#endif
1371#endif
1372#if defined( RE_IndirectSpecular )
1373	vec3 radiance = vec3( 0.0 );
1374	vec3 clearcoatRadiance = vec3( 0.0 );
1375#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse )
1376	#ifdef USE_LIGHTMAP
1377		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1378		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1379		irradiance += lightMapIrradiance;
1380	#endif
1381	#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )
1382		#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )
1383			iblIrradiance += getIBLIrradiance( geometryNormal );
1384		#endif
1385	#endif
1386#endif
1387#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1388	#ifdef USE_ANISOTROPY
1389		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1390	#else
1391		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1392	#endif
1393	#ifdef USE_CLEARCOAT
1394		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1395	#endif
1396#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse )
1397	#if defined( LAMBERT ) || defined( PHONG )
1398		irradiance += iblIrradiance;
1399	#endif
1400	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1401#endif
1402#if defined( RE_IndirectSpecular )
1403	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1404#endif`,lightprobes_pars_fragment:`#ifdef USE_LIGHT_PROBES_GRID
1405uniform highp sampler3D probesSH;
1406uniform vec3 probesMin;
1407uniform vec3 probesMax;
1408uniform vec3 probesResolution;
1409vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1410	vec3 res = probesResolution;
1411	vec3 gridRange = probesMax - probesMin;
1412	vec3 resMinusOne = res - 1.0;
1413	vec3 probeSpacing = gridRange / resMinusOne;
1414	vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;
1415	vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );
1416	uvw = uvw * resMinusOne / res + 0.5 / res;
1417	float nz          = res.z;
1418	float paddedSlices = nz + 2.0;
1419	float atlasDepth  = 7.0 * paddedSlices;
1420	float uvZBase     = uvw.z * nz + 1.0;
1421	vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase                       ) / atlasDepth ) );
1422	vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase +       paddedSlices   ) / atlasDepth ) );
1423	vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices   ) / atlasDepth ) );
1424	vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices   ) / atlasDepth ) );
1425	vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices   ) / atlasDepth ) );
1426	vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices   ) / atlasDepth ) );
1427	vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices   ) / atlasDepth ) );
1428	vec3 c0 = s0.xyz;
1429	vec3 c1 = vec3( s0.w, s1.xy );
1430	vec3 c2 = vec3( s1.zw, s2.x );
1431	vec3 c3 = s2.yzw;
1432	vec3 c4 = s3.xyz;
1433	vec3 c5 = vec3( s3.w, s4.xy );
1434	vec3 c6 = vec3( s4.zw, s5.x );
1435	vec3 c7 = s5.yzw;
1436	vec3 c8 = s6.xyz;
1437	float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;
1438	vec3 result = c0 * 0.886227;
1439	result += c1 * 2.0 * 0.511664 * y;
1440	result += c2 * 2.0 * 0.511664 * z;
1441	result += c3 * 2.0 * 0.511664 * x;
1442	result += c4 * 2.0 * 0.429043 * x * y;
1443	result += c5 * 2.0 * 0.429043 * y * z;
1444	result += c6 * ( 0.743125 * z * z - 0.247708 );
1445	result += c7 * 2.0 * 0.429043 * x * z;
1446	result += c8 * 0.429043 * ( x * x - y * y );
1447	return max( result, vec3( 0.0 ) );
1448}
1449#endif`,logdepthbuf_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1450	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1451#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1452	uniform float logDepthBufFC;
1453	varying float vFragDepth;
1454	varying float vIsPerspective;
1455#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1456	varying float vFragDepth;
1457	varying float vIsPerspective;
1458#endif`,logdepthbuf_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1459	vFragDepth = 1.0 + gl_Position.w;
1460	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1461#endif`,map_fragment:`#ifdef USE_MAP
1462	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1463	#ifdef DECODE_VIDEO_TEXTURE
1464		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1465	#endif
1466	diffuseColor *= sampledDiffuseColor;
1467#endif`,map_pars_fragment:`#ifdef USE_MAP
1468	uniform sampler2D map;
1469#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1470	#if defined( USE_POINTS_UV )
1471		vec2 uv = vUv;
1472	#else
1473		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1474	#endif
1475#endif
1476#ifdef USE_MAP
1477	diffuseColor *= texture2D( map, uv );
1478#endif
1479#ifdef USE_ALPHAMAP
1480	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1481#endif`,map_particle_pars_fragment:`#if defined( USE_POINTS_UV )
1482	varying vec2 vUv;
1483#else
1484	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1485		uniform mat3 uvTransform;
1486	#endif
1487#endif
1488#ifdef USE_MAP
1489	uniform sampler2D map;
1490#endif
1491#ifdef USE_ALPHAMAP
1492	uniform sampler2D alphaMap;
1493#endif`,metalnessmap_fragment:`float metalnessFactor = metalness;
1494#ifdef USE_METALNESSMAP
1495	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1496	metalnessFactor *= texelMetalness.b;
1497#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP
1498	uniform sampler2D metalnessMap;
1499#endif`,morphinstance_vertex:`#ifdef USE_INSTANCING_MORPH
1500	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1501	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1502	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1503		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1504	}
1505#endif`,morphcolor_vertex:`#if defined( USE_MORPHCOLORS )
1506	vColor *= morphTargetBaseInfluence;
1507	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1508		#if defined( USE_COLOR_ALPHA )
1509			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1510		#elif defined( USE_COLOR )
1511			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1512		#endif
1513	}
1514#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS
1515	objectNormal *= morphTargetBaseInfluence;
1516	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1517		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1518	}
1519#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS
1520	#ifndef USE_INSTANCING_MORPH
1521		uniform float morphTargetBaseInfluence;
1522		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1523	#endif
1524	uniform sampler2DArray morphTargetsTexture;
1525	uniform ivec2 morphTargetsTextureSize;
1526	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1527		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1528		int y = texelIndex / morphTargetsTextureSize.x;
1529		int x = texelIndex - y * morphTargetsTextureSize.x;
1530		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1531		return texelFetch( morphTargetsTexture, morphUV, 0 );
1532	}
1533#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS
1534	transformed *= morphTargetBaseInfluence;
1535	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1536		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1537	}
1538#endif`,normal_fragment_begin:`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1539#ifdef FLAT_SHADED
1540	vec3 fdx = dFdx( vViewPosition );
1541	vec3 fdy = dFdy( vViewPosition );
1542	vec3 normal = normalize( cross( fdx, fdy ) );
1543#else
1544	vec3 normal = normalize( vNormal );
1545	#ifdef DOUBLE_SIDED
1546		normal *= faceDirection;
1547	#endif
1548#endif
1549#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1550	#ifdef USE_TANGENT
1551		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1552	#else
1553		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1554		#if defined( USE_NORMALMAP )
1555			vNormalMapUv
1556		#elif defined( USE_CLEARCOAT_NORMALMAP )
1557			vClearcoatNormalMapUv
1558		#else
1559			vUv
1560		#endif
1561		);
1562	#endif
1563	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1564		tbn[0] *= faceDirection;
1565		tbn[1] *= faceDirection;
1566	#endif
1567#endif
1568#ifdef USE_CLEARCOAT_NORMALMAP
1569	#ifdef USE_TANGENT
1570		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1571	#else
1572		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1573	#endif
1574	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1575		tbn2[0] *= faceDirection;
1576		tbn2[1] *= faceDirection;
1577	#endif
1578#endif
1579vec3 nonPerturbedNormal = normal;`,normal_fragment_maps:`#ifdef USE_NORMALMAP_OBJECTSPACE
1580	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1581	#ifdef FLIP_SIDED
1582		normal = - normal;
1583	#endif
1584	#ifdef DOUBLE_SIDED
1585		normal = normal * faceDirection;
1586	#endif
1587	normal = normalize( normalMatrix * normal );
1588#elif defined( USE_NORMALMAP_TANGENTSPACE )
1589	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1590	#if defined( USE_PACKED_NORMALMAP )
1591		mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );
1592	#endif
vendor: 4,891 bytes, lines 1592-1725
1592
1593	mapN.xy *= normalScale;
1594	normal = normalize( tbn * mapN );
1595#elif defined( USE_BUMPMAP )
1596	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1597#endif`,normal_pars_fragment:`#ifndef FLAT_SHADED
1598	varying vec3 vNormal;
1599	#ifdef USE_TANGENT
1600		varying vec3 vTangent;
1601		varying vec3 vBitangent;
1602	#endif
1603#endif`,normal_pars_vertex:`#ifndef FLAT_SHADED
1604	varying vec3 vNormal;
1605	#ifdef USE_TANGENT
1606		varying vec3 vTangent;
1607		varying vec3 vBitangent;
1608	#endif
1609#endif`,normal_vertex:`#ifndef FLAT_SHADED
1610	vNormal = normalize( transformedNormal );
1611	#ifdef USE_TANGENT
1612		vTangent = normalize( transformedTangent );
1613		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1614	#endif
1615#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP
1616	uniform sampler2D normalMap;
1617	uniform vec2 normalScale;
1618#endif
1619#ifdef USE_NORMALMAP_OBJECTSPACE
1620	uniform mat3 normalMatrix;
1621#endif
1622#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1623	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1624		vec3 q0 = dFdx( eye_pos.xyz );
1625		vec3 q1 = dFdy( eye_pos.xyz );
1626		vec2 st0 = dFdx( uv.st );
1627		vec2 st1 = dFdy( uv.st );
1628		vec3 N = surf_norm;
1629		vec3 q1perp = cross( q1, N );
1630		vec3 q0perp = cross( N, q0 );
1631		vec3 T = q1perp * st0.x + q0perp * st1.x;
1632		vec3 B = q1perp * st0.y + q0perp * st1.y;
1633		float det = max( dot( T, T ), dot( B, B ) );
1634		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1635		return mat3( T * scale, B * scale, N );
1636	}
1637#endif`,clearcoat_normal_fragment_begin:`#ifdef USE_CLEARCOAT
1638	vec3 clearcoatNormal = nonPerturbedNormal;
1639#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP
1640	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1641	clearcoatMapN.xy *= clearcoatNormalScale;
1642	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1643#endif`,clearcoat_pars_fragment:`#ifdef USE_CLEARCOATMAP
1644	uniform sampler2D clearcoatMap;
1645#endif
1646#ifdef USE_CLEARCOAT_NORMALMAP
1647	uniform sampler2D clearcoatNormalMap;
1648	uniform vec2 clearcoatNormalScale;
1649#endif
1650#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1651	uniform sampler2D clearcoatRoughnessMap;
1652#endif`,iridescence_pars_fragment:`#ifdef USE_IRIDESCENCEMAP
1653	uniform sampler2D iridescenceMap;
1654#endif
1655#ifdef USE_IRIDESCENCE_THICKNESSMAP
1656	uniform sampler2D iridescenceThicknessMap;
1657#endif`,opaque_fragment:`#ifdef OPAQUE
1658diffuseColor.a = 1.0;
1659#endif
1660#ifdef USE_TRANSMISSION
1661diffuseColor.a *= material.transmissionAlpha;
1662#endif
1663gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,packing:`vec3 packNormalToRGB( const in vec3 normal ) {
1664	return normalize( normal ) * 0.5 + 0.5;
1665}
1666vec3 unpackRGBToNormal( const in vec3 rgb ) {
1667	return 2.0 * rgb.xyz - 1.0;
1668}
1669const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
1670const float Inv255 = 1. / 255.;
1671const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
1672const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
1673const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
1674const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
1675vec4 packDepthToRGBA( const in float v ) {
1676	if( v <= 0.0 )
1677		return vec4( 0., 0., 0., 0. );
1678	if( v >= 1.0 )
1679		return vec4( 1., 1., 1., 1. );
1680	float vuf;
1681	float af = modf( v * PackFactors.a, vuf );
1682	float bf = modf( vuf * ShiftRight8, vuf );
1683	float gf = modf( vuf * ShiftRight8, vuf );
1684	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
1685}
1686vec3 packDepthToRGB( const in float v ) {
1687	if( v <= 0.0 )
1688		return vec3( 0., 0., 0. );
1689	if( v >= 1.0 )
1690		return vec3( 1., 1., 1. );
1691	float vuf;
1692	float bf = modf( v * PackFactors.b, vuf );
1693	float gf = modf( vuf * ShiftRight8, vuf );
1694	return vec3( vuf * Inv255, gf * PackUpscale, bf );
1695}
1696vec2 packDepthToRG( const in float v ) {
1697	if( v <= 0.0 )
1698		return vec2( 0., 0. );
1699	if( v >= 1.0 )
1700		return vec2( 1., 1. );
1701	float vuf;
1702	float gf = modf( v * 256., vuf );
1703	return vec2( vuf * Inv255, gf );
1704}
1705float unpackRGBAToDepth( const in vec4 v ) {
1706	return dot( v, UnpackFactors4 );
1707}
1708float unpackRGBToDepth( const in vec3 v ) {
1709	return dot( v, UnpackFactors3 );
1710}
1711float unpackRGToDepth( const in vec2 v ) {
1712	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
1713}
1714vec4 pack2HalfToRGBA( const in vec2 v ) {
1715	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
1716	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
1717}
1718vec2 unpackRGBATo2Half( const in vec4 v ) {
1719	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
1720}
1721float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
1722	return ( viewZ + near ) / ( near - far );
1723}
1724float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
1725	
1725#ifdef USE_REVERSED_DEPTH_BUFFER
1726	
1727		return depth * ( far - near ) - far;
1728	#else
1729		return depth * ( near - far ) - near;
1730	#endif
1731}
1732float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
1733	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
1734}
1735float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1736	
1737	#ifdef USE_REVERSED_DEPTH_BUFFER
1738		return ( near * far ) / ( ( near - far ) * depth - near );
1739	#else
1740		return ( near * far ) / ( ( far - near ) * depth - far );
1741	#endif
1742}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA
1743	gl_FragColor.rgb *= gl_FragColor.a;
1744#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 );
1745#ifdef USE_BATCHING
1746	mvPosition = batchingMatrix * mvPosition;
1747#endif
1748#ifdef USE_INSTANCING
1749	mvPosition = instanceMatrix * mvPosition;
1750#endif
1751mvPosition = modelViewMatrix * mvPosition;
1752gl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING
1753	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1754#endif`,dithering_pars_fragment:`#ifdef DITHERING
1755	vec3 dithering( vec3 color ) {
1756		float grid_position = rand( gl_FragCoord.xy );
1757		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1758		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1759		return color + dither_shift_RGB;
1760	}
1761#endif`,roughnessmap_fragment:`float roughnessFactor = roughness;
1762#ifdef USE_ROUGHNESSMAP
1763	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1764	roughnessFactor *= texelRoughness.g;
1765#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP
1766	uniform sampler2D roughnessMap;
1767#endif`,shadowmap_pars_fragment:`#if NUM_SPOT_LIGHT_COORDS > 0
1768	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1769#endif
1770#if NUM_SPOT_LIGHT_MAPS > 0
1771	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
1772#endif
1773#ifdef USE_SHADOWMAP
1774	#if NUM_DIR_LIGHT_SHADOWS > 0
1775		#if defined( SHADOWMAP_TYPE_PCF )
1776			uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1777		#else
1778			uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1779		#endif
1780		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1781		struct DirectionalLightShadow {
1782			float shadowIntensity;
1783			float shadowBias;
1784			float shadowNormalBias;
1785			float shadowRadius;
1786			vec2 shadowMapSize;
1787		};
1788		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1789	#endif
1790	#if NUM_SPOT_LIGHT_SHADOWS > 0
1791		#if defined( SHADOWMAP_TYPE_PCF )
1792			uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1793		#else
1794			uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1795		#endif
1796		struct SpotLightShadow {
1797			float shadowIntensity;
1798			float shadowBias;
1799			float shadowNormalBias;
1800			float shadowRadius;
1801			vec2 shadowMapSize;
1802		};
1803		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1804	#endif
1805	#if NUM_POINT_LIGHT_SHADOWS > 0
1806		#if defined( SHADOWMAP_TYPE_PCF )
1807			uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1808		#elif defined( SHADOWMAP_TYPE_BASIC )
1809			uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1810		#endif
1811		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1812		struct PointLightShadow {
1813			float shadowIntensity;
1814			float shadowBias;
1815			float shadowNormalBias;
1816			float shadowRadius;
1817			vec2 shadowMapSize;
1818			float shadowCameraNear;
1819			float shadowCameraFar;
1820		};
1821		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1822	#endif
1823	#if defined( SHADOWMAP_TYPE_PCF )
1824		float interleavedGradientNoise( vec2 position ) {
1825			return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );
1826		}
1827		vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {
1828			const float goldenAngle = 2.399963229728653;
1829			float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );
1830			float theta = float( sampleIndex ) * goldenAngle + phi;
1831			return vec2( cos( theta ), sin( theta ) ) * r;
1832		}
1833	#endif
1834	#if defined( SHADOWMAP_TYPE_PCF )
1835		float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1836			float shadow = 1.0;
1837			shadowCoord.xyz /= shadowCoord.w;
1838			shadowCoord.z += shadowBias;
1839			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1840			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1841			if ( frustumTest ) {
1842				vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1843				float radius = shadowRadius * texelSize.x;
1844				float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
1845				shadow = (
1846					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +
1847					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +
1848					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +
1849					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +
1850					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )
1851				) * 0.2;
1852			}
1853			return mix( 1.0, shadow, shadowIntensity );
1854		}
1855	#elif defined( SHADOWMAP_TYPE_VSM )
1856		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1857			float shadow = 1.0;
1858			shadowCoord.xyz /= shadowCoord.w;
1859			#ifdef USE_REVERSED_DEPTH_BUFFER
1860				shadowCoord.z -= shadowBias;
1861			#else
1862				shadowCoord.z += shadowBias;
1863			#endif
1864			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1865			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1866			if ( frustumTest ) {
1867				vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;
1868				float mean = distribution.x;
1869				float variance = distribution.y * distribution.y;
1870				#ifdef USE_REVERSED_DEPTH_BUFFER
1871					float hard_shadow = step( mean, shadowCoord.z );
1872				#else
1873					float hard_shadow = step( shadowCoord.z, mean );
1874				#endif
1875				
1876				if ( hard_shadow == 1.0 ) {
1877					shadow = 1.0;
1878				} else {
1879					variance = max( variance, 0.0000001 );
1880					float d = shadowCoord.z - mean;
1881					float p_max = variance / ( variance + d * d );
1882					p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );
1883					shadow = max( hard_shadow, p_max );
1884				}
1885			}
1886			return mix( 1.0, shadow, shadowIntensity );
1887		}
1888	#else
1889		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1890			float shadow = 1.0;
1891			shadowCoord.xyz /= shadowCoord.w;
1892			#ifdef USE_REVERSED_DEPTH_BUFFER
1893				shadowCoord.z -= shadowBias;
1894			#else
1895				shadowCoord.z += shadowBias;
1896			#endif
1897			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1898			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1899			if ( frustumTest ) {
1900				float depth = texture2D( shadowMap, shadowCoord.xy ).r;
1901				#ifdef USE_REVERSED_DEPTH_BUFFER
1902					shadow = step( depth, shadowCoord.z );
1903				#else
1904					shadow = step( shadowCoord.z, depth );
1905				#endif
1906			}
1907			return mix( 1.0, shadow, shadowIntensity );
1908		}
1909	#endif
1910	#if NUM_POINT_LIGHT_SHADOWS > 0
1911	#if defined( SHADOWMAP_TYPE_PCF )
1912	float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1913		float shadow = 1.0;
1914		vec3 lightToPosition = shadowCoord.xyz;
1915		vec3 bd3D = normalize( lightToPosition );
1916		vec3 absVec = abs( lightToPosition );
1917		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
1918		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
1919			#ifdef USE_REVERSED_DEPTH_BUFFER
1920				float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1921				dp -= shadowBias;
1922			#else
1923				float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1924				dp += shadowBias;
1925			#endif
1926			float texelSize = shadowRadius / shadowMapSize.x;
1927			vec3 absDir = abs( bd3D );
1928			vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );
1929			tangent = normalize( cross( bd3D, tangent ) );
1930			vec3 bitangent = cross( bd3D, tangent );
1931			float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
1932			vec2 sample0 = vogelDiskSample( 0, 5, phi );
1933			vec2 sample1 = vogelDiskSample( 1, 5, phi );
1934			vec2 sample2 = vogelDiskSample( 2, 5, phi );
1935			vec2 sample3 = vogelDiskSample( 3, 5, phi );
1936			vec2 sample4 = vogelDiskSample( 4, 5, phi );
1937			shadow = (
1938				texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +
1939				texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +
1940				texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +
1941				texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +
1942				texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )
1943			) * 0.2;
1944		}
1945		return mix( 1.0, shadow, shadowIntensity );
1946	}
1947	#elif defined( SHADOWMAP_TYPE_BASIC )
1948	float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1949		float shadow = 1.0;
1950		vec3 lightToPosition = shadowCoord.xyz;
1951		vec3 absVec = abs( lightToPosition );
1952		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
1953		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
1954			float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1955			dp += shadowBias;
1956			vec3 bd3D = normalize( lightToPosition );
1957			float depth = textureCube( shadowMap, bd3D ).r;
1958			#ifdef USE_REVERSED_DEPTH_BUFFER
1959				depth = 1.0 - depth;
1960			#endif
1961			shadow = step( dp, depth );
1962		}
1963		return mix( 1.0, shadow, shadowIntensity );
1964	}
1965	#endif
1966	#endif
1967#endif`,shadowmap_pars_vertex:`#if NUM_SPOT_LIGHT_COORDS > 0
1968	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1969	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1970#endif
1971#ifdef USE_SHADOWMAP
1972	#if NUM_DIR_LIGHT_SHADOWS > 0
1973		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
1974		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1975		struct DirectionalLightShadow {
1976			float shadowIntensity;
1977			float shadowBias;
1978			float shadowNormalBias;
1979			float shadowRadius;
1980			vec2 shadowMapSize;
1981		};
1982		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1983	#endif
1984	#if NUM_SPOT_LIGHT_SHADOWS > 0
1985		struct SpotLightShadow {
1986			float shadowIntensity;
1987			float shadowBias;
1988			float shadowNormalBias;
1989			float shadowRadius;
1990			vec2 shadowMapSize;
1991		};
1992		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1993	#endif
1994	#if NUM_POINT_LIGHT_SHADOWS > 0
1995		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
1996		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1997		struct PointLightShadow {
1998			float shadowIntensity;
1999			float shadowBias;
2000			float shadowNormalBias;
2001			float shadowRadius;
2002			vec2 shadowMapSize;
2003			float shadowCameraNear;
2004			float shadowCameraFar;
2005		};
2006		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
2007	#endif
2008#endif`,shadowmap_vertex:`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
2009	#ifdef HAS_NORMAL
2010		vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
2011	#else
2012		vec3 shadowWorldNormal = vec3( 0.0 );
2013	#endif
vendor: 15,483 bytes, lines 2013-2375
2013
2014	vec4 shadowWorldPosition;
2015#endif
2016#if defined( USE_SHADOWMAP )
2017	#if NUM_DIR_LIGHT_SHADOWS > 0
2018		#pragma unroll_loop_start
2019		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2020			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
2021			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
2022		}
2023		#pragma unroll_loop_end
2024	#endif
2025	#if NUM_POINT_LIGHT_SHADOWS > 0
2026		#pragma unroll_loop_start
2027		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2028			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
2029			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
2030		}
2031		#pragma unroll_loop_end
2032	#endif
2033#endif
2034#if NUM_SPOT_LIGHT_COORDS > 0
2035	#pragma unroll_loop_start
2036	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
2037		shadowWorldPosition = worldPosition;
2038		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
2039			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
2040		#endif
2041		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
2042	}
2043	#pragma unroll_loop_end
2044#endif`,shadowmask_pars_fragment:`float getShadowMask() {
2045	float shadow = 1.0;
2046	#ifdef USE_SHADOWMAP
2047	#if NUM_DIR_LIGHT_SHADOWS > 0
2048	DirectionalLightShadow directionalLight;
2049	#pragma unroll_loop_start
2050	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2051		directionalLight = directionalLightShadows[ i ];
2052		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
2053	}
2054	#pragma unroll_loop_end
2055	#endif
2056	#if NUM_SPOT_LIGHT_SHADOWS > 0
2057	SpotLightShadow spotLight;
2058	#pragma unroll_loop_start
2059	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
2060		spotLight = spotLightShadows[ i ];
2061		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
2062	}
2063	#pragma unroll_loop_end
2064	#endif
2065	#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
2066	PointLightShadow pointLight;
2067	#pragma unroll_loop_start
2068	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2069		pointLight = pointLightShadows[ i ];
2070		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
2071	}
2072	#pragma unroll_loop_end
2073	#endif
2074	#endif
2075	return shadow;
2076}`,skinbase_vertex:`#ifdef USE_SKINNING
2077	mat4 boneMatX = getBoneMatrix( skinIndex.x );
2078	mat4 boneMatY = getBoneMatrix( skinIndex.y );
2079	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2080	mat4 boneMatW = getBoneMatrix( skinIndex.w );
2081#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING
2082	uniform mat4 bindMatrix;
2083	uniform mat4 bindMatrixInverse;
2084	uniform highp sampler2D boneTexture;
2085	mat4 getBoneMatrix( const in float i ) {
2086		int size = textureSize( boneTexture, 0 ).x;
2087		int j = int( i ) * 4;
2088		int x = j % size;
2089		int y = j / size;
2090		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
2091		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
2092		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
2093		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2094		return mat4( v1, v2, v3, v4 );
2095	}
2096#endif`,skinning_vertex:`#ifdef USE_SKINNING
2097	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2098	vec4 skinned = vec4( 0.0 );
2099	skinned += boneMatX * skinVertex * skinWeight.x;
2100	skinned += boneMatY * skinVertex * skinWeight.y;
2101	skinned += boneMatZ * skinVertex * skinWeight.z;
2102	skinned += boneMatW * skinVertex * skinWeight.w;
2103	transformed = ( bindMatrixInverse * skinned ).xyz;
2104#endif`,skinnormal_vertex:`#ifdef USE_SKINNING
2105	mat4 skinMatrix = mat4( 0.0 );
2106	skinMatrix += skinWeight.x * boneMatX;
2107	skinMatrix += skinWeight.y * boneMatY;
2108	skinMatrix += skinWeight.z * boneMatZ;
2109	skinMatrix += skinWeight.w * boneMatW;
2110	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
2111	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
2112	#ifdef USE_TANGENT
2113		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2114	#endif
2115#endif`,specularmap_fragment:`float specularStrength;
2116#ifdef USE_SPECULARMAP
2117	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2118	specularStrength = texelSpecular.r;
2119#else
2120	specularStrength = 1.0;
2121#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP
2122	uniform sampler2D specularMap;
2123#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING )
2124	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2125#endif`,tonemapping_pars_fragment:`#ifndef saturate
2126#define saturate( a ) clamp( a, 0.0, 1.0 )
2127#endif
2128uniform float toneMappingExposure;
2129vec3 LinearToneMapping( vec3 color ) {
2130	return saturate( toneMappingExposure * color );
2131}
2132vec3 ReinhardToneMapping( vec3 color ) {
2133	color *= toneMappingExposure;
2134	return saturate( color / ( vec3( 1.0 ) + color ) );
2135}
2136vec3 CineonToneMapping( vec3 color ) {
2137	color *= toneMappingExposure;
2138	color = max( vec3( 0.0 ), color - 0.004 );
2139	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2140}
2141vec3 RRTAndODTFit( vec3 v ) {
2142	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2143	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2144	return a / b;
2145}
2146vec3 ACESFilmicToneMapping( vec3 color ) {
2147	const mat3 ACESInputMat = mat3(
2148		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2149		vec3( 0.04823, 0.01566, 0.83777 )
2150	);
2151	const mat3 ACESOutputMat = mat3(
2152		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2153		vec3( -0.07367, -0.00605,  1.07602 )
2154	);
2155	color *= toneMappingExposure / 0.6;
2156	color = ACESInputMat * color;
2157	color = RRTAndODTFit( color );
2158	color = ACESOutputMat * color;
2159	return saturate( color );
2160}
2161const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2162	vec3( 1.6605, - 0.1246, - 0.0182 ),
2163	vec3( - 0.5876, 1.1329, - 0.1006 ),
2164	vec3( - 0.0728, - 0.0083, 1.1187 )
2165);
2166const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2167	vec3( 0.6274, 0.0691, 0.0164 ),
2168	vec3( 0.3293, 0.9195, 0.0880 ),
2169	vec3( 0.0433, 0.0113, 0.8956 )
2170);
2171vec3 agxDefaultContrastApprox( vec3 x ) {
2172	vec3 x2 = x * x;
2173	vec3 x4 = x2 * x2;
2174	return + 15.5 * x4 * x2
2175		- 40.14 * x4 * x
2176		+ 31.96 * x4
2177		- 6.868 * x2 * x
2178		+ 0.4298 * x2
2179		+ 0.1191 * x
2180		- 0.00232;
2181}
2182vec3 AgXToneMapping( vec3 color ) {
2183	const mat3 AgXInsetMatrix = mat3(
2184		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2185		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2186		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2187	);
2188	const mat3 AgXOutsetMatrix = mat3(
2189		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2190		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2191		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2192	);
2193	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2194	color *= toneMappingExposure;
2195	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2196	color = AgXInsetMatrix * color;
2197	color = max( color, 1e-10 );	color = log2( color );
2198	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2199	color = clamp( color, 0.0, 1.0 );
2200	color = agxDefaultContrastApprox( color );
2201	color = AgXOutsetMatrix * color;
2202	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2203	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2204	color = clamp( color, 0.0, 1.0 );
2205	return color;
2206}
2207vec3 NeutralToneMapping( vec3 color ) {
2208	const float StartCompression = 0.8 - 0.04;
2209	const float Desaturation = 0.15;
2210	color *= toneMappingExposure;
2211	float x = min( color.r, min( color.g, color.b ) );
2212	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
2213	color -= offset;
2214	float peak = max( color.r, max( color.g, color.b ) );
2215	if ( peak < StartCompression ) return color;
2216	float d = 1. - StartCompression;
2217	float newPeak = 1. - d * d / ( peak + d - StartCompression );
2218	color *= newPeak / peak;
2219	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2220	return mix( color, vec3( newPeak ), g );
2221}
2222vec3 CustomToneMapping( vec3 color ) { return color; }`,transmission_fragment:`#ifdef USE_TRANSMISSION
2223	material.transmission = transmission;
2224	material.transmissionAlpha = 1.0;
2225	material.thickness = thickness;
2226	material.attenuationDistance = attenuationDistance;
2227	material.attenuationColor = attenuationColor;
2228	#ifdef USE_TRANSMISSIONMAP
2229		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2230	#endif
2231	#ifdef USE_THICKNESSMAP
2232		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2233	#endif
2234	vec3 pos = vWorldPosition;
2235	vec3 v = normalize( cameraPosition - pos );
2236	vec3 n = inverseTransformDirection( normal, viewMatrix );
2237	vec4 transmitted = getIBLVolumeRefraction(
2238		n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,
2239		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
2240		material.attenuationColor, material.attenuationDistance );
2241	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2242	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2243#endif`,transmission_pars_fragment:`#ifdef USE_TRANSMISSION
2244	uniform float transmission;
2245	uniform float thickness;
2246	uniform float attenuationDistance;
2247	uniform vec3 attenuationColor;
2248	#ifdef USE_TRANSMISSIONMAP
2249		uniform sampler2D transmissionMap;
2250	#endif
2251	#ifdef USE_THICKNESSMAP
2252		uniform sampler2D thicknessMap;
2253	#endif
2254	uniform vec2 transmissionSamplerSize;
2255	uniform sampler2D transmissionSamplerMap;
2256	uniform mat4 modelMatrix;
2257	uniform mat4 projectionMatrix;
2258	varying vec3 vWorldPosition;
2259	float w0( float a ) {
2260		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2261	}
2262	float w1( float a ) {
2263		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2264	}
2265	float w2( float a ){
2266		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2267	}
2268	float w3( float a ) {
2269		return ( 1.0 / 6.0 ) * ( a * a * a );
2270	}
2271	float g0( float a ) {
2272		return w0( a ) + w1( a );
2273	}
2274	float g1( float a ) {
2275		return w2( a ) + w3( a );
2276	}
2277	float h0( float a ) {
2278		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2279	}
2280	float h1( float a ) {
2281		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2282	}
2283	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2284		uv = uv * texelSize.zw + 0.5;
2285		vec2 iuv = floor( uv );
2286		vec2 fuv = fract( uv );
2287		float g0x = g0( fuv.x );
2288		float g1x = g1( fuv.x );
2289		float h0x = h0( fuv.x );
2290		float h1x = h1( fuv.x );
2291		float h0y = h0( fuv.y );
2292		float h1y = h1( fuv.y );
2293		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2294		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2295		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2296		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2297		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2298			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2299	}
2300	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2301		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2302		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2303		vec2 fLodSizeInv = 1.0 / fLodSize;
2304		vec2 cLodSizeInv = 1.0 / cLodSize;
2305		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2306		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2307		return mix( fSample, cSample, fract( lod ) );
2308	}
2309	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2310		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2311		vec3 modelScale;
2312		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2313		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2314		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2315		return normalize( refractionVector ) * thickness * modelScale;
2316	}
2317	float applyIorToRoughness( const in float roughness, const in float ior ) {
2318		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2319	}
2320	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2321		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2322		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2323	}
2324	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2325		if ( isinf( attenuationDistance ) ) {
2326			return vec3( 1.0 );
2327		} else {
2328			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2329			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2330		}
2331	}
2332	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2333		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2334		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
2335		const in vec3 attenuationColor, const in float attenuationDistance ) {
2336		vec4 transmittedLight;
2337		vec3 transmittance;
2338		#ifdef USE_DISPERSION
2339			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
2340			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
2341			for ( int i = 0; i < 3; i ++ ) {
2342				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
2343				vec3 refractedRayExit = position + transmissionRay;
2344				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2345				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2346				refractionCoords += 1.0;
2347				refractionCoords /= 2.0;
2348				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
2349				transmittedLight[ i ] = transmissionSample[ i ];
2350				transmittedLight.a += transmissionSample.a;
2351				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
2352			}
2353			transmittedLight.a /= 3.0;
2354		#else
2355			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2356			vec3 refractedRayExit = position + transmissionRay;
2357			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2358			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2359			refractionCoords += 1.0;
2360			refractionCoords /= 2.0;
2361			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2362			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2363		#endif
2364		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2365		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2366		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2367		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2368	}
2369#endif`,uv_pars_fragment:`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2370	varying vec2 vUv;
2371#endif
2372#ifdef USE_MAP
2373	varying vec2 vMapUv;
2374#endif
2375#ifdef USE_ALPHAMAP
vendor: 8,035 bytes, lines 2376-2642
2376	varying vec2 vAlphaMapUv;
2377#endif
2378#ifdef USE_LIGHTMAP
2379	varying vec2 vLightMapUv;
2380#endif
2381#ifdef USE_AOMAP
2382	varying vec2 vAoMapUv;
2383#endif
2384#ifdef USE_BUMPMAP
2385	varying vec2 vBumpMapUv;
2386#endif
2387#ifdef USE_NORMALMAP
2388	varying vec2 vNormalMapUv;
2389#endif
2390#ifdef USE_EMISSIVEMAP
2391	varying vec2 vEmissiveMapUv;
2392#endif
2393#ifdef USE_METALNESSMAP
2394	varying vec2 vMetalnessMapUv;
2395#endif
2396#ifdef USE_ROUGHNESSMAP
2397	varying vec2 vRoughnessMapUv;
2398#endif
2399#ifdef USE_ANISOTROPYMAP
2400	varying vec2 vAnisotropyMapUv;
2401#endif
2402#ifdef USE_CLEARCOATMAP
2403	varying vec2 vClearcoatMapUv;
2404#endif
2405#ifdef USE_CLEARCOAT_NORMALMAP
2406	varying vec2 vClearcoatNormalMapUv;
2407#endif
2408#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2409	varying vec2 vClearcoatRoughnessMapUv;
2410#endif
2411#ifdef USE_IRIDESCENCEMAP
2412	varying vec2 vIridescenceMapUv;
2413#endif
2414#ifdef USE_IRIDESCENCE_THICKNESSMAP
2415	varying vec2 vIridescenceThicknessMapUv;
2416#endif
2417#ifdef USE_SHEEN_COLORMAP
2418	varying vec2 vSheenColorMapUv;
2419#endif
2420#ifdef USE_SHEEN_ROUGHNESSMAP
2421	varying vec2 vSheenRoughnessMapUv;
2422#endif
2423#ifdef USE_SPECULARMAP
2424	varying vec2 vSpecularMapUv;
2425#endif
2426#ifdef USE_SPECULAR_COLORMAP
2427	varying vec2 vSpecularColorMapUv;
2428#endif
2429#ifdef USE_SPECULAR_INTENSITYMAP
2430	varying vec2 vSpecularIntensityMapUv;
2431#endif
2432#ifdef USE_TRANSMISSIONMAP
2433	uniform mat3 transmissionMapTransform;
2434	varying vec2 vTransmissionMapUv;
2435#endif
2436#ifdef USE_THICKNESSMAP
2437	uniform mat3 thicknessMapTransform;
2438	varying vec2 vThicknessMapUv;
2439#endif`,uv_pars_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2440	varying vec2 vUv;
2441#endif
2442#ifdef USE_MAP
2443	uniform mat3 mapTransform;
2444	varying vec2 vMapUv;
2445#endif
2446#ifdef USE_ALPHAMAP
2447	uniform mat3 alphaMapTransform;
2448	varying vec2 vAlphaMapUv;
2449#endif
2450#ifdef USE_LIGHTMAP
2451	uniform mat3 lightMapTransform;
2452	varying vec2 vLightMapUv;
2453#endif
2454#ifdef USE_AOMAP
2455	uniform mat3 aoMapTransform;
2456	varying vec2 vAoMapUv;
2457#endif
2458#ifdef USE_BUMPMAP
2459	uniform mat3 bumpMapTransform;
2460	varying vec2 vBumpMapUv;
2461#endif
2462#ifdef USE_NORMALMAP
2463	uniform mat3 normalMapTransform;
2464	varying vec2 vNormalMapUv;
2465#endif
2466#ifdef USE_DISPLACEMENTMAP
2467	uniform mat3 displacementMapTransform;
2468	varying vec2 vDisplacementMapUv;
2469#endif
2470#ifdef USE_EMISSIVEMAP
2471	uniform mat3 emissiveMapTransform;
2472	varying vec2 vEmissiveMapUv;
2473#endif
2474#ifdef USE_METALNESSMAP
2475	uniform mat3 metalnessMapTransform;
2476	varying vec2 vMetalnessMapUv;
2477#endif
2478#ifdef USE_ROUGHNESSMAP
2479	uniform mat3 roughnessMapTransform;
2480	varying vec2 vRoughnessMapUv;
2481#endif
2482#ifdef USE_ANISOTROPYMAP
2483	uniform mat3 anisotropyMapTransform;
2484	varying vec2 vAnisotropyMapUv;
2485#endif
2486#ifdef USE_CLEARCOATMAP
2487	uniform mat3 clearcoatMapTransform;
2488	varying vec2 vClearcoatMapUv;
2489#endif
2490#ifdef USE_CLEARCOAT_NORMALMAP
2491	uniform mat3 clearcoatNormalMapTransform;
2492	varying vec2 vClearcoatNormalMapUv;
2493#endif
2494#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2495	uniform mat3 clearcoatRoughnessMapTransform;
2496	varying vec2 vClearcoatRoughnessMapUv;
2497#endif
2498#ifdef USE_SHEEN_COLORMAP
2499	uniform mat3 sheenColorMapTransform;
2500	varying vec2 vSheenColorMapUv;
2501#endif
2502#ifdef USE_SHEEN_ROUGHNESSMAP
2503	uniform mat3 sheenRoughnessMapTransform;
2504	varying vec2 vSheenRoughnessMapUv;
2505#endif
2506#ifdef USE_IRIDESCENCEMAP
2507	uniform mat3 iridescenceMapTransform;
2508	varying vec2 vIridescenceMapUv;
2509#endif
2510#ifdef USE_IRIDESCENCE_THICKNESSMAP
2511	uniform mat3 iridescenceThicknessMapTransform;
2512	varying vec2 vIridescenceThicknessMapUv;
2513#endif
2514#ifdef USE_SPECULARMAP
2515	uniform mat3 specularMapTransform;
2516	varying vec2 vSpecularMapUv;
2517#endif
2518#ifdef USE_SPECULAR_COLORMAP
2519	uniform mat3 specularColorMapTransform;
2520	varying vec2 vSpecularColorMapUv;
2521#endif
2522#ifdef USE_SPECULAR_INTENSITYMAP
2523	uniform mat3 specularIntensityMapTransform;
2524	varying vec2 vSpecularIntensityMapUv;
2525#endif
2526#ifdef USE_TRANSMISSIONMAP
2527	uniform mat3 transmissionMapTransform;
2528	varying vec2 vTransmissionMapUv;
2529#endif
2530#ifdef USE_THICKNESSMAP
2531	uniform mat3 thicknessMapTransform;
2532	varying vec2 vThicknessMapUv;
2533#endif`,uv_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2534	vUv = vec3( uv, 1 ).xy;
2535#endif
2536#ifdef USE_MAP
2537	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2538#endif
2539#ifdef USE_ALPHAMAP
2540	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2541#endif
2542#ifdef USE_LIGHTMAP
2543	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2544#endif
2545#ifdef USE_AOMAP
2546	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2547#endif
2548#ifdef USE_BUMPMAP
2549	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2550#endif
2551#ifdef USE_NORMALMAP
2552	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2553#endif
2554#ifdef USE_DISPLACEMENTMAP
2555	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2556#endif
2557#ifdef USE_EMISSIVEMAP
2558	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2559#endif
2560#ifdef USE_METALNESSMAP
2561	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2562#endif
2563#ifdef USE_ROUGHNESSMAP
2564	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2565#endif
2566#ifdef USE_ANISOTROPYMAP
2567	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2568#endif
2569#ifdef USE_CLEARCOATMAP
2570	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2571#endif
2572#ifdef USE_CLEARCOAT_NORMALMAP
2573	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2574#endif
2575#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2576	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2577#endif
2578#ifdef USE_IRIDESCENCEMAP
2579	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2580#endif
2581#ifdef USE_IRIDESCENCE_THICKNESSMAP
2582	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2583#endif
2584#ifdef USE_SHEEN_COLORMAP
2585	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2586#endif
2587#ifdef USE_SHEEN_ROUGHNESSMAP
2588	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2589#endif
2590#ifdef USE_SPECULARMAP
2591	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2592#endif
2593#ifdef USE_SPECULAR_COLORMAP
2594	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2595#endif
2596#ifdef USE_SPECULAR_INTENSITYMAP
2597	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2598#endif
2599#ifdef USE_TRANSMISSIONMAP
2600	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2601#endif
2602#ifdef USE_THICKNESSMAP
2603	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2604#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2605	vec4 worldPosition = vec4( transformed, 1.0 );
2606	#ifdef USE_BATCHING
2607		worldPosition = batchingMatrix * worldPosition;
2608	#endif
2609	#ifdef USE_INSTANCING
2610		worldPosition = instanceMatrix * worldPosition;
2611	#endif
2612	worldPosition = modelMatrix * worldPosition;
2613#endif`,background_vert:`varying vec2 vUv;
2614uniform mat3 uvTransform;
2615void main() {
2616	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2617	gl_Position = vec4( position.xy, 1.0, 1.0 );
2618}`,background_frag:`uniform sampler2D t2D;
2619uniform float backgroundIntensity;
2620varying vec2 vUv;
2621void main() {
2622	vec4 texColor = texture2D( t2D, vUv );
2623	#ifdef DECODE_VIDEO_TEXTURE
2624		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
2625	#endif
2626	texColor.rgb *= backgroundIntensity;
2627	gl_FragColor = texColor;
2628	#include <tonemapping_fragment>
2629	#include <colorspace_fragment>
2630}`,backgroundCube_vert:`varying vec3 vWorldDirection;
2631#include <common>
2632void main() {
2633	vWorldDirection = transformDirection( position, modelMatrix );
2634	#include <begin_vertex>
2635	#include <project_vertex>
2636	gl_Position.z = gl_Position.w;
2637}`,backgroundCube_frag:`#ifdef ENVMAP_TYPE_CUBE
2638	uniform samplerCube envMap;
2639#elif defined( ENVMAP_TYPE_CUBE_UV )
2640	uniform sampler2D envMap;
2641#endif
2642uniform float 
2642backgroundBlurriness;
2643uniform float backgroundIntensity;
2644uniform mat3 backgroundRotation;
2645varying vec3 vWorldDirection;
2646#include <cube_uv_reflection_fragment>
2647void main() {
2648	#ifdef ENVMAP_TYPE_CUBE
2649		vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );
2650	#elif defined( ENVMAP_TYPE_CUBE_UV )
2651		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
2652	#else
2653		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
2654	#endif
2655	texColor.rgb *= backgroundIntensity;
2656	gl_FragColor = texColor;
2657	#include <tonemapping_fragment>
2658	#include <colorspace_fragment>
2659}`,cube_vert:`varying vec3 vWorldDirection;
2660#include <common>
2661void main() {
2662	vWorldDirection = transformDirection( position, modelMatrix );
2663	#include <begin_vertex>
2664	#include <project_vertex>
2665	gl_Position.z = gl_Position.w;
2666}`,cube_frag:`uniform samplerCube tCube;
2667uniform float tFlip;
2668uniform float opacity;
2669varying vec3 vWorldDirection;
2670void main() {
2671	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
2672	gl_FragColor = texColor;
2673	gl_FragColor.a *= opacity;
2674	#include <tonemapping_fragment>
2675	#include <colorspace_fragment>
2676}`,depth_vert:`#include <common>
2677#include <batching_pars_vertex>
2678#include <uv_pars_vertex>
2679#include <displacementmap_pars_vertex>
2680#include <morphtarget_pars_vertex>
2681#include <skinning_pars_vertex>
2682#include <logdepthbuf_pars_vertex>
2683#include <clipping_planes_pars_vertex>
2684varying vec2 vHighPrecisionZW;
2685void main() {
2686	#include <uv_vertex>
2687	#include <batching_vertex>
2688	#include <skinbase_vertex>
2689	#include <morphinstance_vertex>
2690	#ifdef USE_DISPLACEMENTMAP
2691		#include <beginnormal_vertex>
2692		#include <morphnormal_vertex>
2693		#include <skinnormal_vertex>
2694	#endif
2695	#include <begin_vertex>
2696	#include <morphtarget_vertex>
2697	#include <skinning_vertex>
2698	#include <displacementmap_vertex>
2699	#include <project_vertex>
2700	#include <logdepthbuf_vertex>
2701	#include <clipping_planes_vertex>
2702	vHighPrecisionZW = gl_Position.zw;
2703}`,depth_frag:`#if DEPTH_PACKING == 3200
2704	uniform float opacity;
2705#endif
2706#include <common>
2707#include <packing>
2708#include <uv_pars_fragment>
2709#include <map_pars_fragment>
2710#include <alphamap_pars_fragment>
2711#include <alphatest_pars_fragment>
2712#include <alphahash_pars_fragment>
2713#include <logdepthbuf_pars_fragment>
2714#include <clipping_planes_pars_fragment>
2715varying vec2 vHighPrecisionZW;
2716void main() {
2717	vec4 diffuseColor = vec4( 1.0 );
2718	#include <clipping_planes_fragment>
2719	#if DEPTH_PACKING == 3200
2720		diffuseColor.a = opacity;
2721	#endif
2722	#include <map_fragment>
2723	#include <alphamap_fragment>
2724	#include <alphatest_fragment>
2725	#include <alphahash_fragment>
2726	#include <logdepthbuf_fragment>
2727	#ifdef USE_REVERSED_DEPTH_BUFFER
2728		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
2729	#else
2730		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
2731	#endif
2732	#if DEPTH_PACKING == 3200
2733		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
2734	#elif DEPTH_PACKING == 3201
2735		gl_FragColor = packDepthToRGBA( fragCoordZ );
2736	#elif DEPTH_PACKING == 3202
2737		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
2738	#elif DEPTH_PACKING == 3203
2739		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2740	#endif
2741}`,distance_vert:`#define DISTANCE
2742varying vec3 vWorldPosition;
2743#include <common>
2744#include <batching_pars_vertex>
2745#include <uv_pars_vertex>
2746#include <displacementmap_pars_vertex>
2747#include <morphtarget_pars_vertex>
2748#include <skinning_pars_vertex>
2749#include <clipping_planes_pars_vertex>
2750void main() {
2751	#include <uv_vertex>
2752	#include <batching_vertex>
2753	#include <skinbase_vertex>
2754	#include <morphinstance_vertex>
2755	#ifdef USE_DISPLACEMENTMAP
2756		#include <beginnormal_vertex>
2757		#include <morphnormal_vertex>
2758		#include <skinnormal_vertex>
2759	#endif
2760	#include <begin_vertex>
2761	#include <morphtarget_vertex>
2762	#include <skinning_vertex>
2763	#include <displacementmap_vertex>
2764	#include <project_vertex>
2765	#include <worldpos_vertex>
2766	#include <clipping_planes_vertex>
2767	vWorldPosition = worldPosition.xyz;
2768}`,distance_frag:`#define DISTANCE
2769uniform vec3 referencePosition;
2770uniform float nearDistance;
2771uniform float farDistance;
2772varying vec3 vWorldPosition;
2773#include <common>
2774#include <uv_pars_fragment>
2775#include <map_pars_fragment>
2776#include <alphamap_pars_fragment>
2777#include <alphatest_pars_fragment>
2778#include <alphahash_pars_fragment>
2779#include <clipping_planes_pars_fragment>
2780void main () {
2781	vec4 diffuseColor = vec4( 1.0 );
2782	#include <clipping_planes_fragment>
2783	#include <map_fragment>
2784	#include <alphamap_fragment>
2785	#include <alphatest_fragment>
2786	#include <alphahash_fragment>
2787	float dist = length( vWorldPosition - referencePosition );
2788	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2789	dist = saturate( dist );
2790	gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
2791}`,equirect_vert:`varying vec3 vWorldDirection;
2792#include <common>
2793void main() {
2794	vWorldDirection = transformDirection( position, modelMatrix );
2795	#include <begin_vertex>
2796	#include <project_vertex>
2797}`,equirect_frag:`uniform sampler2D tEquirect;
2798varying vec3 vWorldDirection;
2799#include <common>
2800void main() {
2801	vec3 direction = normalize( vWorldDirection );
2802	vec2 sampleUV = equirectUv( direction );
2803	gl_FragColor = texture2D( tEquirect, sampleUV );
2804	#include <tonemapping_fragment>
2805	#include <colorspace_fragment>
2806}`,linedashed_vert:`uniform float scale;
2807attribute float lineDistance;
2808varying float vLineDistance;
2809#include <common>
2810#include <uv_pars_vertex>
2811#include <color_pars_vertex>
2812#include <fog_pars_vertex>
2813#include <morphtarget_pars_vertex>
2814#include <logdepthbuf_pars_vertex>
2815#include <clipping_planes_pars_vertex>
2816void main() {
2817	vLineDistance = scale * lineDistance;
2818	#include <uv_vertex>
2819	#include <color_vertex>
2820	#include <morphinstance_vertex>
2821	#include <morphcolor_vertex>
2822	#include <begin_vertex>
2823	#include <morphtarget_vertex>
2824	#include <project_vertex>
2825	#include <logdepthbuf_vertex>
2826	#include <clipping_planes_vertex>
2827	#include <fog_vertex>
2828}`,linedashed_frag:`uniform vec3 diffuse;
2829uniform float opacity;
2830uniform float dashSize;
2831uniform float totalSize;
2832varying float vLineDistance;
2833#include <common>
2834#include <color_pars_fragment>
2835#include <uv_pars_fragment>
2836#include <map_pars_fragment>
2837#include <fog_pars_fragment>
2838#include <logdepthbuf_pars_fragment>
2839#include <clipping_planes_pars_fragment>
2840void main() {
2841	vec4 diffuseColor = vec4( diffuse, opacity );
2842	#include <clipping_planes_fragment>
2843	if ( mod( vLineDistance, totalSize ) > dashSize ) {
2844		discard;
2845	}
2846	vec3 outgoingLight = vec3( 0.0 );
2847	#include <logdepthbuf_fragment>
2848	#include <map_fragment>
2849	#include <color_fragment>
2850	outgoingLight = diffuseColor.rgb;
2851	#include <opaque_fragment>
2852	#include <tonemapping_fragment>
2853	#include <colorspace_fragment>
2854	#include <fog_fragment>
2855	#include <premultiplied_alpha_fragment>
2856}`,meshbasic_vert:`#include <common>
2857#include <batching_pars_vertex>
2858#include <uv_pars_vertex>
2859#include <envmap_pars_vertex>
2860#include <color_pars_vertex>
2861#include <fog_pars_vertex>
2862#include <morphtarget_pars_vertex>
2863#include <skinning_pars_vertex>
2864#include <logdepthbuf_pars_vertex>
2865#include <clipping_planes_pars_vertex>
2866void main() {
2867	#include <uv_vertex>
2868	#include <color_vertex>
2869	#include <morphinstance_vertex>
2870	#include <morphcolor_vertex>
2871	#include <batching_vertex>
2872	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
2873		#include <beginnormal_vertex>
2874		#include <morphnormal_vertex>
2875		#include <skinbase_vertex>
2876		#include <skinnormal_vertex>
2877		#include <defaultnormal_vertex>
2878	#endif
2879	#include <begin_vertex>
2880	#include <morphtarget_vertex>
2881	#include <skinning_vertex>
2882	#include <project_vertex>
2883	#include <logdepthbuf_vertex>
2884	#include <clipping_planes_vertex>
2885	#include <worldpos_vertex>
2886	#include <envmap_vertex>
2887	#include <fog_vertex>
2888}`,meshbasic_frag:`uniform vec3 diffuse;
2889uniform float opacity;
2890#ifndef FLAT_SHADED
2891	varying vec3 vNormal;
2892#endif
2893#include <common>
2894#include <dithering_pars_fragment>
2895#include <color_pars_fragment>
2896#include <uv_pars_fragment>
2897#include <map_pars_fragment>
2898#include <alphamap_pars_fragment>
2899#include <alphatest_pars_fragment>
2900#include <alphahash_pars_fragment>
2901#include <aomap_pars_fragment>
2902#include <lightmap_pars_fragment>
2903#include <envmap_common_pars_fragment>
2904#include <envmap_pars_fragment>
2905#include <fog_pars_fragment>
2906#include <specularmap_pars_fragment>
2907#include <logdepthbuf_pars_fragment>
2908#include <clipping_planes_pars_fragment>
2909void main() {
2910	vec4 diffuseColor = vec4( diffuse, opacity );
2911	#include <clipping_planes_fragment>
2912	#include <logdepthbuf_fragment>
2913	#include <map_fragment>
2914	#include <color_fragment>
2915	#include <alphamap_fragment>
2916	#include <alphatest_fragment>
2917	#include <alphahash_fragment>
2918	#include <specularmap_fragment>
2919	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2920	#ifdef USE_LIGHTMAP
2921		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
2922		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
2923	#else
2924		reflectedLight.indirectDiffuse += vec3( 1.0 );
2925	#endif
2926	#include <aomap_fragment>
2927	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
2928	vec3 outgoingLight = reflectedLight.indirectDiffuse;
2929	#include <envmap_fragment>
2930	#include <opaque_fragment>
2931	#include <tonemapping_fragment>
2932	#include <colorspace_fragment>
2933	#include <fog_fragment>
2934	#include <premultiplied_alpha_fragment>
2935	#include <dithering_fragment>
2936}`,meshlambert_vert:`#define LAMBERT
2937varying vec3 vViewPosition;
2938#include <common>
2939#include <batching_pars_vertex>
2940#include <uv_pars_vertex>
2941#include <displacementmap_pars_vertex>
2942#include <envmap_pars_vertex>
2943#include <color_pars_vertex>
2944#include <fog_pars_vertex>
2945#include <normal_pars_vertex>
2946#include <morphtarget_pars_vertex>
2947#include <skinning_pars_vertex>
2948#include <shadowmap_pars_vertex>
2949#include <logdepthbuf_pars_vertex>
2950#include <clipping_planes_pars_vertex>
2951void main() {
2952	#include <uv_vertex>
2953	#include <color_vertex>
2954	#include <morphinstance_vertex>
2955	#include <morphcolor_vertex>
2956	#include <batching_vertex>
2957	#include <beginnormal_vertex>
2958	#include <morphnormal_vertex>
2959	#include <skinbase_vertex>
2960	#include <skinnormal_vertex>
2961	#include <defaultnormal_vertex>
2962	#include <normal_vertex>
2963	#include <begin_vertex>
2964	#include <morphtarget_vertex>
2965	#include <skinning_vertex>
2966	#include <displacementmap_vertex>
2967	#include <project_vertex>
2968	#include <logdepthbuf_vertex>
2969	#include <clipping_planes_vertex>
2970	vViewPosition = - mvPosition.xyz;
2971	#include <worldpos_vertex>
2972	#include <envmap_vertex>
2973	#include <shadowmap_vertex>
2974	#include <fog_vertex>
2975}`,meshlambert_frag:`#define LAMBERT
2976uniform vec3 diffuse;
2977uniform vec3 emissive;
2978uniform float opacity;
2979#include <common>
2980#include <dithering_pars_fragment>
2981#include <color_pars_fragment>
2982#include <uv_pars_fragment>
2983#include <map_pars_fragment>
2984#include <alphamap_pars_fragment>
2985#include <alphatest_pars_fragment>
2986#include <alphahash_pars_fragment>
2987#include <aomap_pars_fragment>
2988#include <lightmap_pars_fragment>
2989#include <emissivemap_pars_fragment>
2990#include <cube_uv_reflection_fragment>
2991#include <envmap_common_pars_fragment>
2992#include <envmap_pars_fragment>
2993#include <envmap_physical_pars_fragment>
2994#include <fog_pars_fragment>
2995#include <bsdfs>
2996#include <lights_pars_begin>
2997#include <normal_pars_fragment>
2998#include <lights_lambert_pars_fragment>
2999#include <shadowmap_pars_fragment>
3000#include <bumpmap_pars_fragment>
3001#include <normalmap_pars_fragment>
3002#include <specularmap_pars_fragment>
3003#include <logdepthbuf_pars_fragment>
3004#include <clipping_planes_pars_fragment>
3005void main() {
3006	vec4 diffuseColor = vec4( diffuse, opacity );
3007	#include <clipping_planes_fragment>
3008	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3009	vec3 totalEmissiveRadiance = emissive;
3010	#include <logdepthbuf_fragment>
3011	#include <map_fragment>
3012	#include <color_fragment>
3013	#include <alphamap_fragment>
3014	#include <alphatest_fragment>
3015	#include <alphahash_fragment>
3016	#include <specularmap_fragment>
3017	#include <normal_fragment_begin>
3018	#include <normal_fragment_maps>
3019	#include <emissivemap_fragment>
3020	#include <lights_lambert_fragment>
3021	#include <lights_fragment_begin>
3022	#include <lights_fragment_maps>
3023	#include <lights_fragment_end>
3024	#include <aomap_fragment>
3025	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3026	#include <envmap_fragment>
3027	#include <opaque_fragment>
3028	#include <tonemapping_fragment>
3029	#include <colorspace_fragment>
3030	#include <fog_fragment>
3031	#include <premultiplied_alpha_fragment>
3032	#include <dithering_fragment>
3033}`,meshmatcap_vert:`#define MATCAP
3034varying vec3 vViewPosition;
3035#include <common>
3036#include <batching_pars_vertex>
3037#include <uv_pars_vertex>
3038#include <color_pars_vertex>
3039#include <displacementmap_pars_vertex>
3040#include <fog_pars_vertex>
3041#include <normal_pars_vertex>
3042#include <morphtarget_pars_vertex>
3043#include <skinning_pars_vertex>
3044#include <logdepthbuf_pars_vertex>
3045#include <clipping_planes_pars_vertex>
3046void main() {
3047	#include <uv_vertex>
3048	#include <color_vertex>
3049	#include <morphinstance_vertex>
3050	#include <morphcolor_vertex>
3051	#include <batching_vertex>
3052	#include <beginnormal_vertex>
3053	#include <morphnormal_vertex>
3054	#include <skinbase_vertex>
3055	#include <skinnormal_vertex>
3056	#include <defaultnormal_vertex>
3057	#include <normal_vertex>
3058	#include <begin_vertex>
3059	#include <morphtarget_vertex>
3060	#include <skinning_vertex>
3061	#include <displacementmap_vertex>
3062	#include <project_vertex>
3063	#include <logdepthbuf_vertex>
3064	#include <clipping_planes_vertex>
3065	#include <fog_vertex>
3066	vViewPosition = - mvPosition.xyz;
3067}`,meshmatcap_frag:`#define MATCAP
3068uniform vec3 diffuse;
3069uniform float opacity;
3070uniform sampler2D matcap;
3071varying vec3 vViewPosition;
3072#include <common>
3073#include <dithering_pars_fragment>
3074#include <color_pars_fragment>
3075#include <uv_pars_fragment>
3076#include <map_pars_fragment>
3077#include <alphamap_pars_fragment>
3078#include <alphatest_pars_fragment>
3079#include <alphahash_pars_fragment>
3080#include <fog_pars_fragment>
3081#include <normal_pars_fragment>
3082#include <bumpmap_pars_fragment>
3083#include <normalmap_pars_fragment>
3084#include <logdepthbuf_pars_fragment>
3085#include <clipping_planes_pars_fragment>
3086void main() {
3087	vec4 diffuseColor = vec4( diffuse, opacity );
3088	#include <clipping_planes_fragment>
3089	#include <logdepthbuf_fragment>
3090	#include <map_fragment>
3091	#include <color_fragment>
3092	#include <alphamap_fragment>
3093	#include <alphatest_fragment>
3094	#include <alphahash_fragment>
3095	#include <normal_fragment_begin>
3096	#include <normal_fragment_maps>
3097	vec3 viewDir = normalize( vViewPosition );
3098	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
3099	vec3 y = cross( viewDir, x );
3100	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
3101	#ifdef USE_MATCAP
3102		vec4 matcapColor = texture2D( matcap, uv );
3103	#else
3104		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
3105	#endif
3106	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
3107	#include <opaque_fragment>
3108	#include <tonemapping_fragment>
3109	#include <colorspace_fragment>
3110	#include <fog_fragment>
3111	#include <premultiplied_alpha_fragment>
3112	#include <dithering_fragment>
3113}`,meshnormal_vert:`#define NORMAL
3114#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3115	varying vec3 vViewPosition;
3116#endif
3117#include <common>
3118#include <batching_pars_vertex>
3119#include <uv_pars_vertex>
3120#include <displacementmap_pars_vertex>
3121#include <normal_pars_vertex>
3122#include <morphtarget_pars_vertex>
3123#include <skinning_pars_vertex>
3124#include <logdepthbuf_pars_vertex>
3125#include <clipping_planes_pars_vertex>
3126void main() {
3127	#include <uv_vertex>
3128	#include <batching_vertex>
3129	#include <beginnormal_vertex>
3130	#include <morphinstance_vertex>
3131	#include <morphnormal_vertex>
3132	#include <skinbase_vertex>
3133	#include <skinnormal_vertex>
3134	#include <defaultnormal_vertex>
3135	#include <normal_vertex>
3136	#include <begin_vertex>
3137	#include <morphtarget_vertex>
3138	#include <skinning_vertex>
3139	#include <displacementmap_vertex>
3140	#include <project_vertex>
3141	#include <logdepthbuf_vertex>
3142	#include <clipping_planes_vertex>
3143#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3144	vViewPosition = - mvPosition.xyz;
3145#endif
3146}`,meshnormal_frag:`#define NORMAL
3147uniform float opacity;
3148#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3149	varying vec3 vViewPosition;
3150#endif
3151#include <uv_pars_fragment>
3152#include <normal_pars_fragment>
3153#include <bumpmap_pars_fragment>
3154#include <normalmap_pars_fragment>
3155#include <logdepthbuf_pars_fragment>
3156#include <clipping_planes_pars_fragment>
3157void main() {
3158	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
3159	#include <clipping_planes_fragment>
3160	#include <logdepthbuf_fragment>
3161	#include <normal_fragment_begin>
3162	#include <normal_fragment_maps>
3163	gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );
3164	#ifdef OPAQUE
3165		gl_FragColor.a = 1.0;
3166	#endif
3167}`,meshphong_vert:`#define PHONG
3168varying vec3 vViewPosition;
3169#include <common>
3170#include <batching_pars_vertex>
3171#include <uv_pars_vertex>
3172#include <displacementmap_pars_vertex>
3173#include <envmap_pars_vertex>
3174#include <color_pars_vertex>
3175#include <fog_pars_vertex>
3176#include <normal_pars_vertex>
3177#include <morphtarget_pars_vertex>
3178#include <skinning_pars_vertex>
3179#include <shadowmap_pars_vertex>
3180#include <logdepthbuf_pars_vertex>
3181#include <clipping_planes_pars_vertex>
3182void main() {
3183	#include <uv_vertex>
3184	#include <color_vertex>
3185	#include <morphcolor_vertex>
3186	#include <batching_vertex>
3187	#include <beginnormal_vertex>
3188	#include <morphinstance_vertex>
3189	#include <morphnormal_vertex>
3190	#include <skinbase_vertex>
3191	#include <skinnormal_vertex>
3192	#include <defaultnormal_vertex>
3193	#include <normal_vertex>
3194	#include <begin_vertex>
3195	#include <morphtarget_vertex>
3196	#include <skinning_vertex>
3197	#include <displacementmap_vertex>
3198	#include <project_vertex>
3199	#include <logdepthbuf_vertex>
3200	#include <clipping_planes_vertex>
3201	vViewPosition = - mvPosition.xyz;
3202	#include <worldpos_vertex>
3203	#include <envmap_vertex>
3204	#include <shadowmap_vertex>
3205	#include <fog_vertex>
3206}`,meshphong_frag:`#define PHONG
3207uniform vec3 diffuse;
3208uniform vec3 emissive;
3209uniform vec3 specular;
3210uniform float shininess;
3211uniform float opacity;
3212#include <common>
3213#include <dithering_pars_fragment>
3214#include <color_pars_fragment>
3215#include <uv_pars_fragment>
3216#include <map_pars_fragment>
3217#include <alphamap_pars_fragment>
3218#include <alphatest_pars_fragment>
3219#include <alphahash_pars_fragment>
3220#include <aomap_pars_fragment>
3221#include <lightmap_pars_fragment>
3222#include <emissivemap_pars_fragment>
3223#include <cube_uv_reflection_fragment>
3224#include <envmap_common_pars_fragment>
3225#include <envmap_pars_fragment>
3226#include <envmap_physical_pars_fragment>
3227#include <fog_pars_fragment>
3228#include <bsdfs>
3229#include <lights_pars_begin>
3230#include <normal_pars_fragment>
3231#include <lights_phong_pars_fragment>
3232#include <shadowmap_pars_fragment>
3233#include <bumpmap_pars_fragment>
3234#include <normalmap_pars_fragment>
3235#include <specularmap_pars_fragment>
3236#include <logdepthbuf_pars_fragment>
3237#include <clipping_planes_pars_fragment>
3238void main() {
3239	vec4 diffuseColor = vec4( diffuse, opacity );
3240	#include <clipping_planes_fragment>
3241	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3242	vec3 totalEmissiveRadiance = emissive;
3243	#include <logdepthbuf_fragment>
3244	#include <map_fragment>
3245	#include <color_fragment>
3246	#include <alphamap_fragment>
3247	#include <alphatest_fragment>
3248	#include <alphahash_fragment>
3249	#include <specularmap_fragment>
3250	#include <normal_fragment_begin>
3251	#include <normal_fragment_maps>
3252	#include <emissivemap_fragment>
3253	#include <lights_phong_fragment>
3254	#include <lights_fragment_begin>
3255	#include <lights_fragment_maps>
3256	#include <lights_fragment_end>
3257	#include <aomap_fragment>
3258	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3259	#include <envmap_fragment>
3260	#include <opaque_fragment>
3261	#include <tonemapping_fragment>
3262	#include <colorspace_fragment>
3263	#include <fog_fragment>
3264	#include <premultiplied_alpha_fragment>
3265	#include <dithering_fragment>
3266}`,meshphysical_vert:`#define STANDARD
3267varying vec3 vViewPosition;
3268#ifdef USE_TRANSMISSION
3269	varying vec3 vWorldPosition;
3270#endif
3271#include <common>
3272#include <batching_pars_vertex>
3273#include <uv_pars_vertex>
3274#include <displacementmap_pars_vertex>
3275#include <color_pars_vertex>
3276#include <fog_pars_vertex>
3277#include <normal_pars_vertex>
3278#include <morphtarget_pars_vertex>
3279#include <skinning_pars_vertex>
3280#include <shadowmap_pars_vertex>
3281#include <logdepthbuf_pars_vertex>
3282#include <clipping_planes_pars_vertex>
3283void main() {
3284	#include <uv_vertex>
3285	#include <color_vertex>
3286	#include <morphinstance_vertex>
3287	#include <morphcolor_vertex>
3288	#include <batching_vertex>
3289	#include <beginnormal_vertex>
3290	#include <morphnormal_vertex>
3291	#include <skinbase_vertex>
3292	#include <skinnormal_vertex>
3293	#include <defaultnormal_vertex>
3294	#include <normal_vertex>
3295	#include <begin_vertex>
3296	#include <morphtarget_vertex>
3297	#include <skinning_vertex>
3298	#include <displacementmap_vertex>
3299	#include <project_vertex>
3300	#include <logdepthbuf_vertex>
3301	#include <clipping_planes_vertex>
3302	vViewPosition = - mvPosition.xyz;
3303	#include <worldpos_vertex>
3304	#include <shadowmap_vertex>
3305	#include <fog_vertex>
3306#ifdef USE_TRANSMISSION
3307	vWorldPosition = worldPosition.xyz;
3308#endif
3309}`,meshphysical_frag:`#define STANDARD
3310#ifdef PHYSICAL
3311	#define IOR
3312	#define USE_SPECULAR
3313#endif
3314uniform vec3 diffuse;
3315uniform vec3 emissive;
3316uniform float roughness;
3317uniform float metalness;
3318uniform float opacity;
3319#ifdef IOR
3320	uniform float ior;
3321#endif
3322#ifdef USE_SPECULAR
3323	uniform float specularIntensity;
3324	uniform vec3 specularColor;
3325	#ifdef USE_SPECULAR_COLORMAP
3326		uniform sampler2D specularColorMap;
3327	#endif
3328	#ifdef USE_SPECULAR_INTENSITYMAP
3329		uniform sampler2D specularIntensityMap;
3330	#endif
3331#endif
3332#ifdef USE_CLEARCOAT
3333	uniform float clearcoat;
3334	uniform float clearcoatRoughness;
3335#endif
3336#ifdef USE_DISPERSION
3337	uniform float dispersion;
3338#endif
3339#ifdef USE_IRIDESCENCE
3340	uniform float iridescence;
3341	uniform float iridescenceIOR;
3342	uniform float iridescenceThicknessMinimum;
3343	uniform float iridescenceThicknessMaximum;
3344#endif
3345#ifdef USE_SHEEN
3346	uniform vec3 sheenColor;
3347	uniform float sheenRoughness;
3348	#ifdef USE_SHEEN_COLORMAP
3349		uniform sampler2D sheenColorMap;
3350	#endif
3351	#ifdef USE_SHEEN_ROUGHNESSMAP
3352		uniform sampler2D sheenRoughnessMap;
3353	#endif
3354#endif
3355#ifdef USE_ANISOTROPY
3356	uniform vec2 anisotropyVector;
3357	#ifdef USE_ANISOTROPYMAP
3358		uniform sampler2D anisotropyMap;
3359	#endif
3360#endif
3361varying vec3 vViewPosition;
3362#include <common>
3363#include <dithering_pars_fragment>
3364#include <color_pars_fragment>
3365#include <uv_pars_fragment>
3366#include <map_pars_fragment>
3367#include <alphamap_pars_fragment>
3368#include <alphatest_pars_fragment>
3369#include <alphahash_pars_fragment>
3370#include <aomap_pars_fragment>
3371#include <lightmap_pars_fragment>
3372#include <emissivemap_pars_fragment>
3373#include <iridescence_fragment>
3374#include <cube_uv_reflection_fragment>
3375#include <envmap_common_pars_fragment>
3376#include <envmap_physical_pars_fragment>
3377#include <fog_pars_fragment>
3378#include <lights_pars_begin>
3379#include <normal_pars_fragment>
3380#include <lights_physical_pars_fragment>
3381#include <transmission_pars_fragment>
3382#include <shadowmap_pars_fragment>
3383#include <bumpmap_pars_fragment>
3384#include <normalmap_pars_fragment>
3385#include <clearcoat_pars_fragment>
3386#include <iridescence_pars_fragment>
3387#include <roughnessmap_pars_fragment>
3388#include <metalnessmap_pars_fragment>
3389#include <logdepthbuf_pars_fragment>
3390#include <clipping_planes_pars_fragment>
3391void main() {
3392	vec4 diffuseColor = vec4( diffuse, opacity );
3393	#include <clipping_planes_fragment>
3394	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3395	vec3 totalEmissiveRadiance = emissive;
3396	#include <logdepthbuf_fragment>
3397	#include <map_fragment>
3398	#include <color_fragment>
3399	#include <alphamap_fragment>
3400	#include <alphatest_fragment>
3401	#include <alphahash_fragment>
3402	#include <roughnessmap_fragment>
3403	#include <metalnessmap_fragment>
3404	#include <normal_fragment_begin>
3405	#include <normal_fragment_maps>
3406	#include <clearcoat_normal_fragment_begin>
3407	#include <clearcoat_normal_fragment_maps>
3408	#include <emissivemap_fragment>
3409	#include <lights_physical_fragment>
3410	#include <lights_fragment_begin>
3411	#include <lights_fragment_maps>
3412	#include <lights_fragment_end>
3413	#include <aomap_fragment>
3414	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3415	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3416	#include <transmission_fragment>
3417	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3418	#ifdef USE_SHEEN
3419 
3420		outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;
3421 
3422 	#endif
3423	#ifdef USE_CLEARCOAT
3424		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3425		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3426		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3427	#endif
3428	#include <opaque_fragment>
3429	#include <tonemapping_fragment>
3430	#include <colorspace_fragment>
3431	#include <fog_fragment>
3432	#include <premultiplied_alpha_fragment>
3433	#include <dithering_fragment>
3434}`,meshtoon_vert:`#define TOON
3435varying vec3 vViewPosition;
3436#include <common>
3437#include <batching_pars_vertex>
3438#include <uv_pars_vertex>
3439#include <displacementmap_pars_vertex>
3440#include <color_pars_vertex>
3441#include <fog_pars_vertex>
3442#include <normal_pars_vertex>
3443#include <morphtarget_pars_vertex>
3444#include <skinning_pars_vertex>
3445#include <shadowmap_pars_vertex>
3446#include <logdepthbuf_pars_vertex>
3447#include <clipping_planes_pars_vertex>
3448void main() {
3449	#include <uv_vertex>
3450	#include <color_vertex>
3451	#include <morphinstance_vertex>
3452	#include <morphcolor_vertex>
3453	#include <batching_vertex>
3454	#include <beginnormal_vertex>
3455	#include <morphnormal_vertex>
3456	#include <skinbase_vertex>
3457	#include <skinnormal_vertex>
3458	#include <defaultnormal_vertex>
3459	#include <normal_vertex>
3460	#include <begin_vertex>
3461	#include <morphtarget_vertex>
3462	#include <skinning_vertex>
3463	#include <displacementmap_vertex>
3464	#include <project_vertex>
3465	#include <logdepthbuf_vertex>
3466	#include <clipping_planes_vertex>
3467	vViewPosition = - mvPosition.xyz;
3468	#include <worldpos_vertex>
3469	#include <shadowmap_vertex>
3470	#include <fog_vertex>
3471}`,meshtoon_frag:`#define TOON
3472uniform vec3 diffuse;
3473uniform vec3 emissive;
3474uniform float opacity;
3475#include <common>
3476#include <dithering_pars_fragment>
3477#include <color_pars_fragment>
3478#include <uv_pars_fragment>
3479#include <map_pars_fragment>
3480#include <alphamap_pars_fragment>
3481#include <alphatest_pars_fragment>
3482#include <alphahash_pars_fragment>
3483#include <aomap_pars_fragment>
3484#include <lightmap_pars_fragment>
3485#include <emissivemap_pars_fragment>
3486#include <gradientmap_pars_fragment>
3487#include <fog_pars_fragment>
3488#include <bsdfs>
3489#include <lights_pars_begin>
3490#include <normal_pars_fragment>
3491#include <lights_toon_pars_fragment>
3492#include <shadowmap_pars_fragment>
3493#include <bumpmap_pars_fragment>
3494#include <normalmap_pars_fragment>
3495#include <logdepthbuf_pars_fragment>
3496#include <clipping_planes_pars_fragment>
3497void main() {
3498	vec4 diffuseColor = vec4( diffuse, opacity );
3499	#include <clipping_planes_fragment>
3500	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3501	vec3 totalEmissiveRadiance = emissive;
3502	#include <logdepthbuf_fragment>
3503	#include <map_fragment>
3504	#include <color_fragment>
3505	#include <alphamap_fragment>
3506	#include <alphatest_fragment>
3507	#include <alphahash_fragment>
3508	#include <normal_fragment_begin>
3509	#include <normal_fragment_maps>
3510	#include <emissivemap_fragment>
3511	#include <lights_toon_fragment>
3512	#include <lights_fragment_begin>
3513	#include <lights_fragment_maps>
3514	#include <lights_fragment_end>
3515	#include <aomap_fragment>
3516	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3517	#include <opaque_fragment>
3518	#include <tonemapping_fragment>
3519	#include <colorspace_fragment>
3520	#include <fog_fragment>
3521	#include <premultiplied_alpha_fragment>
3522	#include <dithering_fragment>
3523}`,points_vert:`uniform float size;
3524uniform float scale;
3525#include <common>
3526#include <color_pars_vertex>
3527#include <fog_pars_vertex>
3528#include <morphtarget_pars_vertex>
3529#include <logdepthbuf_pars_vertex>
3530#include <clipping_planes_pars_vertex>
3531#ifdef USE_POINTS_UV
3532	varying vec2 vUv;
3533	uniform mat3 uvTransform;
3534#endif
3535void main() {
3536	#ifdef USE_POINTS_UV
3537		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3538	#endif
3539	#include <color_vertex>
3540	#include <morphinstance_vertex>
3541	#include <morphcolor_vertex>
3542	#include <begin_vertex>
3543	#include <morphtarget_vertex>
3544	#include <project_vertex>
3545	gl_PointSize = size;
3546	#ifdef USE_SIZEATTENUATION
3547		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3548		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3549	#endif
3550	#include <logdepthbuf_vertex>
3551	#include <clipping_planes_vertex>
3552	#include <worldpos_vertex>
3553	#include <fog_vertex>
3554}`,points_frag:`uniform vec3 diffuse;
3555uniform float opacity;
3556#include <common>
3557#include <color_pars_fragment>
3558#include <map_particle_pars_fragment>
3559#include <alphatest_pars_fragment>
3560#include <alphahash_pars_fragment>
3561#include <fog_pars_fragment>
3562#include <logdepthbuf_pars_fragment>
3563#include <clipping_planes_pars_fragment>
3564void main() {
3565	vec4 diffuseColor = vec4( diffuse, opacity );
3566	#include <clipping_planes_fragment>
3567	vec3 outgoingLight = vec3( 0.0 );
3568	#include <logdepthbuf_fragment>
3569	#include <map_particle_fragment>
3570	#include <color_fragment>
3571	#include <alphatest_fragment>
3572	#include <alphahash_fragment>
3573	outgoingLight = diffuseColor.rgb;
3574	#include <opaque_fragment>
3575	#include <tonemapping_fragment>
3576	#include <colorspace_fragment>
3577	#include <fog_fragment>
3578	#include <premultiplied_alpha_fragment>
3579}`,shadow_vert:`#include <common>
3580#include <batching_pars_vertex>
3581#include <fog_pars_vertex>
3582#include <morphtarget_pars_vertex>
3583#include <skinning_pars_vertex>
3584#include <logdepthbuf_pars_vertex>
3585#include <shadowmap_pars_vertex>
3586void main() {
3587	#include <batching_vertex>
3588	#include <beginnormal_vertex>
3589	#include <morphinstance_vertex>
3590	#include <morphnormal_vertex>
3591	#include <skinbase_vertex>
3592	#include <skinnormal_vertex>
3593	#include <defaultnormal_vertex>
3594	#include <begin_vertex>
3595	#include <morphtarget_vertex>
3596	#include <skinning_vertex>
3597	#include <project_vertex>
3598	#include <logdepthbuf_vertex>
3599	#include <worldpos_vertex>
3600	#include <shadowmap_vertex>
3601	#include <fog_vertex>
3602}`,shadow_frag:`uniform vec3 color;
3603uniform float opacity;
3604#include <common>
3605#include <fog_pars_fragment>
3606#include <bsdfs>
3607#include <lights_pars_begin>
3608#include <logdepthbuf_pars_fragment>
3609#include <shadowmap_pars_fragment>
3610#include <shadowmask_pars_fragment>
3611void main() {
3612	#include <logdepthbuf_fragment>
3613	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3614	#include <tonemapping_fragment>
3615	#include <colorspace_fragment>
3616	#include <fog_fragment>
3617	#include <premultiplied_alpha_fragment>
3618}`,sprite_vert:`uniform float rotation;
3619uniform vec2 center;
3620#include <common>
3621#include <uv_pars_vertex>
3622#include <fog_pars_vertex>
3623#include <logdepthbuf_pars_vertex>
3624#include <clipping_planes_pars_vertex>
3625void main() {
3626	#include <uv_vertex>
3627	vec4 mvPosition = modelViewMatrix[ 3 ];
3628	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
3629	#ifndef USE_SIZEATTENUATION
3630		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3631		if ( isPerspective ) scale *= - mvPosition.z;
3632	#endif
3633	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3634	vec2 rotatedPosition;
3635	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3636	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3637	mvPosition.xy += rotatedPosition;
3638	gl_Position = projectionMatrix * mvPosition;
3639	#include <logdepthbuf_vertex>
3640	#include <clipping_planes_vertex>
3641	#include <fog_vertex>
3642}`,sprite_frag:`uniform vec3 diffuse;
3643uniform float opacity;
3644#include <common>
3645#include <uv_pars_fragment>
3646#include <map_pars_fragment>
3647#include <alphamap_pars_fragment>
3648#include <alphatest_pars_fragment>
3649#include <alphahash_pars_fragment>
3650#include <fog_pars_fragment>
3651#include <logdepthbuf_pars_fragment>
3652#include <clipping_planes_pars_fragment>
3653void main() {
3654	vec4 diffuseColor = vec4( diffuse, opacity );
3655	#include <clipping_planes_fragment>
3656	vec3 outgoingLight = vec3( 0.0 );
3657	#include <logdepthbuf_fragment>
3658	#include <map_fragment>
3659	#include <alphamap_fragment>
3660	#include <alphatest_fragment>
3661	#include <alphahash_fragment>
3662	outgoingLight = diffuseColor.rgb;
3663	#include <opaque_fragment>
3664	#include <tonemapping_fragment>
3665	#include <colorspace_fragment>
3666	#include <fog_fragment>
3667}`},Y={common:{diffuse:{value:new q(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Nr},alphaMap:{value:null},alphaMapTransform:{value:new Nr},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Nr}},envmap:{envMap:{value:null},envMapRotation:{value:new Nr},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Nr}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Nr}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Nr},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Nr},normalScale:{value:new W(1,1)}}
vendor: 4,158 bytes, line 3667
3667,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Nr},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Nr}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Nr}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Nr}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new q(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new G},probesMax:{value:new G},probesResolution:{value:new G}},points:{diffuse:{value:new q(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Nr},alphaTest:{value:0},uvTransform:{value:new Nr}},sprite:{diffuse:{value:new q(16777215)},opacity:{value:1},center:{value:new W(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Nr},alphaMap:{value:null},alphaMapTransform:{value:new Nr},alphaTest:{value:0}}},Zp={basic:{uniforms:lu([Y.common,Y.specularmap,Y.envmap,Y.aomap,Y.lightmap,Y.fog]),vertexShader:Xp.meshbasic_vert,fragmentShader:Xp.meshbasic_frag},lambert:{uniforms:lu([Y.common,Y.specularmap,Y.envmap,Y.aomap,Y.lightmap,Y.emissivemap,Y.bumpmap,Y.normalmap,Y.displacementmap,Y.fog,Y.lights,{emissive:{value:new q(0)},envMapIntensity:{value:1}}]),vertexShader:Xp.meshlambert_vert,fragmentShader:Xp.meshlambert_frag},phong:{uniforms:lu([Y.common,Y.specularmap,Y.envmap,Y.aomap,Y.lightmap,Y.emissivemap,Y.bumpmap,Y.normalmap,Y.displacementmap,Y.fog,Y.lights,{emissive:{value:new q(0)},specular:{value:new q(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Xp.meshphong_vert,fragmentShader:Xp.meshphong_frag},standard:{uniforms:lu([Y.common,Y.envmap,Y.aomap,Y.lightmap,Y.emissivemap,Y.bumpmap,Y.normalmap,Y.displacementmap,Y.roughnessmap,Y.metalnessmap,Y.fog,Y.lights,{emissive:{value:new q(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Xp.meshphysical_vert,fragmentShader:Xp.meshphysical_frag},toon:{uniforms:lu([Y.common,Y.aomap,Y.lightmap,Y.emissivemap,Y.bumpmap,Y.normalmap,Y.displacementmap,Y.gradientmap,Y.fog,Y.lights,{emissive:{value:new q(0)}}]),vertexShader:Xp.meshtoon_vert,fragmentShader:Xp.meshtoon_frag},matcap:{uniforms:lu([Y.common,Y.bumpmap,Y.normalmap,Y.displacementmap,Y.fog,{matcap:{value:null}}]),vertexShader:Xp.meshmatcap_vert,fragmentShader:Xp.meshmatcap_frag},points:{uniforms:lu([Y.points,Y.fog]),vertexShader:Xp.points_vert,fragmentShader:Xp.points_frag},dashed:{uniforms:lu([Y.common,Y.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Xp.linedashed_vert,fragmentShader:Xp.linedashed_frag},depth:{uniforms:lu([Y.common,Y.displacementmap]),vertexShader:Xp.depth_vert,fragmentShader:Xp.depth_frag},normal:{uniforms:lu([Y.common,Y.bumpmap,Y.normalmap,Y.displacementmap,{opacity:{value:1}}]),vertexShader:Xp.meshnormal_vert,fragmentShader:Xp.meshnormal_frag},sprite:{uniforms:lu([Y.sprite,Y.fog]),vertexShader:Xp.sprite_vert,fragmentShader:X
vendor: 4,467 bytes, line 3667
3667p.sprite_frag},background:{uniforms:{uvTransform:{value:new Nr},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Xp.background_vert,fragmentShader:Xp.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Nr}},vertexShader:Xp.backgroundCube_vert,fragmentShader:Xp.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Xp.cube_vert,fragmentShader:Xp.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Xp.equirect_vert,fragmentShader:Xp.equirect_frag},distance:{uniforms:lu([Y.common,Y.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Xp.distance_vert,fragmentShader:Xp.distance_frag},shadow:{uniforms:lu([Y.lights,Y.fog,{color:{value:new q(0)},opacity:{value:1}}]),vertexShader:Xp.shadow_vert,fragmentShader:Xp.shadow_frag}};Zp.physical={uniforms:lu([Zp.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Nr},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Nr},clearcoatNormalScale:{value:new W(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Nr},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Nr},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Nr},sheen:{value:0},sheenColor:{value:new q(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Nr},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Nr},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Nr},transmissionSamplerSize:{value:new W},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Nr},attenuationDistance:{value:0},attenuationColor:{value:new q(0)},specularColor:{value:new q(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Nr},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Nr},anisotropyVector:{value:new W},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Nr}}]),vertexShader:Xp.meshphysical_vert,fragmentShader:Xp.meshphysical_frag};var Qp={r:0,b:0,g:0},$p=new K,em=new Nr;em.set(-1,0,0,0,1,0,0,0,1);function tm(e,t,n,r,i,a){let o=new q(0),s=i===!0?0:1,c,l,u=null,d=0,f=null;function p(e){let n=e.isScene===!0?e.background:null;if(n&&n.isTexture){let r=e.backgroundBlurriness>0;n=t.get(n,r)}return n}function m(t){let r=!1,i=p(t);i===null?g(o,s):i&&i.isColor&&(g(i,1),r=!0);let c=e.xr.getEnvironmentBlendMode();c===`additive`?n.buffers.color.setClear(0,0,0,1,a):c===`alpha-blend`&&n.buffers.color.setClear(0,0,0,0,a),(e.autoClear||r)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function h(t,n){let i=p(n);i&&(i.isCubeTexture||i.mapping===306)?(l===void 0&&(l=new Fo(new _c(1,1,1),new gu({name:`BackgroundCubeMaterial`,uniforms:cu(Zp.backgroundCube.uniforms),vertexShader:Zp.backgroundCube.vertexShader,fragmentShader:Zp.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),l.geometry.deleteAttribute(`uv`),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),l.material.uniforms.envMap.value=i,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4($p.makeRotationFromEuler(n.backgroundRotation)).transpose(),i.isCubeTexture&&i.isRenderTargetTexture===!1&&l.material.uniforms.backgroundRotation.value.premultiply(em),l.material.toneMapped=Rr.getTransfer(i.colorSpace)!==vn,(u!==i||d!==i.version||f!==e.toneMapping)&&(l.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):i&&i.isTexture&&(c===void 0&&(c=new Fo(new Yl(2,2),new gu({name:`Backgroun
3667dMaterial`,uniforms:cu(Zp.background.uniforms),vertexShader:Zp.background.vertexShader,fragmentShader:Zp.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute(`normal`),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=i,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.toneMapped=Rr.getTransfer(i.colorSpace)!==vn,i.matrixAutoUpdate===!0&&i.updateMatrix(),c.material.uniforms.uvTransform.value.copy(i.matrix),(u!==i||d!==i.version||f!==e.toneMapping)&&(c.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null))}function g(t,r){t.getRGB(Qp,fu(e)),n.buffers.color.setClear(Qp.r,Qp.g,Qp.b,r,a)}function _(){l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),s=t,g(o,s)},getClearAlpha:function(){return s},setClearAlpha:function(e){s=e,g(o,s)},render:m,addToRenderList:h,dispose:_}}function nm(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=f(null),a=i,o=!1;function s(n,r,i,s,c){let u=!1,f=d(n,s,i,r);a!==f&&(a=f,l(a.object)),u=p(n,s,i,c),u&&m(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(u||o)&&(o=!1,b(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function c(){return e.createVertexArray()}function l(t){return e.bindVertexArray(t)}function u(t){return e.deleteVertexArray(t)}function d(e,t,n,i){let a=i.wireframe===!0,o=r[t.id];o===void 0&&(o={},r[t.id]=o);let s=e.isInstancedMesh===!0?e.id:0,l=o[s];l===void 0&&(l={},o[s]=l);let u=l[n.id];u===void 0&&(u={},l[n.id]=u);let d=u[a];return d===void 0&&(d=f(c()),u[a]=d),d}function f(e){let t=[],r=[],i=[];for(let e=0;e<n;e++)t[e]=0,r[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function p(e,t,n,r){let i=a.attributes,o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function m(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function h(){let e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function g(e){_(e,0)}function _(t,n){let r=a.newAttributes,i=a.enabledAttributes,o=a.attributeDivisors;r[t]=1,i[t]===0&&(e.enableVertexAttribArray(t),i[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function v(){let t=a.newAttributes,n=a.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function y(t,n,r,i,a,o,s){s===!0?e.vertexAttribIPointer(t,n,r,a,o):e.vertexAttribPointer(t,n,r,i,a,o)}function b(n,r,i,a){h();let o=a.attributes,s=i.getAttributes(),c=r.defaultAttributeValues;for(let r in s){let i=s[r];if(i.location>=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)_(i.location+e,t.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<i.locationSize;e++)g(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)y(i.location+e,o/i.locationSize,u,r,c*d,(p+o/i.locationSize*e)*d,f)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)_(i.location+e,s.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<i.locationSize;e++)g(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)y(i.location+e,o/i.locationSize,u,r,o*d,o/i.locationSize*e*d,f)}}else if(c!==void 0){let t=c[r];if(t!==void 0)switch(t.length){case 2:e.vertexAttrib2fv(i.location,t);break;case 3:e.vertexAttrib3fv(i.location,t);break;case 4:e.vertexAttrib4fv(i.location,t);break;default:e.vertexAttrib1fv(i.location,t)}}}}v()}function x(){T();for(let e in r){let t=r[e];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)u(t[e].object),delete t[e];delete n[e]}}delete r[e]}}function S(e){if(r[e.id]===void 0)return;let t=r[e.id];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)u(t[e].object),delete t[e];delete n[e]}}delete r[e.id]}function C(e){for(let t in r){let n=r[t];for(let t in n){let r=n[t];if(r[e.id]===void 0)continue;let i=r[e.id];for(let e in i)u(i[e].object),delete i[e];delete r[e.id]}}}function w(e){for(let t in r){let n=r[t],i=e.isInstancedMesh===!0?e.id:0,a=n[i];if(a!==void 0){for(let e in a){let t=a[e];for(let e in t)u(t[e].object),delete t[e];delete a[e]}delete n[i],Object.keys(n).length===0&&delete r[t]}}}function T(){E(),o=!0,a!==i&&(a=i,l(a.object))}
vendor: 7,170 bytes, line 3667
3667function E(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:s,reset:T,resetDefaultState:E,dispose:x,releaseStatesOfGeometry:S,releaseStatesOfObject:w,releaseStatesOfProgram:C,initAttributes:h,enableAttribute:g,disableUnusedAttributes:v}}function rm(e,t,n){let r;function i(e){r=e}function a(t,i){e.drawArrays(r,t,i),n.update(i,r,1)}function o(t,i,a){a!==0&&(e.drawArraysInstanced(r,t,i,a),n.update(i,r,a))}function s(e,i,a){if(a===0)return;t.get(`WEBGL_multi_draw`).multiDrawArraysWEBGL(r,e,0,i,0,a);let o=0;for(let e=0;e<a;e++)o+=i[e];n.update(o,r,1)}this.setMode=i,this.render=a,this.renderInstances=o,this.renderMultiDraw=s}function im(e,t,n,r){let i;function a(){if(i!==void 0)return i;if(t.has(`EXT_texture_filter_anisotropic`)===!0){let n=t.get(`EXT_texture_filter_anisotropic`);i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(t){return t===1023||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)}function s(n){let i=n===1016&&(t.has(`EXT_color_buffer_half_float`)||t.has(`EXT_color_buffer_float`));return!(n!==1009&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==1015&&!i)}function c(t){if(t===`highp`){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let l=n.precision===void 0?`highp`:n.precision,u=c(l);u!==l&&(V(`WebGLRenderer:`,l,`not supported, using`,u,`instead.`),l=u);let d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`);n.reversedDepthBuffer===!0&&f===!1&&V(`WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.`);let p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),m=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),g=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),_=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),y=e.getParameter(e.MAX_VARYING_VECTORS),b=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=e.getParameter(e.MAX_SAMPLES),S=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:s,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:v,maxVaryings:y,maxFragmentUniforms:b,maxSamples:x,samples:S}}function am(e){let t=this,n=null,r=0,i=!1,a=!1,o=new ds,s=new Nr,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(t,o,s){let d=t.clippingPlanes,f=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!i||d===null||d.length===0||a&&!p)a?u(null):l();else{let e=a?0:r,t=e*4,i=m.clippingState||null;c.value=i,i=u(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length<t)&&(l=new Float32Array(t));for(let t=0,n=r;t!==a;++t,n+=4)o.copy(e[t]).applyMatrix4(i,s),o.normal.toArray(l,n),l[n+3]=o.constant}c.value=l,c.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,l}}var om=4,sm=[.125,.215,.35,.446,.526,.582],cm=20,lm=256,um=new Ad,dm=new q,fm=null,pm=0,mm=0,hm=!1,gm=new G,_m=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=gm}=i;fm=this._renderer.getRenderTarget(),pm=this._renderer.getActiveCubeFace(),mm=this._renderer.getActiveMipmapLevel(),hm=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=wm(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Cm(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(fm,pm,mm),this._renderer.xr.enabled=hm,e.scissorTest=!1,bm(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===301||e.mapping===302?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),fm=this._renderer.getRenderTarget(),pm=this._renderer.getActiveCubeFace(),mm=this._renderer.getActiveMipmapLevel(),hm=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Ve,minFilter:Ve,generateMipmaps:!1,type:$e,format:st,colorSpace:gn,depthBuffer:!1},r=ym(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=ym(e,t,n);let{_lodMax:r}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=vm(r)),this._blurMaterial=Sm(r,e,t),this._ggxMaterial=xm(r,e,t)}return r}_compileMaterial(e){let t=new Fo(new Ua,e);this._renderer.compile(t,um)}_sceneToCubeUV(e,t,n,r,i){let a=new Td(90,1,t,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],c=this._renderer,l=c.autoClear,u=c.toneMapping;c.getClearColor(dm),c.toneMapping=0,c.autoClear=!1,c.state.buffers.depth.getReversed()&&(c.setRenderTarget(r),c.clearDepth(),c.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Fo(new _c,new Co({name:`PMREM.Backgroun
3667d`,side:1,depthWrite:!1,depthTest:!1})));let d=this._backgroundBox,f=d.material,p=!1,m=e.background;m?m.isColor&&(f.color.copy(m),e.background=null,p=!0):(f.color.copy(dm),p=!0);for(let t=0;t<6;t++){let n=t%3;n===0?(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x+s[t],i.y,i.z)):n===1?(a.up.set(0,0,o[t]),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y+s[t],i.z)):(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y,i.z+s[t]));let l=this._cubeSize;bm(r,n*l,t>2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=wm()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Cm());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;bm(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,um)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;t<r;t++)this._applyGGXFilter(e,t-1,t);t.autoClear=n}_applyGGXFilter(e,t,n){let r=this._renderer,i=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;let s=a.uniforms,c=n/(this._lodMeshes.length-1),l=t/(this._lodMeshes.length-1),u=Math.sqrt(c*c-l*l)*(0+c*1.25),{_lodMax:d}=this,f=this._sizeLods[n],p=3*f*(n>d-om?n-d+om:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,bm(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,um),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,bm(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,um)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&H(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/f,m=isFinite(i)?1+Math.floor(3*p):cm;m>cm&&V(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${cm}`);let h=[],g=0;for(let e=0;e<cm;++e){let t=e/p,n=Math.exp(-t*t/2);h.push(n),e===0?g+=n:e<m&&(g+=2*n)}for(let e=0;e<h.length;e++)h[e]=h[e]/g;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=h,u.latitudinal.value=a===`latitudinal`,o&&(u.poleAxis.value=o);let{_lodMax:_}=this;u.dTheta.value=f,u.mipInt.value=_-n;let v=this._sizeLods[r];bm(t,3*v*(r>_-om?r-_+om:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,um)}};function vm(e){let t=[],n=[],r=[],i=e,a=e-om+1+sm.length;for(let o=0;o<a;o++){let a=2**i;t.push(a);let s=1/a;o>e-om?s=sm[o-e+om-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new Ua;h.setAttribute(`position`,new Ca(f,3)),h.setAttribute(`uv`,new Ca(p,2)),h.setAttribute(`faceIndex`,new Ca(m,1)),r.push(new Fo(h,null)),i>om&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function ym(e,t,n){let r=new Zr(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function bm(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function xm(e,t,n){return new gu({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:lm,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Tm(),fragmentShader:`
3668
3669			precision highp float;
3670			precision highp int;
3671
3672			varying vec3 vOutputDirection;
3673
3674			uniform sampler2D envMap;
3675			uniform float roughness;
3676			uniform float mipInt;
3677
3678			#define ENVMAP_TYPE_CUBE_UV
3679			#include <cube_uv_reflection_fragment>
3680
3681			#define PI 3.14159265359
3682
3683			// Van der Corput radical inverse
3684			float radicalInverse_VdC(uint bits) {
3685				bits = (bits << 16u) | (bits >> 16u);
3686				bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
3687				bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
3688				bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
3689				bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
3690				return float(bits) * 2.3283064365386963e-10; // / 0x100000000
3691			}
3692
3693			// Hammersley sequence
3694			vec2 hammersley(uint i, uint N) {
3695				return vec2(float(i) / float(N), radicalInverse_VdC(i));
3696			}
3697
3698			// GGX VNDF importance sampling (Eric Heitz 2018)
3699			// "Sampling the GGX Distribution of Visible Normals"
3700			// https://jcgt.org/published/0007/04/01/
3701			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
3702				float alpha = roughness * roughness;
3703
3704				// Section 4.1: Orthonormal basis
3705				vec3 T1 = vec3(1.0, 0.0, 0.0);
3706				vec3 T2 = cross(V, T1);
3707
3708				// Section 4.2: Parameterization of projected area
3709				float r = sqrt(Xi.x);
3710				float phi = 2.0 * PI * Xi.y;
3711				float t1 = r * cos(phi);
3712				float t2 = r * sin(phi);
3713				float s = 0.5 * (1.0 + V.z);
3714				t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
3715
3716				// Section 4.3: Reprojection onto hemisphere
3717				vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;
3718
3719				// Section 3.4: Transform back to ellipsoid configuration
3720				return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
3721			}
3722
3723			void main() {
3724				vec3 N = normalize(vOutputDirection);
3725				vec3 V = N; // Assume view direction equals normal for pre-filtering
3726
3727				vec3 prefilteredColor = vec3(0.0);
3728				float totalWeight = 0.0;
3729
3730				// For very low roughness, just sample the environment directly
3731				if (roughness < 0.001) {
3732					gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
3733					return;
3734				}
3735
3736				// Tangent space basis for VNDF sampling
3737				vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
3738				vec3 tangent = normalize(cross(up, N));
3739				vec3 bitangent = cross(N, tangent);
3740
3741				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
3742					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
3743
3744					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
3745					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
3746
3747					// Transform H back to world space
3748					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
3749					vec3 L = normalize(2.0 * dot(V, H) * H - V);
3750
3751					float NdotL = max(dot(N, L), 0.0);
3752
3753					if(NdotL > 0.0) {
3754						// Sample environment at fixed mip level
3755						// VNDF importance sampling handles the distribution filtering
3756						vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
3757
3758						// Weight by NdotL for the split-sum approximation
3759						// VNDF PDF naturally accounts for the visible microfacet distribution
3760						prefilteredColor += sampleColor * NdotL;
3761						totalWeight += NdotL;
3762					}
3763				}
3764
3765				if (totalWeight > 0.0) {
3766					prefilteredColor = prefilteredColor / totalWeight;
3767				}
3768
3769				gl_FragColor = vec4(prefilteredColor, 1.0);
3770			}
3771		`,blending:0,depthTest:!1,depthWrite:!1})}function Sm(e,t,n){let r=new Float32Array(cm),i=new G(0,1,0);return new gu({name:`SphericalGaussianBlur`,defines:{n:cm,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Tm(),fragmentShader:`
3772
3773			precision mediump float;
3774			precision mediump int;
3775
3776			varying vec3 vOutputDirection;
3777
3778			uniform sampler2D envMap;
3779			uniform int samples;
3780			uniform float weights[ n ];
3781			uniform bool latitudinal;
3782			uniform float dTheta;
3783			uniform float mipInt;
3784			uniform vec3 poleAxis;
3785
3786			#define ENVMAP_TYPE_CUBE_UV
3787			#include <cube_uv_reflection_fragment>
3788
3789			vec3 getSample( float theta, vec3 axis ) {
3790
3791				float cosTheta = cos( theta );
3792				// Rodrigues' axis-angle rotation
3793				vec3 sampleDirection = vOutputDirection * cosTheta
3794					+ cross( axis, vOutputDirection ) * sin( theta )
3795					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
3796
3797				return bilinearCubeUV( envMap, sampleDirection, mipInt );
3798
3799			}
3800
3801			void main() {
3802
3803				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
3804
3805				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
3806
3807					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
3808
3809				}
3810
3811				axis = normalize( axis );
3812
3813				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
3814				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
3815
3816				for ( int i = 1; i < n; i++ ) {
3817
3818					if ( i >= samples ) {
3819
3820						break;
3821
3822					}
3823
3824					float theta = dTheta * float( i );
3825					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
3826					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
3827
3828				}
3829
3830			}
3831		`,blending:0,depthTest:!1,depthWrite:!1})}function Cm(){return new gu({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:Tm(),fragmentShader:`
3832
3833			precision mediump float;
3834			precision mediump int;
3835
3836			varying vec3 vOutputDirection;
3837
3838			uniform sampler2D envMap;
3839
3840			#include <common>
3841
3842			void main() {
3843
3844				vec3 outputDirection = normalize( vOutputDirection );
3845				vec2 uv = equirectUv( outputDirection );
3846
3847				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3848
3849			}
3850		`,blending:0,depthTest:!1,depthWrite:!1})}function wm(){return new gu({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Tm(),fragmentShader:`
3851
3852			precision mediump float;
3853			precision mediump int;
3854
3855			uniform float flipEnvMap;
3856
3857			varying vec3 vOutputDirection;
3858
3859			uniform samplerCube envMap;
3860
3861			void main() {
3862
3863				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3864
3865			}
3866		`,blending:0,depthTest:!1,depthWrite:!1})}function Tm(){return`
3867
3868		precision mediump float;
3869		precision mediump int;
3870
3871		attribute float faceIndex;
3872
3873		varying vec3 vOutputDirection;
3874
3875		// RH coordinate system; PMREM face-indexing convention
3876		vec3 getDirection( vec2 uv, float face ) {
3877
3878			uv = 2.0 * uv - 1.0;
3879
3880			vec3 direction = vec3( uv, 1.0 );
3881
3882			if ( face == 0.0 ) {
3883
3884				direction = direction.zyx; // ( 1, v, u ) pos x
3885
3886			} else if ( face == 1.0 ) {
3887
3888				direction = direction.xzy;
3889				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
3890
3891			} else if ( face == 2.0 ) {
3892
3893				direction.x *= -1.0; // ( -u, v, 1 ) pos z
3894
3895			} else if ( face == 3.0 ) {
3896
3897				direction = direction.zyx;
3898				direction.xz *= -1.0; // ( -1, v, -u ) neg x
3899
3900			} else if ( face == 4.0 ) {
3901
3902				direction = direction.xzy;
3903				direction.xy *= -1.0; // ( -u, -1, v ) neg y
3904
3905			} else if ( face == 5.0 ) {
3906
3907				direction.z *= -1.0; // ( u, v, -1 ) neg z
3908
3909			}
3910
3911			return direction;
3912
3913		}
3914
3915		void main() {
3916
3917			vOutputDirection = getDirection( uv, faceIndex );
3918			gl_Position = vec4( position, 1.0 );
3919
3920		}
3921	`}var Em=class extends Zr{constructor(e=1,t={}
3921){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new dc(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`
3922
3923				varying vec3 vWorldDirection;
3924
3925				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
3926
3927					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
3928
3929				}
3930
3931				void main() {
3932
3933					vWorldDirection = transformDirection( position, modelMatrix );
3934
3935					#include <begin_vertex>
3936					#include <project_vertex>
3937
3938				}
3939			`,fragmentShader:`
3940
3941				uniform sampler2D tEquirect;
3942
3943				varying vec3 vWorldDirection;
3944
3945				#include <common>
3946
3947				void main() {
3948
3949					vec3 direction = normalize( vWorldDirection );
3950
3951					vec2 sampleUV = equirectUv( direction );
3952
3953					gl_FragColor = texture2D( tEquirect, sampleUV );
3954
3955				}
3956			`},r=new _c(5,5,5),i=new gu({name:`CubemapFromEquirect`,uniforms:cu(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new Fo(r,i),o=t.minFilter;return t.minFilter===1008&&(t.minFilter=Ve),new rf(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}};function Dm(e){let t=new WeakMap,n=new WeakMap,r=null;function i(e,t=!1){return e==null?null:t?o(e):a(e)}function a(n){if(n&&n.isTexture){let r=n.mapping;if(r===303||r===304){if(t.has(n)){let e=t.get(n).texture;return s(e,n.mapping)}{let r=n.image;if(r&&r.height>0){let i=new Em(r.height);return i.fromEquirectangularTexture(e,n),t.set(n,i),n.addEventListener(`dispose`,l),s(i.texture,n.mapping)}return null}}}return n}function o(t){if(t&&t.isTexture){let i=t.mapping,a=i===303||i===304,o=i===301||i===302;if(a||o){let i=n.get(t),s=i===void 0?0:i.texture.pmremVersion;if(t.isRenderTargetTexture&&t.pmremVersion!==s)return r===null&&(r=new _m(e)),i=a?r.fromEquirectangular(t,i):r.fromCubemap(t,i),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),i.texture;if(i!==void 0)return i.texture;{let s=t.image;return a&&s&&s.height>0||o&&s&&c(s)?(r===null&&(r=new _m(e)),i=a?r.fromEquirectangular(t):r.fromCubemap(t),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),t.addEventListener(`dispose`,u),i.texture):null}}}return t}function s(e,t){return t===303?e.mapping=301:t===304&&(e.mapping=302),e}function c(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}function l(e){let n=e.target;n.removeEventListener(`dispose`,l);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function u(e){let t=e.target;t.removeEventListener(`dispose`,u);let r=n.get(t);r!==void 0&&(n.delete(t),r.dispose())}function d(){t=new WeakMap,n=new WeakMap,r!==null&&(r.dispose(),r=null)}return{get:i,dispose:d}}function Om(e){let t={};
vendor: 36,234 bytes, lines 3956-4053
3956function n(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return n(e)!==null},init:function(){n(`EXT_color_buffer_float`),n(`WEBGL_clip_cull_distance`),n(`OES_texture_float_linear`),n(`EXT_color_buffer_half_float`),n(`WEBGL_multisampled_render_to_texture`),n(`WEBGL_render_shared_exponent`)},get:function(e){let t=n(e);return t===null&&er(`WebGLRenderer: `+e+` extension not supported.`),t}}}function km(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;s.index!==null&&t.remove(s.index);for(let e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener(`dispose`,o),delete i[s.id];let c=a.get(s);c&&(t.remove(c),a.delete(s)),r.releaseStatesOfGeometry(s),s.isInstancedBufferGeometry===!0&&delete s._maxInstanceCount,n.memory.geometries--}function s(e,t){return i[t.id]===!0?t:(t.addEventListener(`dispose`,o),i[t.id]=!0,n.memory.geometries++,t)}function c(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER)}function l(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(i===void 0)return;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;t<r;t+=3){let r=e[t+0],i=e[t+1],a=e[t+2];n.push(r,i,i,a,a,r)}}else{let e=i.array;o=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){let e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}let s=new(i.count>=65535?Aa:Oa)(n,1);s.version=o;let c=a.get(e);c&&t.remove(c),a.set(e,s)}function u(e){let t=a.get(e);if(t){let n=e.index;n!==null&&t.version<n.version&&l(e)}else l(e);return a.get(e)}return{get:s,update:c,getWireframeAttribute:u}}function Am(e,t,n){let r;function i(e){r=e}let a,o;function s(e){a=e.type,o=e.bytesPerElement}function c(t,i){e.drawElements(r,i,a,t*o),n.update(i,r,1)}function l(t,i,s){s!==0&&(e.drawElementsInstanced(r,i,a,t*o,s),n.update(i,r,s))}function u(e,i,o){if(o===0)return;t.get(`WEBGL_multi_draw`).multiDrawElementsWEBGL(r,i,0,a,e,0,o);let s=0;for(let e=0;e<o;e++)s+=i[e];n.update(s,r,1)}this.setMode=i,this.setIndex=s,this.render=c,this.renderInstances=l,this.renderMultiDraw=u}function jm(e){let t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(t,r,i){switch(n.calls++,r){case e.TRIANGLES:n.triangles+=t/3*i;break;case e.LINES:n.lines+=t/2*i;break;case e.LINE_STRIP:n.lines+=i*(t-1);break;case e.LINE_LOOP:n.lines+=i*t;break;case e.POINTS:n.points+=i*t;break;default:H(`WebGLInfo: Unknown draw mode:`,r)}}function i(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:t,render:n,programs:null,autoReset:!0,reset:i,update:r}}function Mm(e,t,n){let r=new WeakMap,i=new Yr;function a(a,o,s){let c=a.morphTargetInfluences,l=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=l===void 0?0:l.length,d=r.get(o);if(d===void 0||d.count!==u){d!==void 0&&d.texture.dispose();let e=o.morphAttributes.position!==void 0,n=o.morphAttributes.normal!==void 0,a=o.morphAttributes.color!==void 0,s=o.morphAttributes.position||[],c=o.morphAttributes.normal||[],l=o.morphAttributes.color||[],f=0;e===!0&&(f=1),n===!0&&(f=2),a===!0&&(f=3);let p=o.attributes.position.count*f,m=1;p>t.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new Qr(h,p,m,u);g.type=Qe,g.needsUpdate=!0;let _=f*4;for(let t=0;t<u;t++){let r=s[t],o=c[t],u=l[t],d=p*m*4*t;for(let t=0;t<r.count;t++){let s=t*_;e===!0&&(i.fromBufferAttribute(r,t),h[d+s+0]=i.x,h[d+s+1]=i.y,h[d+s+2]=i.z,h[d+s+3]=0),n===!0&&(i.fromBufferAttribute(o,t),h[d+s+4]=i.x,h[d+s+5]=i.y,h[d+s+6]=i.z,h[d+s+7]=0),a===!0&&(i.fromBufferAttribute(u,t),h[d+s+8]=i.x,h[d+s+9]=i.y,h[d+s+10]=i.z,h[d+s+11]=u.itemSize===4?i.w:1)}}d={count:u,texture:g,size:new W(p,m)},r.set(o,d);function v(){g.dispose(),r.delete(o),o.removeEventListener(`dispose`,v)}o.addEventListener(`dispose`,v)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)s.getUniforms().setValue(e,`morphTexture`,a.morphTexture,n);else{let t=0;for(let e=0;e<c.length;e++)t+=c[e];let n=o.morphTargetsRelative?1:1-t;s.getUniforms().setValue(e,`morphTargetBaseInfluence`,n),s.getUniforms().setValue(e,`morphTargetInfluences`,c)}s.getUniforms().setValue(e,`morphTargetsTexture`,d.texture,n),s.getUniforms().setValue(e,`morphTargetsTextureSize`,d.size)}return{update:a}}function Nm(e,t,n,r,i){let a=new WeakMap;function o(r){let o=i.render.frame,s=r.geometry,l=t.get(r,s);if(a.get(l)!==o&&(t.update(l),a.set(l,o)),r.isInstancedMesh&&(r.hasEventListener(`dispose`,c)===!1&&r.addEventListener(`dispose`,c),a.get(r)!==o&&(n.update(r.instanceMatrix,e.ARRAY_BUFFER),r.instanceColor!==null&&n.update(r.instanceColor,e.ARRAY_BUFFER),a.set(r,o))),r.isSkinnedMesh){let e=r.skeleton;a.get(e)!==o&&(e.update(),a.set(e,o))}return l}function s(){a=new WeakMap}function c(e){let t=e.target;t.removeEventListener(`dispose`,c),r.releaseStatesOfObject(t),n.remove(t.instanceMatrix),t.instanceColor!==null&&n.remove(t.instanceColor)}return{update:o,dispose:s}}var Pm={1:`LINEAR_TONE_MAPPING`,2:`REINHARD_TONE_MAPPING`,3:`CINEON_TONE_MAPPING`,4:`ACES_FILMIC_TONE_MAPPING`,6:`AGX_TONE_MAPPING`,7:`NEUTRAL_TONE_MAPPING`,5:`CUSTOM_TONE_MAPPING`};function Fm(e,t,n,r,i){let a=new Zr(t,n,{type:e,depthBuffer:r,stencilBuffer:i,depthTexture:r?new mc(t,n):void 0}),o=new Zr(t,n,{type:$e,depthBuffer:!1,stencilBuffer:!1}),s=new Ua;s.setAttribute(`position`,new J([-1,3,0,-1,-1,0,3,-1,0],3)),s.setAttribute(`uv`,new J([0,2,0,0,2,0],2));let c=new _u({uniforms:{tDiffuse:{value:null}},vertexShader:`
3957			precision highp float;
3958
3959			uniform mat4 modelViewMatrix;
3960			uniform mat4 projectionMatrix;
3961
3962			attribute vec3 position;
3963			attribute vec2 uv;
3964
3965			varying vec2 vUv;
3966
3967			void main() {
3968				vUv = uv;
3969				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3970			}`,fragmentShader:`
3971			precision highp float;
3972
3973			uniform sampler2D tDiffuse;
3974
3975			varying vec2 vUv;
3976
3977			#include <tonemapping_pars_fragment>
3978			#include <colorspace_pars_fragment>
3979
3980			void main() {
3981				gl_FragColor = texture2D( tDiffuse, vUv );
3982
3983				#ifdef LINEAR_TONE_MAPPING
3984					gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
3985				#elif defined( REINHARD_TONE_MAPPING )
3986					gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
3987				#elif defined( CINEON_TONE_MAPPING )
3988					gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
3989				#elif defined( ACES_FILMIC_TONE_MAPPING )
3990					gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
3991				#elif defined( AGX_TONE_MAPPING )
3992					gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
3993				#elif defined( NEUTRAL_TONE_MAPPING )
3994					gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
3995				#elif defined( CUSTOM_TONE_MAPPING )
3996					gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
3997				#endif
3998
3999				#ifdef SRGB_TRANSFER
4000					gl_FragColor = sRGBTransferOETF( gl_FragColor );
4001				#endif
4002			}`,depthTest:!1,depthWrite:!1}),l=new Fo(s,c),u=new Ad(-1,1,1,-1,0,1),d=null,f=null,p=!1,m,h=null,g=[],_=!1;this.setSize=function(e,t){a.setSize(e,t),o.setSize(e,t);for(let n=0;n<g.length;n++){let r=g[n];r.setSize&&r.setSize(e,t)}},this.setEffects=function(e){g=e,_=g.length>0&&g[0].isRenderPass===!0;let t=a.width,n=a.height;for(let e=0;e<g.length;e++){let r=g[e];r.setSize&&r.setSize(t,n)}},this.begin=function(e,t){if(p||e.toneMapping===0&&g.length===0)return!1;if(h=t,t!==null){let e=t.width,n=t.height;(a.width!==e||a.height!==n)&&this.setSize(e,n)}return _===!1&&e.setRenderTarget(a),m=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return _},this.end=function(e,t){e.toneMapping=m,p=!0;let n=a,r=o;for(let i=0;i<g.length;i++){let a=g[i];if(a.enabled!==!1&&(a.render(e,r,n,t),a.needsSwap!==!1)){let e=n;n=r,r=e}}if(d!==e.outputColorSpace||f!==e.toneMapping){d=e.outputColorSpace,f=e.toneMapping,c.defines={},Rr.getTransfer(d)===`srgb`&&(c.defines.SRGB_TRANSFER=``);let t=Pm[f];t&&(c.defines[t]=``),c.needsUpdate=!0}c.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(h),e.render(l,u),h=null,p=!1},this.isCompositing=function(){return p},this.dispose=function(){a.depthTexture&&a.depthTexture.dispose(),a.dispose(),o.dispose(),s.dispose(),c.dispose()}}var Im=new Jr,Lm=new mc(1,1),Rm=new Qr,zm=new ei,Bm=new dc,Vm=[],Hm=[],Um=new Float32Array(16),Wm=new Float32Array(9),Gm=new Float32Array(4);function Km(e,t,n){let r=e[0];if(r<=0||r>0)return e;let i=t*n,a=Vm[i];if(a===void 0&&(a=new Float32Array(i),Vm[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function qm(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Jm(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function Ym(e,t){let n=Hm[t];n===void 0&&(n=new Int32Array(t),Hm[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Xm(e,t){let n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Zm(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(qm(n,t))return;e.uniform2fv(this.addr,t),Jm(n,t)}}function Qm(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(t.r!==void 0)(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(qm(n,t))return;e.uniform3fv(this.addr,t),Jm(n,t)}}function $m(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(qm(n,t))return;e.uniform4fv(this.addr,t),Jm(n,t)}}function eh(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(qm(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Jm(n,t)}else{if(qm(n,r))return;Gm.set(r),e.uniformMatrix2fv(this.addr,!1,Gm),Jm(n,r)}}function th(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(qm(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Jm(n,t)}else{if(qm(n,r))return;Wm.set(r),e.uniformMatrix3fv(this.addr,!1,Wm),Jm(n,r)}}function nh(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(qm(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Jm(n,t)}else{if(qm(n,r))return;Um.set(r),e.uniformMatrix4fv(this.addr,!1,Um),Jm(n,r)}}function rh(e,t){let n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function ih(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(qm(n,t))return;e.uniform2iv(this.addr,t),Jm(n,t)}}function ah(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(qm(n,t))return;e.uniform3iv(this.addr,t),Jm(n,t)}}function oh(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(qm(n,t))return;e.uniform4iv(this.addr,t),Jm(n,t)}}function sh(e,t){let n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function ch(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(qm(n,t))return;e.uniform2uiv(this.addr,t),Jm(n,t)}}function lh(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(qm(n,t))return;e.uniform3uiv(this.addr,t),Jm(n,t)}}function uh(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(qm(n,t))return;e.uniform4uiv(this.addr,t),Jm(n,t)}}function dh(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i);let a;this.type===e.SAMPLER_2D_SHADOW?(Lm.compareFunction=n.isReversedDepthBuffer()?518:515,a=Lm):a=Im,n.setTexture2D(t||a,i)}function fh(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||zm,i)}function ph(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||Bm,i)}function mh(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||Rm,i)}function hh(e){switch(e){case 5126:return Xm;case 35664:return Zm;case 35665:return Qm;case 35666:return $m;case 35674:return eh;case 35675:return th;case 35676:return nh;case 5124:case 35670:return rh;case 35667:case 35671:return ih;case 35668:case 35672:return ah;case 35669:case 35673:return oh;case 5125:return sh;case 36294:return ch;case 36295:return lh;case 36296:return uh;case 35678:case 36198:case 36298:case 36306:case 35682:return dh;case 35679:case 36299:case 36307:return fh;case 35680:case 36300:case 36308:case 36293:return ph;case 36289:case 36303:case 36311:case 36292:return mh}}function gh(e,t){e.uniform1fv(this.addr,t)}function _h(e,t){let n=Km(t,this.size,2);e.uniform2fv(this.addr,n)}function vh(e,t){let n=Km(t,this.size,3);e.uniform3fv(this.addr,n)}function yh(e,t){let n=Km(t,this.size,4);e.uniform4fv(this.addr,n)}function bh(e,t){let n=Km(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function xh(e,t){let n=Km(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Sh(e,t){let n=Km(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Ch(e,t){e.uniform1iv(this.addr,t)}function wh(e,t){e.uniform2iv(this.addr,t)}function Th(e,t){e.uniform3iv(this.addr,t)}function Eh(e,t){e.uniform4iv(this.addr,t)}function Dh(e,t){e.uniform1uiv(this.addr,t)}function Oh(e,t){e.uniform2uiv(this.addr,t)}function kh(e,t){e.uniform3uiv(this.addr,t)}function Ah(e,t){e.uniform4uiv(this.addr,t)}function jh(e,t,n){let r=this.cache,i=t.length,a=Ym(n,i);qm(r,a)||(e.uniform1iv(this.addr,a),Jm(r,a));let o;o=this.type===e.SAMPLER_2D_SHADOW?Lm:Im;for(let e=0;e!==i;++e)n.setTexture2D(t[e]||o,a[e])}function Mh(e,t,n){let r=this.cache,i=t.length,a=Ym(n,i);qm(r,a)||(e.uniform1iv(this.addr,a),Jm(r,a));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||zm,a[e])}function Nh(e,t,n){let r=this.cache,i=t.length,a=Ym(n,i);qm(r,a)||(e.uniform1iv(this.addr,a),Jm(r,a));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||Bm,a[e])}function Ph(e,t,n){let r=this.cache,i=t.length,a=Ym(n,i);qm(r,a)||(e.uniform1iv(this.addr,a),Jm(r,a));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||Rm,a[e])}function Fh(e){switch(e){case 5126:return gh;case 35664:return _h;case 35665:return vh;case 35666:return yh;case 35674:return bh;case 35675:return xh;case 35676:return Sh;case 5124:case 35670:return Ch;case 35667:case 35671:return wh;case 35668:case 35672:return Th;case 35669:case 35673:return Eh;case 5125:return Dh;case 36294:return Oh;case 36295:return kh;case 36296:return Ah;case 35678:case 36198:case 36298:case 36306:case 35682:return jh;case 35679:case 36299:case 36307:return Mh;case 35680:case 36300:case 36308:case 36293:return Nh;case 36289:case 36303:case 36311:case 36292:return Ph}}var Ih=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=hh(t.type)}},Lh=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=Fh(t.type)}},Rh=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let r=this.seq;for(let i=0,a=r.length;i!==a;++i){let a=r[i];a.setValue(e,t[a.id],n)}}},zh=/(\w+)(\])?(\[|\.)?/g;function Bh(e,t){e.seq.push(t),e.map[t.id]=t}function Vh(e,t,n){let r=e.name,i=r.length;for(zh.lastIndex=0;;){let a=zh.exec(r),o=zh.lastIndex,s=a[1],c=a[2]===`]`,l=a[3];if(c&&(s|=0),l===void 0||l===`[`&&o+2===i){Bh(n,l===void 0?new Ih(s,e,t):new Lh(s,e,t));break}{let e=n.map[s];e===void 0&&(e=new Rh(s),Bh(n,e)),n=e}}}var Hh=class{constructor(e,t){this.seq=[],this.map={};let n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){let n=e.getActiveUniform(t,r);Vh(n,e.getUniformLocation(t,n.name),this)}let r=[],i=[];for(let t of this.seq)t.type===e.SAMPLER_2D_SHADOW||t.type===e.SAMPLER_CUBE_SHADOW||t.type===e.SAMPLER_2D_ARRAY_SHADOW?r.push(t):i.push(t);r.length>0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}};function Uh(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}var Wh=37297,Gh=0;function Kh(e,t){let n=e.split(`
4003`),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e<a;e++){let i=e+1;r.push(`${i===t?`>`:` `} ${i}: ${n[e]}`)}return r.join(`
4004`)}var qh=new Nr;function Jh(e){Rr._getMatrix(qh,Rr.workingColorSpace,e);let t=`mat3( ${qh.elements.map(e=>e.toFixed(4))} )`;switch(Rr.getTransfer(e)){case _n:return[t,`LinearTransferOETF`];case vn:return[t,`sRGBTransferOETF`];default:return V(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function Yh(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||``).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+`
4005
4006`+i+`
4007
4008`+Kh(e.getShaderSource(t),r)}return i}function Xh(e,t){let n=Jh(t);return[`vec4 ${e}( vec4 value ) {`,`	return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(`
4009`)}var Zh={1:`Linear`,2:`Reinhard`,3:`Cineon`,4:`ACESFilmic`,6:`AgX`,7:`Neutral`,5:`Custom`};function Qh(e,t){let n=Zh[t];return n===void 0?(V(`WebGLProgram: Unsupported toneMapping:`,t),`vec3 `+e+`( vec3 color ) { return LinearToneMapping( color ); }`):`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}var $h=new G;function eg(){return Rr.getLuminanceCoefficients($h),[`float luminance( const in vec3 rgb ) {`,`	const vec3 weights = vec3( ${$h.x.toFixed(4)}, ${$h.y.toFixed(4)}, ${$h.z.toFixed(4)} );`,`	return dot( weights, rgb );`,`}`].join(`
4010`)}function tg(e){return[e.extensionClipCullDistance?`#extension GL_ANGLE_clip_cull_distance : require`:``,e.extensionMultiDraw?`#extension GL_ANGLE_multi_draw : require`:``].filter(ig).join(`
4011`)}function ng(e){let t=[];for(let n in e){let r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(`
4012`)}function rg(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){let r=e.getActiveAttrib(t,i),a=r.name,o=1;r.type===e.FLOAT_MAT2&&(o=2),r.type===e.FLOAT_MAT3&&(o=3),r.type===e.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}function ig(e){return e!==``}function ag(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function og(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var sg=/^[ \t]*#include +<([\w\d./]+)>/gm;function cg(e){return e.replace(sg,ug)}var lg=new Map;function ug(e,t){let n=Xp[t];if(n===void 0){let e=lg.get(t);if(e!==void 0)n=Xp[e],V(`WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e);else throw Error(`Can not resolve #include <`+t+`>`)}return cg(n)}var dg=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function fg(e){return e.replace(dg,pg)}function pg(e,t,n,r){let i=``;for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\[\s*i\s*\]/g,`[ `+e+` ]`).replace(/UNROLLED_LOOP_INDEX/g,e);return i}function mg(e){let t=`precision ${e.precision} float;
4013	precision ${e.precision} int;
4014	precision ${e.precision} sampler2D;
4015	precision ${e.precision} samplerCube;
4016	precision ${e.precision} sampler3D;
4017	precision ${e.precision} sampler2DArray;
4018	precision ${e.precision} sampler2DShadow;
4019	precision ${e.precision} samplerCubeShadow;
4020	precision ${e.precision} sampler2DArrayShadow;
4021	precision ${e.precision} isampler2D;
4022	precision ${e.precision} isampler3D;
4023	precision ${e.precision} isamplerCube;
4024	precision ${e.precision} isampler2DArray;
4025	precision ${e.precision} usampler2D;
4026	precision ${e.precision} usampler3D;
4027	precision ${e.precision} usamplerCube;
4028	precision ${e.precision} usampler2DArray;
4029	`;return e.precision===`highp`?t+=`
4030#define HIGH_PRECISION`:e.precision===`mediump`?t+=`
4031#define MEDIUM_PRECISION`:e.precision===`lowp`&&(t+=`
4032#define LOW_PRECISION`),t}var hg={1:`SHADOWMAP_TYPE_PCF`,3:`SHADOWMAP_TYPE_VSM`};function gg(e){return hg[e.shadowMapType]||`SHADOWMAP_TYPE_BASIC`}var _g={301:`ENVMAP_TYPE_CUBE`,302:`ENVMAP_TYPE_CUBE`,306:`ENVMAP_TYPE_CUBE_UV`};function vg(e){return e.envMap===!1?`ENVMAP_TYPE_CUBE`:_g[e.envMapMode]||`ENVMAP_TYPE_CUBE`}var yg={302:`ENVMAP_MODE_REFRACTION`};function bg(e){return e.envMap===!1?`ENVMAP_MODE_REFLECTION`:yg[e.envMapMode]||`ENVMAP_MODE_REFLECTION`}var xg={0:`ENVMAP_BLENDING_MULTIPLY`,1:`ENVMAP_BLENDING_MIX`,2:`ENVMAP_BLENDING_ADD`};function Sg(e){return e.envMap===!1?`ENVMAP_BLENDING_NONE`:xg[e.combine]||`ENVMAP_BLENDING_NONE`}function Cg(e){let t=e.envMapCubeUVHeight;if(t===null)return null;let n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(2**n,112)),texelHeight:r,maxMip:n}}function wg(e,t,n,r){let i=e.getContext(),a=n.defines,o=n.vertexShader,s=n.fragmentShader,c=gg(n),l=vg(n),u=bg(n),d=Sg(n),f=Cg(n),p=tg(n),m=ng(a),h=i.createProgram(),g,_,v=n.glslVersion?`#version `+n.glslVersion+`
4033`:``;n.isRawShaderMaterial?(g=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(ig).join(`
4034`),g.length>0&&(g+=`
4035`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(ig).join(`
4036`),_.length>0&&(_+=`
4037`)):(g=[mg(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.extensionClipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexNormals?`#define HAS_NORMAL`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&n.flatShading===!1?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,`	attribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,`	attribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,`	uniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,`	attribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,`	attribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,`	attribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,`	attribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,`	attribute vec4 color;`,`#elif defined( USE_COLOR )`,`	attribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,`	attribute vec4 skinIndex;`,`	attribute vec4 skinWeight;`,`#endif`,`
4038`].filter(ig).join(`
4039`),_=[mg(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matcap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+d:``,f?`#define CUBEUV_TEXEL_WIDTH `+f.texelWidth:``,f?`#define CUBEUV_TEXEL_HEIGHT `+f.texelHeight:``,f?`#define CUBEUV_MAX_MIP `+f.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.packedNormalMap?`#define USE_PACKED_NORMALMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor?`#define USE_COLOR`:``,n.vertexAlphas||n.batchingColor?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.numLightProbeGrids>0?`#define USE_LIGHT_PROBES_GRID`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:Xp.tonemapping_pars_fragment,n.toneMapping===0?``:Qh(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,Xp.colorspace_pars_fragment,Xh(`linearToOutputTexel`,n.outputColorSpace),eg(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,`
4040`].filter(ig).join(`
4041`)),o=cg(o),o=ag(o,n),o=og(o,n),s=cg(s),s=ag(s,n),s=og(s,n),o=fg(o),s=fg(s),n.isRawShaderMaterial!==!0&&(v=`#version 300 es
4042`,g=[p,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(`
4043`)+`
4044`+g,_=[`#define varying in`,n.glslVersion===`300 es`?``:`layout(location = 0) out highp vec4 pc_fragColor;`,n.glslVersion===`300 es`?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(`
4045`)+`
4046`+_);let y=v+g+o,b=v+_+s,x=Uh(i,i.VERTEX_SHADER,y),S=Uh(i,i.FRAGMENT_SHADER,b);i.attachShader(h,x),i.attachShader(h,S),n.index0AttributeName===void 0?n.morphTargets===!0&&i.bindAttribLocation(h,0,`position`):i.bindAttribLocation(h,0,n.index0AttributeName),i.linkProgram(h);function C(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(h)||``,r=i.getShaderInfoLog(x)||``,a=i.getShaderInfoLog(S)||``,o=n.trim(),s=r.trim(),c=a.trim(),l=!0,u=!0;if(i.getProgramParameter(h,i.LINK_STATUS)===!1){if(l=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,h,x,S);else{let e=Yh(i,x,`vertex`),n=Yh(i,S,`fragment`);H(`THREE.WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(h,i.VALIDATE_STATUS)+`
4047
4048Material Name: `+t.name+`
4049Material Type: `+t.type+`
4050
4051Program Info Log: `+o+`
4052`+e+`
4053`+n)}}else o===``?(s===``||c===``)&&(u=!1):V(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),w=new Hh(i,h),T=rg(i,h)}let w;this.getUniforms=function(){return w===void 0&&C(this),w};let T;this.getAttributes=function(){return T===void 0&&C(this),T};let E=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=i.getProgramParameter(h,Wh)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Gh++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}var Tg=0,Eg=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(i)===!1&&(a.add(i),i.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new Dg(e),t.set(e,n)),n}},Dg=class{constructor(e){this.id=Tg++,this.code=e,this.usedTimes=0}};function Og(e){return e===1030||e===37490||e===36285}function kg(e,t,n,r,i,a){let o=new fi,s=new Eg,c=new Set,l=[],u=new Map,d=r.logarithmicDepthBuffer,f=r.precision,p={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,MeshNormalMaterial:`normal`,MeshBasicMaterial:`basic`,MeshLambertMaterial:`lambert`,MeshPhongMaterial:`phong`,MeshToonMaterial:`toon`,MeshStandardMaterial:`physical`,MeshPhysicalMaterial:`physical`,MeshMatcapMaterial:`matcap`,LineBasicMaterial:`basic`,LineDashedMaterial:`dashed`,PointsMaterial:`points`,ShadowMaterial:`shadow`,SpriteMaterial:`sprite`};function m(e){return c.add(e),e===0?`uv`:`uv${e}`}function h(i,o,l,u,h,g){let _=u.fog,v=h.geometry,y=i.isMeshStandardMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial?u.environment:null,b=i.isMeshStandardMaterial||i.isMeshLambertMaterial&&!i.envMap||i.isMeshPhongMaterial&&!i.envMap,x=t.get(i.envMap||y,b),S=x&&x.mapping===306?x.image.height:null,C=p[i.type];i.precision!==null&&(f=r.getMaxPrecision(i.precision),f!==i.precision&&V(`WebGLProgram.getParameters:`,i.precision,`not supported, using`,f,`instead.`));let w=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,T=w===void 0?0:w.length,E=0;v.morphAttributes.position!==void 0&&(E=1),v.morphAttributes.normal!==void 0&&(E=2),v.morphAttributes.color!==void 0&&(E=3);let D,O,k,A;if(C){let e=Zp[C];D=e.vertexShader,O=e.fragmentShader}else D=i.vertexShader,O=i.fragmentShader,s.update(i),k=s.getVertexShaderID(i),A=s.getFragmentShaderID(i);let j=e.getRenderTarget(),M=e.state.buffers.depth.getReversed(),N=h.isInstancedMesh===!0,P=h.isBatchedMesh===!0,ee=!!i.map,te=!!i.matcap,ne=!!x,re=!!i.aoMap,F=!!i.lightMap,I=!!i.bumpMap,L=!!i.normalMap,ie=!!i.displacementMap,ae=!!i.emissiveMap,oe=!!i.metalnessMap,se=!!i.roughnessMap,ce=i.anisotropy>0,le=i.clearcoat>0,ue=i.dispersion>0,de=i.iridescence>0,fe=i.sheen>0,pe=i.transmission>
40530,me=ce&&!!i.anisotropyMap,he=le&&!!i.clearcoatMap,ge=le&&!!i.clearcoatNormalMap,R=le&&!!i.clearcoatRoughnessMap,_e=de&&!!i.iridescenceMap,ve=de&&!!i.iridescenceThicknessMap,ye=fe&&!!i.sheenColorMap,z=fe&&!!i.sheenRoughnessMap,be=!!i.specularMap,B=!!i.specularColorMap,xe=!!i.specularIntensityMap,Se=pe&&!!i.transmissionMap,Ce=pe&&!!i.thicknessMap,we=!!i.gradientMap,Te=!!i.alphaMap,Ee=i.alphaTest>0,De=!!i.alphaHash,Oe=!!i.extensions,ke=0;i.toneMapped&&(j===null||j.isXRRenderTarget===!0)&&(ke=e.toneMapping);let Ae={shaderID:C,shaderType:i.type,shaderName:i.name,vertexShader:D,fragmentShader:O,defines:i.defines,customVertexShaderID:k,customFragmentShaderID:A,isRawShaderMaterial:i.isRawShaderMaterial===!0,glslVersion:i.glslVersion,precision:f,batching:P,batchingColor:P&&h._colorsTexture!==null,instancing:N,instancingColor:N&&h.instanceColor!==null,instancingMorph:N&&h.morphTexture!==null,outputColorSpace:j===null?e.outputColorSpace:j.isXRRenderTarget===!0?j.texture.colorSpace:Rr.workingColorSpace,alphaToCoverage:!!i.alphaToCoverage,map:ee,matcap:te,envMap:ne,envMapMode:ne&&x.mapping,envMapCubeUVHeight:S,aoMap:re,lightMap:F,bumpMap:I,normalMap:L,displacementMap:ie,emissiveMap:ae,normalMapObjectSpace:L&&i.normalMapType===1,normalMapTangentSpace:L&&i.normalMapType===0,packedNormalMap:L&&i.normalMapType===0&&Og(i.normalMap.format),metalnessMap:oe,roughnessMap:se,anisotropy:ce,anisotropyMap:me,clearcoat:le,clearcoatMap:he,clearcoatNormalMap:ge,clearcoatRoughnessMap:R,dispersion:ue,iridescence:de,iridescenceMap:_e,iridescenceThicknessMap:ve,sheen:fe,sheenColorMap:ye,sheenRoughnessMap:z,specularMap:be,specularColorMap:B,specularIntensityMap:xe,transmission:pe,transmissionMap:Se,thicknessMap:Ce,gradientMap:we,opaque:i.transparent===!1&&i.blending===1&&i.alphaToCoverage===!1,alphaMap:Te,alphaTest:Ee,alphaHash:De,combine:i.combine,mapUv:ee&&m(i.map.channel),aoMapUv:re&&m(i.aoMap.channel),lightMapUv:F&&m(i.lightMap.channel),bumpMapUv:I&&m(i.bumpMap.channel),normalMapUv:L&&m(i.normalMap.channel),displacementMapUv:ie&&m(i.displacementMap.channel),emissiveMapUv:ae&&m(i.emissiveMap.channel),metalnessMapUv:oe&&m(i.metalnessMap.channel),roughnessMapUv:se&&m(i.roughnessMap.channel),anisotropyMapUv:me&&m(i.anisotropyMap.channel),clearcoatMapUv:he&&m(i.clearcoatMap.channel),clearcoatNormalMapUv:ge&&m(i.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:R&&m(i.clearcoatRoughnessMap.channel),iridescenceMapUv:_e&&m(i.iridescenceMap.channel),iridescenceThicknessMapUv:ve&&m(i.iridescenceThicknessMap.channel),sheenColorMapUv:ye&&m(i.sheenColorMap.channel),sheenRoughnessMapUv:z&&m(i.sheenRoughnessMap.channel),specularMapUv:be&&m(i.specularMap.channel),specularColorMapUv:B&&m(i.specularColorMap.channel),specularIntensityMapUv:xe&&m(i.specularIntensityMap.channel),transmissionMapUv:Se&&m(i.transmissionMap.channel),thicknessMapUv:Ce&&m(i.thicknessMap.channel),alphaMapUv:Te&&m(i.alphaMap.channel),vertexTangents:!!v.attributes.tangent&&(L||ce),vertexNormals:!!v.attributes.normal,vertexColors:i.vertexColors,vertexAlphas:i.vertexColors===!0&&!!v.attributes.color&&v.attributes.color.itemSize===4,pointsUvs:h.isPoints===!0&&!!v.attributes.uv&&(ee||Te),fog:!!_,useFog:i.fog===!0,fogExp2:!!_&&_.isFogExp2,flatShading:i.wireframe===!1&&(i.flatShading===!0||v.attributes.normal===void 0&&L===!1&&(i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshPhysicalMaterial)),sizeAttenuation:i.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:M,skinning:h.isSkinnedMesh===!0,morphTargets:v.morphAttributes.position!==void 0,morphNormals:v.morphAttributes.normal!==void 0,morphColors:v.morphAttributes.color!==void 0,morphTargetsCount:T,morphTextureStride:E,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numLightProbeGrids:g.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&l.length>0,shadowMapType:e.shadowMap.type,toneMapping:ke,decodeVideoTexture:ee&&i.map.isVideoTexture===!0&&Rr.getTransfer(i.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:ae&&i.emissiveMap.isVideoTexture===!0&&Rr.getTransfer(i.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:i.premultipliedAlpha,doubleSided:i.side===2,flipSided:i.side===1,useDepthPacking:i.depthPacking>=0,depthPacking:i.depthPacking||0,index0AttributeName:i.index0AttributeName,extensionCl
vendor: 8,524 bytes, line 4053
4053ipCullDistance:Oe&&i.extensions.clipCullDistance===!0&&n.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(Oe&&i.extensions.multiDraw===!0||P)&&n.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:n.has(`KHR_parallel_shader_compile`),customProgramCacheKey:i.customProgramCacheKey()};return Ae.vertexUv1s=c.has(1),Ae.vertexUv2s=c.has(2),Ae.vertexUv3s=c.has(3),c.clear(),Ae}function g(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(_(n,t),v(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function _(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function v(e,t){o.disableAll(),t.instancing&&o.enable(0),t.instancingColor&&o.enable(1),t.instancingMorph&&o.enable(2),t.matcap&&o.enable(3),t.envMap&&o.enable(4),t.normalMapObjectSpace&&o.enable(5),t.normalMapTangentSpace&&o.enable(6),t.clearcoat&&o.enable(7),t.iridescence&&o.enable(8),t.alphaTest&&o.enable(9),t.vertexColors&&o.enable(10),t.vertexAlphas&&o.enable(11),t.vertexUv1s&&o.enable(12),t.vertexUv2s&&o.enable(13),t.vertexUv3s&&o.enable(14),t.vertexTangents&&o.enable(15),t.anisotropy&&o.enable(16),t.alphaHash&&o.enable(17),t.batching&&o.enable(18),t.dispersion&&o.enable(19),t.batchingColor&&o.enable(20),t.gradientMap&&o.enable(21),t.packedNormalMap&&o.enable(22),t.vertexNormals&&o.enable(23),e.push(o.mask),o.disableAll(),t.fog&&o.enable(0),t.useFog&&o.enable(1),t.flatShading&&o.enable(2),t.logarithmicDepthBuffer&&o.enable(3),t.reversedDepthBuffer&&o.enable(4),t.skinning&&o.enable(5),t.morphTargets&&o.enable(6),t.morphNormals&&o.enable(7),t.morphColors&&o.enable(8),t.premultipliedAlpha&&o.enable(9),t.shadowMapEnabled&&o.enable(10),t.doubleSided&&o.enable(11),t.flipSided&&o.enable(12),t.useDepthPacking&&o.enable(13),t.dithering&&o.enable(14),t.transmission&&o.enable(15),t.sheen&&o.enable(16),t.opaque&&o.enable(17),t.pointsUvs&&o.enable(18),t.decodeVideoTexture&&o.enable(19),t.decodeVideoTextureEmissive&&o.enable(20),t.alphaToCoverage&&o.enable(21),t.numLightProbeGrids>0&&o.enable(22),e.push(o.mask)}function y(e){let t=p[e.type],n;if(t){let e=Zp[t];n=pu.clone(e.uniforms)}else n=e.uniforms;return n}function b(t,n){let r=u.get(n);return r===void 0?(r=new wg(e,n,t,i),l.push(r),u.set(n,r)):++r.usedTimes,r}function x(e){if(--e.usedTimes===0){let t=l.indexOf(e);l[t]=l[l.length-1],l.pop(),u.delete(e.cacheKey),e.destroy()}}function S(e){s.remove(e)}function C(){s.dispose()}return{getParameters:h,getProgramCacheKey:g,getUniforms:y,acquireProgram:b,releaseProgram:x,releaseShaderCache:S,programs:l,dispose:C}}function Ag(){let e=new WeakMap;function t(t){return e.has(t)}function n(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function r(t){e.delete(t)}function i(t,n,r){e.get(t)[n]=r}function a(){e=new WeakMap}return{has:t,get:n,remove:r,update:i,dispose:a}}function jg(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.materialVariant===t.materialVariant?e.z===t.z?e.id-t.id:e.z-t.z:e.materialVariant-t.materialVariant:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function Mg(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function Ng(){let e=[],t=0,n=[],r=[],i=[];function a(){t=0,n.length=0,r.length=0,i.length=0}function o(e){let t=0;return e.isInstancedMesh&&(t+=2),e.isSkinnedMesh&&(t+=1),t}function s(n,r,i,a,s,c){let l=e[t];return l===void 0?(l={id:n.id,object:n,geometry:r,material:i,materialVariant:o(n),groupOrder:a,renderOrder:n.renderOrder,z:s,group:c},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.materialVariant=o(n),l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=c),t++,l}function c(e,t,a,o,c,l){let u=s(e,t,a,o,c,l);a.transmission>0?r.push(u):a.transparent===!0?i.push(u):n.push(u)}function l(e,t,a,o,c,l){let u=s(e,t,a,o,c,l);a.transmission>0?r.unshift(u):a.transparent===!0?i.unshift(u):n.unshift(u)}function u(e,t){n.length>1&&n.sort(e||jg),r.length>1&&r.sort(t||Mg),i.length>1&&i.sort(t||Mg)}function d(){for(let n=t,r=e.length;n<r;n++){let t=e[n];if(t.id===null)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}}return{opaque:n,transmissive:r,transparent:i,init:a,push:c,unshift:l,finish:d,sort:u}}function Pg(){let e=new WeakMap;function t(t,n){let r=e.get(t),i;return r===void 0?(i=new Ng,e.set(t,[i])):n>=r.length?(i=new Ng,r.push(i)):i=r[n],i}function n(){e=new WeakMap}return{get:t,dispose:n}}function Fg(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new G,color:new q};break;case`SpotLight`:n={position:new G,direction:new G,color:new q,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new G,color:new q,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new G,skyColor:new q,groundColor:new q};break;case`RectAreaLight`:n={color:new q,position:new G,halfWidth:new G,halfHeight:new G}}return e[t.id]=n,n}}}function Ig(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new W};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new W};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new W,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}var Lg=0;function Rg(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+ +!!t.map-!!e.map}function zg(e){let t=new Fg,n=Ig(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new G);let i=new G,a=new K,o=new K;function s(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(Rg);for(let e=0,y=i.length;e<y;e++){let y=i[e],b=y.color,x=y.intensity,S=y.distance,C=null;if(y.shadow&&y.shadow.map&&(C=y.shadow.map.texture.format===1030?y.shadow.map.texture:y.shadow.map.depthTexture||y.shadow.map.texture),y.isAmbientLight)a+=b.r*x,o+=b.g*x,s+=b.b*x;else if(y.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(y.sh.coefficients[e],x);v++}else if(y.isDirectionalLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[c]=t,r.directionalShadowMap[c]=C,r.directionalShadowMatrix[c]=y.shadow.matrix,p++}r.directional[c]=e,c++}
vendor: 4,423 bytes, lines 4053-4058
4053else if(y.isSpotLight){let e=t.get(y);e.position.setFromMatrixPosition(y.matrixWorld),e.color.copy(b).multiplyScalar(x),e.distance=S,e.coneCos=Math.cos(y.angle),e.penumbraCos=Math.cos(y.angle*(1-y.penumbra)),e.decay=y.decay,r.spot[u]=e;let i=y.shadow;if(y.map&&(r.spotLightMap[g]=y.map,g++,i.updateMatrices(y),y.castShadow&&_++),r.spotLightMatrix[u]=i.matrix,y.castShadow){let e=n.get(y);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[u]=e,r.spotShadowMap[u]=C,h++}u++}else if(y.isRectAreaLight){let e=t.get(y);e.color.copy(b).multiplyScalar(x),e.halfWidth.set(y.width*.5,0,0),e.halfHeight.set(0,y.height*.5,0),r.rectArea[d]=e,d++}else if(y.isPointLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),e.distance=y.distance,e.decay=y.decay,y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[l]=t,r.pointShadowMap[l]=C,r.pointShadowMatrix[l]=y.shadow.matrix,m++}r.point[l]=e,l++}else if(y.isHemisphereLight){let e=t.get(y);e.skyColor.copy(y.color).multiplyScalar(x),e.groundColor.copy(y.groundColor).multiplyScalar(x),r.hemi[f]=e,f++}}d>0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=Y.LTC_FLOAT_1,r.rectAreaLTC2=Y.LTC_FLOAT_2):(r.rectAreaLTC1=Y.LTC_HALF_1,r.rectAreaLTC2=Y.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=Lg++)}function c(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t<f;t++){let f=e[t];if(f.isDirectionalLight){let e=r.directional[n];e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),n++}else if(f.isSpotLight){let e=r.spot[c];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),c++}else if(f.isRectAreaLight){let e=r.rectArea[l];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),o.identity(),a.copy(f.matrixWorld),a.premultiply(d),o.extractRotation(a),e.halfWidth.set(f.width*.5,0,0),e.halfHeight.set(0,f.height*.5,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),l++}else if(f.isPointLight){let e=r.point[s];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),s++}else if(f.isHemisphereLight){let e=r.hemi[u];e.direction.setFromMatrixPosition(f.matrixWorld),e.direction.transformDirection(d),u++}}}return{setup:s,setupView:c,state:r}}function Bg(e){let t=new zg(e),n=[],r=[],i=[];function a(e){d.camera=e,n.length=0,r.length=0,i.length=0}function o(e){n.push(e)}function s(e){r.push(e)}function c(e){i.push(e)}function l(){t.setup(n)}function u(e){t.setupView(n,e)}let d={lightsArray:n,shadowsArray:r,lightProbeGridArray:i,camera:null,lights:t,transmissionRenderTarget:{},textureUnits:0};return{init:a,state:d,setupLights:l,setupLightsView:u,pushLight:o,pushShadow:s,pushLightProbeGrid:c}}function Vg(e){let t=new WeakMap;function n(n,r=0){let i=t.get(n),a;return i===void 0?(a=new Bg(e),t.set(n,[a])):r>=i.length?(a=new Bg(e),i.push(a)):a=i[r],a}function r(){t=new WeakMap}return{get:n,dispose:r}}var Hg=`void main() {
4054	gl_Position = vec4( position, 1.0 );
4055}`,Ug=`uniform sampler2D shadow_pass;
4056uniform vec2 resolution;
4057uniform float radius;
4058void main() {
4059	const float samples = float( VSM_SAMPLES );
4060	float mean = 0.0;
4061	float squared_mean = 0.0;
4062	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
4063	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
4064	for ( float i = 0.0; i < samples; i ++ ) {
4065		float uvOffset = uvStart + i * uvStride;
4066		#ifdef HORIZONTAL_PASS
4067			vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;
4068			mean += distribution.x;
4069			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
4070		#else
4071			float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;
4072			mean += depth;
4073			squared_mean += depth * depth;
4074		#endif
4075	}
4076	mean = mean / samples;
4077	squared_mean = squared_mean / samples;
4078	float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
4079	gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
4080}`,Wg=[new G(1,0,0),new G(-1,0,0),new G(0,1,0),new G(0,-1,0),new G(0,0,1),new G(0,0,-1)],Gg=[new G(0,-1,0),new G(0,-1,0),new G(0,0,1),new G(0,0,-1),new G(0,-1,0),new G(0,-1,0)],Kg=new K,qg=new G,Jg=new G;function Yg(e,t,n){let r=new hs,i=new W,a=new W,o=new Yr,s=new wu,c=new Tu,l={},u=n.maxTextureSize,d={0:1,1:0,2:2},f=new gu({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new W},radius:{value:4}},vertexShader:Hg,fragmentShader:Ug}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new Ua;m.setAttribute(`position`,new Ca(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new Fo(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;this.type===2&&(V(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),this.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.depth.getReversed()===!0?f.buffers.color.setClear(0,0,0,0):f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==this.type;p&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;c<l;c++){let l=t[c],d=l.shadow;if(d===void 0){V(`WebGLShadowMap:`,l,`has no shadow.`);continue}if(d.autoUpdate===!1&&d.needsUpdate===!1)continue;i.copy(d.mapSize);let m=d.getFrameExtents();i.multiply(m),a.copy(d.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/m.x),i.x=a.x*m.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/m.y),i.y=a.y*m.y,d.mapSize.y=a.y));let h=e.state.buffers.depth.getReversed();if(d.camera._reversedDepth=h,d.map===null||p===!0){if(d.map!==null&&(d.map.depthTexture!==null&&(d.map.depthTexture.dispose(),d.map.depthTexture=null),d.map.dispose()),this.type===3){if(l.isPointLight){V(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}d.map=new Zr(i.x,i.y,{format:ft,type:$e,minFilter:Ve,magFilter:Ve,generateMipmaps:!1}),d.map.texture.name=l.name+`.shadowMap`,d.map.depthTexture=new mc(i.x,i.y,Qe),d.map.depthTexture.name=l.name+`.shadowMapDepth`,d.map.depthTexture.format=ct,d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=Ie,d.map.depthTexture.magFilter=Ie}else l.isPointLight?(d.map=new Em(i.x),d.map.depthTexture=new hc(i.x,Ze)):(d.map=new Zr(i.x,i.y),d.map.depthTexture=new mc(i.x,i.y,Ze)),d.map.depthTexture.name=l.name+`.shadowMap`,d.map.depthTexture.format=ct,this.type===1?(d.map.depthTexture.compareFunction=h?518:515,d.map.depthTexture.minFilter=Ve,d.map.depthTexture.magFilter=Ve):(d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=Ie,d.map.depthTexture.magFilter=Ie);d.camera.updateProjectionMatrix()}let g=d.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t<g;t++){if(d.map.isWebGLCubeRenderTarget)e.setRenderTarget(d.map,t),e.clear();else{t===0&&(e.setRenderTarget(d.map),e.clear());let n=d.getViewport(t);o.set(a.x*n.x,a.y*n.y,a.x*n.z,a.y*n.w),f.viewport(o)}if(l.isPointLight){let e=d.camera,n=d.matrix,r=l.distance||e.far;r!==e.far&&(e.far=r,e.updateProjectionMatrix()),qg.setFromMatrixPosition(l.matrixWorld),e.position.copy(qg),Jg.copy(e.position),Jg.add(Wg[t]),e.up.copy(Gg[t]),e.lookAt(Jg),e.updateMatrixWorld(),n.makeTranslation(-qg.x,-qg.y,-qg.z),Kg.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),d._frustum.setFromProjectionMatrix(Kg,e.coordinateSystem,e.reversedDepth)}else d.updateMatrices(l);r=d.getFrustum(),b(n,s,d.camera,l,this.type)}d.isPointLightShadow!==!0&&this.type===3&&v(d,s),d.needsUpdate=!1}
vendor: 8,050 bytes, line 4080
4080_=this.type,g.needsUpdate=!1,e.setRenderTarget(c,l,d)};function v(n,r){let a=t.update(h);f.defines.VSM_SAMPLES!==n.blurSamples&&(f.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),n.mapPass===null&&(n.mapPass=new Zr(i.x,i.y,{format:ft,type:$e})),f.uniforms.shadow_pass.value=n.map.depthTexture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,f,h,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,p,h,null)}function y(t,n,r,i){let a=null,o=r.isPointLight===!0?t.customDistanceMaterial:t.customDepthMaterial;if(o!==void 0)a=o;else if(a=r.isPointLight===!0?c:s,e.localClippingEnabled&&n.clipShadows===!0&&Array.isArray(n.clippingPlanes)&&n.clippingPlanes.length!==0||n.displacementMap&&n.displacementScale!==0||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,x)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function b(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l<u;l++){let u=t[l],d=c[u.materialIndex];if(d&&d.visible){let t=y(n,d,o,s);n.onBeforeShadow(e,n,i,a,r,t,u),e.renderBufferDirect(a,null,r,t,n,u),n.onAfterShadow(e,n,i,a,r,t,u)}}}else if(c.visible){let t=y(n,c,o,s);n.onBeforeShadow(e,n,i,a,r,t,null),e.renderBufferDirect(a,null,r,t,n,null),n.onAfterShadow(e,n,i,a,r,t,null)}}let c=n.children;for(let e=0,t=c.length;e<t;e++)b(c[e],i,a,o,s)}function x(e){e.target.removeEventListener(`dispose`,x);for(let t in l){let n=l[t],r=e.target.uuid;r in n&&(n[r].dispose(),delete n[r])}}}function Xg(e,t){function n(){let t=!1,n=new Yr,r=null,i=new Yr(0,0,0,0);return{setMask:function(n){r!==n&&!t&&(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){s===!0&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),i.equals(n)===!1&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}}function r(){let n=!1,r=!1,i=null,a=null,o=null;return{setReversed:function(e){if(r!==e){let n=t.get(`EXT_clip_control`);e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),r=e;let i=o;o=null,this.setClear(i)}},getReversed:function(){return r},setTest:function(t){t?oe(e.DEPTH_TEST):se(e.DEPTH_TEST)},setMask:function(t){i!==t&&!n&&(e.depthMask(t),i=t)},setFunc:function(t){if(r&&(t=nr[t]),a!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}a=t}},setLocked:function(e){n=e},setClear:function(t){o!==t&&(o=t,r&&(t=1-t),e.clearDepth(t))},reset:function(){n=!1,i=null,a=null,o=null,r=!1}}}function i(){let t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(n){t||(n?oe(e.STENCIL_TEST):se(e.STENCIL_TEST))},setMask:function(r){n!==r&&!t&&(e.stencilMask(r),n=r)},setFunc:function(t,n,o){(r!==t||i!==n||a!==o)&&(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){(o!==t||s!==n||c!==r)&&(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}}let a=new n,o=new r,s=new i,c=new WeakMap,l=new WeakMap,u={},d={},f={},p=new WeakMap,m=[],h=null,g=!1,_=null,v=null,y=null,b=null,x=null,S=null,C=null,w=new q(0,0,0),T=0,E=!1,D=null,O=null,k=null,A=null,j=null,M=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),N=!1,P=0,ee=e.getParameter(e.VERSION);ee.indexOf(`WebGL`)===-1?ee.indexOf(`OpenGL ES`)!==-1&&(P=parseFloat(/^OpenGL ES (\d)/.exec(ee)[1]),N=P>=2):(P=parseFloat(/^WebGL (\d)/.exec(ee)[1]),N=P>=1);let te=null,ne={},re=e.getParameter(e.SCISSOR_BOX),F=e.getParameter(e.VIEWPORT),I=new Yr().fromArray(re),L=new Yr().fromArray(F);function ie(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o<r;o++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}let ae={};ae[e.TEXTURE_2D]=ie(e.TEXTURE_2D,e.TEXTURE_2D,1),ae[e.TEXTURE_CUBE_MAP]=ie(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),ae[e.TEXTURE_2D_ARRAY]=ie(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),ae[e.TEXTURE_3D]=ie(e.TEXTURE_3D,e.TEXTURE_3D,1,1),a.setClear(0,0,0,1),o.setClear(1),s.setClear(0),oe(e.DEPTH_TEST),o.setFunc(3),he(!1),ge(1),oe(e.CULL_FACE),pe(0);function oe(t){u[t]!==!0&&(e.enable(t),u[t]=!0)}function se(t){u[t]!==!1&&(e.disable(t),u[t]=!1)}function ce(t,n){return f[t]!==n&&(e.bindFramebuffer(t,n),f[t]=n,t===e.DRAW_FRAMEBUFFER&&(f[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(f[e.DRAW_FRAMEBUFFER]=n),!0)}function le(t,n){let r=m,i=!1;if(t){r=p.get(n),r===void 0&&(r=[],p.set(n,r));let a=t.textures;if(r.length!==a.length||r[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)r[t]=e.COLOR_ATTACHMENT0+t;r.length=a.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)}function ue(t){return h!==t&&(e.useProgram(t),h=t,!0)}let de={100:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};de[103]=e.MIN,de[104]=e.MAX;let fe={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function pe(t,n,r,i,a,o,s,c,l,u){if(t===0){g===!0&&(se(e.BLEND),g=!1);return}if(g===!1&&(oe(e.BLEND),g=!0),t!==5){if(t!==_||u!==E){if((v!==100||x!==100)&&(e.blendEquation(e.FUNC_ADD),v=100,x=100),u)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:H(`WebGLState: Invalid blending: `,t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case 3:H(`WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true`);break;case 4:H(`WebGLState: MultiplyBlending requires material.premultipliedAlpha = true`);break;default:H(`WebGLState: Invalid blending: `,t)}y=null,b=null,S=null,C=null,w.set(0,0,0),T=0,_=t,E=u}return}a||=n,o||=r,s||=i,(n!==v||a!==x)&&(e.blendEquationSeparate(de[n],de[a]),v=n,x=a),(r!==y||i!==b||o!==S||s!==C)&&(e.blendFuncSeparate(fe[r],fe[i],fe[o],fe[s]),y=r,b=i,S=o,C=s),(c.equals(w)===!1||l!==T)&&(e.blendColor
4080(c.r,c.g,c.b,l),w.copy(c),T=l),_=t,E=!1}function me(t,n){t.side===2?se(e.CULL_FACE):oe(e.CULL_FACE);let r=t.side===1;n&&(r=!r),he(r),t.blending===1&&t.transparent===!1?pe(0):pe(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),a.setMask(t.colorWrite);let i=t.stencilWrite;s.setTest(i),i&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),_e(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),t.alphaToCoverage===!0?oe(e.SAMPLE_ALPHA_TO_COVERAGE):se(e.SAMPLE_ALPHA_TO_COVERAGE)}function he(t){D!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),D=t)}function ge(t){t===0?se(e.CULL_FACE):(oe(e.CULL_FACE),t!==O&&(t===1?e.cullFace(e.BACK):t===2?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))),O=t}function R(t){t!==k&&(N&&e.lineWidth(t),k=t)}function _e(t,n,r){t?(oe(e.POLYGON_OFFSET_FILL),(A!==n||j!==r)&&(A=n,j=r,o.getReversed()&&(n=-n),e.polygonOffset(n,r))):se(e.POLYGON_OFFSET_FILL)}function ve(t){t?oe(e.SCISSOR_TEST):se(e.SCISSOR_TEST)}function ye(t){t===void 0&&(t=e.TEXTURE0+M-1),te!==t&&(e.activeTexture(t),te=t)}function z(t,n,r){r===void 0&&(r=te===null?e.TEXTURE0+M-1:te);let i=ne[r];i===void 0&&(i={type:void 0,texture:void 0},ne[r]=i),(i.type!==t||i.texture!==n)&&(te!==r&&(e.activeTexture(r),te=r),e.bindTexture(t,n||ae[t]),i.type=t,i.texture=n)}function be(){let t=ne[te];t!==void 0&&t.type!==void 0&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)}function B(){try{e.compressedTexImage2D(...arguments)}catch(e){H(`WebGLState:`,e)}}function xe(){try{e.compressedTexImage3D(...arguments)}catch(e){H(`WebGLState:`,e)}}function Se(){try{e.texSubImage2D(...arguments)}catch(e){H(`WebGLState:`,e)}}function Ce(){try{e.texSubImage3D(...arguments)}catch(e){H(`WebGLState:`,e)}}function we(){try{e.compressedTexSubImage2D(...arguments)}catch(e){H(`WebGLState:`,e)}}function Te(){try{e.compressedTexSubImage3D(...arguments)}catch(e){H(`WebGLState:`,e)}}function Ee(){try{e.texStorage2D(...arguments)}catch(e){H(`WebGLState:`,e)}}function De(){try{e.texStorage3D(...arguments)}catch(e){H(`WebGLState:`,e)}}function Oe(){try{e.texImage2D(...arguments)}catch(e){H(`WebGLState:`,e)}}function ke(){try{e.texImage3D(...arguments)}catch(e){H(`WebGLState:`,e)}}function Ae(t){return d[t]===void 0?e.getParameter(t):d[t]}function je(t,n){d[t]!==n&&(e.pixelStorei(t,n),d[t]=n)}function Me(t){I.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),I.copy(t))}function Ne(t){L.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),L.copy(t))}function Pe(t,n){let r=l.get(n);r===void 0&&(r=new WeakMap,l.set(n,r));let i=r.get(t);i===void 0&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))}function Fe(t,n){let r=l.get(n).get(t);c.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),c.set(n,r))}function Ie(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),o.setReversed(!1),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),e.pixelStorei(e.PACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),e.pixelStorei(e.PACK_ROW_LENGTH,0),e.pixelStorei(e.PACK_SKIP_PIXELS,0),e.pixelStorei(e.PACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_ROW_LENGTH,0),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,0),e.pixelStorei(e.UNPACK_SKIP_PIXELS,0),e.pixelStorei(e.UNPACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_SKIP_IMAGES,0),u={},d={},te=null,ne={},f={},p=new WeakMap,m=[],h=null,g=!1,_=null,v=null,y=null,b=null,x=null,S=null,C=null,w=new q(0,0,0),T=0,E=!1,D=null,O=null,k=null,A=null,j=null,I.set(0,0,e.canvas.width,e.canvas.height),L.set(0,0,e.canvas.width,e.canvas.height),a.reset(),o.reset(),s.reset()}return{buffers:{color:a,depth:o,stencil:s},enable:oe,disable:se,bindFramebuffer:ce,drawBuffers:le,useProgram:ue,setBlending:pe,setMaterial:me,setFlipSided:he,setCullFace:ge,setLineWidth:R,setPolygonOffset:_e,setScissorTest:ve,activeTexture:ye,bindTexture:z,unbindTexture:be,compressedTexImage2D:B,compressedTexImage3D:xe,texImage2D:Oe,texImage3D:ke,pixelStorei:je,getParameter:Ae,updateUBOMapping:Pe,uniformBlockBinding:Fe,texStorage2D:Ee,texStorage3D:De,texSubImage2D:Se,texSubImage3D:Ce,compressedTexSubImage2D:we,compressedTexSubImage3D:Te,scissor:Me,viewport:Ne,reset:Ie}}function Zg(e,t,n,r,i,a,o){let s=t.has(`WEBGL_multisampled_render_to_texture`)?t.get(`WEBGL_multisampled_render_to_texture`):null,c=typeof navigator>
4080`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new W,u=new WeakMap,d=new Set,f,p=new WeakMap,m=!1;try{m=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function h(e,t){return m?new OffscreenCanvas(e,t):Kn(`canvas`)}function g(e,t,n){let r=1,i=B(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);f===void 0&&(f=h(n,a));let o=t?h(n,a):f;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),V(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}return`data`in e&&V(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e}return e}function _(e){return e.generateMipmaps}function v(t){e.generateMipmap(t)}function y(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function b(n,r,i,a,o,s=!1){if(n!==null){if(e[n]!==void 0)return e[n];V(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let c;a&&(c=t.get(`EXT_texture_norm16`),c||V(`WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension`));let l=r;if(r===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8),i===e.UNSIGNED_SHORT&&c&&(l=c.R16_EXT),i===e.SHORT&&c&&(l=c.R16_SNORM_EXT)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.R8UI),i===e.UNSIGNED_SHORT&&(l=e.R16UI),i===e.UNSIGNED_INT&&(l=e.R32UI),i===e.BYTE&&(l=e.R8I),i===e.SHORT&&(l=e.R16I),i===e.INT&&(l=e.R32I)),r===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8),i===e.UNSIGNED_SHORT&&c&&(l=c.RG16_EXT),i===e.SHORT&&c&&(l=c.RG16_SNORM_EXT)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RG8UI),i===e.UNSIGNED_SHORT&&(l=e.RG16UI),i===e.UNSIGNED_INT&&(l=e.RG32UI),i===e.BYTE&&(l=e.RG8I),i===e.SHORT&&(l=e.RG16I),i===e.INT&&(l=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGB8UI),i===e.UNSIGNED_SHORT&&(l=e.RGB16UI),i===e.UNSIGNED_INT&&(l=e.RGB32UI),i===e.BYTE&&(l=e.RGB8I),i===e.SHORT&&(l=e.RGB16I),i===e.INT&&(l=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(l=e.RGBA16UI),i===e.UNSIGNED_INT&&(l=e.RGBA32UI),i===e.BYTE&&(l=e.RGBA8I),i===e.SHORT&&(l=e.RGBA16I),i===e.INT&&(l=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_SHORT&&c&&(l=c.RGB16_EXT),i===e.SHORT&&c&&(l=c.RGB16_SNORM_EXT),i===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(l=e.R11F_G11F_B10F)),r===e.RGBA){let t=s?_n:Rr.getTransfer(o);i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT&&c&&(l=c.RGBA16_EXT),i===e.SHORT&&c&&(l=c.RGBA16_SNORM_EXT),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return(l===e.R16F||l===e.R32F||l===e.RG16F||l===e.RG32F||l===e.RGBA16F||l===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),l}function x(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,V(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function S(e,t){return _(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function C(e){let t=e.target;t.removeEventListener(`dispose`,C),T(t),t.isVideoTexture&&u.delete(t),t.isHTMLTexture&&d.delete(t)}function w(e){let t=e.target;t.removeEventListener(`dispose`,w),D(t)}function T(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=p.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&E(e),Object.keys(i).length===0&&p.delete(n)}r.remove(e)}function E(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=p.get(i);delete a[n.__cacheKey],o.memory.textures--}function D(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRen
vendor: 1,272 bytes, line 4080
4080derTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r<n.__webglFramebuffer[t].length;r++)e.deleteFramebuffer(n.__webglFramebuffer[t][r]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}let i=t.textures;for(let t=0,n=i.length;t<n;t++){let n=r.get(i[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[t])}r.remove(t)}let O=0;function k(){O=0}function A(){return O}function j(e){O=e}function M(){let e=O;return e>=i.maxTextures&&V(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),O+=1,e}function N(e){let t=[];
vendor: 4,843 bytes, line 4080
4080return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function P(t,i){let a=r.get(t);if(t.isVideoTexture&&z(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)V(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)V(`WebGLRenderer: Texture marked for update but image is incomplete`);else{se(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function ee(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){se(a,t,i);return}t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function te(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){se(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function ne(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){ce(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let re={[Ne]:e.REPEAT,[Pe]:e.CLAMP_TO_EDGE,[Fe]:e.MIRRORED_REPEAT},F={[Ie]:e.NEAREST,[Le]:e.NEAREST_MIPMAP_NEAREST,[ze]:e.NEAREST_MIPMAP_LINEAR,[Ve]:e.LINEAR,[He]:e.LINEAR_MIPMAP_NEAREST,[We]:e.LINEAR_MIPMAP_LINEAR},I={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function L(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&V(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,re[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,re[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,re[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,F[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,F[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,I[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function ie(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,C));let i=n.source,a=p.get(i);a===void 0&&(a={},p.set(i,a));let s=N(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&E(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function ae(e,t,n){return Math.floor(Math.floor(e/n)/t)}function oe(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e<o.length;e++){let t=o[s],n=o[e],i=t.start+t.count,a=ae(n.start,r.width,4),c=ae(t.start,r.width,4);n.start<=i+1&&a===c&&ae(n.start+n.count-1,r.width,4)===a?t.count=Math.max(t.count,n.start+n.count-t.start):(++s,o[s]=n)}o.length=s+1;let c=n.getParameter(e.UNPACK_ROW_LENGTH),l=n.getParameter(e.UNPACK_SKIP_PIXELS),u=n.getParameter(e.UNPACK_SKIP_ROWS);n.pixelStorei(e.UNPACK_ROW_LENGTH,r.width);for(let t=0,s=o.length;t<s;t++){let s=o[t],c=Math.floor(s.start/4),l=Math.ceil(s.count/4),u=c%r.width,d=Math.floor(c/r.width),f=l;n.pixelStorei(e.UNPACK_SKIP_PIXELS,u),n.pixelStorei(e.UNPACK_SKIP_ROWS,d),n.texSubImage2D(e.TEXTURE_2D,0,u,d,f,1,i,a,r.data)}t.clearUpdateRanges(),n.pixelStorei(e.UNPACK_ROW_LENGTH,c),n.pixelStorei(e.UNPACK_SKIP_PIXELS,l),n.pixelStorei(e.UNPACK_SKIP_ROWS,u)}}function se(t,o,s){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);let l=ie(t,o),u=o.source;n.bindTexture(c,t.__webglTexture,e.TEXTURE0+s);let f=r.get(u);if(u.version!==f.__version||l===!0){if(n.activeTexture(e.TEXTURE0+s),!(typeof ImageBitmap<`u`&&o.image instanceof ImageBitmap)){let t=Rr.getPrimaries(Rr.workingColorSpace),r=o.colorSpace
4080===``?null:Rr.getPrimaries(o.colorSpace),i=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,i)}n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment);let t=g(o.image,!1,i.maxTextureSize);t=be(o,t);let r=a.convert(o.format,o.colorSpace),p=a.convert(o.type),m=b(o.internalFormat,r,p,o.normalized,o.colorSpace,o.isVideoTexture);L(c,o);let h,y=o.mipmaps,C=o.isVideoTexture!==!0,w=f.__version===void 0||l===!0,T=u.dataReady,E=S(o,t);if(o.isDepthTexture)m=x(o.format===lt,o.type),w&&(C?n.texStorage2D(e.TEXTURE_2D,1,m,t.width,t.height):n.texImage2D(e.TEXTURE_2D,0,m,t.width,t.height,0,r,p,null));else if(o.isDataTexture){if(y.length>0){C&&w&&n.texStorage2D(e.TEXTURE_2D,E,m,y[0].width,y[0].height);for(let t=0,i=y.length;t<i;t++)h=y[t],C?T&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,p,h.data):n.texImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,r,p,h.data);o.generateMipmaps=!1}else C?(w&&n.texStorage2D(e.TEXTURE_2D,E,m,t.width,t.height),T&&oe(o,t,r,p)):n.texImage2D(e.TEXTURE_2D,0,m,t.width,t.height,0,r,p,t.data)}else if(o.isCompressedTexture){if(o.isCompressedArrayTexture){C&&w&&n.texStorage3D(e.TEXTURE_2D_ARRAY,E,m,y[0].width,y[0].height,t.depth);for(let i=0,a=y.length;i<a;i++)if(h=y[i],o.format!==1023){if(r!==null){if(C){if(T){if(o.layerUpdates.size>0){let t=Wp(h.width,h.height,o.format,o.type);for(let a of o.layerUpdates){let o=h.data.subarray(a*t/h.data.BYTES_PER_ELEMENT,(a+1)*t/h.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,h.width,h.height,1,r,o)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,h.data)}}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,h.data,0,0)}else V(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`)}else C?T&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,p,h.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,r,p,h.data)}else{C&&w&&n.texStorage2D(e.TEXTURE_2D,E,m,y[0].width,y[0].height);for(let t=0,i=y.length;t<i;t++)h=y[t],o.format===1023?C?T&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,p,h.data):n.texImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,r,p,h.data):r===null?V(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`):C?T&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,h.data):n.compressedTexImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,h.data)}}else if(o.isDataArrayTexture){if(C){if(w&&n.texStorage3D(e.TEXTURE_2D_ARRAY,E,m,t.width,t.height,t.depth),T){if(o.layerUpdates.size>0){let i=Wp(t.width,t.height,o.format,o.type);for(let a of o.layerUpdates){let o=t.data.subarray(a*i/t.data.BYTES_PER_ELEMENT,(a+1)*i/t.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,a,t.width,t.height,1,r,p,o)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)}}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,m,t.width,t.height,t.depth,0,r,p,t.data)}else if(o.isData3DTexture)C?(w&&n.texStorage3D(e.TEXTURE_3D,E,m,t.width,t.height,t.depth),T&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)):n.texImage3D(e.TEXTURE_3D,0,m,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isFramebufferTexture){if(w){if(C)n.texStorage2D(e.TEXTURE_2D,E,m,t.width,t.height);else{let i=t.width,a=t.height;for(let t=0;t<E;t++)n.texImage2D(e.TEXTURE_2D,t,m,i,a,0,r,p,null),i>>=1,a>>=1}}}else if(o.isHTMLTexture){if(`texElementImage2D`in e){let n=e.canvas;if(n.hasAttribute(`layoutsubtree`)||n.setAttribute(`layoutsubtree`,`true`),t.parentNode!==n){n.appendChild(t),d.add(o),n.onpaint=e=>{let t=e.changedElements;for(let e of d)t.includes(e.image)&&(e.needsUpdate=!0)},n.requestPaint();return}let r=e.RGBA,i=e.RGBA,a=e.UNSIGNED_BYTE;e.texElementImage2D(e.TEXTURE_2D,0,r,i,a,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}else if(y.length>0){if(C&&w){let t=B(y[0]);n.texStorage2D(e.TEXTURE_2D,E,m,t.width,t.height)}for(let t=0,i=y.length;t<i;t++)h=y[t],C?T&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,r,p,h):n.texImage2D(e.TEXTURE_2D,t,m,r,p,h);o.generateMipmaps=!1}else if(C){if(w){let r=B(t);n.texStorage2D(e.TEXTURE_2D,E,m,r.width,r.height)}T&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,r,p,t)}else n.texImage2D(e.TEXTURE_2D,0,m,r,p,t);_(o)&&v(c),f.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function ce(t,o,s){if(o.image.length!==6)return;let c=ie(t,o),l=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);let u=r.get(l);if(l.version!==u.__version||c===!0){n.activeTexture(e.TEXTURE0+s);
vendor: 5,537 bytes, line 4080
4080let t=Rr.getPrimaries(Rr.workingColorSpace),r=o.colorSpace===``?null:Rr.getPrimaries(o.colorSpace),d=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let f=o.isCompressedTexture||o.image[0].isCompressedTexture,p=o.image[0]&&o.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)!f&&!p?m[e]=g(o.image[e],!0,i.maxCubemapSize):m[e]=p?o.image[e].image:o.image[e],m[e]=be(o,m[e]);let h=m[0],y=a.convert(o.format,o.colorSpace),x=a.convert(o.type),C=b(o.internalFormat,y,x,o.normalized,o.colorSpace),w=o.isVideoTexture!==!0,T=u.__version===void 0||c===!0,E=l.dataReady,D=S(o,h);L(e.TEXTURE_CUBE_MAP,o);let O;if(f){w&&T&&n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,h.width,h.height);for(let t=0;t<6;t++){O=m[t].mipmaps;for(let r=0;r<O.length;r++){let i=O[r];o.format===1023?w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,y,x,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,C,i.width,i.height,0,y,x,i.data):y===null?V(`WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()`):w?E&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,y,i.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,C,i.width,i.height,0,i.data)}}}else{if(O=o.mipmaps,w&&T){O.length>0&&D++;let t=B(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,t.width,t.height)}for(let t=0;t<6;t++)if(p){w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,y,x,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,m[t].width,m[t].height,0,y,x,m[t].data);for(let r=0;r<O.length;r++){let i=O[r].image[t].image;w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,y,x,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,C,i.width,i.height,0,y,x,i.data)}}else{w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,y,x,m[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,y,x,m[t]);for(let r=0;r<O.length;r++){let i=O[r];w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,y,x,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,C,y,x,i.image[t])}}}_(o)&&v(e.TEXTURE_CUBE_MAP),u.__version=l.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function le(t,i,o,c,l,u){let d=a.convert(o.format,o.colorSpace),f=a.convert(o.type),p=b(o.internalFormat,d,f,o.normalized,o.colorSpace),m=r.get(i),h=r.get(o);if(h.__renderTarget=i,!m.__hasExternalTextures){let t=Math.max(1,i.width>>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),ye(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,ve(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function ue(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=x(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;ye(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,ve(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,ve(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i<t.length;i++){let o=t[i],c=a.convert(o.format,o.colorSpace),l=a.convert(o.type),u=b(o.internalFormat,c,l,o.normalized,o.colorSpace);ye(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,ve(n),u,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,ve(n),u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function de(t,i,o){let c=i.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(e.FRAMEBUFFER,t),!(i.depthTexture&&i.depthTexture.isDepthTexture))throw Error(`renderTarget.depthTexture must be an instance of THREE.DepthTexture`);let l=r.get(i.depthTexture);if(l.__renderTarget=i,(!l.__webglTexture||i.depthTexture.image.width!==i.width||i.depthTexture.image.height!==i.height)&&(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),c){if(l.__webglInit===void 0&&(l.__webglInit=!0,i.depthTexture.addEventListener(`dispose`,C)),l.__webglTexture===void 0){l.__webglTexture=e.createTexture(),n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),L(e.TEXTURE_CUBE_MAP,i.depthTexture);let t=a.convert(i.depthTexture.format),r=a.convert(i.depthTexture.type),o;i.depthTexture.format===1026?o=e.DEPTH_COMPONENT24:i.depthTexture.format===1027&&(o=e.DEPTH24_STENCIL8);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o,i.width,i.height,0,t,r,null)}}else P(i.depthTexture,0);let u=l.__webglTexture,d=ve(i),f=c?e.TEXTURE_CUBE_MAP_POSITIVE_X+o:e.TEXTURE_2D,p=i.depthTexture.format===1027?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;if(i.depthTexture.format===1026)ye(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else if(i.depthTexture.format===1027)ye(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else throw Error(`Unknown depthTexture format`)}
vendor: 5,628 bytes, line 4080
4080function fe(t){let i=r.get(t),a=t.isWebGLCubeRenderTarget===!0;if(i.__boundDepthTexture!==t.depthTexture){let e=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),e){let t=()=>{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)for(let e=0;e<6;e++)de(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?de(i.__webglFramebuffer[0],t,0):de(i.__webglFramebuffer,t,0)}}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),ue(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),ue(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function pe(t,n,i){let a=r.get(t);n!==void 0&&le(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&fe(t)}function me(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,w);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)s.__webglFramebuffer[t][n]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(d)for(let t=0,n=l.length;t<n;t++){let n=r.get(l[t]);n.__webglTexture===void 0&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&ye(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<l.length;n++){let r=l[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);let i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),c=b(r.internalFormat,i,o,r.normalized,r.colorSpace,t.isXRRenderTarget===!0),u=ve(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,c,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,s.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),ue(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,c.__webglTexture),L(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)le(s.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else le(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);_(i)&&v(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){for(let i=0,a=l.length;i<a;i++){let a=l[i],o=r.get(a),c=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(c=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(c,o.__webglTexture),L(c,a),le(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+i,c,0),_(a)&&v(c)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,c.__webglTexture),L(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)le(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else le(s.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);_(i)&&v(r),n.unbindTexture()}t.depthBuffer&&fe(t)}function he(e){let t=e.textures;for(let i=0,a=t.length;i<a;i++){let a=t[i];if(_(a)){let t=y(e),i=r.get(a).__webglTexture;n.bindTexture(t,i),v(t),n.unbindTexture()}}}let ge=[],R=[];function _e(t){if(t.samples>0){if(ye(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer);let f=t.texture.mipmaps;f&&f.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),d){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRen
vendor: 16,147 bytes, lines 4080-4104
4080derbuffer[n]);let t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),c===!0&&(ge.length=0,R.length=0,ge.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&t.resolveDepthBuffer===!1&&(ge.push(l),R.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,R)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,ge))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),d)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);let a=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&t.resolveDepthBuffer===!1&&c){let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}}}function ve(e){return Math.min(i.maxSamples,e.samples)}function ye(e){let n=r.get(e);return e.samples>0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function z(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function be(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(Rr.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&V(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):H(`WebGLTextures: Unsupported texture color space:`,n)),t}function B(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=M,this.resetTextureUnits=k,this.getTextureUnits=A,this.setTextureUnits=j,this.setTexture2D=P,this.setTexture2DArray=ee,this.setTexture3D=te,this.setTextureCube=ne,this.rebindTextures=pe,this.setupRenderTarget=me,this.updateRenderTargetMipmap=he,this.updateMultisampleRenderTarget=_e,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=le,this.useMultisampledRTT=ye,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function Qg(e,t){function n(n,r=``){let i,a=Rr.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779){if(a===`srgb`){if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null}else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null}if(n===35840||n===35841||n===35842||n===35843){if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null}if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491){if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null}if(n===37808||n===37809||n===37810||n===37811||n===37812||n===37813||n===37814||n===37815||n===37816||n===37817||n===37818||n===37819||n===37820||n===37821){if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null}if(n===36492||n===36494||n===36495){if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null}if(n===36283||n===36284||n===36285||n===36286){if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null}return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert:n}}var $g=`
4081void main() {
4082
4083	gl_Position = vec4( position, 1.0 );
4084
4085}`,e_=`
4086uniform sampler2DArray depthColor;
4087uniform float depthWidth;
4088uniform float depthHeight;
4089
4090void main() {
4091
4092	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
4093
4094	if ( coord.x >= 1.0 ) {
4095
4096		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
4097
4098	} else {
4099
4100		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
4101
4102	}
4103
4104}`,t_=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new gc(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new gu({vertexShader:$g,fragmentShader:e_,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Fo(new Yl(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},n_=class extends rr{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new t_,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new W,C=null,w=new Td;w.viewport=new Yr;let T=new Td;T.viewport=new Yr;let E=[w,T],D=new af,O=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new ji,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new ji,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new ji,b[e]=t),t.getHandSpace()};function A(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function j(){r.removeEventListener(`select`,A),r.removeEventListener(`selectstart`,A),r.removeEventListener(`selectend`,A),r.removeEventListener(`squeeze`,A),r.removeEventListener(`squeezestart`,A),r.removeEventListener(`squeezeend`,A),r.removeEventListener(`end`,j),r.removeEventListener(`inputsourceschange`,M);for(let e=0;e<b.length;e++){let t=x[e];t!==null&&(x[e]=null,b[e].disconnect(t))}O=null,k=null,h.reset();for(let e in g)delete g[e];e.setRenderTarget(v),f=null,d=null,u=null,r=null,y=null,I.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(S.width,S.height,!1),n.dispatchEvent({type:`sessionend`})}this.setFramebufferScaleFactor=function(e){i=e,n.isPresenting===!0&&V(`WebXRManager: Cannot change framebuffer scale while presenting.`)},this.setReferenceSpaceType=function(e){o=e,n.isPresenting===!0&&V(`WebXRManager: Cannot change reference space type while presenting.`)},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return d===null?f:d},this.getBinding=function(){return u===null&&m&&(u=new XRWebGLBinding(r,t)),u},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(l){if(r=l,r!==null){if(v=e.getRenderTarget(),r.addEventListener(`select`,A),r.addEventListener(`selectstart`,A),r.addEventListener(`selectend`,A),r.addEventListener(`squeeze`,A),r.addEventListener(`squeezestart`,A),r.addEventListener(`squeezeend`,A),r.addEventListener(`end`,j),r.addEventListener(`inputsourceschange`,M),_.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(S),m&&`createProjectionLayer`in XRWebGLBinding.prototype){let n=null,a=null,o=null;_.depth&&(o=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=_.stencil?lt:ct,a=_.stencil?nt:Ze);let s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=this.getBinding(),d=u.createProjectionLayer(s),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),y=new Zr(d.textureWidth,d.textureHeight,{format:st,type:Ke,depthTexture:new mc(d.textureWidth,d.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{let n={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:i};f=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new Zr(f.framebufferWidth,f.framebufferHeight,{format:st,type:Ke,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}y.isXRRenderTarget=!0,this.setFoveation(s),c=null,a=await r.requestReferenceSpace(o),I.setContext(r),I.start(),n.isPresenting=!0,n.dispatchEvent({type:`sessionstart`})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return h.getDepthTexture()};function M(e){for(let t=0;t<e.removed.length;t++){let n=e.removed[t],r=x.indexOf(n);r>=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t<e.added.length;t++){let n=e.added[t],r=x.indexOf(n);if(r===-1){for(let e=0;e<b.length;e++)if(e>=x.length){x.push(n),r=e;break}else if(x[e]===null){x[e]=n,r=e;break}if(r===-1)break}let i=b[r];i&&i.connect(n)}}let N=new G,P=new G;function ee(e,t,n){N.setFromMatrixPosition(t.matrixWorld),P.setFromMatrixPosition(n.matrixWorld);let r=N.distanceTo(P),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function te(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,(O!==D.near||k!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,k=D.far),D.layers.mask=e.layers.mask|6,w.layers.mask=D.layers.mask&-5,T.layers.mask=D.layers.mask&-3;let i=e.parent,a=D.cameras;te(D,i);for(let e=0;e<a.length;e++)te(a[e],i);a.length===2?ee(D,w,T):D.projectionMatrix.copy(w.projectionMatrix),ne(e,D,i)};function ne(e,t,n){n===null?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld)),e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=sr*2*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}this.getCamera=function(){return D},this.getFoveation=function(){if(d!==null||f!==null)return s},this.setFoveation=function(e){s=e,d!==null&&(d.fixedFoveation=e),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=e)},this.hasDepthSensing=function(){return h.texture!==null},this.getDepthSensingMesh=function(){return h.getMesh(D)},this.getCameraTexture=function(e){return g[e]};let re=null;function F(t,i){if(l=i.getViewerPose(c||a),p=i,l!==null){let t=l.views;f!==null&&(e.setRenderTargetFramebuffer(y,f.framebuffer),e.setRenderTarget(y));let i=!1;t.length!==D.cameras.length&&(D.cameras.length=0,i=!0);for(let n=0;n<t.length;n++){let r=t[n],a=null;if(f!==null)a=f.getViewport(r);else{let t=u.getViewSubImage(d,r);a=t.viewport,n===0&&(e.setRenderTargetTextures(y,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(y))}let o=E[n];o===void 0&&(o=new Td,o.layers.enable(n),o.viewport=new Yr,E[n]=o),o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(r.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),n===0&&(D.matrix.copy(o.matrix),D.matrix.decompose(D.position,D.quaternion,D.scale)),i===!0&&D.cameras.push(o)}let a=r.enabledFeatures;if(a&&a.includes(`depth-sensing`)&&r.depthUsage==`gpu-optimized`&&m){u=n.getBinding();let e=u.getDepthInformation(t[0]);e&&e.isValid&&e.texture&&h.init(e,r.renderState)}if(a&&a.includes(`camera-access`)&&m){e.state.unbindTexture(),u=n.getBinding();for(let e=0;e<t.length;e++){let n=t[e].camera;if(n){let e=g[n];e||(e=new gc,g[n]=e);let t=u.getCameraImage(n);e.sourceTexture=t}}}}for(let e=0;e<b.length;e++){let t=x[e],n=b[e];t!==null&&n!==void 0&&n.update(t,i,c||a)}
4104re&&re(t,i),i.detectedPlanes&&n.dispatchEvent({type:`planesdetected`,data:i}),p=null}let I=new Jp;I.setAnimationLoop(F),this.setAnimationLoop=function(e){re=e},this.dispose=function(){}}},r_=new K,i_=new Nr;i_.set(-1,0,0,0,1,0,0,0,1);function a_(e,t){function n(e,t){e.matrixAutoUpdate===!0&&e.updateMatrix(),t.value.copy(e.matrix)}function r(t,n){n.color.getRGB(t.fogColor.value,fu(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)}function i(e,t,n,r,i){t.isNodeMaterial?t.uniformsNeedUpdate=!1:t.isMeshBasicMaterial?a(e,t):t.isMeshLambertMaterial?(a(e,t),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)):t.isMeshToonMaterial?(a(e,t),d(e,t)):t.isMeshPhongMaterial?(a(e,t),u(e,t),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)):t.isMeshStandardMaterial?(a(e,t),f(e,t),t.isMeshPhysicalMaterial&&p(e,t,i)):t.isMeshMatcapMaterial?(a(e,t),m(e,t)):t.isMeshDepthMaterial?a(e,t):t.isMeshDistanceMaterial?(a(e,t),h(e,t)):t.isMeshNormalMaterial?a(e,t):t.isLineBasicMaterial?(o(e,t),t.isLineDashedMaterial&&s(e,t)):t.isPointsMaterial?c(e,t,n,r):t.isSpriteMaterial?l(e,t):t.isShadowMaterial?(e.color.value.copy(t.color),e.opacity.value=t.opacity):t.isShaderMaterial&&(t.uniformsNeedUpdate=!1)}function a(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,n(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,n(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,n(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,r.side===1&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),r.side===1&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,n(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,n(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,e.envMapRotation.value.setFromMatrix4(r_.makeRotationFromEuler(o)).transpose(),a.isCubeTexture&&a.isRenderTargetTexture===!1&&e.envMapRotation.value.premultiply(i_),e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}function o(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}function s(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function c(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=i*.5,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function l(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function d(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function f(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function p(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dis
4104persion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}function m(e,t){t.matcap&&(e.matcap.value=t.matcap)}function h(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function o_(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function l(e,n){let o=i[e.id];o===void 0&&(m(e),o=u(e),i[e.id]=o,e.addEventListener(`dispose`,g));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(f(e),a[e.id]=c)}function u(t){let n=d();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function d(){for(let e=0;e<s;e++)if(o.indexOf(e)===-1)return o.push(e),e;return H(`WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.`),0}function f(t){let n=i[t.id],r=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=r.length;t<n;t++){let n=Array.isArray(r[t])?r[t]:[r[t]];for(let r=0,i=n.length;r<i;r++){let i=n[r];if(p(i,t,r,a)===!0){let t=i.__offset,n=Array.isArray(i.value)?i.value:[i.value],r=0;for(let a=0;a<n.length;a++){let o=n[a],s=h(o);typeof o==`number`||typeof o==`boolean`?(i.__data[0]=o,e.bufferSubData(e.UNIFORM_BUFFER,t+r,i.__data)):o.isMatrix3?(i.__data[0]=o.elements[0],i.__data[1]=o.elements[1],i.__data[2]=o.elements[2],i.__data[3]=0,i.__data[4]=o.elements[3],i.__data[5]=o.elements[4],i.__data[6]=o.elements[5],i.__data[7]=0,i.__data[8]=o.elements[6],i.__data[9]=o.elements[7],i.__data[10]=o.elements[8],i.__data[11]=0):ArrayBuffer.isView(o)?i.__data.set(new o.constructor(o.buffer,o.byteOffset,i.__data.length)):(o.toArray(i.__data,r),r+=s.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,i.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}function p(e,t,n,r){let i=e.value,a=t+`_`+n;if(r[a]===void 0)return r[a]=typeof i==`number`||typeof i==`boolean`?i:ArrayBuffer.isView(i)?i.slice():i.clone(),!0;{let e=r[a];if(typeof i==`number`||typeof i==`boolean`){if(e!==i)return r[a]=i,!0}else if(ArrayBuffer.isView(i))return!0;else if(e.equals(i)===!1)return e.copy(i),!0}return!1}function m(e){let t=e.uniforms,n=0;for(let e=0,r=t.length;e<r;e++){let r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){let t=r[e],i=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=i.length;e<r;e++){let r=i[e],a=h(r),o=n%16,s=o%a.boundary,c=o+s;
4104n+=s,c!==0&&16-c<a.storage&&(n+=16-c),t.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=a.storage}}}let r=n%16;return r>0&&(n+=16-r),e.__size=n,e.__cache={},this}function h(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?V(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):ArrayBuffer.isView(e)?(t.boundary=16,t.storage=e.byteLength):V(`WebGLRenderer: Unsupported uniform value type.`,e),t}function g(t){let n=t.target;n.removeEventListener(`dispose`,g);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function _(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind:c,update:l,dispose:_}}var s_=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,
vendor: 4,089 bytes, line 4104
410414942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),c_=null;function l_(){return c_===null&&(c_=new Yo(s_,16,16,ft,$e),c_.name=`DFG_LUT`,c_.minFilter=Ve,c_.magFilter=Ve,c_.wrapS=Pe,c_.wrapT=Pe,c_.generateMipmaps=!1,c_.needsUpdate=!0),c_}var u_=class{constructor(e={}){let{canvas:t=qn(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=Ke}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);p=n.getContextAttributes().alpha}else p=a;let m=f,h=new Set([ht,pt,dt]),g=new Set([Ke,Ze,Ye,nt,et,tt]),_=new Uint32Array(4),v=new Int32Array(4),y=new G,b=null,x=null,S=[],C=[],w=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let T=this,E=!1,D=null;this._outputColorSpace=hn;let O=0,k=0,A=null,j=-1,M=null,N=new Yr,P=new Yr,ee=null,te=new q(0),ne=0,re=t.width,F=t.height,I=1,L=null,ie=null,ae=new Yr(0,0,re,F),oe=new Yr(0,0,re,F),se=!1,ce=new hs,le=!1,ue=!1,de=new K,fe=new G,pe=new Yr,me={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},he=!1;function ge(){return A===null?I:1}let R=n;function _e(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r184`),t.addEventListener(`webglcontextlost`,Ve,!1),t.addEventListener(`webglcontextrestored`,He,!1),t.addEventListener(`webglcontextcreationerror`,Ue,!1),R===null){let t=`webgl2`;if(R=_e(t,e),R===null)throw _e(t)?Error(`Error creating WebGL context with your selected attributes.`):Error(`Error creating WebGL context.`)}}catch(e){throw H(`WebGLRenderer: `+e.message),e}let ve,ye,z,be,B,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re;
vendor: 5,559 bytes, line 4104
4104function ze(){ve=new Om(R),ve.init(),Ie=new Qg(R,ve),ye=new im(R,ve,e,Ie),z=new Xg(R,ve),ye.reversedDepthBuffer&&d&&z.buffers.depth.setReversed(!0),be=new jm(R),B=new Ag,xe=new Zg(R,ve,z,B,ye,Ie,be),Se=new Dm(T),Ce=new Yp(R),Le=new nm(R,Ce),we=new km(R,Ce,be,Le),Te=new Nm(R,we,Ce,Le,be),Ne=new Mm(R,ye,xe),Ae=new am(B),Ee=new kg(T,Se,ve,ye,Le,Ae),De=new a_(T,B),Oe=new Pg,ke=new Vg(ve),Me=new tm(T,Se,z,Te,p,s),je=new Yg(T,Te,ye),Re=new o_(R,be,ye,z),Pe=new rm(R,ve,be),Fe=new Am(R,ve,be),be.programs=Ee.programs,T.capabilities=ye,T.extensions=ve,T.properties=B,T.renderLists=Oe,T.shadowMap=je,T.state=z,T.info=be}ze(),m!==1009&&(w=new Fm(m,t.width,t.height,r,i));let Be=new n_(T,R);this.xr=Be,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){let e=ve.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=ve.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(e){e!==void 0&&(I=e,this.setSize(re,F,!1))},this.getSize=function(e){return e.set(re,F)},this.setSize=function(e,n,r=!0){if(Be.isPresenting){V(`WebGLRenderer: Can't change size while VR device is presenting.`);return}re=e,F=n,t.width=Math.floor(e*I),t.height=Math.floor(n*I),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),w!==null&&w.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(re*I,F*I).floor()},this.setDrawingBufferSize=function(e,n,r){re=e,F=n,I=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(m===1009){H(`THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t<e.length;t++)if(e[t].isOutputPass===!0){V(`THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.`);break}}w.setEffects(e||[])},this.getCurrentViewport=function(e){return e.copy(N)},this.getViewport=function(e){return e.copy(ae)},this.setViewport=function(e,t,n,r){e.isVector4?ae.set(e.x,e.y,e.z,e.w):ae.set(e,t,n,r),z.viewport(N.copy(ae).multiplyScalar(I).round())},this.getScissor=function(e){return e.copy(oe)},this.setScissor=function(e,t,n,r){e.isVector4?oe.set(e.x,e.y,e.z,e.w):oe.set(e,t,n,r),z.scissor(P.copy(oe).multiplyScalar(I).round())},this.getScissorTest=function(){return se},this.setScissorTest=function(e){z.setScissorTest(se=e)},this.setOpaqueSort=function(e){L=e},this.setTransparentSort=function(e){ie=e},this.getClearColor=function(e){return e.copy(Me.getClearColor())},this.setClearColor=function(){Me.setClearColor(...arguments)},this.getClearAlpha=function(){return Me.getClearAlpha()},this.setClearAlpha=function(){Me.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(A!==null){let t=A.texture.format;e=h.has(t)}if(e){let e=A.texture.type,t=g.has(e),n=Me.getClearColor(),r=Me.getClearAlpha(),i=n.r,a=n.g,o=n.b;t?(_[0]=i,_[1]=a,_[2]=o,_[3]=r,R.clearBufferuiv(R.COLOR,0,_)):(v[0]=i,v[1]=a,v[2]=o,v[3]=r,R.clearBufferiv(R.COLOR,0,v))}else r|=R.COLOR_BUFFER_BIT}t&&(r|=R.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),n&&(r|=R.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),r!==0&&R.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.setNodesHandler=function(e){e.setRenderer(this),D=e},this.dispose=function(){t.removeEventListener(`webglcontextlost`,Ve,!1),t.removeEventListener(`webglcontextrestored`,He,!1),t.removeEventListener(`webglcontextcreationerror`,Ue,!1),Me.dispose(),Oe.dispose(),ke.dispose(),B.dispose(),Se.dispose(),Te.dispose(),Le.dispose(),Re.dispose(),Ee.dispose(),Be.dispose(),Be.removeEventListener(`sessionstart`,it),Be.removeEventListener(`sessionend`,at),ot.stop()};function Ve(e){e.preventDefault(),Qn(`WebGLRenderer: Context Lost.`),E=!0}function He(){Qn(`WebGLRenderer: Context Restored.`),E=!1;let e=be.autoReset,t=je.enabled,n=je.autoUpdate,r=je.needsUpdate,i=je.type;ze(),be.autoReset=e,je.enabled=t,je.autoUpdate=n,je.needsUpdate=r,je.type=i}function Ue(e){H(`WebGLRenderer: A WebGL context could not be created. Reason: `,e.statusMessage)}function Ge(e){let t=e.target;t.removeEventListener(`dispose`,Ge),qe(t)}function qe(e){Je(e),B.remove(e)}function Je(e){let t=B.get(e).programs;t!==void 0&&(t.forEach(function(e){Ee.releaseProgram(e)}),e.isShaderMaterial&&Ee.releaseShaderCache(e))}this.renderBufferDirect=function(e,t,n,r,i,a){t===null&&(t=me);let o=i.isMesh&&i.matrixWorld.determinant()<0,s=yt(e,t,n,r,i);z.setMaterial(r,o);let c=n.index,l=1;if(r.wireframe===!0){if(c=we.getWireframeAttribute(n),c===void 0)return;l=2}let u=n.drawRange,d=n.attributes.position,f=u.start*l,p=(u.start+u.count)*l;a!==null&&(f=Math.max(f,a.start*l),p=Math.min(p,(a.start+a.count)*l)),c===null?d!=null&&(f=Math.max(f,0),p=Math.min(p,d.count)):(f=Math.max(f,0),p=Math.min(p,c.count));let m=p-f;if(m<0||m===1/0)return;Le.setup(i,r,s,n,c);let h,g=Pe;if(c!==null&&(h=Ce.get(c),g=Fe,g.setIndex(h)),i.isMesh)r.wireframe===!0?(z.setLineWidth(r.wireframeLinewidth*ge()),g.setMode(R.LINES)):g.setMode(R.TRIANGLES);else if(i.isLine){let e=r.linewidth;e===void 0&&(e=1),z.setLineWidth(e*ge()),i.isLineSegments?g.setMode(R.LINES):i.isLineLoop?g.setMode(R.LINE_LOOP):g.setMode(R.LINE_STRIP)}else i.isPoints?g.setMode(R.POINTS):i.isSprite&&g.setMode(R.TRIANGLES);
vendor: 4,358 bytes, line 4104
4104if(i.isBatchedMesh){if(ve.get(`WEBGL_multi_draw`))g.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{let e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,a=c?Ce.get(c).bytesPerElement:1,o=B.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)o.setValue(R,`_gl_DrawID`,r),g.render(e[r]/a,t[r])}}else if(i.isInstancedMesh)g.renderInstances(f,m,i.count);else if(n.isInstancedBufferGeometry){let e=n._maxInstanceCount===void 0?1/0:n._maxInstanceCount,t=Math.min(n.instanceCount,e);g.renderInstances(f,m,t)}else g.render(f,m)};function Xe(e,t,n){e.transparent===!0&&e.side===2&&e.forceSinglePass===!1?(e.side=1,e.needsUpdate=!0,mt(e,t,n),e.side=0,e.needsUpdate=!0,mt(e,t,n),e.side=2):mt(e,t,n)}this.compile=function(e,t,n=null){n===null&&(n=e),x=ke.get(n),x.init(t),C.push(x),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(x.pushLight(e),e.castShadow&&x.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(x.pushLight(e),e.castShadow&&x.pushShadow(e))}),x.setupLights();let r=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t){if(Array.isArray(t))for(let i=0;i<t.length;i++){let a=t[i];Xe(a,n,e),r.add(a)}else Xe(t,n,e),r.add(t)}}),x=C.pop(),r},this.compileAsync=function(e,t,n=null){let r=this.compile(e,t,n);return new Promise(t=>{function n(){if(r.forEach(function(e){B.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(n,10)}ve.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let Qe=null;function rt(e){Qe&&Qe(e)}function it(){ot.stop()}function at(){ot.start()}let ot=new Jp;ot.setAnimationLoop(rt),typeof self<`u`&&ot.setContext(self),this.setAnimationLoop=function(e){Qe=e,Be.setAnimationLoop(e),e===null?ot.stop():ot.start()},Be.addEventListener(`sessionstart`,it),Be.addEventListener(`sessionend`,at),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){H(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(E===!0)return;D!==null&&D.renderStart(e,t);let n=Be.enabled===!0&&Be.isPresenting===!0,r=w!==null&&(A===null||n)&&w.begin(T,A);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),Be.enabled===!0&&Be.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(Be.cameraAutoUpdate===!0&&Be.updateCamera(t),t=Be.getCamera()),e.isScene===!0&&e.onBeforeRender(T,e,t,A),x=ke.get(e,C.length),x.init(t),x.state.textureUnits=xe.getTextureUnits(),C.push(x),de.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ce.setFromProjectionMatrix(de,In,t.reversedDepth),ue=this.localClippingEnabled,le=Ae.init(this.clippingPlanes,ue),b=Oe.get(e,S.length),b.init(),S.push(b),Be.enabled===!0&&Be.isPresenting===!0){let e=T.xr.getDepthSensingMesh();e!==null&&st(e,t,-1/0,T.sortObjects)}st(e,t,0,T.sortObjects),b.finish(),T.sortObjects===!0&&b.sort(L,ie),he=Be.enabled===!1||Be.isPresenting===!1||Be.hasDepthSensing()===!1,he&&Me.addToRenderList(b,e),this.info.render.frame++,le===!0&&Ae.beginShadows();let i=x.state.shadowsArray;if(je.render(i,e,t),le===!0&&Ae.endShadows(),this.info.autoReset===!0&&this.info.reset(),(r&&w.hasRenderPass())===!1){let n=b.opaque,r=b.transmissive;if(x.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t<a;t++){let a=i[t];lt(n,r,e,a)}he&&Me.render(e);for(let t=0,n=i.length;t<n;t++){let n=i[t];ct(b,e,n,n.viewport)}}else r.length>0&&lt(n,r,e,t),he&&Me.render(e),ct(b,e,t)}A!==null&&k===0&&(xe.updateMultisampleRenderTarget(A),xe.updateRenderTargetMipmap(A)),r&&w.end(T),e.isScene===!0&&e.onAfterRender(T,e,t),Le.resetDefaultState(),j=-1,M=null,C.pop(),C.length>0?(x=C[C.length-1],xe.setTextureUnits(x.state.textureUnits),le===!0&&Ae.setGlobalState(T.clippingPlanes,x.state.camera)):x=null,S.pop(),b=S.length>0?S[S.length-1]:null,D!==null&&D.renderEnd()};function st(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLightProbeGrid)x.pushLightProbeGrid(e);else if(e.isLight)x.pushLight(e),e.castShadow&&x.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ce.intersectsSprite(e)){r&&pe.setFromMatrixPosition(e.matrixWorld).applyMatrix4(de);let t=Te.update(e),i=e.material;
vendor: 5,173 bytes, line 4104
4104i.visible&&b.push(e,t,i,n,pe.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ce.intersectsObject(e))){let t=Te.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),pe.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),pe.copy(e.boundingSphere.center)),pe.applyMatrix4(e.matrixWorld).applyMatrix4(de)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a<o;a++){let o=r[a],s=i[o.materialIndex];s&&s.visible&&b.push(e,t,s,n,pe.z,o)}}else i.visible&&b.push(e,t,i,n,pe.z,null)}}let i=e.children;for(let e=0,a=i.length;e<a;e++)st(i[e],t,n,r)}function ct(e,t,n,r){let{opaque:i,transmissive:a,transparent:o}=e;x.setupLightsView(n),le===!0&&Ae.setGlobalState(T.clippingPlanes,n),r&&z.viewport(N.copy(r)),i.length>0&&ut(i,t,n),a.length>0&&ut(a,t,n),o.length>0&&ut(o,t,n),z.buffers.depth.setTest(!0),z.buffers.depth.setMask(!0),z.buffers.color.setMask(!0),z.setPolygonOffset(!1)}function lt(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(x.state.transmissionRenderTarget[r.id]===void 0){let e=ve.has(`EXT_color_buffer_half_float`)||ve.has(`EXT_color_buffer_float`);x.state.transmissionRenderTarget[r.id]=new Zr(1,1,{generateMipmaps:!0,type:e?$e:Ke,minFilter:We,samples:Math.max(4,ye.samples),stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Rr.workingColorSpace})}let a=x.state.transmissionRenderTarget[r.id],o=r.viewport||N;a.setSize(o.z*T.transmissionResolutionScale,o.w*T.transmissionResolutionScale);let s=T.getRenderTarget(),c=T.getActiveCubeFace(),l=T.getActiveMipmapLevel();T.setRenderTarget(a),T.getClearColor(te),ne=T.getClearAlpha(),ne<1&&T.setClearColor(16777215,.5),T.clear(),he&&Me.render(n);let u=T.toneMapping;T.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),x.setupLightsView(r),le===!0&&Ae.setGlobalState(T.clippingPlanes,r),ut(e,n,r),xe.updateMultisampleRenderTarget(a),xe.updateRenderTargetMipmap(a),ve.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i<a;i++){let{object:a,geometry:o,material:s,group:c}=t[i];if(s.side===2&&a.layers.test(r.layers)){let t=s.side;s.side=1,s.needsUpdate=!0,ft(a,n,r,o,s,c),s.side=t,s.needsUpdate=!0,e=!0}}e===!0&&(xe.updateMultisampleRenderTarget(a),xe.updateRenderTargetMipmap(a))}T.setRenderTarget(s,c,l),T.setClearColor(te,ne),d!==void 0&&(r.viewport=d),T.toneMapping=u}function ut(e,t,n){let r=t.isScene===!0?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){let a=e[i],{object:o,geometry:s,group:c}=a,l=a.material;l.allowOverride===!0&&r!==null&&(l=r),o.layers.test(n.layers)&&ft(o,t,n,s,l,c)}}function ft(e,t,n,r,i,a){e.onBeforeRender(T,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(T,t,n,r,e,a),i.transparent===!0&&i.side===2&&i.forceSinglePass===!1?(i.side=1,i.needsUpdate=!0,T.renderBufferDirect(n,t,r,i,e,a),i.side=0,i.needsUpdate=!0,T.renderBufferDirect(n,t,r,i,e,a),i.side=2):T.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(T,t,n,r,i,a)}function mt(e,t,n){t.isScene!==!0&&(t=me);let r=B.get(e),i=x.state.lights,a=x.state.shadowsArray,o=i.state.version,s=Ee.getParameters(e,i.state,a,t,n,x.state.lightProbeGridArray),c=Ee.getProgramCacheKey(s),l=r.programs;r.environment=e.isMeshStandardMaterial||e.isMeshLambertMaterial||e.isMeshPhongMaterial?t.environment:null,r.fog=t.fog;let u=e.isMeshStandardMaterial||e.isMeshLambertMaterial&&!e.envMap||e.isMeshPhongMaterial&&!e.envMap;r.envMap=Se.get(e.envMap||r.environment,u),r.envMapRotation=r.environment!==null&&e.envMap===null?t.environmentRotation:e.envMapRotation,l===void 0&&(e.addEventListener(`dispose`,Ge),l=new Map,r.programs=l);let d=l.get(c);if(d!==void 0){if(r.currentProgram===d&&r.lightsStateVersion===o)return _t(e,s),d}else s.uniforms=Ee.getUniforms(e),D!==null&&e.isNodeMaterial&&D.build(e,n,s),e.onBeforeCompile(s,T),d=Ee.acquireProgram(s,c),l.set(c,d),r.uniforms=s.uniforms;let f=r.uniforms;return(!e.isShaderMaterial&&!e.isRawShaderMaterial||e.clipping===!0)&&(f.clippingPlanes=Ae.uniform),_t(e,s),r.needsLights=xt(e),r.lightsStateVersion=o,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.ltc_1.value=i.state.rectAreaLTC1,f.ltc_2.value=i.state.rectAreaLTC2,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotLightMatrix.value=i.state.spotLightMatrix,f.spotLightMap.value=i.state.spotLightMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix),r.lightProbeGrid=x.state.lightProbeGridArray.length>0,r.currentProgram=d,r.uniformsList=null,d}function gt(e){if(e.uniformsList===null){let t=e.currentProgram.getUniforms();e.uniformsList=Hh.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function _t(e,t){let n=B.get(e);
4104n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}function vt(e,t){if(e.length===0)return null;if(e.length===1)return e[0].texture===null?null:e[0];y.setFromMatrixPosition(t.matrixWorld);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n.texture!==null&&n.boundingBox.containsPoint(y))return n}return null}function yt(e,t,n,r,i){t.isScene!==!0&&(t=me),xe.resetTextureUnits();let a=t.fog,o=r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial?t.environment:null,s=A===null?T.outputColorSpace:A.isXRRenderTarget===!0?A.texture.colorSpace:Rr.workingColorSpace,c=r.isMeshStandardMaterial||r.isMeshLambertMaterial&&!r.envMap||r.isMeshPhongMaterial&&!r.envMap,l=Se.get(r.envMap||o,c),u=r.vertexColors===!0&&!!n.attributes.color&&n.attributes.color.itemSize===4,d=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),f=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,m=!!n.morphAttributes.color,h=0;r.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(h=T.toneMapping);let g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=g===void 0?0:g.length,v=B.get(r),y=x.state.lights;if(le===!0&&(ue===!0||e!==M)){let t=e===M&&r.id===j;Ae.setState(r,e,t)}let b=!1;r.version===v.__version?v.needsLights&&v.lightsStateVersion!==y.state.version?b=!0:v.outputColorSpace===s?i.isBatchedMesh&&v.batching===!1||!i.isBatchedMesh&&v.batching===!0||i.isBatchedMesh&&v.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&v.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&v.instancing===!1||!i.isInstancedMesh&&v.instancing===!0||i.isSkinnedMesh&&v.skinning===!1||!i.isSkinnedMesh&&v.skinning===!0||i.isInstancedMesh&&v.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&v.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&v.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&v.instancingMorph===!1&&i.morphTexture!==null?b=!0:v.envMap===l?r.fog===!0&&v.fog!==a||v.numClippingPlanes!==void 0&&(v.numClippingPlanes!==Ae.numPlanes||v.numIntersection!==Ae.numIntersection)?b=!0:v.vertexAlphas===u&&v.vertexTangents===d&&v.morphTargets===f&&v.morphNormals===p&&v.morphColors===m&&v.toneMapping===h&&v.morphTargetsCount===_?!!v.lightProbeGrid!=x.state.lightProbeGridArray.length>0&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=r.version);let S=v.currentProgram;b===!0&&(S=mt(r,t,i),D&&r.isNodeMaterial&&D.onUpdateProgram(r,S,v));let C=!1,w=!1,E=!1,O=S.getUniforms(),k=v.uniforms;if(z.useProgram(S.program)&&(C=!0,w=!0,E=!0),r.id!==j&&(j=r.id,w=!0),v.needsLights){let e=vt(x.state.lightProbeGridArray,i);v.lightProbeGrid!==e&&(v.lightProbeGrid=e,w=!0)}if(C||M!==e){z.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),O.setValue(R,`projectionMatrix`,e.projectionMatrix),O.setValue(R,`viewMatrix`,e.matrixWorldInverse);let t=O.map.cameraPosition;t!==void 0&&t.setValue(R,fe.setFromMatrixPosition(e.matrixWorld)),ye.logarithmicDepthBuffer&&O.setValue(R,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&O.setValue(R,`isOrthographic`,e.isOrthographicCamera===!0),M!==e&&(M=e,w=!0,E=!0)}if(v.needsLights&&(y.state.directionalShadowMap.length>0&&O.setValue(R,`directionalShadowMap`,y.state.directionalShadowMap,xe),y.state.spotShadowMap.length>0&&O.setValue(R,`spotShadowMap`,y.state.spotShadowMap,xe),y.state.pointShadowMap.length>0&&O.setValue(R,`pointShadowMap`,y.state.pointShadowMap,xe)),i.isSkinnedMesh){O.setOptional(R,i,`bindMatrix`),O.setOptional(R,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),O.setValue(R,`boneTexture`,e.boneTexture,xe))}i.isBatchedMesh&&(O.setOptional(R,i,`batchingTexture`),O.setValue(R,`batchingTexture`,i._matricesTexture,xe),O.setOptional(R,i,`batchingIdTexture`),O.setValue(R,`batchingIdTexture`,i._indirectTexture,xe),O.setOptional(R,i,`batchingColorTexture`),i._colorsTexture!==null&&O.setValue(R,`batchingColorTexture`,i._colorsTexture,xe));let N=n.morphAttributes;if((N.position!==void 0||N.normal!==void 0||N.color!==void 0)&&Ne.update(i,n,S),(w||v.receiveShadow!==i.receiveShadow)&&(v.receiveShadow=i.receiveShadow,O.setValue(R,`receiveShadow`,i.receiveShadow)),(r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial)&&r.envMap===null&&t.environment!==null&&(k.envMapIntensity.value=t.environmentIntensity),k.dfgLUT!==void 0&&(k.dfgLUT.value=l_()),w){if(O.setValue(R,`toneMappingExposure`,T.toneMappingExposure),v.needsLights&&bt(k,E),a&&r.fog===!0&&De.refreshFogUniforms(k,a),De.refreshMaterialUniforms(k,r,I,F,x.state.transmissionRenderTarget[e.id]),v.needsLights&&v.lightProbeGrid){let e=v.lightProbeGrid;k.probesSH.value=e.texture,k.probesMin.value.copy(e.boundingBox.min),k.probesMax.value.copy(e.boundingBox.max),k.probesResolution.value.copy(e.resolution)}Hh.upload(R,gt(v),k,xe)}if(r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(Hh.upload(R,gt(v),k,xe),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&O.setValue(R,`center`,i.center),O.setValue(R,`modelViewMatrix`,i.modelViewMatrix),O.setValue(R,`normalMatrix`,i.normalMatrix),O.setValue(R,`modelMatrix`,i.matrixWorld),r.uniformsGroups!==void 0){let e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){let n=e[t];Re.update(n,S),Re.bind(n,S)}}return S}function bt(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function xt(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&e.lights===!0}this.getActiveCubeFace=function(){return O},this.getActiveMipmapLevel=function(){return k},this.getRenderTarget=function(){return A},this.setRenderTargetTextures=function(e,t,n){let r=B.get(e);r.__autoAllocateDepthBuffer=e.resolveDepthBuffer===!1,r.__autoAllocateDepthBuffer===!1&&(r.__useRenderToTexture=!1),B.get(e.texture).__webglTexture=t,B.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=B.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=t===void 0};let St=R.createFramebuffer();this.setRenderTarget=function(e,t=0,n=0){A=e,O=t,k=n;let r=null,i=!1,a=!1;if(e){let o=B.get(e);if(o.__useDefaultFramebuffer!==void 0){z.bindFramebuffer(R.FRAMEBUFFER,o.__webglFramebuffer),N.copy(e.viewport),P.copy(e.scissor),ee=e.scissorTest,z.viewport(N),z.scissor(P),z.setScissorTest(ee),j=-1;return}if(o.__webglFramebuffer===void 0)xe.setupRenderTarget(e);else if(o.__hasExternalTextures)xe.rebindTextures(e,B.get(e.texture).__webglTexture,B.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(o.__boundDepthTexture!==t){if(t!==null&&B.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error(`WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.`);xe.setupDepthRenderbuffer(e)}}let s=e.texture;(s.isData3DTexture||s.isDataArrayTexture||s.isCompressedArrayTexture)&&(a=!0);let c=B.get(e).__webglFramebuffer;
vendor: 26,118 bytes, lines 4104-4121
4104e.isWebGLCubeRenderTarget?(r=Array.isArray(c[t])?c[t][n]:c[t],i=!0):r=e.samples>0&&xe.useMultisampledRTT(e)===!1?B.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,N.copy(e.viewport),P.copy(e.scissor),ee=e.scissorTest}else N.copy(ae).multiplyScalar(I).floor(),P.copy(oe).multiplyScalar(I).floor(),ee=se;if(n!==0&&(r=St),z.bindFramebuffer(R.FRAMEBUFFER,r)&&z.drawBuffers(e,r),z.viewport(N),z.scissor(P),z.setScissorTest(ee),i){let r=B.get(e.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t<e.textures.length;t++){let i=B.get(e.textures[t]);R.framebufferTextureLayer(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0+t,i.__webglTexture,n,r)}}else if(e!==null&&n!==0){let t=B.get(e.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,t.__webglTexture,n)}j=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget)){H(`WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}let c=B.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){z.bindFramebuffer(R.FRAMEBUFFER,c);try{let o=e.textures[s],c=o.format,l=o.type;if(e.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+s),!ye.textureFormatReadable(c)){H(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!ye.textureTypeReadable(l)){H(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&R.readPixels(t,n,r,i,Ie.convert(c),Ie.convert(l),a)}finally{let e=A===null?null:B.get(A).__webglFramebuffer;z.bindFramebuffer(R.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=B.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){z.bindFramebuffer(R.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(e.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+s),!ye.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!ye.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=R.createBuffer();R.bindBuffer(R.PIXEL_PACK_BUFFER,d),R.bufferData(R.PIXEL_PACK_BUFFER,a.byteLength,R.STREAM_READ),R.readPixels(t,n,r,i,Ie.convert(l),Ie.convert(u),0);let f=A===null?null:B.get(A).__webglFramebuffer;z.bindFramebuffer(R.FRAMEBUFFER,f);let p=R.fenceSync(R.SYNC_GPU_COMMANDS_COMPLETE,0);return R.flush(),await tr(R,p,4),R.bindBuffer(R.PIXEL_PACK_BUFFER,d),R.getBufferSubData(R.PIXEL_PACK_BUFFER,0,a),R.deleteBuffer(d),R.deleteSync(p),a}throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)}},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;xe.setTexture2D(e,0),R.copyTexSubImage2D(R.TEXTURE_2D,n,0,0,o,s,i,a),z.unbindTexture()};let Ct=R.createFramebuffer(),wt=R.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=0){let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=Ie.convert(t.format),_=Ie.convert(t.type),v;t.isData3DTexture?(xe.setTexture3D(t,0),v=R.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(xe.setTexture2DArray(t,0),v=R.TEXTURE_2D_ARRAY):(xe.setTexture2D(t,0),v=R.TEXTURE_2D),z.activeTexture(R.TEXTURE0),z.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,t.flipY),z.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),z.pixelStorei(R.UNPACK_ALIGNMENT,t.unpackAlignment);let y=z.getParameter(R.UNPACK_ROW_LENGTH),b=z.getParameter(R.UNPACK_IMAGE_HEIGHT),x=z.getParameter(R.UNPACK_SKIP_PIXELS),S=z.getParameter(R.UNPACK_SKIP_ROWS),C=z.getParameter(R.UNPACK_SKIP_IMAGES);z.pixelStorei(R.UNPACK_ROW_LENGTH,h.width),z.pixelStorei(R.UNPACK_IMAGE_HEIGHT,h.height),z.pixelStorei(R.UNPACK_SKIP_PIXELS,l),z.pixelStorei(R.UNPACK_SKIP_ROWS,u),z.pixelStorei(R.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=B.get(e),r=B.get(t),h=B.get(n.__renderTarget),g=B.get(r.__renderTarget);z.bindFramebuffer(R.READ_FRAMEBUFFER,h.__webglFramebuffer),z.bindFramebuffer(R.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n<c;n++)w&&(R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,B.get(e).__webglTexture,i,d+n),R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,B.get(t).__webglTexture,a,m+n)),R.blitFramebuffer(l,u,o,s,f,p,o,s,R.DEPTH_BUFFER_BIT,R.NEAREST);z.bindFramebuffer(R.READ_FRAMEBUFFER,null),z.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else if(i!==0||e.isRenderTargetTexture||B.has(e)){let n=B.get(e),r=B.get(t);z.bindFramebuffer(R.READ_FRAMEBUFFER,Ct),z.bindFramebuffer(R.DRAW_FRAMEBUFFER,wt);for(let e=0;e<c;e++)w?R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,n.__webglTexture,i,d+e):R.framebufferTexture2D(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,n.__webglTexture,i),T?R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,r.__webglTexture,a,m+e):R.framebufferTexture2D(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,r.__webglTexture,a),i===0?T?R.copyTexSubImage3D(v,a,f,p,m+e,l,u,o,s):R.copyTexSubImage2D(v,a,f,p,l,u,o,s):R.blitFramebuffer(l,u,o,s,f,p,o,s,R.COLOR_BUFFER_BIT,R.NEAREST);z.bindFramebuffer(R.READ_FRAMEBUFFER,null),z.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else T?e.isDataTexture||e.isData3DTexture?R.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h.data):t.isCompressedArrayTexture?R.compressedTexSubImage3D(v,a,f,p,m,o,s,c,g,h.data):R.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h):e.isDataTexture?R.texSubImage2D(R.TEXTURE_2D,a,f,p,o,s,g,_,h.data):e.isCompressedTexture?R.compressedTexSubImage2D(R.TEXTURE_2D,a,f,p,h.width,h.height,g,h.data):R.texSubImage2D(R.TEXTURE_2D,a,f,p,o,s,g,_,h);z.pixelStorei(R.UNPACK_ROW_LENGTH,y),z.pixelStorei(R.UNPACK_IMAGE_HEIGHT,b),z.pixelStorei(R.UNPACK_SKIP_PIXELS,x),z.pixelStorei(R.UNPACK_SKIP_ROWS,S),z.pixelStorei(R.UNPACK_SKIP_IMAGES,C),a===0&&t.generateMipmaps&&R.generateMipmap(v),z.unbindTexture()},this.initRenderTarget=function(e){B.get(e).__webglFramebuffer===void 0&&xe.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?xe.setTextureCube(e,0):e.isData3DTexture?xe.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?xe.setTexture2DArray(e,0):xe.setTexture2D(e,0),z.unbindTexture()},this.resetState=function(){O=0,k=0,A=null,z.reset(),Le.reset()},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}get coordinateSystem(){return In}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=Rr._getDrawingBufferColorSpace(e),t.unpackColorSpace=Rr._getUnpackColorSpace()}},d_=Uint8Array,f_=Uint16Array,p_=Int32Array,m_=new d_([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),h_=new d_([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),g_=new d_([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),__=function(e,t){for(var n=new f_(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new p_(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},v_=__(m_,2),y_=v_.b,b_=v_.r;y_[28]=258,b_[258]=28;var x_=__(h_,0);x_.b;for(var S_=x_.r,C_=new f_(32768),w_=0;w_<32768;++w_){var T_=(w_&43690)>>1|(w_&21845)<<1;T_=(T_&52428)>>2|(T_&13107)<<2,T_=(T_&61680)>>4|(T_&3855)<<4,C_[w_]=((T_&65280)>>8|(T_&255)<<8)>>1}for(var E_=(function(e,t,n){for(var r=e.length,i=0,a=new f_(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new f_(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new f_(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[C_[d]>>c]=l}else for(s=new f_(r),i=0;i<r;++i)e[i]&&(s[i]=C_[o[e[i]-1]++]>>15-e[i]);return s}),D_=new d_(288),w_=0;w_<144;++w_)D_[w_]=8;for(var w_=144;w_<256;++w_)D_[w_]=9;for(var w_=256;w_<280;++w_)D_[w_]=7;for(var w_=280;w_<288;++w_)D_[w_]=8;for(var O_=new d_(32),w_=0;w_<32;++w_)O_[w_]=5;var k_=E_(D_,9,0),A_=E_(O_,5,0),j_=function(e){return(e+7)/8|0},M_=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new d_(e.subarray(t,n))},N_=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],P_=function(e,t,n){var r=Error(t||N_[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,P_),!n)throw r;return r},F_=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},I_=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},L_=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return{t:W_,l:0};if(i==1){var o=new d_(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new f_(f+1),m=R_(n[u-1],p,0);if(m>t){var r=0,h=0,g=m-t,_=1<<g;for(a.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<i;++r){var v=a[r].s;if(p[v]>t)h+=_-(1<<m-p[v]),p[v]=t;else break}for(h>>=g;h>0;){var y=a[r].s;p[y]<t?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return{t:new d_(p),l:m}},R_=function(e,t,n){return e.s==-1?Math.max(R_(e.l,t,n+1),R_(e.r,t,n+1)):t[e.s]=n},z_=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new f_(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return{c:n.subarray(0,r),n:t}},B_=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},V_=function(e,t,n){var r=n.length,i=j_(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},H_=function(e,t,n,r,i,a,o,s,c,l,u){F_(t,u++,n),++i[256];for(var d=L_(i,15),f=d.t,p=d.l,m=L_(a,15),h=m.t,g=m.l,_=z_(f),v=_.c,y=_.n,b=z_(h),x=b.c,S=b.n,C=new f_(19),w=0;w<v.length;++w)++C[v[w]&31];for(var w=0;w<x.length;++w)++C[x[w]&31];for(var T=L_(C,7),E=T.t,D=T.l,O=19;O>4&&!E[g_[O-1]];--O);var k=l+5<<3,A=B_(i,D_)+B_(a,O_)+o,j=B_(i,f)+B_(a,h)+o+14+3*O+B_(C,E)+2*C[16]+3*C[17]+7*C[18];if(c>=0&&k<=A&&k<=j)return V_(t,u,e.subarray(c,c+l));var M,N,P,ee;if(F_(t,u,1+(j<A)),u+=2,j<A){M=E_(f,p,0),N=f,P=E_(h,g,0),ee=h;var te=E_(E,D,0);F_(t,u,y-257),F_(t,u+5,S-1),F_(t,u+10,O-4),u+=14;for(var w=0;w<O;++w)F_(t,u+3*w,E[g_[w]]);u+=3*O;for(var ne=[v,x],re=0;re<2;++re)for(var F=ne[re],w=0;w<F.length;++w){var I=F[w]&31;F_(t,u,te[I]),u+=E[I],I>15&&(F_(t,u,F[w]>>5&127),u+=F[w]>>12)}}else M=k_,N=D_,P=A_,ee=O_;for(var w=0;w<s;++w){var L=r[w];if(L>255){var I=L>>18&31;I_(t,u,M[I+257]),u+=N[I+257],I>7&&(F_(t,u,L>>23&31),u+=m_[I]);var ie=L&31;I_(t,u,P[ie]),u+=ee[ie],ie>3&&(I_(t,u,L>>5&8191),u+=h_[ie])}else I_(t,u,M[L]),u+=N[L]}return I_(t,u,M[256]),u+N[256]},U_=new p_([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),W_=new d_(0),G_=function(e,t,n,r,i,a){var o=a.z||e.length,s=new d_(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=a.l,u=(a.r||0)&7;if(t){u&&(c[0]=a.r>>3);for(var d=U_[t-1],f=d>>13,p=d&8191,m=(1<<n)-1,h=a.p||new f_(32768),g=a.h||new f_(m+1),_=Math.ceil(n/3),v=2*_,y=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<v)&m},b=new p_(25e3),x=new f_(288),S=new f_(32),C=0,w=0,T=a.i||0,E=0,D=a.w||0,O=0;T+2<o;++T){var k=y(T),A=T&32767,j=g[k];if(h[A]=j,g[k]=A,D<=T){var M=o-T;if((C>7e3||E>24576)&&(M>423||!l)){u=H_(e,c,0,b,x,S,w,E,O,T-O,u),E=C=w=0,O=T;for(var N=0;N<286;++N)x[N]=0;for(var N=0;N<30;++N)S[N]=0}var P=2,ee=0,te=p,ne=A-j&32767;if(M>2&&k==y(T-ne))for(var re=Math.min(f,M)-1,F=Math.min(32767,T),I=Math.min(258,M);ne<=F&&--te&&A!=j;){if(e[T+P]==e[T+P-ne]){for(var L=0;L<I&&e[T+L]==e[T+L-ne];++L);if(L>P){if(P=L,ee=ne,L>re)break;for(var ie=Math.min(ne,L-2),ae=0,N=0;N<ie;++N){var oe=T-ne+N&32767,se=oe-h[oe]&32767;se>ae&&(ae=se,j=oe)}}}A=j,j=h[A],ne+=A-j&32767}if(ee){b[E++]=268435456|b_[P]<<18|S_[ee];var ce=b_[P]&31,le=S_[ee]&31;w+=m_[ce]+h_[le],++x[257+ce],++S[le],D=T+P,++C}else b[E++]=e[T],++x[e[T]]}}for(T=Math.max(T,D);T<o;++T)b[E++]=e[T],++x[e[T]];u=H_(e,c,l,b,x,S,w,E,O,T-O,u),l||(a.r=u&7|c[u/8|0]<<3,u-=7,a.h=g,a.p=h,a.i=T,a.w=D)}else{for(var T=a.w||0;T<o+l;T+=65535){var ue=T+65535;ue>=o&&(c[u/8|0]=l,ue=o),u=V_(c,u+1,e.subarray(T,ue))}a.i=o}return M_(s,0,r+j_(u)+i)},K_=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),q_=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=K_[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},J_=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new d_(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return G_(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},Y_=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},X_=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Z_(e,t){return J_(e,t||{},0,0)}var Q_=function(e,t,n,r){for(var i in e){var a=e[i],o=t+i,s=r;Array.isArray(a)&&(s=Y_(r,a[1]),a=a[0]),a instanceof d_?n[o]=[a,s]:(n[o+=`/`]=[new d_(0),s],Q_(a,o,n,r))}},$_=typeof TextEncoder<`u`&&new TextEncoder,ev=typeof TextDecoder<`u`&&new TextDecoder;try{ev.decode(W_,{stream:!0})}catch{}function tv(e,t){if(t){for(var n=new d_(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if($_)return $_.encode(e);for(var i=e.length,a=new d_(e.length+(e.length>>1)),o=0,s=function(e){a[o++]=e},r=0;r<i;++r){if(o+5>a.length){var c=new d_(o+8+(i-r<<1));c.set(a),a=c}var l=e.charCodeAt(r);l<128||t?s(l):l<2048?(s(192|l>>6),s(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++r)&1023,s(240|l>>18),s(128|l>>12&63),s(128|l>>6&63),s(128|l&63)):(s(224|l>>12),s(128|l>>6&63),s(128|l&63))}return M_(a,0,o)}var nv=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&P_(9),t+=r+4}return t},rv=function(e,t,n,r,i,a,o,s){var c=r.length,l=n.extra,u=s&&s.length,d=nv(l);X_(e,t,o==null?67324752:33639248),t+=4,o!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(a<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var f=new Date(n.mtime==null?Date.now():n.mtime),p=f.getFullYear()-1980;if((p<0||p>119)&&P_(10),X_(e,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,a!=-1&&(X_(e,t,n.crc),X_(e,t+4,a<0?-a-2:a),X_(e,t+8,n.size)),X_(e,t+12,c),X_(e,t+14,d),t+=16,o!=null&&(X_(e,t,u),X_(e,t+6,n.attrs),X_(e,t+10,o),t+=14),e.set(r,t),t+=c,d)for(var m in l){var h=l[m],g=h.length;X_(e,t,+m),X_(e,t+2,g),e.set(h,t+4),t+=4+g}return u&&(e.set(s,t),t+=u),t},iv=function(e,t,n,r,i){X_(e,t,101010256),X_(e,t+8,n),X_(e,t+10,n),X_(e,t+12,r),X_(e,t+16,i)};function av(e,t){t||={};var n={},r=[];Q_(e,``,n,t);var i=0,a=0;for(var o in n){var s=n[o],c=s[0],l=s[1],u=l.level==0?0:8,d=tv(o),f=d.length,p=l.comment,m=p&&tv(p),h=m&&m.length,g=nv(l.extra);f>65535&&P_(11);var _=u?Z_(c,l):c,v=_.length,y=q_();y.p(c),r.push(Y_(l,{size:c.length,crc:y.d(),c:_,f:d,m,u:f!=o.length||m&&p.length!=h,o:i,compression:u})),i+=30+f+g+v,a+=76+2*(f+g)+(h||0)+v}for(var b=new d_(a+22),x=i,S=a-i,C=0;C<r.length;++C){var d=r[C];rv(b,d.o,d,d.f,d.u,d.c.length);var w=30+d.f.length+nv(d.extra);b.set(d.c,d.o+w),rv(b,i,d,d.f,d.u,d.c.length,d.o,d.m),i+=16+w+(d.m?d.m.length:0)}return iv(b,i,r.length,S,x),b}var ov=class{constructor(e,t=``,n=[],r=[]){this.name=e,this.type=t,this.metadata=n,this.properties=r,this.children=[]}addMetadata(e,t){this.metadata.push({key:e,value:t})}addProperty(e,t=[]){this.properties.push({property:e,metadata:t})}addChild(e){this.children.push(e)}toString(e=0){let t=`	`.repeat(e),n=this.metadata.map(e=>{let n=e.key,r=e.value;if(Array.isArray(r)){let e=[];return e.push(`${n} = {`),r.forEach(n=>{e.push(`${t}\t\t${n}`)}),e.push(`${t}\t}`),e.join(`
4105`)}return`${n} = ${r}`}),r=n.length?` (\n${n.map(e=>`${t}\t${e}`).join(`
4106`)}\n${t})`:``,i=this.properties.map(e=>{let n=e.property,r=e.metadata.length?` (\n${e.metadata.map(e=>`${t}\t\t${e}`).join(`
4107`)}\n${t}\t)`:``;return`${t}\t${n}${r}`}),a=this.children.map(t=>t.toString(e+1)),o=[];if(i.length>0&&o.push(...i),a.length>0){i.length>0&&o.push(``);for(let e=0;e<a.length;e++)o.push(a[e]),e<a.length-1&&o.push(``)}let s=o.join(`
4108`);return`${t}def ${this.type?this.type+` `:``}"${this.name}"${r}\n${t}{\n${s}\n${t}}`}},sv=class{constructor(){this.textureUtils=null}setTextureUtils(e){this.textureUtils=e}parse(e,t,n,r){this.parseAsync(e,r).then(t).catch(n)}async parseAsync(e,t={}){t=Object.assign({ar:{anchoring:{type:`plane`},planeAnchoring:{alignment:`horizontal`}},includeAnchoringProperties:!0,onlyVisible:!0,quickLookCompatible:!1,maxTextureSize:1024},t);let n=new Set,r={},i=`model.usda`;r[i]=null;let a=new ov(`Root`,`Xform`),o=new ov(`Scenes`,`Scope`);o.addMetadata(`kind`,`"sceneLibrary"`),a.addChild(o);let s=`Scene`,c=new ov(s,`Xform`);c.addMetadata(`customData`,[`bool preliminary_collidesWithEnvironment = 0`,`string sceneName = "${s}"`]),c.addMetadata(`sceneName`,`"${s}"`),t.includeAnchoringProperties&&(c.addProperty(`token preliminary:anchoring:type = "${t.ar.anchoring.type}"`),c.addProperty(`token preliminary:planeAnchoring:alignment = "${t.ar.planeAnchoring.alignment}"`)),o.addChild(c);let l,u={},d={};fv(e,c,u,n,r,t);let f=Cv(u,d,t.quickLookCompatible);l=dv()+`
4109`+a.toString()+`
4110
4111`+f.toString(),r[i]=tv(l),l=null;for(let e in d){let n=d[e];if(n.isCompressedTexture===!0){if(this.textureUtils===null)throw Error(`THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.`);n=await this.textureUtils.decompress(n)}let i=lv(n.image,n.flipY,t.maxTextureSize),a=await new Promise(e=>i.toBlob(e,`image/png`,1));r[`textures/Texture_${e}.png`]=new Uint8Array(await a.arrayBuffer())}let p=0;for(let e in r){let t=r[e],n=34+e.length;p+=n;let i=p&63;if(i!==4){let n=64-i;r[e]=[t,{extra:{12345:new Uint8Array(n)}}]}p=t.length}return av(r,{level:0})}};function cv(e,t){let n=e.name;return n=n.replace(/[^A-Za-z0-9_]/g,``),/^[0-9]/.test(n)&&(n=`_`+n),n===``&&(n=e.isCamera?`Camera`:`Object`),t.has(n)&&(n=n+`_`+e.id),t.add(n),n}function lv(e,t,n){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let r=n/Math.max(e.width,e.height),i=document.createElement(`canvas`);i.width=e.width*Math.min(1,r),i.height=e.height*Math.min(1,r);let a=i.getContext(`2d`);return t===!0&&(a.translate(0,i.height),a.scale(1,-1)),a.drawImage(e,0,0,i.width,i.height),i}throw Error(`THREE.USDZExporter: No valid image data found. Unable to process texture.`)}var uv=7;function dv(){return`#usda 1.0
4112(
4113	customLayerData = {
4114		string creator = "Three.js USDZExporter"
4115	}
4116	defaultPrim = "Root"
4117	metersPerUnit = 1
4118	upAxis = "Y"
4119)
4120`}function fv(e,t,n,r,i,a){for(let o=0,s=e.children.length;o<s;o++){let s=e.children[o];if(s.visible===!1&&a.onlyVisible===!0)continue;let c;if(s.isMesh){let e=s.geometry,t=s.material;if(t.isMeshStandardMaterial){let a=`geometries/Geometry_`+e.id+`.usda`;if(!(a in i)){let t=_v(e);i[a]=tv(dv()+`
4121`+t.toString())}t.uuid in n||(n[t.uuid]=t),c=mv(s,e,n[t.uuid],r)}else console.warn(`THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)`,s)}else c=s.isCamera?Ov(s,r):pv(s,r);c&&(t.addChild(c),fv(s,c,n,r,i,a))}}function pv(e,t){let n=cv(e,t);e.matrix.determinant()<0&&console.warn(`THREE.USDZExporter: USDZ does not support negative scales`,e);let r=new ov(n,`Xform`);if(e.pivot!==null){let t=e.position,n=e.quaternion,i=e.scale,a=e.pivot;r.addProperty(`float3 xformOp:translate = (${t.x.toPrecision(uv)}, ${t.y.toPrecision(uv)}, ${t.z.toPrecision(uv)})`),r.addProperty(`float3 xformOp:translate:pivot = (${a.x.toPrecision(uv)}, ${a.y.toPrecision(uv)}, ${a.z.toPrecision(uv)})`),r.addProperty(`quatf xformOp:orient = (${n.w.toPrecision(uv)}, ${n.x.toPrecision(uv)}, ${n.y.toPrecision(uv)}, ${n.z.toPrecision(uv)})`),r.addProperty(`float3 xformOp:scale = (${i.x.toPrecision(uv)}, ${i.y.toPrecision(uv)}, ${i.z.toPrecision(uv)})`),r.addProperty(`uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:translate:pivot", "xformOp:orient", "xformOp:scale", "!invert!xformOp:translate:pivot"]`)}else{let t=hv(e.matrix);r.addProperty(`matrix4d xformOp:transform = ${t}`),r.addProperty(`uniform token[] xformOpOrder = ["xformOp:transform"]`)}return r}function mv(e,t,n,r){let i=pv(e,r);return i.addMetadata(`prepend references`,`@./geometries/Geometry_${t.id}.usda@</Geometry>`),i.addMetadata(`prepend apiSchemas`,`["MaterialBindingAPI"]`),i.addProperty(`rel material:binding = </Materials/Material_${n.id}>`),i}function hv(e){let t=e.elements;return`( ${gv(t,0)}, ${gv(t,4)}, ${gv(t,8)}, ${gv(t,12)} )`}function gv(e,t){return`(${e[t+0]}, ${e[t+1]}, ${e[t+2]}, ${e[t+3]})`}function _v(e){let t=new ov(`Geometry`),n=vv(e);return t.addChild(n),t}function vv(e){let t=e.attributes,n=t.position.count,r=new ov(`Geometry`,`Mesh`);r.addProperty(`int[] faceVertexCounts = [${yv(e)}]`),r.addProperty(`int[] faceVertexIndices = [${bv(e)}]`),r.addProperty(`normal3f[] normals = [${xv(t.normal,n)}]`,[`interpolation = "vertex"`]),r.addProperty(`point3f[] points = [${xv(t.position,n)}]`);for(let e=0;e<4;e++){let n=e>0?e:``,i=t[`uv`+n];i!==void 0&&r.addProperty(`texCoord2f[] primvars:st${n} = [${Sv(i)}]`,[`interpolation = "vertex"`])}let i=t.color;return i!==void 0&&r.addProperty(`color3f[] primvars:displayColor = [${xv(i,n)}]`,[`interpolation = "vertex"`]),r.addProperty(`uniform token subdivisionScheme = "none"`),r}function yv(e){let t=e.index===null?e.attributes.position.count:e.index.count;return Array(t/3).fill(3).join(`, `)}function bv(e){let t=e.index,n=[];if(t!==null)for(let e=0;e<t.count;e++)n.push(t.getX(e));else{let t=e.attributes.position.count;for(let e=0;e<t;e++)n.push(e)}return n.join(`, `)}function xv(e,t){if(e===void 0)return console.warn(`USDZExporter: Normals missing.`),Array(t).fill(`(0, 0, 0)`).join(`, `);let n=[];for(let t=0;t<e.count;t++){let r=e.getX(t),i=e.getY(t),a=e.getZ(t);n.push(`(${r.toPrecision(uv)}, ${i.toPrecision(uv)}, ${a.toPrecision(uv)})`)}return n.join(`, `)}function Sv(e){let t=[];for(let n=0;n<e.count;n++){let r=e.getX(n),i=e.getY(n);t.push(`(${r.toPrecision(uv)}, ${1-i.toPrecision(uv)})`)}return t.join(`, `)}function Cv(e,t,n=!1){let r=new ov(`Materials`);for(let i in e){let a=e[i];r.addChild(wv(a,t,n))}return r}function wv(e,t,n=!1){let r=new ov(`Material_${e.id}`,`Material`);function i(r,i,a){let o=r.source.id+`_`+r.flipY;t[o]=r;let s=r.channel>0?`st`+r.channel:`st`,c={1e3:`repeat`,1001:`clamp`,1002:`mirror`},l=r.repeat.clone(),u=r.offset.clone(),d=r.rotation,f=Math.sin(d),p=Math.cos(d);u.y=1-u.y-l.y,n?(u.x/=l.x,u.y/=l.y,u.x+=f/l.x,u.y+=p-1):(u.x+=f*l.x,u.y+=(1-p)*l.y);let m=new ov(`PrimvarReader_${i}`,`Shader`);m.addProperty(`uniform token info:id = "UsdPrimvarReader_float2"`),m.addProperty(`float2 inputs:fallback = (0.0, 0.0)`),m.addProperty(`string inputs:varname = "${s}"`),m.addProperty(`float2 outputs:result`);let h=new ov(`Transform2d_${i}`,`Shader`);h.addProperty(`uniform token info:id = "UsdTransform2d"`),h.addProperty(`float2 inputs:in.connect = </Materials/Material_${e.id}/PrimvarReader_${i}.outputs:result>`),h.addProperty(`float inputs:rotation = ${(180/Math.PI*d).toFixed(uv)}`),h.addProperty(`float2 inputs:scale = ${Dv(l)}`),h.addProperty(`float2 inputs:translation = ${Dv(u)}`),h.addProperty(`float2 outputs:result`);let g=new ov(`Texture_${r.id}_${i}`,`Shader`);return g.addProperty(`uniform token info:id = "UsdUVTexture"`),g.addProperty(`asset inputs:file = @textures/Texture_${o}.png@`),g.addProperty(`float2 inputs:st.connect = </Materials/Material_${e.id}/Transform2d_${i}.outputs:result>`),a!==void 0&&g.addProperty(`float4 inputs:scale = ${Ev(a)}`),i===`normal`&&(g.addProperty(`float4 inputs:scale = (2, 2, 2, 1)`),g.addProperty(`float4 inputs:bias = (-1, -1, -1, 0)`)),g.addProperty(`token inputs:sourceColorSpace = "${r.colorSpace===``?`raw`:`sRGB`}"`),g.addProperty(`token inputs:wrapS = "${c[r.wrapS]}"`),g.addProperty(`token inputs:wrapT = "${c[r.wrapT]}"`),g.addProperty(`float outputs:r`),g.addProperty(`float outputs:g`),g.addProperty(`float outputs:b`),g.addProperty(`float3 outputs:rgb`),(e.transparent||e.alphaTest>0)&&g.addProperty(`float outputs:a`),[m,h,g]}e.side===2&&console.warn(`THREE.USDZExporter: USDZ does not support double sided materials`,e);let a=new ov(`PreviewSurface`,`Shader`);if(a.addProperty(`uniform token info:id = "UsdPreviewSurface"`),e.map===null?a.addProperty(`color3f inputs:diffuseColor = ${Tv(e.color)}`):(a.addProperty(`color3f inputs:diffuseColor.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:rgb>`),e.transparent?a.addProperty(`float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:a>`):e.alphaTest>
41210&&(a.addProperty(`float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:a>`),a.addProperty(`float inputs:opacityThreshold = ${e.alphaTest}`)),i(e.map,`diffuse`,e.color).forEach(e=>r.addChild(e))),e.emissiveMap!==null){a.addProperty(`color3f inputs:emissiveColor.connect = </Materials/Material_${e.id}/Texture_${e.emissiveMap.id}_emissive.outputs:rgb>`);let t=new q(e.emissive.r*e.emissiveIntensity,e.emissive.g*e.emissiveIntensity,e.emissive.b*e.emissiveIntensity);i(e.emissiveMap,`emissive`,t).forEach(e=>r.addChild(e))}else e.emissive.getHex()>0&&a.addProperty(`color3f inputs:emissiveColor = ${Tv(e.emissive)}`);if(e.normalMap!==null&&(a.addProperty(`normal3f inputs:normal.connect = </Materials/Material_${e.id}/Texture_${e.normalMap.id}_normal.outputs:rgb>`),i(e.normalMap,`normal`).forEach(e=>r.addChild(e))),e.aoMap!==null){a.addProperty(`float inputs:occlusion.connect = </Materials/Material_${e.id}/Texture_${e.aoMap.id}_occlusion.outputs:r>`);let t=new q(e.aoMapIntensity,e.aoMapIntensity,e.aoMapIntensity);i(e.aoMap,`occlusion`,t).forEach(e=>r.addChild(e))}if(e.roughnessMap!==null){a.addProperty(`float inputs:roughness.connect = </Materials/Material_${e.id}/Texture_${e.roughnessMap.id}_roughness.outputs:g>`);let t=new q(e.roughness,e.roughness,e.roughness);i(e.roughnessMap,`roughness`,t).forEach(e=>r.addChild(e))}else a.addProperty(`float inputs:roughness = ${e.roughness}`);if(e.metalnessMap!==null){a.addProperty(`float inputs:metallic.connect = </Materials/Material_${e.id}/Texture_${e.metalnessMap.id}_metallic.outputs:b>`);let t=new q(e.metalness,e.metalness,e.metalness);i(e.metalnessMap,`metallic`,t).forEach(e=>r.addChild(e))}else a.addProperty(`float inputs:metallic = ${e.metalness}`);if(e.alphaMap===null?a.addProperty(`float inputs:opacity = ${e.opacity}`):(a.addProperty(`float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.alphaMap.id}_opacity.outputs:r>`),a.addProperty(`float inputs:opacityThreshold = 0.0001`),i(e.alphaMap,`opacity`).forEach(e=>r.addChild(e))),e.isMeshPhysicalMaterial){if(e.clearcoatMap!==null){a.addProperty(`float inputs:clearcoat.connect = </Materials/Material_${e.id}/Texture_${e.clearcoatMap.id}_clearcoat.outputs:r>`);let t=new q(e.clearcoat,e.clearcoat,e.clearcoat);i(e.clearcoatMap,`clearcoat`,t).forEach(e=>r.addChild(e))}else a.addProperty(`float inputs:clearcoat = ${e.clearcoat}`);if(e.clearcoatRoughnessMap!==null){a.addProperty(`float inputs:clearcoatRoughness.connect = </Materials/Material_${e.id}/Texture_${e.clearcoatRoughnessMap.id}_clearcoatRoughness.outputs:g>`);let t=new q(e.clearcoatRoughness,e.clearcoatRoughness,e.clearcoatRoughness);i(e.clearcoatRoughnessMap,`clearcoatRoughness`,t).forEach(e=>r.addChild(e))}else a.addProperty(`float inputs:clearcoatRoughness = ${e.clearcoatRoughness}`);a.addProperty(`float inputs:ior = ${e.ior}`)}return a.addProperty(`int inputs:useSpecularWorkflow = 0`),a.addProperty(`token outputs:surface`),r.addChild(a),r.addProperty(`token outputs:surface.connect = </Materials/Material_${e.id}/PreviewSurface.outputs:surface>`),r}function Tv(e){return`(${e.r}, ${e.g}, ${e.b})`}function Ev(e){return`(${e.r}, ${e.g}, ${e.b}, 1.0)`}function Dv(e){return`(${e.x}, ${e.y})`}function Ov(e,t){let n=cv(e,t),r=hv(e.matrix);e.matrix.determinant()<0&&console.warn(`THREE.USDZExporter: USDZ does not support negative scales`,e);let i=new ov(n,`Camera`);i.addProperty(`matrix4d xformOp:transform = ${r}`),i.addProperty(`uniform token[] xformOpOrder = ["xformOp:transform"]`);let a=e.isOrthographicCamera?`orthographic`:`perspective`;i.addProperty(`token projection = "${a}"`);let o=`(${e.near.toPrecision(uv)}, ${e.far.toPrecision(uv)})`;i.addProperty(`float2 clippingRange = ${o}`);let s;s=e.isOrthographicCamera?((Math.abs(e.left)+Math.abs(e.right))*10).toPrecision(uv):e.getFilmWidth().toPrecision(uv),i.addProperty(`float horizontalAperture = ${s}`);let c;if(c=e.isOrthographicCamera?((Math.abs(e.top)+Math.abs(e.bottom))*10).toPrecision(uv):e.getFilmHeight().toPrecision(uv),i.addProperty(`float verticalAperture = ${c}`),e.isPerspectiveCamera){let t=e.getFocalLength().toPrecision(uv);i.addProperty(`float focalLength = ${t}`);let n=e.focus.toPrecision(uv);i.addProperty(`float focusDistance = ${n}`)}return i}function kv(e){return y()?(N(e),!0):!1}function Av(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return kv(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}var jv=new WeakMap,Mv=(...e)=>{let t=e[0],n=d()?.proxy;if(n==null&&!s())throw Error(`injectLocal must be called in setup`);return n&&jv.has(n)&&t in jv.get(n)?jv.get(n)[t]:l(...e)};function Nv(e,t){let n=d()?.proxy;if(n==null)throw Error(`provideLocal must be called in setup`);jv.has(n)||jv.set(n,Object.create(null));let r=jv.get(n);return r[e]=t,D(e,t)}function Pv(e,t){let n=t?.injectionKey||Symbol(e.name||`InjectionState`),r=t?.defaultValue;return[(...t)=>{let r=e(...t);return Nv(n,r),r},()=>Mv(n,r)]}var Fv=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;
4121var Iv=Object.prototype.toString,Lv=e=>Iv.call(e)===`[object Object]`,Rv=()=>{};function zv(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}function Bv(e,t={}){let n,r,i=Rv,a=e=>{clearTimeout(e),i(),i=Rv},s;return c=>{let l=o(e),u=o(t.maxWait);return n&&a(n),l<=0||u!==void 0&&u<=0?(r&&=(a(r),void 0),Promise.resolve(c())):new Promise((e,o)=>{i=t.rejectOnCancel?o:e,s=c,u&&!r&&(r=setTimeout(()=>{n&&a(n),r=void 0,e(s())},u)),n=setTimeout(()=>{r&&a(r),r=void 0,e(c())},l)})}}function Vv(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{setTimeout(t?()=>i(n):r,e)})}function Hv(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function Uv(e){return Array.isArray(e)?e:[e]}function Wv(e){return e||d()}function Gv(e,t=200,n={}){return zv(Bv(t,n),e)}function Kv(e,t=200,n={}){let r=I(o(e)),i=Gv(()=>{r.value=e.value},t,n);return c(e,()=>i()),x(r)}function qv(e,t=!0,n){Wv(n)?S(e,n):t?e():ne(e)}function Jv(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:s}={}){let l=null,u=[new Promise(a=>{l=c(e,e=>{n(e)!==t&&(l?l():ne(()=>l?.()),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&u.push(Vv(a,s).then(()=>o(e)).finally(()=>l?.())),Promise.race(u)}function r(r,i){if(!re(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:s=!1,timeout:l,throwOnTimeout:u}=i??{},d=null,f=[new Promise(n=>{d=c([e,r],([e,r])=>{t!==(e===r)&&(d?d():ne(()=>d?.()),n(e))},{flush:a,deep:s,immediate:!0})})];return l!=null&&f.push(Vv(l,u).then(()=>o(e)).finally(()=>(d?.(),o(e)))),Promise.race(f)}function i(e){return n(e=>!!e,e)}function a(e){return r(null,e)}function s(e){return r(void 0,e)}function l(e){return n(Number.isNaN,e)}function u(e,t){return n(t=>{let n=Array.from(t);return n.includes(e)||n.includes(o(e))},t)}function d(e){return f(1,e)}function f(e=1,t){let r=-1;return n(()=>(r+=1,r>=e),t)}return Array.isArray(o(e))?{toMatch:n,toContains:u,changed:d,changedTimes:f,get not(){return Jv(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:i,toBeNull:a,toBeNaN:l,toBeUndefined:s,changed:d,changedTimes:f,get not(){return Jv(e,!t)}}}function Yv(e){return Jv(e)}function Xv(e,t=1e3,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=null,s=L(!1);function l(){a&&=(clearInterval(a),null)}function u(){s.value=!1,l()}function d(){let n=o(t);n<=0||(s.value=!0,i&&e(),l(),s.value&&(a=setInterval(e,n)))}return r&&Fv&&d(),(re(t)||typeof t==`function`)&&kv(c(t,()=>{s.value&&Fv&&d()})),kv(u),{isActive:x(s),pause:u,resume:d}}function Zv(e,t,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=L(!1),s;function c(){s&&=(clearTimeout(s),void 0)}function l(){a.value=!1,c()}function u(...n){i&&e(),c(),a.value=!0,s=setTimeout(()=>{a.value=!1,s=void 0,e(...n)},o(t))}return r&&(a.value=!0,Fv&&u()),kv(l),{isPending:x(a),start:u,stop:l}}function Qv(e=1e3,t={}){let{controls:n=!1,callback:r}=t,i=Zv(r??Rv,e,t),a=T(()=>!i.isPending.value);return n?{ready:a,...i}:a}function $v(e,t,n){return c(e,t,{...n,immediate:!0})}var ey=Fv?window:void 0;Fv&&window.document,Fv&&window.navigator,Fv&&window.location;function ty(e){let t=o(e);return t?.$el??t}function ny(...e){let t=[],n=()=>{t.forEach(e=>e()),t.length=0},r=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),i=T(()=>{let t=Uv(o(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),a=$v(()=>[i.value?.map(e=>ty(e))??[ey].filter(e=>e!=null),Uv(o(i.value?e[1]:e[0])),Uv(p(i.value?e[2]:e[1])),o(i.value?e[3]:e[2])],([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=Lv(o)?{...o}:o;t.push(...e.flatMap(e=>i.flatMap(t=>a.map(n=>r(e,t,n,s)))))},{flush:`post`});return kv(n),()=>{a(),n()}}function ry(){let e=L(!1),t=d();return t&&S(()=>{e.value=!0},t),e}function iy(e){let t=ry();return T(()=>(t.value,!!e()))}function ay(e,t={}){let{immediate:n=!0,fpsLimit:r=void 0,window:i=ey,once:a=!1}=t,s=L(!1),c=T(()=>r?1e3/o(r):null),l=0,u=null;function d(t){if(!s.value||!i)return;l||=t;let n=t-l;if(c.value&&n<c.value){u=i.requestAnimationFrame(d);return}if(l=t,e({delta:n,timestamp:t}),a){s.value=!1,u=null;return}u=i.requestAnimationFrame(d)}function f(){!s.value&&i&&(s.value=!0,l=0,u=i.requestAnimationFrame(d))}function p(){s.value=!1,u!=null&&i&&(i.cancelAnimationFrame(u),u=null)}return n&&f(),kv(p),{isActive:v(s),pause:p,resume:f}}function oy(e,t,n){let{immediate:r=!0,delay:i=0,onError:a=globalThis.reportError??Rv,onSuccess:s=Rv,resetOnExecute:c=!0,shallow:l=!0,throwError:u}=n??{},d=l?L(t):I(t),f=L(!1),p=L(!1),m=L(void 0);async function h(n=0,...r){c&&(d.value=o(t)),m.value=void 0,f.value=!1,p.value=!0,n>0&&await Vv(n);let i=typeof e==`function`?e(...r):e;try{let e=await i;d.value=e,f.value=!0,s(e)}catch(e){if(m.value=e,a(e),u)throw e}finally{p.value=!1}return d.value}r&&h(i);let g={state:d,isReady:f,isLoading:p,error:m,execute:h,executeImmediate:(...e)=>h(0,...e)};function _(){return new Promise((e,t)=>
4121{Yv(p).toBe(!1).then(()=>e(g)).catch(t)})}return{...g,then(e,t){return _().then(e,t)}}}var sy=Symbol(`vueuse-ssr-width`);function cy(){let e=s()?Mv(sy,null):null;return typeof e==`number`?e:void 0}function ly(e,t={}){let{window:n=ey,ssrWidth:r=cy()}=t,i=iy(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=L(typeof r==`number`),s=L(),c=L(!1);return g(()=>{if(a.value){a.value=!i.value;let t=o(e).split(`,`);c.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=Hv(n[1])),i&&a&&(a=r<=Hv(i[1])),t?!a:a});return}i.value&&(s.value=n.matchMedia(o(e)),c.value=s.value.matches)}),ny(s,`change`,e=>{c.value=e.matches},{passive:!0}),T(()=>c.value)}function uy(e={}){let{window:t=ey}=e,n=L(1),r=ly(()=>`(resolution: ${n.value}dppx)`,e),i=Rv;return t&&(i=$v(r,()=>n.value=t.devicePixelRatio)),{pixelRatio:v(n),stop:i}}function dy(e,t,n={}){let{window:r=ey,...i}=n,a,s=iy(()=>r&&`ResizeObserver`in r),l=()=>{a&&=(a.disconnect(),void 0)},u=T(()=>{let t=o(e);return Array.isArray(t)?t.map(e=>ty(e)):[ty(t)]}),d=c(u,e=>{if(l(),s.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),f=()=>{l(),d()};return kv(f),{isSupported:s,stop:f}}function fy(e,t={width:0,height:0},n={}){let{window:r=ey,box:i=`content-box`}=n,a=T(()=>(ty(e)?.namespaceURI)?.includes(`svg`)),o=L(t.width),s=L(t.height),{stop:l}=dy(e,([t])=>{let n=i===`border-box`?t.borderBoxSize:i===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;if(r&&a.value){let t=ty(e);if(t){let e=t.getBoundingClientRect();o.value=e.width,s.value=e.height}}else if(n){let e=Uv(n);o.value=e.reduce((e,{inlineSize:t})=>e+t,0),s.value=e.reduce((e,{blockSize:t})=>e+t,0)}else o.value=t.contentRect.width,s.value=t.contentRect.height},n);qv(()=>{let n=ty(e);n&&(o.value=`offsetWidth`in n?n.offsetWidth:t.width,s.value=`offsetHeight`in n?n.offsetHeight:t.height)});let u=c(()=>ty(e),e=>{o.value=e?t.width:0,s.value=e?t.height:0});function d(){l(),u()}return{width:o,height:s,stop:d}}function py(e){let t=L(0);if(typeof performance>`u`)return t;let n=e?.every??10,r=performance.now(),i=0;return ay(()=>{if(i+=1,i>=n){let e=performance.now(),n=e-r;t.value=Math.round(1e3/(n/i)),r=e,i=0}}),t}function my(e={}){let t=I(),n=iy(()=>typeof performance<`u`&&`memory`in performance);if(n.value){let{interval:n=1e3}=e;Xv(()=>{t.value=performance.memory},n,{immediate:e.immediate,immediateCallback:e.immediateCallback})}return{isSupported:n,memory:t}}function hy(e={}){let{window:t=ey,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:i=!0,includeScrollbar:a=!0,type:o=`inner`}=e,s=L(n),l=L(r),u=()=>{if(t){if(o===`outer`)s.value=t.outerWidth,l.value=t.outerHeight;else if(o===`visual`&&t.visualViewport){let{width:e,height:n,scale:r}=t.visualViewport;s.value=Math.round(e*r),l.value=Math.round(n*r)}else a?(s.value=t.innerWidth,l.value=t.innerHeight):(s.value=t.document.documentElement.clientWidth,l.value=t.document.documentElement.clientHeight)}};u(),qv(u);let d={passive:!0};if(ny(`resize`,u,d),t&&o===`visual`&&t.visualViewport&&ny(t.visualViewport,`resize`,u,d),i){let e=ly(`(orientation: portrait)`);c(e,()=>u())}return{width:s,height:l}}function gy(e){let t=(e?.replace(/([A-Z])+/g,_y))?.split(/(?=[A-Z])|[\.\-\s_]/).map(e=>e.toLowerCase())??[];return t.length===0?``:t.length===1?t[0]:t.reduce((e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`)}function _y(e){if(!e||e.length===0)return``;let t=e.toLowerCase();return t.substring(0,1).toUpperCase()+t.substring(1,t.length)}new Map(Object.entries({Æ:`Ae`,Ð:`D`,Ø:`O`,Þ:`Th`,ß:`ss`,æ:`ae`,ð:`d`,ø:`o`,þ:`th`,Đ:`D`,đ:`d`,Ħ:`H`,ħ:`h`,ı:`i`,IJ:`IJ`,ij:`ij`,ĸ:`k`,Ŀ:`L`,ŀ:`l`,Ł:`L`,ł:`l`,ʼn:`'n`,Ŋ:`N`,ŋ:`n`,Œ:`Oe`,œ:`oe`,Ŧ:`T`,ŧ:`t`,ſ:`s`}));function vy(e,t){if(Object.is(e,t))return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.toString()===t.toString();if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);
4121if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Reflect.has(t,n[r])||!vy(e[n[r]],t[n[r]]))return!1;return!0}function yy(e){return typeof e==`function`}function by(e){return typeof e==`number`&&!Number.isNaN(e)}function xy(e){return Cy(e,`[object Object]`)}function Sy(e){return typeof e==`string`}function Cy(e,t){return Object.prototype.toString.call(e)===t}function wy(e){return e===void 0}var Ty=class{nativeEvent;NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3;relatedTarget=null;get altKey(){return this.getFromNative(`altKey`,!1)}get button(){return this.getFromNative(`button`,0)}get buttons(){return this.getFromNative(`buttons`,0)}get clientX(){return this.getFromNative(`clientX`,0)}get clientY(){return this.getFromNative(`clientY`,0)}get ctrlKey(){return this.getFromNative(`ctrlKey`,!1)}get layerX(){return this.getFromNative(`layerX`,0)}get layerY(){return this.getFromNative(`layerY`,0)}get metaKey(){return this.getFromNative(`metaKey`,!1)}get movementX(){return this.getFromNative(`movementX`,0)}get movementY(){return this.getFromNative(`movementY`,0)}get offsetX(){return this.getFromNative(`offsetX`,0)}get offsetY(){return this.getFromNative(`offsetY`,0)}get pageX(){return this.getFromNative(`pageX`,0)}get pageY(){return this.getFromNative(`pageY`,0)}get screenX(){return this.getFromNative(`screenX`,0)}get screenY(){return this.getFromNative(`screenY`,0)}get shiftKey(){return this.getFromNative(`shiftKey`,!1)}get x(){return this.getFromNative(`x`,0)}get y(){return this.getFromNative(`y`,0)}get detail(){return this.getFromNative(`detail`,0)}get view(){return this.getFromNative(`view`,null)}get which(){return this.getFromNative(`which`,0)}get cancelBubble(){return this.getFromNative(`cancelBubble`,!1)}get composed(){return this.getFromNative(`composed`,!1)}get eventPhase(){return this.getFromNative(`eventPhase`,0)}get isTrusted(){return this.getFromNative(`isTrusted`,!1)}get returnValue(){return this.getFromNative(`returnValue`,!1)}get timeStamp(){return this.getFromNative(`timeStamp`,0)}get cancelable(){return this.getFromNative(`cancelable`,!1)}get defaultPrevented(){return this.getFromNative(`defaultPrevented`,!1)}constructor(e){this.nativeEvent=e}getFromNative(e,t){return e in this.nativeEvent?this.nativeEvent[e]:t}},Ey=new G,Dy=class e extends Ty{type;bubbles;internalPointer;intersection;camera;currentObject;object;propagationState;get pointerId(){return this.internalPointer.id}get pointerType(){return this.internalPointer.type}get pointerState(){return this.internalPointer.state}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}get eventObject(){return this.currentObject}get srcElement(){return this.currentObject}_pointer;get pointer(){return this._pointer??=(Ey.copy(this.intersection.point).project(this.camera),new W(Ey.x,Ey.y)),this._pointer}_ray;get ray(){if(this._ray!=null)return this._ray;switch(this.intersection.details.type){case`screen-ray`:case`ray`:case`sphere`:return this._ray=new So(this.intersection.pointerPosition,new G(0,0,-1).applyQuaternion(this.intersection.pointerQuaternion));case`lines`:return this._ray=new So(this.intersection.details.line.start,this.intersection.details.line.end.clone().sub(this.intersection.details.line.start).normalize())}}_intersections=[];get intersections(){return this._intersections??=[{...this.intersection,eventObject:this.currentObject}],this._intersections}_unprojectedPoint;get unprojectedPoint(){if(this._unprojectedPoint==null){let e=this.pointer;this._unprojectedPoint=new G(e.x,e.y,0).unproject(this.camera)}return this._unprojectedPoint}
4121get stopped(){return this.propagationState.stoppedImmediate||this.propagationState.stopped}get stoppedImmediate(){return this.propagationState.stoppedImmediate}get delta(){throw Error(`not supported`)}constructor(e,t,n,r,i,a,o=i.object,s=o,c={stopped:!t,stoppedImmediate:!1}){super(n),this.type=e,this.bubbles=t,this.internalPointer=r,this.intersection=i,this.camera=a,this.currentObject=o,this.object=s,this.propagationState=c}stopPropagation(){this.propagationState.stopped=!0}stopImmediatePropagation(){this.propagationState.stoppedImmediate=!0}retarget(t){return new e(this.type,this.bubbles,this.nativeEvent,this.internalPointer,this.intersection,this.camera,t,this.target,this.propagationState)}},Oy=class e extends Dy{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,n,r,i,a){super(`wheel`,!0,e,t,n,r,i,a)}retarget(t){return new e(this.nativeEvent,this.internalPointer,this.intersection,this.camera,t,this.target)}};function ky(e){Ay(e,e.currentObject)}function Ay(e,t){if(t==null)return;let n=Ny(t,e.type);if(n!=null&&n.length>0){let r=e.retarget(t),i=n.length;for(let e=0;e<i&&!r.stoppedImmediate;e++)n[e](r)}e.stopped||Ay(e,t.parent)}var jy={click:`onClick`,contextmenu:`onContextMenu`,dblclick:`onDoubleClick`,pointercancel:`onPointerCancel`,pointerdown:`onPointerDown`,pointerenter:`onPointerEnter`,pointerleave:`onPointerLeave`,pointermove:`onPointerMove`,pointerout:`onPointerOut`,pointerover:`onPointerOver`,pointerup:`onPointerUp`,wheel:`onWheel`},My=Object.keys(jy);function Ny(e,t){if(e._listeners!=null&&t in e._listeners)return e._listeners[t];let n;if(e.isVoidObject&&t===`click`&&e.parent?.__r3f!=null&&(n=e.parent.__r3f.root.getState().onPointerMissed),e.__r3f!=null&&(n=e.__r3f.handlers[jy[t]]),n!=null)return[n]}var Py=new $l(1e10),Fy=new Map;function Iy(e){let t=Fy.get(e);return t??(t=new Fo(Py),t.isVoidObject=!0,t.parent=e,t.pointerEventsOrder=-1/0,Fy.set(e,t)),t}function Ly(e,t,n){let r=t.normal??t.face?.normal;return r!=null&&(e.setFromNormalAndCoplanarPoint(r,t.localPoint),e.applyMatrix4(n),!0)}function Ry(e,t,n){if(t===`none`||t===`listener`&&!e)return!1;if(n===`all`)return!0;if(typeof n==`function`)return({id:e,type:t,state:r})=>n(e,t,r);let r,i;return`deny`in n?(i=!0,r=n.deny):(i=!1,r=n.allow),Array.isArray(r)?e=>zy(r.includes(e.type),i):e=>zy(r===e.type,i)}function zy(e,t){return t?!e:e}function By(e,t,n,r=!1,i,a,o){let s=r||Vy(e,t),c=t.pointerEvents??i,l=c??t.defaultPointerEvents??`listener`,u=t.pointerEventsType??a??`all`,d=t.pointerEventsOrder??o??0,f=Ry(s,l,u),p=n.length;if(p===1)(f===!0||typeof f==`function`&&f(n[0]))&&Hy(n[0],t,l,u,d);else if(f===!0)for(let e=0;e<p;e++)Hy(n[e],t,l,u,d);else if(typeof f==`function`)for(let e=0;e<p;e++){let r=n[e];f(r)&&Hy(r,t,l,u,d)}if(t.children.length===0||t.intersectChildren===!1)return;let m=t.interactableDescendants??t.children,h=m.length;for(let t=0;t<h;t++)By(e,m[t],n,s,c,u,d)}function Vy(e,t){if(t.ancestorsHaveListeners||e===`pointer`&&t.ancestorsHavePointerListeners||e===`wheel`&&t.ancestorsHaveWheelListeners||t.__r3f!=null&&t.__r3f?.eventCount>0&&(e===`wheel`&&t.__r3f.handlers.onWheel!=null||e===`pointer`&&Object.keys(t.__r3f.handlers).some(e=>e!=`onWheel`)))return!0;if(t._listeners==null)return!1;if(e===`wheel`){let e=t._listeners.wheel;return e!=null&&e.length>0}let n=Object.entries(t._listeners),r=n.length;for(let e=0;e<r;e++){let t=n[e];if(t[0]!==`wheel`&&My.includes(t[0])&&t[1]!=null&&t[1].length>0)return!0}return!1}function Hy({intersector:e,options:t},n,r,i,a){t.filter?.(n,r,i,a)!==!1&&e.executeIntersection(n,a)}function Uy(e,t,{customSort:n=Wy}={},r){let i,a,o,s=e.length;for(let c=0;c<s;c++){let s=e[c];if(r?.(s)===!1)continue;let l=t?.[c];(i==null||n(s,l,i,a)<0)&&(o=c,i=s,a=l)}return o}function Wy(e,t=0,n,r=0){return t==r?e.distance-n.distance:r-t}var Gy=1e7;function Ky(e,t,n,r,i,a=0){let o=t.direction.clone().multiplyScalar(Gy),s=Gy;return{distance:s+a,object:Iy(e),point:o,normal:t.origin.clone().sub(o).normalize(),details:n(o,s),pointerPosition:r,pointerQuaternion:i,pointOnFace:o,localPoint:o}}
4121function qy(e,t,n){for(;n>0;)e.push(t),--n}var Jy=Symbol(`buttonsDownTime`),Yy=Symbol(`buttonsClickTime`);globalThis.pointerEventspointerMap??=new Map,Oi.prototype.setPointerCapture=function(e){Xy(e)?.setCapture(this)},Oi.prototype.releasePointerCapture=function(e){let t=Xy(e);t!=null&&t.hasCaptured(this)&&t.setCapture(void 0)},Oi.prototype.hasPointerCapture=function(e){return Xy(e)?.hasCaptured(this)??!1};function Xy(e){return globalThis.pointerEventspointerMap?.get(e)}var Zy=class{id;type;state;intersector;getCamera;onMoveCommited;parentSetPointerCapture;parentReleasePointerCapture;options;prevIntersection;intersection;prevEnabled=!0;enabled=!0;wheelIntersection;pointerEntered=[];pointerEnteredHelper=[];pointerCapture;buttonsDownTime=new Map;buttonsDown=new Set;wasMoved=!1;onFirstMove=[];constructor(e,t,n,r,i,a,o,s,c={}){this.id=e,this.type=t,this.state=n,this.intersector=r,this.getCamera=i,this.onMoveCommited=a,this.parentSetPointerCapture=o,this.parentReleasePointerCapture=s,this.options=c,globalThis.pointerEventspointerMap?.set(e,this)}getPointerCapture(){return this.pointerCapture}hasCaptured(e){return this.pointerCapture?.object===e}setCapture(e){this.pointerCapture?.object!==e&&(this.clearPointerCapture(),e!=null&&this.intersection!=null&&(this.pointerCapture={object:e,intersection:this.intersection},this.parentSetPointerCapture?.()))}getButtonsDown(){return this.buttonsDown}getIntersection(){return this.intersection}getEnabled(){return this.enabled}setEnabled(e,t,n=!0){this.enabled!==e&&(!e&&this.pointerCapture!=null&&this.clearPointerCapture(),this.enabled=e,n&&this.commit(t,!1))}computeIntersection(e,t,n){return this.pointerCapture==null?(this.intersector.startIntersection(n),By(e,t,[this]),this.intersector.finalizeIntersection(t)):this.intersector.intersectPointerCapture(this.pointerCapture,n)}setIntersection(e){this.intersection=e}commit(e,t){let n=this.getCamera(),r=this.prevEnabled?this.prevIntersection:void 0,i=this.enabled?this.intersection:void 0;r!=null&&r.object!=i?.object&&ky(new Dy(`pointerout`,!0,e,this,r,n));let a=this.pointerEntered;this.pointerEntered=[],this.pointerEnteredHelper.length=0,Qy(i?.object,this.pointerEntered,a,this.pointerEnteredHelper);let o=a.length;for(let t=0;t<o;t++){let i=a[t];ky(new Dy(`pointerleave`,!1,e,this,r,n,i))}i!=null&&r?.object!=i.object&&ky(new Dy(`pointerover`,!0,e,this,i,n));for(let t=this.pointerEnteredHelper.length-1;t>=0;t--){let r=this.pointerEnteredHelper[t];ky(new Dy(`pointerenter`,!1,e,this,i,n,r))}if(t&&i!=null&&ky(new Dy(`pointermove`,!0,e,this,i,n)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved&&this.intersector.isReady()){this.wasMoved=!0;let e=this.onFirstMove.length;for(let t=0;t<e;t++)this.onFirstMove[t](n);this.onFirstMove.length=0}this.onMoveCommited?.(this)}move(e,t){this.intersection=this.computeIntersection(`pointer`,e,t),this.commit(t,!0)}over(e,t){this.wasMoved||(this.intersection=this.computeIntersection(`pointer`,e,t),this.commit(t,!1))}emitMove(e){this.intersection!=null&&ky(new Dy(`pointermove`,!0,e,this,this.intersection,this.getCamera()))}down(e){if(this.buttonsDown.add(e.button),!this.enabled)return;if(!this.wasMoved){this.onFirstMove.push(this.down.bind(this,e));return}if(this.intersection==null)return;ky(new Dy(`pointerdown`,!0,e,this,this.intersection,this.getCamera()));let{object:t}=this.intersection;t[Jy]??=new Map,t[Jy].set(e.button,e.timeStamp),this.buttonsDownTime.set(e.button,e.timeStamp)}up(e){if(this.buttonsDown.delete(e.button),!this.enabled)return;if(!this.wasMoved){this.onFirstMove.push(this.up.bind(this,e));return}if(this.intersection==null)return;let{clickThesholdMs:t,contextMenuButton:n=2,dblClickThresholdMs:r=500,clickThresholdMs:i=t??300}=this.options;this.clearPointerCapture();let a=$y(this.buttonsDownTime,this.intersection.object[Jy],e.button,e.timeStamp,i),o=this.getCamera();if(a&&e.button===n&&ky(new Dy(`contextmenu`,!0,e,this,this.intersection,o)),ky(new Dy(`pointerup`,!0,e,this,this.intersection,o)),!a||e.button===n)return;ky(new Dy(`click`,!0,e,this,this.intersection,o));let{object:s}=this.intersection,c=s[Yy]??=new Map,l=c.get(e.button);if(l==null||e.timeStamp-l>r){c.set(e.button,e.timeStamp);return}ky(new Dy(`dblclick`,!0,e,this,this.intersection,o)),c.delete(e.button)}cancel(e){this.buttonsDown.clear(),this.buttonsDownTime.clear(),this.clearPointerCapture(),this.onFirstMove.length=0,this.enabled&&this.wasMoved&&this.intersection!=null&&ky(new Dy(`pointercancel`,!0,e,this,this.intersection,this.getCamera()))}wheel(e,t,n=!1){if(!this.enabled)return;if(!this.wasMoved&&n){this.onFirstMove.push(this.wheel.bind(this,e,t,n));return}n||(this.wheelIntersection=this.computeIntersection(`wheel`,e,t));let r=n?this.intersection:this.wheelIntersection;r!=null&&ky(new Oy(t,this,r,this.getCamera()))}emitWheel(e,t=!1){if(!this.enabled)return;if(!this.wasMoved&&t){this.onFirstMove.push(this.emitWheel.bind(this,e,t));return}let n=t?this.intersection:this.wheelIntersection;n!=null&&ky(new Oy(e,this,n,this.getCamera()))}exit(e){(this.buttonsDown.size>0||this.pointerCapture!=null)&&this.cancel(e),this.wasMoved&&(this.intersection=void 0,this.commit(e,!1)),this.onFirstMove.length=0,this.wasMoved=!1}clearPointerCapture(){this.pointerCapture!=null&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0)}};function Qy(e,t,n,r){if(e==null)return;let i=n.indexOf(e);i==-1?r.push(e):n.splice(i,1),t.push(e),Qy(e.parent,t,n,r)}function $y(e,t,n,r,i){if(t==null)return!1;let a=t.get(n);return!(a==null||r-a>i||a!=e.get(n))}var eb=new $i,tb=new $i,nb=new W,rb=new W,ib=new W,ab=new G,ob=new K,sb=new G;function cb(e,t,n){sb.copy(t).applyMatrix4(ob.copy(n.matrixWorld).invert());let r=n.geometry.attributes.uv;if(r==null||!(r instanceof Ca))return!1;let i;return lb(n,(e,t,a)=>{n.getVertexPosition(e,eb.a),n.getVertexPosition(t,eb.b),n.getVertexPosition(a,eb.c);let o=eb.closestPointToPoint(sb,ab).distanceTo(sb);i!=null&&o>=i||(i=o,tb.copy(eb),nb.fromBufferAttribute(r,e),rb.fromBufferAttribute(r,t),ib.fromBufferAttribute(r,a))}),i!=null&&(tb.closestPointToPoint(sb,ab),tb.getInterpolation(ab,nb,rb,ib,e),!0)}function lb(e,t){let n=e.geometry.drawRange;if(e.geometry.index!=null){let r=e.geometry.index,i=Math.max(0,n.start),a=Math.min(r.count,n.start+n.count);for(let e=i;e<a;e+=3)t(r.getX(e),r.getX(e+1),r.getX(e+2));return}let r=e.geometry.attributes.position;if(r==null)return;let i=Math.max(0,n.start),a=Math.min(r.count,n.start+n.count);for(let e=i;e<a;e+=3)t(e,e+1,e+2)}new K,new sp,new G,new ds,new So,new W,new G(0,0,0),new G(0,0,1);var ub=new K,db=new G;new G(0,0,-1),new ds;var fb=new W,pb=new G,mb=class{prepareTransformation;options;raycaster=new Gf;cameraQuaternion=new Ar;fromPosition=new G;fromQuaternion=new Ar;coords=new W;viewPlane=new ds;intersects=[];pointerEventsOrders=[];constructor(e,t){this.prepareTransformation=e,this.options=t}isReady(){return!0}intersectPointerCapture({intersection:e,object:t},n){let r=e.details;if(r.type!=`screen-ray`)throw Error(`unable to process a pointer capture of type "${e.details.type}" with a camera ray intersector`);if(!this.startIntersection(n))return e;this.viewPlane.constant-=r.distanceViewPlane;let i=this.raycaster.ray.intersectPlane(this.viewPlane,new G);if(i==null)return e;e.object.updateWorldMatrix(!0,!1),Ly(this.viewPlane,e,e.object.matrixWorld);let a=e.uv;
4121return e.object instanceof Fo&&cb(fb,i,e.object)&&(a=fb.clone()),{...e,details:{...r,direction:this.raycaster.ray.direction.clone(),screenPoint:this.coords.clone()},uv:a,object:t,point:i,pointOnFace:i,pointerPosition:this.raycaster.ray.origin.clone(),pointerQuaternion:this.cameraQuaternion.clone()}}startIntersection(e){let t=this.prepareTransformation(e,this.coords);return t!=null&&(t.updateWorldMatrix(!0,!1),t.matrixWorld.decompose(this.fromPosition,this.fromQuaternion,db),this.raycaster.setFromCamera(this.coords,t),this.viewPlane.setFromNormalAndCoplanarPoint(t.getWorldDirection(pb),this.raycaster.ray.origin),!0)}executeIntersection(e,t){let n=this.intersects.length;e.raycast(this.raycaster,this.intersects),qy(this.pointerEventsOrders,t,this.intersects.length-n)}finalizeIntersection(e){let t=this.fromPosition.clone(),n=this.cameraQuaternion.clone(),r=this.raycaster.ray.direction.clone(),i=Uy(this.intersects,this.pointerEventsOrders,this.options),a=i==null?void 0:this.intersects[i];return this.intersects.length=0,this.pointerEventsOrders.length=0,a==null?Ky(e,this.raycaster.ray,(e,t)=>({type:`screen-ray`,distanceViewPlane:t,screenPoint:this.coords.clone(),direction:r}),t,n):(a.object.updateWorldMatrix(!0,!1),ub.copy(a.object.matrixWorld).invert(),Object.assign(a,{details:{type:`screen-ray`,distanceViewPlane:this.viewPlane.distanceToPoint(a.point),screenPoint:this.coords.clone(),direction:r},pointOnFace:a.point,pointerPosition:t,pointerQuaternion:n,localPoint:a.point.clone().applyMatrix4(ub)}))}};new G,new W,new K,new G,new Ar,new ds,new Fa,new G,new G,new G,new G(1e-4,1e-4,1e-4),new K;var hb=23412;function gb(){return hb++}function _b(e,t,n){if(!(t instanceof globalThis.MouseEvent))return n.set(0,0);let{width:r,height:i,top:a,left:o}=e.getBoundingClientRect(),s=t.clientX-o,c=t.clientY-a;return n.set(s/r*2-1,-(c/i)*2+1)}function vb(e,t,n,r){return yb(e,typeof t==`function`?t:()=>t,n,_b.bind(null,e),e.setPointerCapture.bind(e),t=>{e.hasPointerCapture(t)&&e.releasePointerCapture(t)},{pointerTypePrefix:`screen-`,...r})}function yb(e,t,n,r,i,a,o={}){let s=o?.forwardPointerCapture??!0,c=new Map,l=o.pointerTypePrefix??`forward-`,u=(e,u)=>{let d=c.get(e.pointerId);return d??(d=new Zy(gb(),`${l}${e.pointerType}`,e.pointerState,new mb((e,n)=>(r(e,n),t()),o),t,void 0,s?i.bind(null,e.pointerId):void 0,s?a.bind(null,e.pointerId):void 0,o),u!=`move`&&u!=`wheel`&&(d.setIntersection(d.computeIntersection(`pointer`,n,e)),d.commit(e,!1)),c.set(e.pointerId,d),d)},d=new Map,f=new Map,p=[],m=[],h=(e,t,r)=>{switch(e){case`move`:r.move(n,t);return;case`over`:r.move(n,t);return;case`wheel`:r.wheel(n,t);return;case`cancel`:r.cancel(t);return;case`down`:if(!bb(t))return;r.down(t);return;case`up`:if(!bb(t))return;r.up(t);return;case`exit`:f.delete(r),d.delete(r),r.exit(t);return}},g=(e,t)=>{let n=u(t,e);e===`move`&&f.set(n,t),e===`wheel`&&d.set(n,t),o.batchEvents??!0?m.push({type:e,event:t}):h(e,t,n)},_=g.bind(null,`move`),v=g.bind(null,`over`),y=g.bind(null,`cancel`),b=g.bind(null,`down`),x=g.bind(null,`up`),S=g.bind(null,`wheel`),C=g.bind(null,`exit`);return e.addEventListener(`pointermove`,_),e.addEventListener(`pointerover`,v),e.addEventListener(`pointercancel`,y),e.addEventListener(`pointerdown`,b),e.addEventListener(`pointerup`,x),e.addEventListener(`wheel`,S),e.addEventListener(`pointerleave`,C),{destroy(){e.removeEventListener(`pointermove`,_),e.removeEventListener(`pointerover`,v),e.removeEventListener(`pointercancel`,y),e.removeEventListener(`pointerdown`,b),e.removeEventListener(`pointerup`,x),e.removeEventListener(`wheel`,S),e.removeEventListener(`pointerleave`,C),f.clear(),d.clear()},update(){let e=m.length;for(let t=0;t<e;t++){let{type:e,event:n}=m[t],r=u(n,e);if(e===`move`&&(p.push(r),f.get(r)!=n)){r.emitMove(n);continue}if(e===`wheel`&&d.get(r)!=n){r.emitWheel(n);continue}h(e,n,r)}if(m.length=0,o.intersectEveryFrame??!1)for(let[e,t]of f.entries())p.includes(e)||e.move(n,t);p.length=0}}}function bb(e){return e.button!=null}var xb=Object.create,Sb=Object.defineProperty,Cb=Object.getOwnPropertyDescriptor,wb=Object.getOwnPropertyNames,Tb=Object.getPrototypeOf,Eb=Object.prototype.hasOwnProperty,Db=(e,t)=>
4121function(){return e&&(t=(0,e[wb(e)[0]])(e=0)),t},Ob=(e,t)=>function(){return t||(0,e[wb(e)[0]])((t={exports:{}}).exports,t),t.exports},kb=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of wb(t))!Eb.call(e,i)&&i!==n&&Sb(e,i,{get:()=>t[i],enumerable:!(r=Cb(t,i))||r.enumerable});return e},Ab=(e,t,n)=>(n=e==null?{}:xb(Tb(e)),kb(t||!e||!e.__esModule?Sb(n,`default`,{value:e,enumerable:!0}):n,e)),jb=Db({"../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),Mb=Ob({"../../node_modules/.pnpm/[email protected]/node_modules/rfdc/index.js"(e,t){jb(),t.exports=r;function n(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function r(e){if(e||={},e.circles)return i(e);let t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(a(Array.from(e),t))),t.set(Set,(e,t)=>new Set(a(Array.from(e),t))),e.constructorHandlers)for(let n of e.constructorHandlers)t.set(n[0],n[1]);let r=null;return e.proto?s:o;function a(e,i){let a=Object.keys(e),o=Array(a.length);for(let s=0;s<a.length;s++){let c=a[s],l=e[c];o[c]=typeof l!=`object`||!l?l:l.constructor!==Object&&(r=t.get(l.constructor))?r(l,i):ArrayBuffer.isView(l)?n(l):i(l)}return o}function o(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return a(e,o);if(e.constructor!==Object&&(r=t.get(e.constructor)))return r(e,o);let i={};for(let a in e){if(Object.hasOwnProperty.call(e,a)===!1)continue;let s=e[a];i[a]=typeof s!=`object`||!s?s:s.constructor!==Object&&(r=t.get(s.constructor))?r(s,o):ArrayBuffer.isView(s)?n(s):o(s)}return i}function s(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return a(e,s);if(e.constructor!==Object&&(r=t.get(e.constructor)))return r(e,s);let i={};for(let a in e){let o=e[a];i[a]=typeof o!=`object`||!o?o:o.constructor!==Object&&(r=t.get(o.constructor))?r(o,s):ArrayBuffer.isView(o)?n(o):s(o)}return i}}function i(e){let t=[],r=[],i=new Map;if(i.set(Date,e=>new Date(e)),i.set(Map,(e,t)=>new Map(o(Array.from(e),t))),i.set(Set,(e,t)=>new Set(o(Array.from(e),t))),e.constructorHandlers)for(let t of e.constructorHandlers)i.set(t[0],t[1]);let a=null;return e.proto?c:s;function o(e,o){let s=Object.keys(e),c=Array(s.length);for(let l=0;l<s.length;l++){let u=s[l],d=e[u];if(typeof d!=`object`||!d)c[u]=d;else if(d.constructor!==Object&&(a=i.get(d.constructor)))c[u]=a(d,o);else if(ArrayBuffer.isView(d))c[u]=n(d);else{let e=t.indexOf(d);c[u]=e===-1?o(d):r[e]}}return c}function s(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return o(e,s);if(e.constructor!==Object&&(a=i.get(e.constructor)))return a(e,s);let c={};t.push(e),r.push(c);for(let o in e){if(Object.hasOwnProperty.call(e,o)===!1)continue;let l=e[o];if(typeof l!=`object`||!l)c[o]=l;else if(l.constructor!==Object&&(a=i.get(l.constructor)))c[o]=a(l,s);else if(ArrayBuffer.isView(l))c[o]=n(l);else{let e=t.indexOf(l);c[o]=e===-1?s(l):r[e]}}return t.pop(),r.pop(),c}function c(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return o(e,c);if(e.constructor!==Object&&(a=i.get(e.constructor)))return a(e,c);let s={};t.push(e),r.push(s);for(let o in e){let l=e[o];if(typeof l!=`object`||!l)s[o]=l;else if(l.constructor!==Object&&(a=i.get(l.constructor)))s[o]=a(l,c);else if(ArrayBuffer.isView(l))s[o]=n(l);else{let e=t.indexOf(l);s[o]=e===-1?c(l):r[e]}}return t.pop(),r.pop(),s}}}});jb(),jb(),jb();var Nb=typeof navigator<`u`,X=typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof global<`u`?global:{};X.chrome!==void 0&&X.chrome.devtools,Nb&&(X.self,X.top),typeof navigator<`u`&&navigator.userAgent?.toLowerCase().includes(`electron`),typeof window<`u`&&window.__NUXT__,jb();var Pb=Ab(Mb(),1),Fb=/(?:^|[-_/])(\w)/g;function Ib(e,t){return t?t.toUpperCase():``}function Lb(e){return e&&`${e}`.replace(Fb,Ib)}function Rb(e,t){let n=e.replace(/^[a-z]:/i,``).replace(/\\/g,`/`);n.endsWith(`index${t}`)&&(n=n.replace(`/index${t}`,t));let r=n.lastIndexOf(`/`),i=n.substring(r+1);if(t){let e=i.lastIndexOf(t);return i.substring(0,e)}return``}var zb=(0,Pb.default)({circles:!0}),Bb={trailing:!0};function Vb(e,t=25,n={}){if(n={...Bb,...n},!Number.isFinite(t))throw TypeError("Expected `wait` to be a finite number");let r,i,a=[],o,s,c=(t,r)=>(o=Hb(e,t,r),o.finally(()=>
4121{if(o=null,n.trailing&&s&&!i){let e=c(t,s);return s=null,e}}),o);return function(...e){return o?(n.trailing&&(s=e),o):new Promise(o=>{let s=!i&&n.leading;clearTimeout(i),i=setTimeout(()=>{i=null;let t=n.leading?r:c(this,e);for(let e of a)e(t);a=[]},t),s?(r=c(this,e),o(r)):a.push(o)})}}async function Hb(e,t,n){return await e.apply(t,n)}var Ub=Object.create,Wb=Object.defineProperty,Gb=Object.getOwnPropertyDescriptor,Kb=Object.getOwnPropertyNames,qb=Object.getPrototypeOf,Jb=Object.prototype.hasOwnProperty,Yb=(e,t)=>function(){return e&&(t=(0,e[Kb(e)[0]])(e=0)),t},Xb=(e,t)=>function(){return t||(0,e[Kb(e)[0]])((t={exports:{}}).exports,t),t.exports},Zb=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Kb(t))!Jb.call(e,i)&&i!==n&&Wb(e,i,{get:()=>t[i],enumerable:!(r=Gb(t,i))||r.enumerable});return e},Qb=(e,t,n)=>(n=e==null?{}:Ub(qb(e)),Zb(t||!e||!e.__esModule?Wb(n,`default`,{value:e,enumerable:!0}):n,e)),Z=Yb({"../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),$b=Xb({"../../node_modules/.pnpm/[email protected]/node_modules/speakingurl/lib/speakingurl.js"(e,t){Z(),(function(e){var n={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`Ae`,Å:`A`,Æ:`AE`,Ç:`C`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,Ð:`D`,Ñ:`N`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`Oe`,Ő:`O`,Ø:`O`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`Ue`,Ű:`U`,Ý:`Y`,Þ:`TH`,ß:`ss`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`ae`,Ã¥:`a`,æ:`ae`,ç:`c`,è:`e`,é:`e`,ê:`e`,ë:`e`,ì:`i`,í:`i`,î:`i`,ï:`i`,ð:`d`,ñ:`n`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`oe`,ő:`o`,ø:`o`,ù:`u`,ú:`u`,û:`u`,ü:`ue`,ű:`u`,ý:`y`,þ:`th`,ÿ:`y`,ẞ:`SS`,ا:`a`,Ø£:`a`,Ø¥:`i`,Ø¢:`aa`,ؤ:`u`,ئ:`e`,Ø¡:`a`,ب:`b`,ت:`t`,Ø«:`th`,ج:`j`,Ø­:`h`,Ø®:`kh`,د:`d`,ذ:`th`,ر:`r`,ز:`z`,س:`s`,Ø´:`sh`,ص:`s`,ض:`dh`,Ø·:`t`,ظ:`z`,ع:`a`,غ:`gh`,ف:`f`,ق:`q`,ك:`k`,ل:`l`,م:`m`,ن:`n`,ه:`h`,و:`w`,ي:`y`,ى:`a`,Ø©:`h`,ï»»:`la`,ï»·:`laa`,ﻹ:`lai`,ﻵ:`laa`,Ú¯:`g`,چ:`ch`,Ù¾:`p`,ژ:`zh`,Ú©:`k`,ی:`y`,"َ":`a`,"ً":`an`,"ِ":`e`,"ٍ":`en`,"ُ":`u`,"ٌ":`on`,"ْ":``,"Ù ":`0`,"Ù¡":`1`,"Ù¢":`2`,"Ù£":`3`,"Ù¤":`4`,"Ù¥":`5`,"Ù¦":`6`,"Ù§":`7`,"Ù¨":`8`,"Ù©":`9`,"Û°":`0`,"Û±":`1`,"Û²":`2`,"Û³":`3`,"Û´":`4`,"Ûµ":`5`,"Û¶":`6`,"Û·":`7`,"Û¸":`8`,"Û¹":`9`,က:`k`,ခ:`kh`,ဂ:`g`,ဃ:`ga`,င:`ng`,စ:`s`,ဆ:`sa`,ဇ:`z`,စျ:`za`,ည:`ny`,ဋ:`t`,ဌ:`ta`,ဍ:`d`,ဎ:`da`,ဏ:`na`,တ:`t`,ထ:`ta`,ဒ:`d`,ဓ:`da`,န:`n`,ပ:`p`,ဖ:`pa`,ဗ:`b`,ဘ:`ba`,မ:`m`,ယ:`y`,ရ:`ya`,လ:`l`,ဝ:`w`,သ:`th`,ဟ:`h`,ဠ:`la`,အ:`a`,"ြ":`y`,"ျ":`ya`,"ွ":`w`,"ြွ":`yw`,"ျွ":`ywa`,"ှ":`h`,ဧ:`e`,"၏":`-e`,ဣ:`i`,ဤ:`-i`,ဉ:`u`,ဦ:`-u`,ဩ:`aw`,သြော:`aw`,ဪ:`aw`,"၀":`0`,"၁":`1`,"၂":`2`,"၃":`3`,"၄":`4`,"၅":`5`,"၆":`6`,"၇":`7`,"၈":`8`,"၉":`9`,"္":``,"့":``,"း":``,č:`c`,ď:`d`,ě:`e`,ň:`n`,ř:`r`,Å¡:`s`,Å¥:`t`,ů:`u`,ž:`z`,Č:`C`,Ď:`D`,Ě:`E`,Ň:`N`,Ř:`R`,Å :`S`,Ť:`T`,Å®:`U`,Ž:`Z`,ހ:`h`,ށ:`sh`,ނ:`n`,ރ:`r`,ބ:`b`,ޅ:`lh`,ކ:`k`,އ:`a`,ވ:`v`,މ:`m`,ފ:`f`,ދ:`dh`,ތ:`th`,ލ:`l`,ގ:`g`,ޏ:`gn`,ސ:`s`,ޑ:`d`,ޒ:`z`,ޓ:`t`,ޔ:`y`,ޕ:`p`,ޖ:`j`,ޗ:`ch`,ޘ:`tt`,ޙ:`hh`,ޚ:`kh`,ޛ:`th`,ޜ:`z`,ޝ:`sh`,ޞ:`s`,ޟ:`d`,Þ :`t`,Þ¡:`z`,Þ¢:`a`,Þ£:`gh`,Þ¤:`q`,Þ¥:`w`,"Þ¦":`a`,"Þ§":`aa`,"Þ¨":`i`,"Þ©":`ee`,"Þª":`u`,"Þ«":`oo`,"Þ¬":`e`,"Þ­":`ey`,"Þ®":`o`,"Þ¯":`oa`,"Þ°":``,ა:`a`,ბ:`b`,გ:`g`,დ:`d`,ე:`e`,ვ:`v`,ზ:`z`,თ:`t`,ი:`i`,კ:`k`,ლ:`l`,მ:`m`,ნ:`n`,ო:`o`,პ:`p`,ჟ:`zh`,რ:`r`,ს:`s`,ტ:`t`,უ:`u`,ფ:`p`,ქ:`k`,ღ:`gh`,ყ:`q`,შ:`sh`,ჩ:`ch`,ც:`ts`,ძ:`dz`,წ:`ts`,ჭ:`ch`,ხ:`kh`,ჯ:`j`,ჰ:`h`,α:`a`,β:`v`,γ:`g`,δ:`d`,ε:`e`,ζ:`z`,η:`i`,θ:`th`,ι:`i`,κ:`k`,λ:`l`,μ:`m`,ν:`n`,ξ:`ks`,ο:`o`,π:`p`,ρ:`r`,σ:`s`,τ:`t`,υ:`y`,φ:`f`,χ:`x`,ψ:`ps`,ω:`o`,ά:`a`,έ:`e`,ί:`i`,ό:`o`,ύ:`y`,ή:`i`,ώ:`o`,ς:`s`,ϊ:`i`,ΰ:`y`,ϋ:`y`,ΐ:`i`,Α:`A`,Β:`B`,Γ:`G`,Δ:`D`,Ε:`E`,Ζ:`Z`,Η:`I`,Θ:`TH`,Ι:`I`,Κ:`K`,Λ:`L`,Μ:`M`,Ν:`N`,Ξ:`KS`,Ο:`O`,Π:`P`,Ρ:`R`,Σ:`S`,Τ:`T`,Î¥:`Y`,Φ:`F`,Χ:`X`,Ψ:`PS`,Ω:`O`,Ά:`A`,Έ:`E`,Ί:`I`,Ό:`O`,Ύ:`Y`,Ή:`I`,Ώ:`O`,Ϊ:`I`,Ϋ:`Y`,ā:`a`,ē:`e`,Ä£:`g`,Ä«:`i`,Ä·:`k`,ļ:`l`,ņ:`n`,Å«:`u`,Ā:`A`,Ē:`E`,Ä¢:`G`,Ī:`I`,Ķ:`k`,Ä»:`L`,Ņ:`N`,Ū:`U`,Ќ:`Kj`,ќ:`kj`,Љ:`Lj`,љ:`lj`,Њ:`Nj`,њ:`nj`,Тс:`Ts`,тс:`ts`,ą:`a`,ć:`c`,ę:`e`,ł:`l`,ń:`n`,ś:`s`,ź:`z`,ż:`z`,Ą:`A`,Ć:`C`,Ę:`E`,Ł:`L`,Ń:`N`,Ś:`S`,Ź:`Z`,Å»:`Z`,Є:`Ye`,І:`I`,Ї:`Yi`,Ґ:`G`,є:`ye`,і:`i`,ї:`yi`,ґ:`g`,ă:`a`,Ă:`A`,ș:`s`,Ș:`S`,ț:`t`,Ț:`T`,Å£:`t`,Å¢:`T`,а:`a`,б:`b`,в:`v`,г:`g`,д:`d`,е:`e`,ё:`yo`,ж:`zh`,з:`z`,и:`i`,й:`i`,к:`k`,л:`l`,м:`m`,н:`n`,о:`o`,п:`p`,р:`r`,с:`s`,т:`t`,у:`u`,ф:`f`,х:`kh`,ц:`c`,ч:`ch`,ш:`sh`,щ:`sh`,ъ:``,ы:`y`,ь:``,э:`e`,ю:`yu`,я:`ya`,А:`A`,Б
4121:`B`,В:`V`,Г:`G`,Д:`D`,Е:`E`,Ё:`Yo`,Ж:`Zh`,З:`Z`,И:`I`,Й:`I`,К:`K`,Л:`L`,М:`M`,Н:`N`,О:`O`,П:`P`,Р:`R`,С:`S`,Т:`T`,У:`U`,Ф:`F`,Х:`Kh`,Ц:`C`,Ч:`Ch`,Ш:`Sh`,Щ:`Sh`,Ъ:``,Ы:`Y`,Ь:``,Э:`E`,Ю:`Yu`,Я:`Ya`,ђ:`dj`,ј:`j`,ћ:`c`,џ:`dz`,Ђ:`Dj`,Ј:`j`,Ћ:`C`,Џ:`Dz`,ľ:`l`,ĺ:`l`,ŕ:`r`,Ľ:`L`,Ĺ:`L`,Ŕ:`R`,ş:`s`,Ş:`S`,ı:`i`,İ:`I`,ğ:`g`,Ğ:`G`,ả:`a`,Ả:`A`,ẳ:`a`,Ẳ:`A`,ẩ:`a`,Ẩ:`A`,đ:`d`,Đ:`D`,ẹ:`e`,Ẹ:`E`,ẽ:`e`,Ẽ:`E`,ẻ:`e`,Ẻ:`E`,ế:`e`,Ế:`E`,ề:`e`,Ề:`E`,ệ:`e`,Ệ:`E`,ễ:`e`,Ễ:`E`,ể:`e`,Ể:`E`,ỏ:`o`,ọ:`o`,Ọ:`o`,ố:`o`,Ố:`O`,ồ:`o`,Ồ:`O`,ổ:`o`,Ổ:`O`,ộ:`o`,Ộ:`O`,ỗ:`o`,Ỗ:`O`,ơ:`o`,Ơ:`O`,ớ:`o`,Ớ:`O`,ờ:`o`,Ờ:`O`,ợ:`o`,Ợ:`O`,ỡ:`o`,Ỡ:`O`,Ở:`o`,ở:`o`,ị:`i`,Ị:`I`,ĩ:`i`,Ĩ:`I`,ỉ:`i`,Ỉ:`i`,ủ:`u`,Ủ:`U`,ụ:`u`,Ụ:`U`,ũ:`u`,Ũ:`U`,ư:`u`,Ư:`U`,ứ:`u`,Ứ:`U`,ừ:`u`,Ừ:`U`,ự:`u`,Ự:`U`,ữ:`u`,Ữ:`U`,ử:`u`,Ử:`ư`,ỷ:`y`,Ỷ:`y`,ỳ:`y`,Ỳ:`Y`,ỵ:`y`,Ỵ:`Y`,ỹ:`y`,Ỹ:`Y`,ạ:`a`,Ạ:`A`,ấ:`a`,Ấ:`A`,ầ:`a`,Ầ:`A`,ậ:`a`,Ậ:`A`,ẫ:`a`,Ẫ:`A`,ắ:`a`,Ắ:`A`,ằ:`a`,Ằ:`A`,ặ:`a`,Ặ:`A`,ẵ:`a`,Ẵ:`A`,"⓪":`0`,"①":`1`,"②":`2`,"③":`3`,"④":`4`,"⑤":`5`,"⑥":`6`,"⑦":`7`,"⑧":`8`,"⑨":`9`,"⑩":`10`,"⑪":`11`,"⑫":`12`,"⑬":`13`,"⑭":`14`,"⑮":`15`,"⑯":`16`,"⑰":`17`,"⑱":`18`,"⑲":`18`,"⑳":`18`,"⓵":`1`,"⓶":`2`,"⓷":`3`,"⓸":`4`,"⓹":`5`,"⓺":`6`,"⓻":`7`,"⓼":`8`,"⓽":`9`,"⓾":`10`,"⓿":`0`,"⓫":`11`,"⓬":`12`,"⓭":`13`,"⓮":`14`,"⓯":`15`,"⓰":`16`,"⓱":`17`,"⓲":`18`,"⓳":`19`,"⓴":`20`,"Ⓐ":`A`,"Ⓑ":`B`,"Ⓒ":`C`,"Ⓓ":`D`,"Ⓔ":`E`,"Ⓕ":`F`,"Ⓖ":`G`,"Ⓗ":`H`,"Ⓘ":`I`,"Ⓙ":`J`,"Ⓚ":`K`,"Ⓛ":`L`,"Ⓜ":`M`,"Ⓝ":`N`,"Ⓞ":`O`,"Ⓟ":`P`,"Ⓠ":`Q`,"Ⓡ":`R`,"Ⓢ":`S`,"Ⓣ":`T`,"Ⓤ":`U`,"Ⓥ":`V`,"Ⓦ":`W`,"Ⓧ":`X`,"Ⓨ":`Y`,"Ⓩ":`Z`,"ⓐ":`a`,"ⓑ":`b`,"ⓒ":`c`,"ⓓ":`d`,"ⓔ":`e`,"ⓕ":`f`,"ⓖ":`g`,"ⓗ":`h`,"ⓘ":`i`,"ⓙ":`j`,"ⓚ":`k`,"ⓛ":`l`,"ⓜ":`m`,"ⓝ":`n`,"ⓞ":`o`,"ⓟ":`p`,"ⓠ":`q`,"ⓡ":`r`,"ⓢ":`s`,"ⓣ":`t`,"ⓤ":`u`,"ⓦ":`v`,"ⓥ":`w`,"ⓧ":`x`,"ⓨ":`y`,"ⓩ":`z`,"“":`"`,"”":`"`,"‘":`'`,"’":`'`,"∂":`d`,ƒ:`f`,"™":`(TM)`,"©":`(C)`,œ:`oe`,Œ:`OE`,"®":`(R)`,"†":`+`,"℠":`(SM)`,"…":`...`,"˚":`o`,º:`o`,ª:`a`,"•":`*`,"၊":`,`,"။":`.`,$:`USD`,"€":`EUR`,"₢":`BRN`,"₣":`FRF`,"£":`GBP`,"₤":`ITL`,"₦":`NGN`,"₧":`ESP`,"₩":`KRW`,"₪":`ILS`,"₫":`VND`,"₭":`LAK`,"₮":`MNT`,"₯":`GRD`,"₱":`ARS`,"₲":`PYG`,"₳":`ARA`,"₴":`UAH`,"₵":`GHS`,"¢":`cent`,"¥":`CNY`,元:`CNY`,円:`YEN`,"﷼":`IRR`,"₠":`EWE`,"฿":`THB`,"₨":`INR`,"₹":`INR`,"₰":`PF`,"₺":`TRY`,"؋":`AFN`,"₼":`AZN`,лв:`BGN`,"៛":`KHR`,"₡":`CRC`,"₸":`KZT`,ден:`MKD`,zł:`PLN`,"₽":`RUB`,"₾":`GEL`},r=[`်`,`ް`],i={"ာ":`a`,"ါ":`a`,"ေ":`e`,"ဲ":`e`,"ိ":`i`,"ီ":`i`,"ို":`o`,"ု":`u`,"ူ":`u`,"ေါင်":`aung`,"ော":`aw`,"ော်":`aw`,"ေါ":`aw`,"ေါ်":`aw`,"်":`်`,က်:`et`,"ိုက်":`aik`,"ောက်":`auk`,င်:`in`,"ိုင်":`aing`,"ောင်":`aung`,စ်:`it`,ည်:`i`,တ်:`at`,"ိတ်":`eik`,"ုတ်":`ok`,"ွတ်":`ut`,"ေတ်":`it`,ဒ်:`d`,"ိုဒ်":`ok`,"ုဒ်":`ait`,န်:`an`,"ာန်":`an`,"ိန်":`ein`,"ုန်":`on`,"ွန်":`un`,ပ်:`at`,"ိပ်":`eik`,"ုပ်":`ok`,"ွပ်":`ut`,န်ုပ်:`nub`,မ်:`an`,"ိမ်":`ein`,"ုမ်":`on`,"ွမ်":`un`,ယ်:`e`,"ိုလ်":`ol`,ဉ်:`in`,"ံ":`an`,"ိံ":`ein`,"ုံ":`on`,"ައް":`ah`,"ަށް":`ah`},a={en:{},az:{ç:`c`,ə:`e`,ğ:`g`,ı:`i`,ö:`o`,ş:`s`,ü:`u`,Ç:`C`,Ə:`E`,Ğ:`G`,İ:`I`,Ö:`O`,Ş:`S`,Ü:`U`},cs:{č:`c`,ď:`d`,ě:`e`,ň:`n`,ř:`r`,š:`s`,ť:`t`,ů:`u`,ž:`z`,Č:`C`,Ď:`D`,Ě:`E`,Ň:`N`,Ř:`R`,Š:`S`,Ť:`T`,Ů:`U`,Ž:`Z`},fi:{ä:`a`,Ä:`A`,ö:`o`,Ö:`O`},hu:{ä:`a`,Ä:`A`,ö:`o`,Ö:`O`,ü:`u`,Ü:`U`,ű:`u`,Ű:`U`},lt:{ą:`a`,č:`c`,ę:`e`,ė:`e`,į:`i`,š:`s`,ų:`u`,ū:`u`,ž:`z`,Ą:`A`,Č:`C`,Ę:`E`,Ė:`E`,Į:`I`,Š:`S`,Ų:`U`,Ū:`U`},lv:{ā:`a`,č:`c`,ē:`e`,ģ:`g`,ī:`i`,ķ:`k`,ļ:`l`,ņ:`n`,š:`s`,ū:`u`,ž:`z`,Ā:`A`,Č:`C`,Ē:`E`,Ģ:`G`,Ī:`i`,Ķ:`k`,Ļ:`L`,Ņ:`N`,Š:`S`,Ū:`u`,Ž:`Z`},pl:{ą:`a`,ć:`c`,ę:`e`,ł:`l`,ń:`n`,ó:`o`,ś:`s`,ź:`z`,ż:`z`,Ą:`A`,Ć:`C`,Ę:`e`,Ł:`L`,Ń:`N`,Ó:`O`,Ś:`S`,Ź:`Z`,Ż:`Z`},sv:{ä:`a`,Ä:`A`,ö:`o`,Ö:`O`},sk:{ä:`a`,Ä:`A`},sr:{љ:`lj`,њ:`nj`,Љ:`Lj`,Њ:`Nj`,đ:`dj`,Đ:`Dj`},tr:{Ü:`U`,Ö:`O`,ü:`u`,ö:`o`}},o={ar:{"∆":`delta`,"∞":`la-nihaya`,"♥":`hob`,"&":`wa`,"|":`aw`,"<":`aqal-men`,">":`akbar-men`,"∑":`majmou`,"¤":`omla`},az:{},ca:{"∆":`delta`,"∞":`infinit`,"♥":`amor`,"&":`i`,"|":`o`,"<":`menys que`,">":`mes que`,"∑":`suma dels`,"¤":`moneda`},cs:{"∆":`delta`,"∞":`nekonecno`,"♥":`laska`,"&":`a`,"|":`nebo`,"<":`mensi nez`,">":`vetsi nez`,"∑":`soucet`,"¤":`mena`},de:{"∆":`delta`,"∞":`unendlich`,"♥":`Liebe`,"&":`und`,"|":`oder`,"<":`kleiner als`,">":`groesser als`,"∑":`Summe von`,"¤":`Waehrung`},dv:{"∆":`delta`,"∞":`kolunulaa`,"♥":`loabi`,"&":`aai`,"|":`noonee`,"<":`ah vure kuda`,">":`ah vure bodu`,"∑":`jumula`,"¤":`faisaa`},en:{"∆":`delta`,"∞":`infinity`,"♥":`love`,"&":`and`,"|":`or`,"<":`less than`,">":`greater than`,"∑":`sum`,"¤":`currency`},es:{"∆":`delta`,"∞":`infinito`,"♥":`amor`,"&":`y`,"|":`u`,"<":`menos que`,">":`mas que`,"∑":`suma de los`,"¤":`moneda`},fa:{"∆":`delta`,"∞":`bi-nahayat`,"♥":`eshgh`,"&":`va`,"|":`ya`,"<":`kamtar-az`,">":`bishtar-az`,"∑":`majmooe`,"¤":`vahed`},fi:{"∆":`delta`,"∞":`aarettomyys`,"♥":`rakkaus`,"&":`ja`,"|":`tai`,"<":`pienempi kuin`,">":`suurempi kuin`,"∑":`summa`,"¤":`valuutta`},fr:{"∆":`delta`,"∞":`infiniment`,"♥":`Amour`,"&":`et`,"|":`ou`,"<":`moins que`,">":`superieure a`,"∑":`somme des`,"¤":`monnaie`},ge:{"∆":`delta`,"∞":`usasruloba`,"♥":`siqvaruli`,"&":`da`,"|":`an`,"<":`naklebi`,">":`meti`,"∑":`jami`,"¤":`valuta`},gr:{},hu:{"∆":`delta`,"∞":`vegtelen`,"♥":`szerelem`,"&":`es`,"|":`vagy`,"<":`kisebb mint`,">":`nagyobb mint`,"∑":`szumma`,"¤":`penznem`},it:{"∆":`delta`,"∞":`infinito`,"♥":`amore`,"&":`e`,"|":`o`,"<":`minore di`,">":`maggiore di`,"∑":`somma`,"¤":`moneta`},lt:{"∆":`delta`,"∞":`begalybe`,"♥":`meile`,"&":`ir`,"|":`ar`,"<":`maziau nei`,">":`daugiau nei`,"∑":`suma`,"¤":`valiuta`},lv:{"∆":`delta`,"∞":`bezgaliba`,"♥":`milestiba`,"&":`un`,"|":`vai`,"<":`mazak neka`,">":`lielaks neka`,"∑":`summa`,"¤":`valuta`},my:{"∆":`kwahkhyaet`,"∞":`asaonasme`,"♥":`akhyait`,"&":`nhin`,"|":`tho`,"<":`ngethaw`,">":`kyithaw`,"∑":`paungld`,"¤":`ngwekye`},mk:{},nl:{"∆":`delta`,"∞":`oneindig`,"♥":`liefde`,"&":`en`,"|":`of`,"<":`kleiner dan`,">":`groter dan`,"∑":`som`,"¤":`valuta`},pl:{"∆":`delta`,"∞":`nieskonczonosc`,"♥":`milosc`,"&":`i`,"|":`lub`,"<":`mniejsze niz`,">":`wieksze niz`,"∑":`suma`,"¤":`waluta`},pt:{"∆":`delta`,"∞":`infinito`,"♥":`amor`,"&":`e`,"|":`ou`,"<":`menor que`,">":`maior que`,"∑":`soma`,"¤":`moeda`},ro:{"∆":`delta`,"∞":`infinit`,"♥":`dragoste`,"&":`si`,"|":`sau`,"<":`mai mic ca`,">":`mai mare ca`,"∑":`suma`,"¤":`valuta`},ru:{"∆":`delta`,"∞":`beskonechno`,"♥":`lubov`,"&":`i`,"|":`ili`,"<":`menshe`,">":`bolshe`,"∑":`summa`,"¤":`valjuta`},sk:{"∆":`delta`,"∞":`nekonecno`,"♥":`laska`,"&":`a`,"|":`alebo`,"<":`menej ako`,">":`viac ako`,"∑":`sucet`,"¤":`mena`},sr:{},tr:{"∆":`delta`,"∞":`sonsuzluk`,"♥":`ask`,"&":`ve`,"|":`veya`,"<":`kucuktur`,">":`buyuktur`,"∑":`toplam`,"¤":`para birimi`},uk:{"∆":`delta`,"∞":`bezkinechnist`,"♥":`lubov`,"&":`i`,"|":`abo`,"<":`menshe`,">":`bilshe`,"∑":`suma`,"¤":`valjuta`},vn:{"∆":`delta`,"∞":`vo cuc`,"♥":`yeu`,"&":`va`,"|":`hoac`,"<":`nho hon`,">":`lon hon`,"∑":`tong`,"¤":`tien te`}},s=[`;`,`?`,`:`,`@`,`&`,`=`,`+`,`$`,`,`,`/`].join(``),c=[`;`,`?`,`:`,`@`,`&`,`=`,`+`,`$`,`,`].join(``),l=[`.`,`!`,`~`,`*`,`'`,`(`,`)`].join(``),u=function(e,t){var u=`-`,d=``,m=``,h=!0,g={},_,v,y,b,x,S,C,w,T,E,D,O,k,A,j=``;if(typeof e!=`string`)return``;if(typeof t==`string`&&(u=t),C=o.en,w=a.en,typeof t==`object`)for(D in _=t.maintainCase||!1,g=t.custom&&typeof t.custom==`object`?t.custom:g,y=+t.truncate>1&&t.truncate||!1,b=t.uric||!1,x=t.uricNoSlash||!1,S=t.mark||!1,h=t.symbols!==!1&&t.lang!==!1,u=t.separator||u,b&&(j+=s),x&&(j+=c),S&&(j+=l),C=t.lang&&o[t.lang]&&h?o[t.lang]:
4121h?o.en:{},w=t.lang&&a[t.lang]?a[t.lang]:t.lang===!1||t.lang===!0?{}:a.en,t.titleCase&&typeof t.titleCase.length==`number`&&Array.prototype.toString.call(t.titleCase)?(t.titleCase.forEach(function(e){g[e+``]=e+``}),v=!0):v=!!t.titleCase,t.custom&&typeof t.custom.length==`number`&&Array.prototype.toString.call(t.custom)&&t.custom.forEach(function(e){g[e+``]=e+``}),Object.keys(g).forEach(function(t){var n=t.length>1?RegExp(`\\b`+f(t)+`\\b`,`gi`):new RegExp(f(t),`gi`);e=e.replace(n,g[t])}),g)j+=D;for(j+=u,j=f(j),e=e.replace(/(^\s+|\s+$)/g,``),k=!1,A=!1,E=0,O=e.length;E<O;E++)D=e[E],p(D,g)?k=!1:w[D]?(D=k&&w[D].match(/[A-Za-z0-9]/)?` `+w[D]:w[D],k=!1):D in n?(E+1<O&&r.indexOf(e[E+1])>=0?(m+=D,D=``):A===!0?(D=i[m]+n[D],m=``):D=k&&n[D].match(/[A-Za-z0-9]/)?` `+n[D]:n[D],k=!1,A=!1):D in i?(m+=D,D=``,E===O-1&&(D=i[m]),A=!0):C[D]&&!(b&&s.indexOf(D)!==-1)&&!(x&&c.indexOf(D)!==-1)?(D=k||d.substr(-1).match(/[A-Za-z0-9]/)?u+C[D]:C[D],D+=e[E+1]!==void 0&&e[E+1].match(/[A-Za-z0-9]/)?u:``,k=!0):(A===!0?(D=i[m]+D,m=``,A=!1):k&&(/[A-Za-z0-9]/.test(D)||d.substr(-1).match(/A-Za-z0-9]/))&&(D=` `+D),k=!1),d+=D.replace(RegExp(`[^\\w\\s`+j+`_-]`,`g`),u);return v&&(d=d.replace(/(\w)(\S*)/g,function(e,t,n){var r=t.toUpperCase()+(n===null?``:n);return Object.keys(g).indexOf(r.toLowerCase())<0?r:r.toLowerCase()})),d=d.replace(/\s+/g,u).replace(RegExp(`\\`+u+`+`,`g`),u).replace(RegExp(`(^\\`+u+`+|\\`+u+`+$)`,`g`),``),y&&d.length>y&&(T=d.charAt(y)===u,d=d.slice(0,y),T||(d=d.slice(0,d.lastIndexOf(u)))),!_&&!v&&(d=d.toLowerCase()),d},d=function(e){return function(t){return u(t,e)}},f=function(e){return e.replace(/[-\\^$*+?.()|[\]{}\/]/g,`\\$&`)},p=function(e,t){for(var n in t)if(t[n]===e)return!0};if(t!==void 0&&t.exports)t.exports=u,t.exports.createSlug=d;else if(typeof define<`u`&&define.amd)define([],function(){return u});else try{if(e.getSlug||e.createSlug)throw`speakingurl: globals exists /(getSlug|createSlug)/`;e.getSlug=u,e.createSlug=d}catch{}})(e)}}),ex=Xb({"../../node_modules/.pnpm/[email protected]/node_modules/speakingurl/index.js"(e,t){Z(),t.exports=$b()}});Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z();function tx(e){let t=e.name||e._componentTag||e.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||e.__name;return t===`index`&&e.__file?.endsWith(`index.vue`)?``:t}function nx(e){let t=e.__file;if(t)return Lb(Rb(t,`.vue`))}function rx(e,t){return e.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__=t,t}function ix(e){if(e.__VUE_DEVTOOLS_NEXT_APP_RECORD__)return e.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(e.root)return e.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__}function ax(e){let t=e.subTree?.type,n=ix(e);return n?n?.types?.Fragment===t:!1}function ox(e){let t=tx(e?.type||{});if(t)return t;if(e?.root===e)return`Root`;for(let t in e.parent?.type?.components)if(e.parent.type.components[t]===e?.type)return rx(e,t);for(let t in e.appContext?.components)if(e.appContext.components[t]===e?.type)return rx(e,t);return nx(e?.type||{})||`Anonymous Component`}function sx(e){return`${e?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__??0}:${e===e?.root?`root`:e.uid}`}function cx(e,t){return t||=`${e.id}:root`,e.instanceMap.get(t)||e.instanceMap.get(`:root`)}function lx(){let e={top:0,bottom:0,left:0,right:0,get width(){return e.right-e.left},get height(){return e.bottom-e.top}};return e}var ux;function dx(e){return ux||=document.createRange(),ux.selectNode(e),ux.getBoundingClientRect()}function fx(e){let t=lx();if(!e.children)return t;for(let n=0,r=e.children.length;n<r;n++){let r=e.children[n],i;if(r.component)i=hx(r.component);else if(r.el){let e=r.el;e.nodeType===1||e.getBoundingClientRect?i=e.getBoundingClientRect():e.nodeType===3&&e.data.trim()&&(i=dx(e))}i&&px(t,i)}return t}function px(e,t){return(!e.top||t.top<e.top)&&(e.top=t.top),(!e.bottom||t.bottom>e.bottom)&&(e.bottom=t.bottom),(!e.left||t.left<e.left)&&(e.left=t.left),(!e.right||t.right>e.right)&&(e.right=t.right),e}var mx={top:0,left:0,right:0,bottom:0,width:0,height:0};function hx(e){let t=e.subTree.el;return typeof window>`u`?mx:ax(e)?fx(e.subTree):t?.nodeType===1?t?.getBoundingClientRect():e.subTree.component?hx(e.subTree.component):mx}Z();function gx(e){return ax(e)?_x(e.subTree):e.subTree?[e.subTree.el]:[]}function _x(e){if(!e.children)return[];let t=[];
4121return e.children.forEach(e=>{e.component?t.push(...gx(e.component)):e?.el&&t.push(e.el)}),t}var vx=`__vue-devtools-component-inspector__`,yx=`__vue-devtools-component-inspector__card__`,bx=`__vue-devtools-component-inspector__name__`,xx=`__vue-devtools-component-inspector__indicator__`,Sx={display:`block`,zIndex:2147483640,position:`fixed`,backgroundColor:`#42b88325`,border:`1px solid #42b88350`,borderRadius:`5px`,transition:`all 0.1s ease-in`,pointerEvents:`none`},Cx={fontFamily:`Arial, Helvetica, sans-serif`,padding:`5px 8px`,borderRadius:`4px`,textAlign:`left`,position:`absolute`,left:0,color:`#e9e9e9`,fontSize:`14px`,fontWeight:600,lineHeight:`24px`,backgroundColor:`#42b883`,boxShadow:`0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)`},wx={display:`inline-block`,fontWeight:400,fontStyle:`normal`,fontSize:`12px`,opacity:.7};function Tx(){return document.getElementById(vx)}function Ex(){return document.getElementById(yx)}function Dx(){return document.getElementById(xx)}function Ox(){return document.getElementById(bx)}function kx(e){return{left:`${Math.round(e.left*100)/100}px`,top:`${Math.round(e.top*100)/100}px`,width:`${Math.round(e.width*100)/100}px`,height:`${Math.round(e.height*100)/100}px`}}function Ax(e){let t=document.createElement(`div`);t.id=e.elementId??vx,Object.assign(t.style,{...Sx,...kx(e.bounds),...e.style});let n=document.createElement(`span`);n.id=yx,Object.assign(n.style,{...Cx,top:e.bounds.top<35?0:`-35px`});let r=document.createElement(`span`);r.id=bx,r.innerHTML=`&lt;${e.name}&gt;&nbsp;&nbsp;`;let i=document.createElement(`i`);return i.id=xx,i.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`,Object.assign(i.style,wx),n.appendChild(r),n.appendChild(i),t.appendChild(n),document.body.appendChild(t),t}function jx(e){let t=Tx(),n=Ex(),r=Ox(),i=Dx();t&&(Object.assign(t.style,{...Sx,...kx(e.bounds)}),Object.assign(n.style,{top:e.bounds.top<35?0:`-35px`}),r.innerHTML=`&lt;${e.name}&gt;&nbsp;&nbsp;`,i.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`)}function Mx(e){let t=hx(e);if(!t.width&&!t.height)return;let n=ox(e);Tx()?jx({bounds:t,name:n}):Ax({bounds:t,name:n})}function Nx(){let e=Tx();e&&(e.style.display=`none`)}var Px=null;function Fx(e){let t=e.target;if(t){let e=t.__vueParentComponent;if(e&&(Px=e,e.vnode.el)){let t=hx(e),n=ox(e);Tx()?jx({bounds:t,name:n}):Ax({bounds:t,name:n})}}}function Ix(e,t){e.preventDefault(),e.stopPropagation(),Px&&t(sx(Px))}var Lx=null;function Rx(){Nx(),window.removeEventListener(`mouseover`,Fx),window.removeEventListener(`click`,Lx,!0),Lx=null}function zx(){return window.addEventListener(`mouseover`,Fx),new Promise(e=>{function t(n){n.preventDefault(),n.stopPropagation(),Ix(n,n=>{window.removeEventListener(`click`,t,!0),Lx=null,window.removeEventListener(`mouseover`,Fx);let r=Tx();r&&(r.style.display=`none`),e(JSON.stringify({id:n}))})}Lx=t,window.addEventListener(`click`,t,!0)})}function Bx(e){let t=cx(yS.value,e.id);if(t){let[n]=gx(t);if(typeof n.scrollIntoView==`function`)n.scrollIntoView({behavior:`smooth`});else{let e=hx(t),n=document.createElement(`div`),r={...kx(e),position:`absolute`};Object.assign(n.style,r),document.body.appendChild(n),n.scrollIntoView({behavior:`smooth`}),setTimeout(()=>{document.body.removeChild(n)},2e3)}setTimeout(()=>{let n=hx(t);if(n.width||n.height){let r=ox(t),i=Tx();i?jx({...e,name:r,bounds:n}):Ax({...e,name:r,bounds:n}),setTimeout(()=>{i&&(i.style.display=`none`)},1500)}},1200)}}Z();var Vx;(Vx=X).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__??(Vx.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__=!0);function Hx(e){let t=0,n=setInterval(()=>{X.__VUE_INSPECTOR__&&(clearInterval(n),t+=30,e()),t>=5e3&&clearInterval(n)},30)}function Ux(){let e=X.__VUE_INSPECTOR__,t=e.openInEditor;e.openInEditor=async(...n)=>{e.disable(),t(...n)}}function Wx(){return new Promise(e=>{function t(){Ux(),e(X.__VUE_INSPECTOR__)}X.__VUE_INSPECTOR__?t():Hx(()=>{t()})})}Z(),Z();function Gx(e){return!!(e&&e.__v_isReadonly)}function Kx(e){return Gx(e)?Kx(e.__v_raw):!!(e&&e.__v_isReactive)}function qx(e){return!!(e&&e.__v_isRef===!0)}function Jx(e){let t=e&&e.__v_raw;return t?Jx(t):e}var Yx=class{constructor(){this.refEditor=new Xx}set(e,t,n,r){let i=Array.isArray(t)?t:t.split(`.`);for(;i.length>1;){let t=i.shift();e=e instanceof Map?e.get(t):e instanceof Set?Array.from(e.values())[t]:e[t],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}let a=i[0],o=this.refEditor.get(e)[a];r?r(e,a,n):this.refEditor.isRef(o)?this.refEditor.set(o,n):e[a]=n}get(e,t){let n=Array.isArray(t)?t:t.split(`.`);for(let t=0;t<n.length;t++)if(e=e instanceof Map?e.get(n[t]):e[n[t]],this.refEditor.isRef(e)&&(e=this.refEditor.get(e)),!e)return;return e}has(e,t,n=!1){if(e===void 0)return!1;let r=Array.isArray(t)?t.slice():t.split(`.`),i=n?2:1;for(;e&&r.length>i;){let t=r.shift();e=e[t],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}return e!=null&&Object.prototype.hasOwnProperty.call(e,r[0])}createDefaultSetCallback(e){return(t,n,r)=>{if((e.remove||e.newKey)&&(Array.isArray(t)?t.splice(n,1):Jx(t)instanceof Map?t.delete(n):Jx(t)instanceof Set?t.delete(Array.from(t.values())[n]):Reflect.deleteProperty(t,n)),!e.remove){let i=t[e.newKey||n];this.refEditor.isRef(i)?this.refEditor.set(i,r):Jx(t)instanceof Map?t.set(e.newKey||n,r):Jx(t)instanceof Set?t.add(r):t[e.newKey||n]=r}}}},Xx=class{set(e,t){if(qx(e))e.value=t;else{if(e instanceof Set&&Array.isArray(t)){e.clear(),t.forEach(t=>e.add(t));return}let n=Object.keys(t);if(e instanceof Map){let r=new Set(e.keys());
4121n.forEach(n=>{e.set(n,Reflect.get(t,n)),r.delete(n)}),r.forEach(t=>e.delete(t));return}let r=new Set(Object.keys(e));n.forEach(n=>{Reflect.set(e,n,Reflect.get(t,n)),r.delete(n)}),r.forEach(t=>Reflect.deleteProperty(e,t))}}get(e){return qx(e)?e.value:e}isRef(e){return qx(e)||Kx(e)}};new Yx,Z(),Z(),Z();var Zx=`__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__`;function Qx(){if(typeof window>`u`||!Nb||typeof localStorage>`u`||localStorage===null)return{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:``};let e=localStorage.getItem===void 0?null:localStorage.getItem(Zx);return e?JSON.parse(e):{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:``}}Z(),Z(),Z();var $x;($x=X).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS??($x.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS=[]);var eS=new Proxy(X.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS,{get(e,t,n){return Reflect.get(e,t,n)}});function tS(e,t){CS.timelineLayersState[t.id]=!1,eS.push({...e,descriptorId:t.id,appRecord:ix(t.app)})}var nS;(nS=X).__VUE_DEVTOOLS_KIT_INSPECTOR__??(nS.__VUE_DEVTOOLS_KIT_INSPECTOR__=[]);var rS=new Proxy(X.__VUE_DEVTOOLS_KIT_INSPECTOR__,{get(e,t,n){return Reflect.get(e,t,n)}}),iS=Vb(()=>{rC.hooks.callHook(`sendInspectorToClient`,oS())});function aS(e,t){rS.push({options:e,descriptor:t,treeFilterPlaceholder:e.treeFilterPlaceholder??`Search tree...`,stateFilterPlaceholder:e.stateFilterPlaceholder??`Search state...`,treeFilter:``,selectedNodeId:``,appRecord:ix(t.app)}),iS()}function oS(){return rS.filter(e=>e.descriptor.app===yS.value.app).filter(e=>e.descriptor.id!==`components`).map(e=>{let t=e.descriptor,n=e.options;return{id:n.id,label:n.label,logo:t.logo,icon:`custom-ic-baseline-${(n?.icon)?.replace(/_/g,`-`)}`,packageName:t.packageName,homepage:t.homepage,pluginId:t.id}})}function sS(e,t){return rS.find(n=>n.options.id===e&&(!t||n.descriptor.app===t))}function cS(){let e=ye();e.hook(`addInspector`,({inspector:e,plugin:t})=>{aS(e,t.descriptor)});let t=Vb(async({inspectorId:t,plugin:n})=>{if(!t||!n?.descriptor?.app||CS.highPerfModeEnabled)return;let r=sS(t,n.descriptor.app),i={app:n.descriptor.app,inspectorId:t,filter:r?.treeFilter||``,rootNodes:[]};await new Promise(t=>{e.callHookWith(async e=>{await Promise.all(e.map(e=>e(i))),t()},`getInspectorTree`)}),e.callHookWith(async e=>{await Promise.all(e.map(e=>e({inspectorId:t,rootNodes:i.rootNodes})))},`sendInspectorTreeToClient`)},120);e.hook(`sendInspectorTree`,t);let n=Vb(async({inspectorId:t,plugin:n})=>{if(!t||!n?.descriptor?.app||CS.highPerfModeEnabled)return;let r=sS(t,n.descriptor.app),i={app:n.descriptor.app,inspectorId:t,nodeId:r?.selectedNodeId||``,state:null},a={currentTab:`custom-inspector:${t}`};i.nodeId&&await new Promise(t=>{e.callHookWith(async e=>{await Promise.all(e.map(e=>e(i,a))),t()},`getInspectorState`)}),e.callHookWith(async e=>{await Promise.all(e.map(e=>e({inspectorId:t,nodeId:i.nodeId,state:i.state})))},`sendInspectorStateToClient`)},120);return e.hook(`sendInspectorState`,n),e.hook(`customInspectorSelectNode`,({inspectorId:e,nodeId:t,plugin:n})=>{let r=sS(e,n.descriptor.app);r&&(r.selectedNodeId=t)}),e.hook(`timelineLayerAdded`,({options:e,plugin:t})=>{tS(e,t.descriptor)}),e.hook(`timelineEventAdded`,({options:t,plugin:n})=>{CS.highPerfModeEnabled||!CS.timelineLayersState?.[n.descriptor.id]&&![`performance`,`component-event`,`keyboard`,`mouse`].includes(t.layerId)||e.callHookWith(async e=>{await Promise.all(e.map(e=>e(t)))},`sendTimelineEventToClient`)}),e.hook(`getComponentInstances`,async({app:e})=>{let t=e.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(!t)return null;let n=t.id.toString();return[...t.instanceMap].filter(([e])=>e.split(`:`)[0]===n).map(([,e])=>e)}),e.hook(`getComponentBounds`,async({instance:e})=>hx(e)),e.hook(`getComponentName`,({instance:e})=>ox(e)),e.hook(`componentHighlight`,({uid:e})=>{let t=yS.value.instanceMap.get(e);t&&Mx(t)}),e.hook(`componentUnhighlight`,()=>{Nx()}),e}var lS;(lS=X).__VUE_DEVTOOLS_KIT_APP_RECORDS__??(lS.__VUE_DEVTOOLS_KIT_APP_RECORDS__=[]);var uS;(uS=X).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__??(uS.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__={});var dS;(dS=X).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__??(dS.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__=``);var fS;(fS=X).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__??(fS.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__=[]);var pS;(pS=X).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__??(pS.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__=[]);var mS=`__VUE_DEVTOOLS_KIT_GLOBAL_STATE__`;function hS(){return{connected:!1,clientConnected:!1,vitePluginDetected:!0,appRecords:[],activeAppRecordId:``,tabs:[],commands:[],highPerfModeEnabled:!0,devtoolsClientDetected:{},perfUniqueGroupId:0,timelineLayersState:Qx()}}var gS;(gS=X)[mS]??(gS[mS]=hS());var _S=Vb(e=>{rC.hooks.callHook(`devtoolsStateUpdated`,{state:e})});Vb((e,t)=>{rC.hooks.callHook(`devtoolsConnectedUpdated`,{state:e,oldState:t})});var vS=new Proxy(X.__VUE_DEVTOOLS_KIT_APP_RECORDS__,{get(e,t,n){return t===`value`?X.__VUE_DEVTOOLS_KIT_APP_RECORDS__:X.__VUE_DEVTOOLS_KIT_APP_RECORDS__[t]}}),yS=new Proxy(X.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__,{get(e,t,n){return t===`value`?X.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__:t===`i
4121d`?X.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__:X.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[t]}});function bS(){_S({...X[mS],appRecords:vS.value,activeAppRecordId:yS.id,tabs:X.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,commands:X.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__})}function xS(e){X.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__=e,bS()}function SS(e){X.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__=e,bS()}var CS=new Proxy(X[mS],{get(e,t){return t===`appRecords`?vS:t===`activeAppRecordId`?yS.id:t===`tabs`?X.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__:t===`commands`?X.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__:X[mS][t]},deleteProperty(e,t){return delete e[t],!0},set(e,t,n){return{...X[mS]},e[t]=n,X[mS][t]=n,!0}});function wS(e={}){let{file:t,host:n,baseUrl:r=window.location.origin,line:i=0,column:a=0}=e;if(t){if(n===`chrome-extension`){let e=t.replace(/\\/g,`\\\\`),n=window.VUE_DEVTOOLS_CONFIG?.openInEditorHost??`/`;fetch(`${n}__open-in-editor?file=${encodeURI(t)}`).then(t=>{if(!t.ok){let t=`Opening component ${e} failed`;console.log(`%c${t}`,`color:red`)}})}else if(CS.vitePluginDetected){let e=X.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__??r;X.__VUE_INSPECTOR__.openInEditor(e,t,i,a)}}}Z(),Z(),Z(),Z(),Z();var TS;(TS=X).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__??(TS.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__=[]);var ES=new Proxy(X.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__,{get(e,t,n){return Reflect.get(e,t,n)}});function DS(e){let t={};return Object.keys(e).forEach(n=>{t[n]=e[n].defaultValue}),t}function OS(e){return`__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${e}__`}function kS(e){return(ES.find(t=>t[0].id===e&&!!t[0]?.settings)?.[0]??null)?.settings??null}function AS(e,t){let n=OS(e);if(n){let e=localStorage.getItem(n);if(e)return JSON.parse(e)}return DS(e?(ES.find(t=>t[0].id===e)?.[0]??null)?.settings??{}:t)}function jS(e,t){let n=OS(e);localStorage.getItem(n)||localStorage.setItem(n,JSON.stringify(DS(t)))}function MS(e,t,n){let r=OS(e),i=localStorage.getItem(r),a=JSON.parse(i||`{}`),o={...a,[t]:n};localStorage.setItem(r,JSON.stringify(o)),rC.hooks.callHookWith(r=>{r.forEach(r=>r({pluginId:e,key:t,oldValue:a[t],newValue:n,settings:o}))},`setPluginSettings`)}Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z();var NS,PS=(NS=X).__VUE_DEVTOOLS_HOOK??(NS.__VUE_DEVTOOLS_HOOK=ye()),FS={on:{vueAppInit(e){PS.hook(`app:init`,e)},vueAppUnmount(e){PS.hook(`app:unmount`,e)},vueAppConnected(e){PS.hook(`app:connected`,e)},componentAdded(e){return PS.hook(`component:added`,e)},componentEmit(e){return PS.hook(`component:emit`,e)},componentUpdated(e){return PS.hook(`component:updated`,e)},componentRemoved(e){return PS.hook(`component:removed`,e)},setupDevtoolsPlugin(e){PS.hook(`devtools-plugin:setup`,e)},perfStart(e){return PS.hook(`perf:start`,e)},perfEnd(e){return PS.hook(`perf:end`,e)}},setupDevToolsPlugin(e,t){return PS.callHook(`devtools-plugin:setup`,e,t)}},IS=class{constructor({plugin:e,ctx:t}){this.hooks=t.hooks,this.plugin=e}get on(){return{visitComponentTree:e=>{this.hooks.hook(`visitComponentTree`,e)},inspectComponent:e=>{this.hooks.hook(`inspectComponent`,e)},editComponentState:e=>{this.hooks.hook(`editComponentState`,e)},getInspectorTree:e=>{this.hooks.hook(`getInspectorTree`,e)},getInspectorState:e=>{this.hooks.hook(`getInspectorState`,e)},editInspectorState:e=>{this.hooks.hook(`editInspectorState`,e)},inspectTimelineEvent:e=>{this.hooks.hook(`inspectTimelineEvent`,e)},timelineCleared:e=>{this.hooks.hook(`timelineCleared`,e)},setPluginSettings:e=>{this.hooks.hook(`setPluginSettings`,e)}}}notifyComponentUpdate(e){if(CS.highPerfModeEnabled)return;let t=oS().find(e=>e.packageName===this.plugin.descriptor.packageName);if(t?.id){if(e){let t=[e.appContext.app,e.uid,e.parent?.uid,e];PS.callHook(`component:updated`,...t)}else PS.callHook(`component:updated`);this.hooks.callHook(`sendInspectorState`,{inspectorId:t.id,plugin:this.plugin})}}addInspector(e){this.hooks.callHook(`addInspector`,{inspector:e,plugin:this.plugin}),this.plugin.descriptor.settings&&jS(e.id,this.plugin.descriptor.settings)}sendInspectorTree(e){CS.highPerfModeEnabled||this.hooks.callHook(`sendInspectorTree`,{inspectorId:e,plugin:this.plugin})}sendInspectorState(e){CS.highPerfModeEnabled||this.hooks.callHook(`sendInspectorState`,{inspectorId:e,plugin:this.plugin})}selectInspectorNode(e,t){this.hooks.callHook(`customInspectorSelectNode`,{inspectorId:e,nodeId:t,plugin:this.plugin})}visitComponentTree(e){return this.hooks.callHook(`visitComponentTree`,e)}now(){return CS.highPerfModeEnabled?0:Date.now()}addTimelineLayer(e){this.hooks.callHook(`timelineLayerAdded`,{options:e,plugin:this.plugin})}addTimelineEvent(e){CS.highPerfModeEnabled||this.hooks.callHook(`timelineEventAdded`,{options:e,plugin:this.plugin})}getSettings(e){return AS(e??this.plugin.descriptor.id,this.plugin.descriptor.settings)}getComponentInstances(e){return this.hooks.callHook(`getComponentInstances`,{app:e})}getComponentBounds(e){return this.hooks.callHook(`getComponentBounds`,{instance:e})}getComponentName(e){return this.hooks.callHook(`getComponentName`,{instance:e})}highlightElement(e){let t=e.__VUE_DEVTOOLS_NEXT_UID__;return this.hooks.callHook(`componentHighlight`,{uid:t})}unhighlightElement(){return this.hooks.callHook(`componentUnhighlight`)}};Z(),Z(),Z(),Z();var LS=`__vue_devtool_undefined__`,RS=`__vue_devtool_infinity__`,zS=`__vue_devtool_negative_infinity__`,BS=`__vue_devtool_nan__`;Z(),Z(),Object.entries({[LS]:`undefined`,[BS]:`NaN`,[RS]:`Infinity`,[zS]:`-Infinity`}).reduce((e,[t,n])=>(e[n]=t,e),{}),Z(),Z(),Z(),Z(),Z();var VS;(VS=X).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__??(VS.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__=new Set);function HS(e,t){return FS.setupDevToolsPlugin(e,t)}function US(e,t){let[n,r]=e;if(n.app!==t)return;let i=new IS({plugin:{setupFn:r,descriptor:n},ctx:rC});n.packageName===`vuex`&&i.on.editInspectorState(e=>{i.sendInspectorState(e.inspectorId)}),r(i)}function WS(e,t){X.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(e)||(!CS.highPerfModeEnabled||t?.inspectingComponent)&&(X.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(e),ES.forEach(t=>{US(t,e)}))}Z(),Z();var GS=`__VUE_DEVTOOLS_ROUTER__`,KS=`__VUE_DEVTOOLS_ROUTER_INFO__`,qS;(qS=X).__VUE_DEVTOOLS_ROUTER_INFO__??(qS.__VUE_DEVTOOLS_ROUTER_INFO__={currentRoute:null,routes:[]});var JS;(JS=X).__VUE_DEVTOOLS_ROUTER__??(JS.__VUE_DEVTOOLS_ROUTER__={}),new Proxy(X[KS],{get(e,t){return X[KS][t]}}),new Proxy(X[GS],{get(e,t){if(t===`value`)return X[GS]}});function YS(e){let t=new Map;return(e?.getRoutes()||[]).filter(e=>!t.has(e.path)&&t.set(e.path,1))}function XS(e){return e.map(e=>{let{path:t,name:n,children:r,meta:i}=e;return r?.length&&(r=XS(r)),{path:t,name:n,children:r,meta:i}})}function ZS(e){if(e){let{fullPath:t,hash:n,href:r,path:i,name:a,matched:o,params:s,query:c}=e;return{fullPath:t,hash:n,href:r,path:i,name:a,params:s,query:c,matched:XS(o)}}return e}function QS(e,t){function n(){let t=e.app?.config.globalProperties.$router,n=ZS(t?.currentRoute.value),r=XS(YS(t)),i=console.warn;console.warn=()=>{},X[KS]={currentRoute:n?zb(n):{},routes:zb(r)},X[GS]=t,console.warn=i}n(),FS.on.componentUpdated(Vb(()=>{t.value?.app===e.app&&(n(),!CS.highPerfModeEnabled&&rC.hooks.callHook(`routerInfoUpdated`,{state:X[KS]}))},200))}function $S(e){return{async getInspectorTree(t){let n={...t,app:yS.value.app,rootNodes:[]};return await new Promise(t=>{e.callHookWith(async e=>{await Promise.all(e.map(e=>e(n))),t()},`getInspectorTree`)}),n.rootNodes},async getInspectorState(t){let n={...t,app:yS.value.app,state:null},r={currentTab:`custom-inspector:${t.inspectorId}`};return await new Promise(t=>{e.callHookWith(async e=>{await Promise.all(e.map(e=>e(n,r))),t()},`getInspectorState`)}),n.state},editInspectorState(t){let n=new Yx,r={...t,app:yS.value.app,set:(e,r=t.path,i=t.state.value,a)=>{n.set(e,r,i,a||n.createDefaultSetCallback(t.state))}};e.callHookWith(e=>
4121{e.forEach(e=>e(r))},`editInspectorState`)},sendInspectorState(t){let n=sS(t);e.callHook(`sendInspectorState`,{inspectorId:t,plugin:{descriptor:n.descriptor,setupFn:()=>({})}})},inspectComponentInspector(){return zx()},cancelInspectComponentInspector(){return Rx()},getComponentRenderCode(e){let t=cx(yS.value,e);if(t)return typeof t?.type==`function`?t.type.toString():t.render.toString()},scrollToComponent(e){return Bx({id:e})},openInEditor:wS,getVueInspector:Wx,toggleApp(e,t){let n=vS.value.find(t=>t.id===e);n&&(SS(e),xS(n),QS(n,yS),iS(),WS(n.app,t))},inspectDOM(e){let t=cx(yS.value,e);if(t){let[e]=gx(t);e&&(X.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__=e)}},updatePluginSettings(e,t,n){MS(e,t,n)},getPluginSettings(e){return{options:kS(e),values:AS(e)}}}}Z();var eC;(eC=X).__VUE_DEVTOOLS_ENV__??(eC.__VUE_DEVTOOLS_ENV__={vitePluginDetected:!1});var tC=cS(),nC;(nC=X).__VUE_DEVTOOLS_KIT_CONTEXT__??(nC.__VUE_DEVTOOLS_KIT_CONTEXT__={hooks:tC,get state(){return{...CS,activeAppRecordId:yS.id,activeAppRecord:yS.value,appRecords:vS.value}},api:$S(tC)});var rC=X.__VUE_DEVTOOLS_KIT_CONTEXT__;Z(),Qb(ex(),1);var iC;(iC=X).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__??(iC.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__={id:0,appIds:new Set}),Z(),Z();function aC(e){CS.highPerfModeEnabled=e??!CS.highPerfModeEnabled,!e&&yS.value&&WS(yS.value.app)}Z(),Z(),Z();function oC(e){CS.devtoolsClientDetected={...CS.devtoolsClientDetected,...e},aC(!Object.values(CS.devtoolsClientDetected).some(Boolean))}var sC;(sC=X).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__??(sC.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__=oC),Z(),Z(),Z(),Z(),Z(),Z(),Z();var cC=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},lC=class{constructor(e){this.generateIdentifier=e,this.kv=new cC}register(e,t){this.kv.getByValue(e)||(t||=this.generateIdentifier(e),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},uC=class extends lC{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t==`object`?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};Z(),Z();function dC(e){if(`values`in Object)return Object.values(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function fC(e,t){let n=dC(e);if(`find`in n)return n.find(t);let r=n;for(let e=0;e<r.length;e++){let n=r[e];if(t(n))return n}}function pC(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function mC(e,t){return e.indexOf(t)!==-1}function hC(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var gC=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return fC(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}};Z(),Z();var _C=e=>Object.prototype.toString.call(e).slice(8,-1),vC=e=>e===void 0,yC=e=>e===null,bC=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null||Object.getPrototypeOf(e)===Object.prototype,xC=e=>bC(e)&&Object.keys(e).length===0,SC=e=>Array.isArray(e),CC=e=>typeof e==`string`,wC=e=>typeof e==`number`&&!isNaN(e),TC=e=>typeof e==`boolean`,EC=e=>e instanceof RegExp,DC=e=>e instanceof Map,OC=e=>e instanceof Set,kC=e=>_C(e)===`Symbol`,AC=e=>e instanceof Date&&!isNaN(e.valueOf()),jC=e=>e instanceof Error,MC=e=>typeof e==`number`&&isNaN(e),NC=e=>TC(e)||yC(e)||vC(e)||wC(e)||CC(e)||kC(e),PC=e=>typeof e==`bigint`,FC=e=>e===1/0||e===-1/0,IC=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),LC=e=>e instanceof URL;Z();var RC=e=>e.replace(/\./g,`\\.`),zC=e=>e.map(String).map(RC).join(`.`),BC=e=>{let t=[],n=``;for(let r=0;r<e.length;r++){let i=e.charAt(r);if(i===`\\`&&e.charAt(r+1)===`.`){n+=`.`,r++;continue}if(i===`.`){t.push(n),n=``;continue}n+=i}let r=n;return t.push(r),t};Z();function VC(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var HC=[VC(vC,`undefined`,()=>null,()=>void 0),VC(PC,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),VC(AC,`Date`,e=>e.toISOString(),e=>new Date(e)),VC(jC,`Error`,(e,t)=>{let n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n},(e,t)=>{let n=Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n}),VC(EC,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),VC(OC,`set`,e=>[...e.values()],e=>new Set(e)),VC(DC,`map`,e=>[...e.entries()],e=>new Map(e)),VC(e=>MC(e)||FC(e),`number`,e=>MC(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),VC(e=>
4121e===0&&1/e==-1/0,`number`,()=>`-0`,Number),VC(LC,`URL`,e=>e.toString(),e=>new URL(e))];function UC(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var WC=UC((e,t)=>kC(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>[`symbol`,t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{let r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown symbol`);return r}),GC=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),KC=UC(IC,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=GC[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function qC(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var JC=UC(qC,(e,t)=>[`class`,t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};let r={};return n.forEach(t=>{r[t]=e[t]}),r},(e,t,n)=>{let r=n.classRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),YC=UC((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>[`custom`,t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{let r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error(`Trying to deserialize unknown custom value`);return r.deserialize(e)}),XC=[JC,WC,YC,KC],ZC=(e,t)=>{let n=hC(XC,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=hC(HC,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},QC={};HC.forEach(e=>{QC[e.annotation]=e});var $C=(e,t,n)=>{if(SC(t))switch(t[0]){case`symbol`:return WC.untransform(e,t,n);case`class`:return JC.untransform(e,t,n);case`custom`:return YC.untransform(e,t,n);case`typed-array`:return KC.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=QC[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}};Z();var ew=(e,t)=>{if(t>e.size)throw Error(`index out of bounds`);let n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function tw(e){if(mC(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(mC(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(mC(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var nw=(e,t)=>{tw(t);for(let n=0;n<t.length;n++){let r=t[n];if(OC(e))e=ew(e,+r);else if(DC(e)){let i=+r,a=+t[++n]==0?`key`:`value`,o=ew(e,i);switch(a){case`key`:e=o;break;case`value`:e=e.get(o)}}else e=e[r]}return e},rw=(e,t,n)=>{if(tw(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(SC(r)){let e=+n;r=r[e]}else if(bC(r))r=r[n];else if(OC(r)){let e=+n;r=ew(r,e)}else if(DC(r)){if(e===t.length-2)break;let i=+n,a=+t[++e]==0?`key`:`value`,o=ew(r,i);switch(a){case`key`:r=o;break;case`value`:r=r.get(o)}}}let i=t[t.length-1];if(SC(r)?r[+i]=n(r[+i]):bC(r)&&(r[i]=n(r[i])),OC(r)){let e=ew(r,+i),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(DC(r)){let e=+t[t.length-2],a=ew(r,e);switch(+i==0?`key`:`value`){case`key`:{let e=n(a);r.set(e,r.get(a)),e!==a&&r.delete(a);break}case`value`:r.set(a,n(r.get(a)))}}return e};function iw(e,t,n=[]){if(!e)return;if(!SC(e)){pC(e,(e,r)=>iw(e,t,[...n,...BC(r)]));return}let[r,i]=e;i&&pC(i,(e,r)=>{iw(e,t,[...n,...BC(r)])}),t(r,n)}function aw(e,t,n){return iw(t,(t,r)=>{e=rw(e,r,e=>$C(e,t,n))}),e}function ow(e,t){function n(t,n){let r=nw(e,BC(n));t.map(BC).forEach(t=>{e=rw(e,t,()=>r)})}if(SC(t)){let[r,i]=t;r.forEach(t=>{e=rw(e,BC(t),()=>e)}),i&&pC(i,n)}else pC(t,n);return e}var sw=(e,t)=>bC(e)||SC(e)||DC(e)||OC(e)||qC(e,t);function cw(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function lw(e,t){let n={},r;return e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[i,...a]=e;i.length===0?r=a.map(zC):n[zC(i)]=a.map(zC)}),r?xC(n)?[r]:[r,n]:xC(n)?void 0:n}var uw=(e,t,n,r,i=[],a=[],o=new Map)=>{let s=NC(e);if(!s){cw(e,i,t);let n=o.get(e);if(n)return r?{transformedValue:null}:n}if(!sw(e,n)){let t=ZC(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return s||o.set(e,r),r}if(mC(a,e))return{transformedValue:null};let c=ZC(e,n),l=c?.value??e,u=SC(l)?[]:{},d={};pC(l,(s,c)=>{if(c===`__proto__`||c===`constructor`||c===`prototype`)throw Error(`Detected property ${c}. This is a prototype pollution risk, please remove it from your object.`);let l=uw(s,t,n,r,[...i,c],[...a,e],o);u[c]=l.transformedValue,SC(l.annotations)?d[c]=l.annotations:bC(l.annotations)&&pC(l.annotations,(e,t)=>{d[RC(c)+`.`+t]=e})});let f=xC(d)?{transformedValue:u,annotations:c?[c.type]:void 0}:{transformedValue:u,annotations:c?[c.type,d]:d};return s||o.set(e,f),f};Z(),Z();function dw(e){return Object.prototype.toString.call(e).slice(8,-1)}function fw(e){return dw(e)===`Array`}function pw(e){if(dw(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function mw(e,t,n,r,i){let a={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;a===`enumerable`&&(e[t]=n),i&&a===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function hw(e,t={}){if(fw(e))return e.map(e=>hw(e,t));if(!pw(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(fw(t.props)&&!t.props.includes(r))return n;let i=e[r];return mw(n,r,hw(i,t),e,t.nonenumerable),n},{})}var gw=class{constructor({dedupe:e=!1}={}){this.classRegistry=new uC,this.symbolRegistry=new lC(e=>e.description??``),this.customTransformerRegistry=new gC,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=uw(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let i=lw(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){let{json:t,meta:n}=e,r=hw(t);return n?.values&&(r=aw(r,n.values,this)),n?.referentialEqualities&&(r=ow(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};gw.defaultInstance=new gw,gw.serialize=gw.defaultInstance.serialize.bind(gw.defaultInstance),gw.deserialize=gw.defaultInstance.deserialize.bind(gw.defaultInstance),gw.stringify=gw.defaultInstance.stringify.bind(gw.defaultInstance),gw.parse=gw.defaultInstance.parse.bind(gw.defaultInstance),gw.registerClass=gw.defaultInstance.registerClass.bind(gw.defaultInstance),gw.registerSymbol=gw.defaultInstance.registerSymbol.bind(gw.defaultInstance),gw.registerCustom=gw.defaultInstance.registerCustom.bind(gw.defaultInstance),gw.allowErrorProps=gw.defaultInstance.allowErrorProps.bind(gw.defaultInstance),gw.serialize,gw.deserialize,gw.stringify,gw.parse,gw.registerClass,gw.registerCustom,gw.registerSymbol,gw.allowErrorProps,Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z(),Z();var _w;(_w=X).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__??(_w.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__=[]);var vw;(vw=X).__VUE_DEVTOOLS_KIT_RPC_CLIENT__??(vw.__VUE_DEVTOOLS_KIT_RPC_CLIENT__=null);var yw;(yw=X).__VUE_DEVTOOLS_KIT_RPC_SERVER__??(yw.__VUE_DEVTOOLS_KIT_RPC_SERVER__=null);var bw;(bw=X).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__??(bw.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__=null);var xw;(xw=X).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__??(xw.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__=null);var Sw;(Sw=X).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__??(Sw.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__=null),Z(),Z(),Z(),Z(),Z(),Z(),Z();var Cw=`5.8.1`;function ww(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var Tw=ww(`html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot`),Ew=e=>t=>xy(t)&&e in t&&!!t[e],Dw=Ew(`isObject3D`),Ow=Ew(`isMesh`),kw=Ew(`isCamera`),Aw=Ew(`isOrthographicCamera`),jw=Ew(`isPerspectiveCamera`),Mw=Ew(`isColor`),Nw=e=>Sy(e)||by(e)||Mw(e),Pw=e=>e instanceof fi,Fw=Ew(`isBufferGeometry`),Iw=Ew(`isMaterial`),Lw=Ew(`isLight`),Rw=Ew(`isFog`),zw=Ew(`isScene`),Bw=e=>typeof e==`object`&&!!e&&`set`in e&&typeof e.set==`function`,Vw=e=>Bw(e)&&`copy`in e&&typeof e.copy==`function`,Hw=e=>!!e?.constructor,Uw=e=>kw(e)||Aw(e)||jw(e),Ww=e=>Dw(e)||Fw(e)||Iw(e)||Rw(e),Gw=Ew(`isPrimitive`),Kw=e=>Ww(e)&&`__tres`in e,qw=(e,t)=>{let n=0;for(let r=0;r<e.length;r++)t(e[r],r)&&(e[n]=e[r],n++);return e.length=n,e},Jw=`[TresJS ▲ ■ ●] `;function Yw(...e){typeof e[0]==`string`?e[0]=Jw+e[0]:e.unshift(Jw),console.error(...e)}function Xw(...e){typeof e[0]==`string`?e[0]=Jw+e[0]:e.unshift(Jw),console.warn(...e)}function Zw(e){(e=>`map`in e&&!!e.map)(e)&&e.map.dispose(),e.dispose()}function Qw(e){if(e.parent&&e.removeFromParent?.(),delete e.__tres,[...e.children].forEac
4121h(e=>Qw(e)),!(e instanceof zi)){let t=e;e&&e.dispose?.(),t.geometry&&t.geometry.dispose(),Array.isArray(t.material)?t.material.forEach(e=>Zw(e)):t.material&&Zw(t.material)}}function $w(e,t){let n=e;if(t.includes(`-`)){let e=t.split(`-`),r=e.shift();for(;n&&e.length;)r in n?(n=n[r],r=e.shift()):r=eT(r,e.shift());return{target:n,key:eT(r,...e)}}return{target:n,key:t}}function eT(...e){return e.map((e,t)=>t===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function tT(e,t,n){let r=/-\d+$/;if(Sy(n)){if(r.test(n)){let{target:t,key:i}=$w(e,n.replace(r,``));if(!Array.isArray(t[i])){let e=t[i],n=[];n.__tresDetach=()=>{n.every(e=>wy(e))&&(t[i]=e)},t[i]=n}}let{target:i,key:a}=$w(e,n);t.__tres.previousAttach=i[a],i[a]=oT(t)}else t.__tres.previousAttach=n(e,t)}function nT(e,t,n){if(Sy(n)){let{target:r,key:i}=$w(e,n),a=t.__tres.previousAttach;a===void 0?delete r[i]:r[i]=a,`__tresDetach`in r&&r.__tresDetach()}else t.__tres?.previousAttach?.(e,t);delete t.__tres?.previousAttach}function rT(e,t,n){let r=e;return r.__tres={type:`unknown`,root:n,memoizedProps:{},objects:[],parent:null,previousAttach:null,...t},r.__tres.attach||(Iw(r)?r.__tres.attach=`material`:Fw(r)?r.__tres.attach=`geometry`:Rw(r)&&(r.__tres.attach=`fog`)),r}function iT(e){let t=e?.__tres?.root;t?.renderer&&t.renderer.canBeInvalidated.value&&t.renderer.invalidate()}function aT(e,t,n,r,i){let a=[...t.__tres.objects],o=oT(t);if(e=oT(e),o===e)return!0;let s=rT(e,t.__tres??{},i),c=t.parent??t.__tres.parent??null,l={...t.__tres.memoizedProps};delete l.object;for(let e of a)sT(e,i),cT(e,i);o.__tres.objects=[],r.remove(t);for(let[e,t]of Object.entries(l))r.patchProp(s,e,s[e],t);n(e),r.insert(t,c);for(let e of a)r.insert(e,t);return!0}function oT(e){if(Gw(e)){let t=e;return t.object.__tres=t.__tres,t.object}return e}function sT(e,t){let n=e.__tres?.parent||t.scene.value;e.__tres&&(e.__tres.parent=null),n&&n.__tres&&`objects`in n.__tres&&qw(n.__tres.objects,t=>t!==e),e.__tres?.attach?nT(n,e,e.__tres.attach):(e.parent?.remove?.(oT(e)),e.parent=null)}function cT(e,t){e.traverse?.(e=>{Uw(e)&&t.camera.deregisterCamera(e)}),Uw(e)&&t.camera.deregisterCamera(e),iT(e)}function lT(e,t,n){let r=new e(n?.manager),i=E({loaded:0,total:0,percentage:0});n?.extensions&&n.extensions(r);let a=o(t),s=oy(e=>
4121new Promise((t,n)=>{let o=e||a||``;r.load(o,e=>{t(e)},e=>{i.loaded=e.loaded,i.total=e.total,i.percentage=i.loaded/i.total*100},e=>{n(e)})}),n?.initialValue??null,{...n?.asyncOptions,immediate:n?.asyncOptions?.immediate??!0}),l=c(()=>o(t),e=>{if(e){let t=s.state.value;t&&typeof t==`object`&&`scene`in t&&t.scene&&Qw(t.scene),s.execute(0,e)}});return w(()=>{l();let e=s.state.value;e&&typeof e==`object`&&`scene`in e&&e.scene&&Qw(e.scene)}),{...s,load:e=>{s.execute(0,e)},progress:i}}var uT=({sizes:e})=>{let t=I([]),n=T(()=>t.value[0]),r=e=>{let n=kw(e)?e:t.value.find(t=>t.uuid===e);n&&(t.value=[n,...t.value.filter(({uuid:e})=>e!==n.uuid)])};return g(()=>{e.aspectRatio.value&&t.value.forEach(t=>{jw(t)&&(t.aspect=e.aspectRatio.value,t.updateProjectionMatrix())})}),{activeCamera:n,cameras:t,registerCamera:(e,n=!1)=>{t.value.some(({uuid:t})=>t===e.uuid)||(t.value.push(e),n&&r(e.uuid))},deregisterCamera:e=>{t.value=t.value.filter(({uuid:t})=>t!==e.uuid)},setActiveCamera:r}};function dT(){let e=new Map,t=new Set,n=0,r=!1,i=()=>{let n=Array.from(e.entries()).sort((e,t)=>{let n=e[1].priority-t[1].priority;return n===0?e[1].addI-t[1].addI:n});t.clear(),n.forEach(e=>t.add(e[0]))},a=n=>{e.delete(n),t.delete(n)};return{on:(t,i=0)=>{e.set(t,{priority:i,addI:n++});let o=()=>a(t);return kv(o),r=!0,{off:o}},off:a,trigger:(...e)=>(r&&=(i(),!1),Promise.all(Array.from(t).map(t=>t(...e)))),dispose:()=>{e.clear(),t.clear()},get count(){return e.size}}}var fT=I({}),pT=e=>Object.assign(fT.value,e),mT=(e,t,n)=>{if(!yy(e.setPixelRatio))return;let r=0;if(n&&Array.isArray(n)&&n.length>=2){let[e,i]=n;r=kr.clamp(t,e,i)}else r=by(n)?n:t;r!==e.getPixelRatio?.()&&e.setPixelRatio(r)},hT=Number.parseInt(`184`),gT=179;function _T(){if(hT>=gT){let e=new of;return{getDelta:()=>e.getDelta(),getElapsed:()=>e.getElapsed(),update:()=>e.update(),start:()=>{typeof document<`u`&&e.connect(document)},stop:()=>e.disconnect()}}{let e=new Jf;return{getDelta:()=>e.getDelta(),getElapsed:()=>e.elapsedTime,update:()=>{},start:()=>e.start(),stop:()=>e.stop()}}}var vT=(e,{fpsLimit:t}={})=>{let n=_T(),r={before:Av(),after:Av()},{pause:i,resume:a,isActive:o}=ay(()=>{n.update();let t={delta:n.getDelta(),elapsed:n.getElapsed()};r.before.trigger(t),e(),r.after.trigger(t)},{immediate:!1,fpsLimit:t});return{start:()=>{n.start(),a()},stop:()=>{n.stop(),i()},isActive:o,onBeforeLoop:r.before.on,onLoop:r.after.on}},yT=class extends Error{name=`TresRendererError`;constructor(e,t,n){super(e,n),this.code=t}};function bT({scene:e,canvas:t,options:n,fpsLimit:r,contextParts:{sizes:i,camera:a}}){let s=yy(n.renderer)?n.renderer({sizes:i,scene:e,camera:a,canvas:t}):new u_({...n,canvas:ty(t)}),l=I(o(n.renderMode)===`manual`?0:1),u=T(()=>o(n.renderMode)===`on-demand`&&l.value===0),d=()=>e.value.traverse(e=>{e instanceof Fo&&e.material instanceof Ja&&(e.material.needsUpdate=!0)}),f=(e=1)=>{u.value&&(l.value=Math.min(60,l.value+e))},p=()=>{if(o(n.renderMode)!==`manual`)throw Error(`advance can only be called in manual render mode.`);l.value=1},m=()=>{o(n.renderMode)===`on-demand`&&f()},h=T(()=>o(n.renderMode)===`always`),_=e=>xy(e)&&`isRenderer`in e&&!!e.isRenderer,v=Av(),y=Av(),b=!1,x=I(!1),S=I(null),C=async()=>{try{_(s)&&await s.init(),x.value=!0}catch(e){let t=new yT(e instanceof Error?e.message:`Unknown error`,`INITIALIZATION_FAILED`,{cause:e instanceof Error?e:void 0});S.value=t,console.error(`[TresJS] Renderer initialization failed. This may occur if:
4122  - WebGPU is not supported by your browser
4123  - GPU is not available or lacks required features
4124  - GPU drivers are outdated
4125Error details: ${t.message}`,t),y.trigger(t)}},E=Av(),D=()=>{l.value=h.value?1:Math.max(0,l.value-1),E.trigger(s)},O=t=>{a.activeCamera.value&&(s.render(e.value,a.activeCamera.value),t())},k=e=>{O=e},A=vT(()=>{l.value&&O(D)},{fpsLimit:r});v.on(()=>{x.value&&A.start()}),c([i.width,i.height,x],()=>{x.value&&(s.setSize(i.width.value,i.height.value),!b&&s.domElement.width&&s.domElement.height&&(b=!0,ne(()=>{v.trigger(s)})),m())},{immediate:!0}),g(()=>{x.value&&mT(s,i.pixelRatio.value,o(n.dpr))}),C(),o(n.renderMode)===`on-demand`&&f(),o(n.renderMode)===`manual`&&Qv(100,{callback:p});let j=T(()=>{let e=o(n.clearColor),t=o(n.clearAlpha),r=typeof e==`string`&&e.length===9&&e.startsWith(`#`);return r&&t!==void 0&&Xw(`clearColor with alpha (e.g. ${e}) and clearAlpha cannot both be set, using clearColor as source of truth`),r?{alpha:Number.parseInt(e.slice(7,9),16)/255,color:e.slice(0,7)}:{alpha:t,color:e}});return g(()=>{if(!x.value)return;let e=j.value;e.color!==void 0&&e.alpha!==void 0&&s.setClearColor(e.color,e.alpha)}),g(()=>{if(!x.value)return;let e=n.toneMapping;e&&(s.toneMapping=e)}),g(()=>{if(!x.value)return;let e=n.toneMappingExposure;e&&(s.toneMappingExposure=e)}),g(()=>{if(!x.value)return;let e=n.outputColorSpace;
4125e&&(s.outputColorSpace=e)}),g(()=>{if(!x.value)return;let e=n.shadows;e!==void 0&&(s.shadowMap.enabled=e,d())}),g(()=>{if(!x.value)return;let e=n.shadowMapType;e!==void 0&&(s.shadowMap.type=e,d())}),w(()=>{s.dispose(),`forceContextLoss`in s&&s.forceContextLoss()}),{loop:A,instance:s,advance:p,onReady:v.on,onRender:E.on,onError:y.on,invalidate:f,canBeInvalidated:u,mode:o(n.renderMode),replaceRenderFunction:k,isInitialized:x,error:S}}function xT(e,t,n=10){let{pixelRatio:r}=uy(),i=o(e)?hy():fy(T(()=>o(t).parentElement)),a=v(Kv(i.width,n)),s=v(Kv(i.height,n));return{width:a,height:s,pixelRatio:r,aspectRatio:T(()=>a.value/s.value)}}function ST({canvas:e,contextParts:{scene:t,camera:n,renderer:r}}){let{update:i,destroy:a}=vb(o(e),()=>o(n.activeCamera),t.value),{off:s}=r.loop.onLoop(i);w(a),w(s);let c=Iy(t.value),l=Av();return c.addEventListener(`click`,l.trigger),{onPointerMissed:l.on}}var CT=`useTres`,[wT,TT]=Pv(({scene:e,canvas:t,fpsLimit:n,windowSize:r,rendererOptions:i})=>{let a=L(e),o=xT(r,t),s=uT({sizes:o}),c=bT({scene:a,canvas:t,options:i,fpsLimit:n,contextParts:{sizes:o,camera:s}}),l=ST({canvas:t,contextParts:{scene:a,camera:s,renderer:c}}),u={sizes:o,scene:a,camera:s,renderer:c,controls:I(null),extend:pT,events:l};return u.scene.value.__tres={root:u,objects:[],isUnmounting:!1},u},{injectionKey:`useTres`}),ET=()=>{let e=TT();if(!e)throw Error(`useTresContext must be used together with useTresContextProvider.
4126 You probably tried to use it above or on the same level as a TresCanvas component.
4127 It should be used in child components of a TresCanvas instance.`);return e};function DT(){let{scene:e,renderer:t,camera:n,sizes:r,controls:i,extend:a,events:o}=ET();return{scene:e,renderer:t.instance,camera:n.activeCamera,sizes:r,controls:i,extend:a,events:o,invalidate:t.invalidate,advance:t.advance}}var OT=()=>{let e=DT(),{renderer:t}=ET(),n=dT(),r=dT();t.loop.onBeforeLoop(t=>{n.trigger({...e,...t})}),t.loop.onLoop(t=>{r.trigger({...e,...t})});let i=t.replaceRenderFunction;return{stop:t.loop.stop,start:t.loop.start,isActive:t.loop.isActive,onBeforeRender:n.on,onRender:r.on,render:i}};function kT(e,t={},n={}){let r=e,i=e=>{r=e},a=new Proxy({},{});return a=new Proxy({},{has(e,n){return n in t||n in r},get(e,n,i){return n in t?t[n](r):r[n]},set(e,t,o){return n[t]?n[t](o,r,a,i):r[t]=o,!0}}),a}var AT=[`onClick`,`onContextmenu`,`onPointermove`,`onPointerenter`,`onPointerleave`,`onPointerover`,`onPointerout`,`onDblclick`,`onPointerdown`,`onPointerup`,`onPointercancel`,`onLostpointercapture`,`onWheel`],jT={onClick:`click`,onContextmenu:`contextmenu`,onPointermove:`pointermove`,onPointerenter:`pointerenter`,onPointerleave:`pointerleave`,onPointerover:`pointerover`,onPointerout:`pointerout`,onDblclick:`dblclick`,onPointerdown:`pointerdown`,onPointerup:`pointerup`,onPointercancel:`pointercancel`,onLostpointercapture:`lostpointercapture`,onWheel:`wheel`},MT=e=>AT.includes(e),NT=Symbol(`tresTextNode`),PT=Symbol(`tresComment`),FT=({context:e,options:t={primitivePrefix:``}})=>{let n=e.scene.value,r=()=>{if(!n?.__tres?.isUnmounting)return{[NT]:!0,__tres:{parent:null}}},i=()=>({[PT]:!0,__tres:{parent:null}}),a=e=>!!e&&typeof e==`object`&&NT in e,o=e=>!!e&&typeof e==`object`&&PT in e;function s(n,r,i,a){if(a||={},a.args||(a.args=[]),Tw(n))return null;n.includes(`-`)&&(n=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()).replace(/^[a-z]/,e=>e.toUpperCase()));let o=n.replace(`Tres`,``),s;if(n===`${t?.primitivePrefix??``}primitive`){(!xy(a.object)||re(a.object))&&Yw(`Tres primitives need an 'object' prop, whose value is an object or shallowRef<object>`),o=a.object.type;let t={};s=kT(a.object,{object:e=>e,isPrimitive:()=>!0,__tres:()=>t},{object:(t,n,r,i)=>{aT(t,r,i,{patchProp:u,remove:l,insert:c},e)},__tres:e=>{Object.assign(t,e)}})}else{let e=fT.value[o];e||Yw(`${o} is not defined on the THREE namespace. Use extend to add it to the catalog.`),s=new e(...a.args)}return s?(Uw(s)&&(a?.position||s.position.set(3,3,3),a?.lookAt||s.lookAt(0,0,0)),s=rT(s,{...Kw(s)?s.__tres:{},type:o,memoizedProps:a,primitive:n===`primitive`,attach:a.attach},e),s):null}function c(t,r,i){if(!t)return;if(r||=n,a(t)||o(t)){let n=r.__tres?r:rT(r,{},e);if(t.__tres.parent=n,n.__tres.objects){let e=i?n.__tres.objects.findIndex(e=>e===i):-1;e>=0?n.__tres.objects.splice(e,0,t):n.__tres.objects.push(t)}return}let s=t.__tres?t:rT(t,{},e),c=r.__tres?r:rT(r,{},e);if(t=oT(s),r=oT(c),Uw(t)&&e.camera?.registerCamera(t),s.__tres.attach?tT(c,s,s.__tres.attach):Dw(t)&&Dw(c)&&(c.add(t),t.dispatchEvent({type:`added`})),s.__tres.parent=c,c.__tres.objects&&!c.__tres.objects.includes(s)){let e=i?c.__tres.objects.findIndex(e=>e===i):-1;~e?c.__tres.objects.splice(e,0,s):c.__tres.objects.push(s)}}function l(t,n){if(!t)return;if(a(t)||o(t)){let e=t.__tres.parent;e?.__tres?.objects&&qw(e.__tres.objects,e=>e!==t),t.__tres.parent=null;return}n=wy(n)?`default`:n;let r=t.__tres?.dispose;wy(r)||(n=r!==null&&r);let i=t.__tres?.primitive,s=n==="default"?!i:!!n;
4127if(t.__tres&&`objects`in t.__tres&&[...t.__tres.objects].forEach(e=>l(e,n)),s&&t.children&&[...t.children].forEach(e=>l(e,n)),sT(t,e),cT(t,e),s&&!zw(t)){if(yy(n))n(t);else if(yy(t.dispose))try{t.dispose()}catch{}}`__tres`in t&&delete t.__tres}function u(t,n,r,i){if(!t)return;let a=t,o=n;if(t.__tres&&(t.__tres.memoizedProps[n]=i),n===`attach`){let n=t.__tres?.parent||t.parent;l(t),rT(t,{attach:i},e),n&&c(t,n);return}if(n===`dispose`){t.__tres||(t=rT(t,{},e)),t.__tres.dispose=i;return}MT(n)&&yy(i)&&t.addEventListener(jT[n],i);let s=gy(o),u=a?.[s];if(o===`args`){let e=t,n=r??[],o=i??[],s=t.__tres?.type||t.type;if(s&&n.length&&!vy(n,o)){let t=new fT.value[s](...i),n=Object.getOwnPropertyDescriptors(t);Object.entries(n).forEach(([n,r])=>{if((r.writable||r.set)&&n in e)try{e[n]=t[n]}catch(e){console.warn(`Could not set property ${n} on ${s}:`,e)}}),a=e}return}if(a.type===`BufferGeometry`){if(o===`args`)return;a.setAttribute(gy(o),new Ca(...i));return}if(o.includes(`-`)&&u===void 0){let e=$w(a,o);if(u=e.target,a=e.target,s=e.key,u&&s){u[s]=i,Uw(t)&&t.updateProjectionMatrix(),iT(t);return}}let d=i;if(d===``&&(d=!0),yy(u)){MT(n)||(Array.isArray(d)?t[s](...d):t[s](d)),s.startsWith(`on`)&&yy(d)&&(a[s]=d);return}Pw(u)&&Pw(d)?u.mask=d.mask:Mw(u)&&Nw(d)?u.set(d):Vw(u)&&Hw(d)&&u.constructor===d.constructor?u.copy(d):Bw(u)&&Array.isArray(d)?`fromArray`in u&&typeof u.fromArray==`function`?u.fromArray(d):u.set(...d):Bw(u)&&typeof d==`number`?`setScalar`in u&&typeof u.setScalar==`function`?u.setScalar(d):u.set(d):a[s]=d,Uw(t)&&t.updateProjectionMatrix(),iT(t)}function d(e){return e?.__tres?.parent||null}function f(e){if(!e||!(`__tres`in e))return null;let t=d(e)?.__tres?.objects||[],n=t.findIndex(t=>t===e);return n<0||n>=t.length-1?null:t[n+1]}let p=()=>{};return{insert:c,remove:l,createElement:s,patchProp:u,parentNode:d,createText:r,createComment:i,setText:p,setElementText:p,nextSibling:f,querySelector:p,setScopeId:p,cloneNode:p,insertStaticContent:p}},IT=new Map,LT=e=>IT.get(e),RT=(e,t)=>{IT.set(e,t)},zT=e=>IT.delete(e),BT=[`asset-load`],VT=class{subscribers=new Set;messageQueue=[];maxQueueSize=100;send(e,t){let n={type:e,data:t,timestamp:Date.now()};this.subscribers.size>0?this.subscribers.forEach(e=>e(n)):BT.includes(e)&&this.queueMessage(n)}queueMessage(e){this.messageQueue.push(e),this.messageQueue.length>this.maxQueueSize&&this.messageQueue.shift()}flushQueue(){this.messageQueue.length!==0&&this.subscribers.size!==0&&(this.messageQueue.forEach(e=>{this.subscribers.forEach(t=>t(e))}),this.messageQueue=[])}subscribe(e){return this.subscribers.add(e),this.flushQueue(),()=>{this.subscribers.delete(e)}}get hasSubscribers(){return this.subscribers.size>0}get queueSize(){return this.messageQueue.length}clearQueue(){this.messageQueue=[]}};function HT(e,t){let n=`▲ ■ ●${e}`;typeof UT==`function`?UT(n,t):t===`error`?console.error(n):t===`warn`?console.warn(n):console.log(n)}function UT(e,t){throw Error(e+t)}function WT(e){let t=0;return e.traverse(e=>{if(Ow(e)&&e.type!==`HightlightMesh`){let n=e.geometry,r=n.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,i=n.index?n.index.count*Uint32Array.BYTES_PER_ELEMENT:0,a=n.attributes.normal?n.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,o=n.attributes.uv?n.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,s=r+i+a+o;t+=s}}),t}function GT(e,t,n){e.push(t),e.length>n&&e.shift()}function KT(e){return(e/1024).toFixed(2)}function qT(e){if(!e)return;typeof window<`u`&&!window.__TRES__DEVTOOLS__&&(window.__TRES__DEVTOOLS__=new VT);let t={maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},n=py({every:100}),{isSupported:r,memory:i}=my({interval:100}),a=performance.now(),o=0,s=({timestamp:o})=>{e.scene.value&&(t.memory.allocatedMem=WT(e.scene.value)),o-a>=100&&(a=o,GT(t.fps.accumulator,n.value,160),t.fps.value=n.value,r.value&&i.value?.usedJSHeapSize&&(GT(t.memory.accumulator,i.value.usedJSHeapSize/1024/1024,160),t.memory.accumulator.length>0&&(t.memory.currentMem=t.memory.accumulator.reduce((e,t)=>e+t,0)/t.memory.accumulator.length)))},{pause:c}=ay(({delta:n})=>{window.__TRES__DEVTOOLS__&&(s({timestamp:performance.now()}),o+=n,o>=1&&(window.__TRES__DEVTOOLS__.send(`context`,e),window.__TRES__DEVTOOLS__.send(`performance`,t),o=0))},{immediate:!0});w(()=>{c()})}var JT=(e,t)=>
4127{if(e.uuid===t)return e;for(let n of e.children){let e=JT(n,t);if(e)return e}},YT=class extends Fo{type=`HightlightMesh`;createTime;constructor(...e){super(...e),this.createTime=Date.now()}onBeforeRender(){let e=(Date.now()-this.createTime)/1e3,t=1+.07*Math.sin(2.5*e);this.scale.set(t,t,t)}},XT=e=>{let t={id:`scene-${e.uuid}`,label:e.type,children:[],tags:[]};e.name!==``&&t.tags.push({label:e.name,textColor:5750629,backgroundColor:15793395});let n=WT(e);return n>0&&t.tags.push({label:`${KT(n)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:`Memory usage`}),e.type.includes(`Light`)&&(Lw(e)&&t.tags.push({label:`${e.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:`Intensity`}),t.tags.push({label:`#${new q(e.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:`Color`})),e.type.includes(`Camera`)&&(t.tags.push({label:`${e.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:`Field of view`}),t.tags.push({label:`x: ${Math.round(e.position.x)} y: ${Math.round(e.position.y)} z: ${Math.round(e.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:`Position`})),t};function ZT(e,t,n=``){return{id:`context-${t}-${n?`${n}.${e}`:e}`,label:e,children:[],tags:[]}}function QT(e,t,n=``){e.children.forEach(e=>{if(e.type===`HightlightMesh`||n&&!e.type.includes(n)&&!e.name.includes(n))return;let r=XT(e);t.children.push(r),QT(e,r,n)})}function $T(e,t,n=new WeakSet,r=0,i=4,a,o=``){if(r>=i||!e||n.has(e))return;let s=r===0?e?.scene?.value?.uuid||Math.random().toString(36).slice(2,11):a;n.add(e),Object.entries(e).forEach(([e,a])=>{if(e.startsWith(`_`)||typeof a==`function`)return;let c=o?`${o}.${e}`:e,l=ZT(e,s,o);e!==`scene`&&(re(a)?(l.tags.push({label:`Ref<${typeof a.value}>`,textColor:4372611,backgroundColor:15793395}),a.value&&typeof a.value==`object`?$T(a.value,l,n,r+1,i,s,c):l.label=`${e}: ${JSON.stringify(a.value)}`):a&&typeof a==`object`&&!Array.isArray(a)?Object.keys(a).length>0?n.has(a)?l.tags.push({label:`Circular`,textColor:16711680,backgroundColor:16773360}):$T(a,l,n,r+1,i,s,c):l.label=`${e}: {}`:Array.isArray(a)?(l.label=`${e}: Array(${a.length})`,l.tags.push({label:`length: ${a.length}`,textColor:9738662,backgroundColor:16316922})):l.label=`${e}: ${JSON.stringify(a)}`,t.children.push(l))})}var eE=e=>t=>{if(t.inspectorId===iE){let n=XT(e.scene.value);QT(e.scene.value,n,t.filter);let r={id:`context-root`,label:`Context`,children:[],tags:[]};$T(e,r),t.rootNodes=[n,r]}},tE=(e,{highlightMesh:t,prevInstance:n})=>r=>{if(r.inspectorId!==iE)return;let i=new Co({color:11003607,transparent:!0,opacity:.2,depthTest:!1,side:2});if(r.nodeId.includes(`scene`)){let a=r.nodeId.match(/^scene-(.+)$/),o=a?a[1]:null;if(!o)return;let[s]=e.scene.value.getObjectsByProperty(`uuid`,o);if(!s)return;if(n&&t&&t.parent&&n.remove(t),Ow(s)){let e=new YT(s.geometry.clone(),i);s.add(e),t=e,n=s}if(r.state={object:Object.entries(s).map(([e,t])=>e===`children`?{key:e,value:t.filter(e=>e.type!==`HightlightMesh`)}:{key:e,value:t,editable:!0}).filter(({key:e})=>e!==`parent`)},zw(s)){let t={...r.state,state:[{key:`Scene Info`,value:{objects:s.children.length,memory:WT(s),calls:e.renderer.instance.info.render.calls,triangles:e.renderer.instance.info.render.triangles,points:e.renderer.instance.info.render.points,lines:e.renderer.instance.info.render.lines}}]};`programs`in e.renderer.instance.info&&t.state.push({key:`Programs`,value:e.renderer.instance.info.programs?.map(e=>({...e,programName:e.name}))}),r.state=t}}else if(r.nodeId.includes(`context`)){let t=r.nodeId.match(/^context-([^-]+(?:-[^-]+)*)-(.+)$/),n=t?t[2]:`context`;if(!n||n===`context`){r.state={object:Object.entries(e).filter(([e])=>!e.startsWith(`_`)&&e!==`parent`).map(([e,t])=>({key:e,value:re(t)?t.value:t,editable:!1}))};return}let i=n.split(`.`),a=e;for(let e of i){if(!a||typeof a!=`object`)break;a=re(a[e])?a[e].value:a[e]}a!==void 0&&(r.state={object:Object.entries(a).filter(([e])=>!e.startsWith(`_`)&&e!==`parent`).map(([e,t])=>re(t)?{key:e,value:t.value,editable:!1}:typeof t==`function`?{key:e,value:`ƒ()`,editable:!1}:t&&typeof t==`object`?{key:e,value:Array.isArray(t)?`Array(${t.length})`:`Object`,editable:!1}:{key:e,value:t,editable:!1})})}},nE=(e,t,n,r)=>{let i=JT(e,t);if(!i){console.warn(`Object with UUID not found in the scene.`);return}let a=i;for(let e=0;e<n.length-1;e++)if(a[n[e]]!==void 0)a=a[n[e]];
4127else{console.warn(`Property path is not valid: ${n.join(`.`)}`);return}let o=n[n.length-1];a[o]===void 0?console.warn(`Property path is not valid: ${n.join(`.`)}`):a[o]=r},rE=e=>t=>{if(t.inspectorId===iE&&t.nodeId.includes(`scene`)){let n=t.nodeId.match(/^scene-(.+)$/),r=n?n[1]:null;if(!r)return;nE(e.scene.value,r,t.path,t.state.value)}},iE=`tres:inspector`;function aE(e,t){let n={id:`dev.esm.tres`,label:`TresJS 🪐`,logo:`https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg`,packageName:`tresjs`,homepage:`https://docs.tresjs.org`,app:e};qT(t),HS(n,e=>{typeof e.now!=`function`&&HT(`You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.`),e.addInspector({id:iE,label:`TresJS 🪐`,icon:`account_tree`,treeFilterPlaceholder:`Search instances`}),setInterval(()=>{e.sendInspectorTree(iE)},1e3),setInterval(()=>{e.notifyComponentUpdate()},5e3),e.on.getInspectorTree(eE(t)),e.on.getInspectorState(tE(t,{highlightMesh:null,prevInstance:null})),e.on.editInspectorState(rE(t))})}var oE=k({__name:`Context`,props:{camera:{type:null,required:!1},windowSize:{type:Boolean,required:!1},fpsLimit:{type:Number,required:!1},enableProvideBridge:{type:Boolean,required:!1},customRendererOptions:{type:Object,required:!1},antialias:{type:Boolean,required:!1},stencil:{type:Boolean,required:!1},depth:{type:Boolean,required:!1},precision:{type:String,required:!1},logarithmicDepthBuffer:{type:Boolean,required:!1},preserveDrawingBuffer:{type:Boolean,required:!1},powerPreference:{type:null,required:!1},alpha:{type:Boolean,required:!1},premultipliedAlpha:{type:Boolean,required:!1},failIfMajorPerformanceCaveat:{type:Boolean,required:!1},clearColor:{type:[Object,String,Number],required:!1},clearAlpha:{type:Number,required:!1},shadows:{type:Boolean,required:!1},toneMapping:{type:null,required:!1},shadowMapType:{type:null,required:!1},useLegacyLights:{type:Boolean,required:!1},outputColorSpace:{type:null,required:!1},toneMappingExposure:{type:Number,required:!1},renderMode:{type:String,required:!1},dpr:{type:[Number,Array],required:!1},renderer:{type:Function,required:!1},canvas:{type:null,required:!0}},emits:[`ready`,`error`,`pointermissed`,`render`,`beforeLoop`,`loop`,`click`,`contextmenu`,`pointermove`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`,`dblclick`,`pointerdown`,`pointerup`,`pointercancel`,`lostpointercapture`,`wheel`],setup(e,{expose:t,emit:n}){let a=e,s=n,l=f(),u=L(new zi),p=d();pT(qp);let m=(e,t)=>k({setup(){let n=d()?.appContext;n&&(n.app=p?.appContext.app);let i={};function o(e){e&&(e.parent&&o(e.parent),e.provides&&Object.assign(i,e.provides))}return p?.parent&&a.enableProvideBridge&&(o(p.parent),Reflect.ownKeys(i).forEac
4127h(e=>{D(e,i[e])})),D(CT,e),D(`extend`,pT),typeof window<`u`&&n?.app&&aE(n?.app,e),()=>(t.value,r(M,null,l.default?.()??[]))}}),h=e=>{let t=a.canvas;if(LT(t))return;let n=I(0),o=m(e,n),s=i(FT({context:e,options:a.customRendererOptions}));s.render(r(o),u.value),RT(t,{renderer:s,internalComponent:o,hmrTick:n,context:e})},_=(e,t=!1)=>{Qw(e.scene.value),t&&(e.renderer.instance.dispose(),e.renderer.instance instanceof u_&&(e.renderer.instance.renderLists.dispose(),e.renderer.instance.forceContextLoss())),u.value.__tres={root:e,objects:[],isUnmounting:!0}},v=L(wT({scene:u.value,canvas:a.canvas,fpsLimit:()=>a.fpsLimit??1/0,windowSize:a.windowSize??!1,rendererOptions:a}));t({context:v,dispose:()=>_(v.value,!0)});let y=()=>{let e=LT(a.canvas);e&&((e=>zw(e)&&`__tres`in e)(u.value)&&(u.value.__tres.isUnmounting=!0),e.renderer.render(null,u.value),_(v.value),zT(a.canvas))},{camera:b,renderer:x}=v.value,{registerCamera:C,cameras:T,activeCamera:E,deregisterCamera:O}=b,A=()=>{let e=new Td(45,window.innerWidth/window.innerHeight,.1,1e3);e.position.set(3,3,3),e.lookAt(0,0,0),C(e);let t=g(()=>{T.value.length>=2&&(e.removeFromParent(),O(e),t?.())})};return v.value.events.onPointerMissed(e=>{s(`pointermissed`,e)}),c(()=>a.camera,(e,t)=>{e&&C(o(e),!0),t&&(o(t).removeFromParent(),O(o(t)))},{immediate:!0}),x.onRender(()=>{v.value&&s(`render`,v.value)}),x.loop.onLoop(e=>{v.value&&s(`loop`,{...v.value,...e})}),x.loop.onBeforeLoop(e=>{v.value&&s(`beforeLoop`,{...v.value,...e})}),x.onReady(()=>{h(v.value),s(`ready`,v.value),E.value||A()}),x.onError(e=>{s(`error`,e)}),S(async()=>{await Vv(3e3),(!v.value.sizes.width||!v.value.sizes.height.value)&&console.warn(`TresCanvas: The canvas has no area, so nothing can be rendered. Set it manually on the parent element or use the prop windowSize.`)}),w(y),()=>{}}}),sE=[`data-scene`,`data-tres`],cE=k({__name:`TresCanvas`,props:{camera:{type:null,required:!1},windowSize:{type:Boolean,required:!1,default:void 0},fpsLimit:{type:Number,required:!1},enableProvideBridge:{type:Boolean,required:!1,default:!0},customRendererOptions:{type:Object,required:!1},antialias:{type:Boolean,required:!1,default:!0},stencil:{type:Boolean,required:!1,default:void 0},depth:{type:Boolean,required:!1,default:void 0},precision:{type:String,required:!1},logarithmicDepthBuffer:{type:Boolean,required:!1,default:void 0},preserveDrawingBuffer:{type:Boolean,required:!1,default:void 0},powerPreference:{type:null,required:!1},alpha:{type:Boolean,required:!1,default:void 0},premultipliedAlpha:{type:Boolean,required:!1},failIfMajorPerformanceCaveat:{type:Boolean,required:!1,default:void 0},clearColor:{type:[Object,String,Number],required:!1,default:`#000000`},clearAlpha:{type:Number,required:!1,default:1},shadows:{type:Boolean,required:!1,default:void 0},toneMapping:{type:null,required:!1,default:4},shadowMapType:{type:null,required:!1,default:2},useLegacyLights:{type:Boolean,required:!1,default:void 0},outputColorSpace:{type:null,required:!1},toneMappingExposure:{type:Number,required:!1},renderMode:{type:String,required:!1,default:`always`},dpr:{type:[Number,Array],required:!1},renderer:{type:Function,required:!1}},emits:[`ready`,`error`,`pointermissed`,`render`,`beforeLoop`,`loop`,`click`,`contextmenu`,`pointermove`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`,`dblclick`,`pointerdown`,`pointerup`,`pointercancel`,`lostpointercapture`,`wheel`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=I(),o=L();return t({get context(){return o.value?.context},dispose:()=>o.value?.dispose()}),(t,n)=>(j(),b(`canvas`,{ref_key:`canvasRef`,ref:a,"data-scene":o.value?.context?.scene.value.uuid,class:m(t.$attrs.class),"data-tres":`tresjs ${p(Cw)}`,style:te({display:`block`,width:`100%`,height:`100%`,position:e.windowSize?`fixed`:`relative`,top:0,left:0,pointerEvents:`auto`,touchAction:`none`,...t.$attrs.style})},[a.value?(j(),F(oE,C({key:0,ref_key:`contextRef`,ref:o,canvas:a.value},r,{onReady:n[0]||=e=>i(`ready`,e),onError:n[1]||=e=>i(`error`,e),onPointermissed:n[2]||=e=>i(`pointermissed`,e),onRender:n[3]||=e=>i(`render`,e),onBeforeLoop:n[4]||=e=>i(`beforeLoop`,e),onLoop:n[5]||=e=>i(`loop`,e),onClick:n[6]||=e=>i(`click`,e),onContextmenu:n[7]||=e=>i(`contextmenu`,e),onPointermove:n[8]||=e=>i(`pointermove`,e),onPointerenter:n[9]||=e=>i(`pointerenter`,e),onPointerleave:n[10]||=e=>i(`pointerleave`,e),onPointerover:n[11]||=e=>i(`pointerover`,e),onPointerout:n[12]||=e=>i(`pointerout`,e),onDblclick:n[13]||=e=>i(`dblclick`,e),onPointerdown:n[14]||=e=>i(`pointerdown`,e),onPointerup:n[15]||=e=>i(`pointerup`,e),onPointercancel:n[16]||=e=>i(`pointercancel`,e),onLostpointercapture:n[17]||=e=>i(`lostpointercapture`,e),onWheel:n[18]||=e=>i(`wheel`,e)}),{default:P(()=>[ie(t.$slots,`default`)]),_:3},16,[`canvas`])):ae(`v-if`,!0)],14,sE))}}),lE=new WeakMap,uE=class extends td{constructor(e){super(e),this.decoderPath=``,this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=``,this.defaultAttributeIDs={position:`POSITION`,normal:`NORMAL`,color:`COLOR`,uv:`TEX_COORD`},this.defaultAttributeTypes={position:`Float32Array`,normal:`Float32Array`,color:`Float32Array`,uv:`Float32Array`}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){let i=new id(this.manager);i.setPath(this.path),i.setResponseType(`arraybuffer`),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>{this.parse(e,t,r)},n,r)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,hn,n).catch(n)}decodeDracoFile(e,t,n,r,i=gn,a=()=>{}){let o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:i};
vendor: 9,635 bytes, lines 4127-4128
4127return this.decodeGeometry(e,o).then(t).catch(a)}decodeGeometry(e,t){let n=JSON.stringify(t);if(lE.has(e)){let t=lE.get(e);if(t.key===n)return t.promise;if(e.byteLength===0)throw Error(`THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.`)}let r,i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(n=>(r=n,new Promise((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:`decode`,id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),lE.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new Ua;e.index&&t.setIndex(new Ca(e.index.array,1));for(let n=0;n<e.attributes.length;n++){let{name:r,array:i,itemSize:a,stride:o,vertexColorSpace:s}=e.attributes[n],c;c=a===o?new Ca(i,a):new Ka(new Wa(i,o),a,0),r===`color`&&(this._assignVertexColorSpace(c,s),c.normalized=!(i instanceof Float32Array)),t.setAttribute(r,c)}return t}_assignVertexColorSpace(e,t){if(t!==`srgb`)return;let n=new q;for(let t=0,r=e.count;t<r;t++)n.fromBufferAttribute(e,t),Rr.colorSpaceToWorking(n,hn),e.setXYZ(t,n.r,n.g,n.b)}_loadLibrary(e,t){let n=new id(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((t,r)=>{n.load(e,t,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!=`object`||this.decoderConfig.type===`js`,t=[];return e?t.push(this._loadLibrary(`draco_decoder.js`,`text`)):(t.push(this._loadLibrary(`draco_wasm_wrapper.js`,`text`)),t.push(this._loadLibrary(`draco_decoder.wasm`,`arraybuffer`))),this.decoderPending=Promise.all(t).then(t=>{let n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let r=dE.toString(),i=[`/* draco decoder */`,n,``,`/* worker */`,r.substring(r.indexOf(`{`)+1,r.lastIndexOf(`}`))].join(`
4128`);this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:`init`,decoderConfig:this.decoderConfig}),e.onmessage=function(t){let n=t.data;switch(n.type){case`decode`:e._callbacks[n.id].resolve(n);break;case`error`:e._callbacks[n.id].reject(n);break;default:console.error(`THREE.DRACOLoader: Unexpected message, "`+n.type+`"`)}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log(`Task load: `,this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==``&&URL.revokeObjectURL(this.workerSourceURL),this}};function dE(){let e,t;onmessage=function(r){let i=r.data;switch(i.type){case`init`:e=i.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case`decode`:let r=i.buffer,a=i.taskConfig;t.then(e=>{let t=e.draco,o=new t.Decoder;try{let e=n(t,o,new Int8Array(r),a),s=e.attributes.map(e=>e.array.buffer);e.index&&s.push(e.index.array.buffer),self.postMessage({type:`decode`,id:i.id,geometry:e},s)}catch(e){console.error(e),self.postMessage({type:`error`,id:i.id,error:e.message})}finally{t.destroy(o)}})}};function n(e,t,n,a){let o=a.attributeIDs,s=a.attributeTypes,c,l,u=t.GetEncodedGeometryType(n);if(u===e.TRIANGULAR_MESH)c=new e.Mesh,l=t.DecodeArrayToMesh(n,n.byteLength,c);else if(u===e.POINT_CLOUD)c=new e.PointCloud,l=t.DecodeArrayToPointCloud(n,n.byteLength,c);else throw Error(`THREE.DRACOLoader: Unexpected geometry type.`);if(!l.ok()||c.ptr===0)throw Error(`THREE.DRACOLoader: Decoding failed: `+l.error_msg());let d={index:null,attributes:[]};for(let n in o){let r=self[s[n]],l,u;if(a.useUniqueIDs)u=o[n],l=t.GetAttributeByUniqueId(c,u);else{if(u=t.GetAttributeId(c,e[o[n]]),u===-1)continue;l=t.GetAttribute(c,u)}let f=i(e,t,c,n,r,l);n===`color`&&(f.vertexColorSpace=a.vertexColorSpace),d.attributes.push(f)}return u===e.TRIANGULAR_MESH&&(d.index=r(e,t,c)),e.destroy(c),d}function r(e,t,n){let r=n.num_faces()*3,i=r*4,a=e._malloc(i);t.GetTrianglesUInt32Array(n,i,a);let o=new Uint32Array(e.HEAPF32.buffer,a,r).slice();return e._free(a),{array:o,itemSize:1}}function i(e,t,n,r,i,o){let s=n.num_points(),c=o.num_components(),l=a(e,i),u=c*i.BYTES_PER_ELEMENT,d=Math.ceil(u/4)*4,f=d/i.BYTES_PER_ELEMENT,p=s*u,m=s*d,h=e._malloc(p);t.GetAttributeDataArrayForAllPoints(n,o,l,p,h);let g=new i(e.HEAPF32.buffer,h,p/i.BYTES_PER_ELEMENT),_;if(u===d)_=g.slice();else{_=new i(m/i.BYTES_PER_ELEMENT);let e=0;for(let t=0,n=g.length;t<n;t++){for(let n=0;n<c;n++)_[e+n]=g[t*c+n];e+=f}}return e._free(h),{name:r,count:s,itemSize:c,array:_,stride:f}}function a(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}}function fE(e,t){if(t===0)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),e;if(t===2||t===1){let n=e.getIndex();if(n===null){let t=[],r=e.getAttribute(`position`);if(r!==void 0){for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}else return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.`),e}let r=n.count-2,i=[];if(t===2)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.`);let a=e.clone();return a.setIndex(i),a.clearGroups(),a}return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:`,t),e}function pE(e){let t=new Map,n=new Map,r=e.clone();return mE(e,r,function(e,r){t.set(r,e),n.set(e,r)}),r.traverse(function(e){if(!e.isSkinnedMesh)return;let r=e,i=t.get(e),a=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=a.map(function(e){return n.get(e)}),r.bind(r.skeleton,r.bindMatrix)}),r}function mE(e,t,n){n(e,t);for(let r=0;r<e.children.length;r++)mE(e.children[r],t.children[r],n)}var hE=class extends td{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new SE(e)}),this.register(function(e){return new CE(e)}),this.register(function(e){return new ME(e)}),this.register(function(e){return new NE(e)}),this.register(function(e){return new PE(e)}),this.register(function(e){return new TE(e)}),this.register(function(e){return new EE(e)}),this.register(function(e){return new DE(e)}),this.register(function(e){return new OE(e)}),this.register(function(e){return new xE(e)}),this.register(function(e){return new kE(e)}),this.register(function(e){return new wE(e)}),this.register(function(e){return new jE(e)}),this.register(function(e){return new AE(e)}),this.register(function(e){return new yE(e)}),this.register(function(e){return new FE(e,vE.EXT_MESHOPT_COMPRESSION)}),this.register(function(e){return new FE(e,vE.KHR_MESHOPT_COMPRESSION)}),this.register(function(e){return new IE(e)})}load(e,t,n,r){let i=this,a;if(this.resourcePath!==``)a=this.resourcePath;else if(this.path!==``){let t=Rd.extractUrlBase(e);a=Rd.resolveURL(t,this.path)}else a=Rd.extractUrlBase(e);this.manager.itemStart(e);let o=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},s=new id(this.manager);s.setPath(this.path),s.setResponseType(`arraybuffer`),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(n){try{i.parse(n,a,function(n){t(n),i.manager.itemEnd(e)},o)}catch(e){o(e)}},n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i,a={},o={},s=new TextDecoder;if(typeof e==`string`)i=JSON.parse(e);else if(e instanceof ArrayBuffer){if(s.decode(new Uint8Array(e,0,4))===LE){try{a[vE.KHR_BINARY_GLTF]=new BE(e)}catch(e){r&&r(e);return}i=JSON.parse(a[vE.KHR_BINARY_GLTF].content)}else i=JSON.parse(s.decode(e))}else i=e;if(i.asset===void 0||i.asset.version[0]<2){r&&r(Error(`THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.`));return}let c=new fD(i,{path:t||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](c);t.name||console.error(`THREE.GLTFLoader: Invalid plugin found: missing name`),o[t.name]=t,a[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){let t=i.extensionsUsed[e],n=i.extensionsRequired||[];
4128switch(t){case vE.KHR_MATERIALS_UNLIT:a[t]=new bE;break;case vE.KHR_DRACO_MESH_COMPRESSION:a[t]=new VE(i,this.dracoLoader);break;case vE.KHR_TEXTURE_TRANSFORM:a[t]=new HE;break;case vE.KHR_MESH_QUANTIZATION:a[t]=new UE;break;default:n.indexOf(t)>=0&&o[t]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+t+`".`)}}c.setExtensions(a),c.setPlugins(o),c.parse(n,r)}parseAsync(e,t){let n=this;return new Promise(function(r,i){n.parse(e,t,r,i)})}};function gE(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}function _E(e,t,n){let r=e.json.materials[t];return r.extensions&&r.extensions[n]?r.extensions[n]:null}var vE={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,KHR_MESHOPT_COMPRESSION:`KHR_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`},yE=class{constructor(e){this.parser=e,this.name=vE.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t=this.parser,n=`light:`+e,r=t.cache.get(n);if(r)return r;let i=t.json,a=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e],o,s=new q(16777215);a.color!==void 0&&s.setRGB(a.color[0],a.color[1],a.color[2],gn);let c=a.range===void 0?0:a.range;switch(a.type){case`directional`:o=new Md(s),o.target.position.set(0,0,-1),o.add(o.target);break;case`point`:o=new kd(s),o.distance=c;break;case`spot`:o=new Dd(s),o.distance=c,a.spot=a.spot||{},a.spot.innerConeAngle=a.spot.innerConeAngle===void 0?0:a.spot.innerConeAngle,a.spot.outerConeAngle=a.spot.outerConeAngle===void 0?Math.PI/4:a.spot.outerConeAngle,o.angle=a.spot.outerConeAngle,o.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw Error(`THREE.GLTFLoader: Unexpected light type: `+a.type)}return o.position.set(0,0,0),iD(o,a),a.intensity!==void 0&&(o.intensity=a.intensity),o.name=t.createUniqueName(a.name||`light_`+e),r=Promise.resolve(o),t.cache.add(n,r),r}getDependency(e,t){if(e===`light`)return this._loadLight(t)}createNodeAttachment(e){let t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return i===void 0?null:this._loadLight(i).then(function(e){return n._getNodeRef(t.cache,i,e)})}},bE=class{constructor(){this.name=vE.KHR_MATERIALS_UNLIT}getMaterialType(){return Co}extendParams(e,t,n){let r=[];e.color=new q(1,1,1),e.opacity=1;let i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){let t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],gn),e.opacity=t[3]}i.baseColorTexture!==void 0&&r.push(n.assignTexture(e,`map`,i.baseColorTexture,hn))}return Promise.all(r)}},xE=class{constructor(e){this.parser=e,this.name=vE.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);return n===null||n.emissiveStrength!==void 0&&(t.emissiveIntensity=n.emissiveStrength),Promise.resolve()}},SE=class{constructor(e){this.parser=e,this.name=vE.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){return _E(this.parser,e,this.name)===null?null:yu}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(n.clearcoatFactor!==void 0&&(t.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatMap`,n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatRoughnessMap`,n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(r.push(this.parser.assignTexture(t,`clearcoatNormalMap`,n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){let e=n.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new W(e,e)}return Promise.all(r)}},CE=class{constructor(e){this.parser=e,this.name=vE.KHR_MATERIALS_DISPERSION}getMaterialType(e){return _E(this.parser,e,this.name)===null?null:yu}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);return n===null||(t.dispersion=n.dispersion===void 0?0:n.dispersion),Promise.resolve()}},wE=class{constructor(e){this.parser=e,this.name=vE.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){return _E(this.parser,e,this.name)===null?null:yu}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.iridescenceFactor!==void 0&&(t.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceMap`,n.iridescenceTexture)),n.iridescenceIor!==void 0&&(t.iridescenceIOR=n.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceThicknessMap`,n.iridescenceThicknessTexture)),Promise.all(r)}},TE=class{constructor(e){this.parser=e,this.name=vE.KHR_MATERIALS_SHEEN}getMaterialType(e){return _E(this.parser,e,this.name)===null?null:yu}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(t.sheenColor=new q(0,0,0),t.sheenRoughness=0,t.sheen=1,n.sheenColorFactor!==void 0){let e=n.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],gn)}return n.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenColorMap`,n.sheenColorTexture,hn)),n.sheenRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenRoughnessMap`,n.sheenRoughnessTexture)),Promise.all(r)}},EE=class{constructor(e){this.parser=e,this.name=vE.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){return _E(this.parser,e,this.name)===null?null:yu}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.transmissionFactor!==void 0&&(t.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&r.push(this.parser.assignTexture(t,`transmissionMap`,n.transmissionTexture)),Promise.all(r)}},DE=class{constructor(e){this.parser=e,this.name=vE.KHR_MATERIALS_VOLUME}getMaterialType(e){return _E(this.parser,e,this.name)===null?null:yu}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.thickness=n.thicknessFactor===void 0?0:n.thicknessFactor,n.thicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`thicknessMap`,n.thicknessTexture)),t.attenuationDistance=n.attenuationDistance||1/0;let i=n.attenuationColor||[1,1,1];
4128return t.attenuationColor=new q().setRGB(i[0],i[1],i[2],gn),Promise.all(r)}},OE=class{constructor(e){this.parser=e,this.name=vE.KHR_MATERIALS_IOR}getMaterialType(e){return _E(this.parser,e,this.name)===null?null:yu}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);return n===null?Promise.resolve():(t.ior=n.ior===void 0?1.5:n.ior,t.ior===0&&(t.ior=1e3),Promise.resolve())}},kE=class{constructor(e){this.parser=e,this.name=vE.KHR_MATERIALS_SPECULAR}getMaterialType(e){return _E(this.parser,e,this.name)===null?null:yu}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.specularIntensity=n.specularFactor===void 0?1:n.specularFactor,n.specularTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularIntensityMap`,n.specularTexture));let i=n.specularColorFactor||[1,1,1];return t.specularColor=new q().setRGB(i[0],i[1],i[2],gn),n.specularColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularColorMap`,n.specularColorTexture,hn)),Promise.all(r)}},AE=class{constructor(e){this.parser=e,this.name=vE.EXT_MATERIALS_BUMP}getMaterialType(e){return _E(this.parser,e,this.name)===null?null:yu}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return t.bumpScale=n.bumpFactor===void 0?1:n.bumpFactor,n.bumpTexture!==void 0&&r.push(this.parser.assignTexture(t,`bumpMap`,n.bumpTexture)),Promise.all(r)}},jE=class{constructor(e){this.parser=e,this.name=vE.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){return _E(this.parser,e,this.name)===null?null:yu}extendMaterialParams(e,t){let n=_E(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.anisotropyStrength!==void 0&&(t.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(t.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&r.push(this.parser.assignTexture(t,`anisotropyMap`,n.anisotropyTexture)),Promise.all(r)}},ME=class{constructor(e){this.parser=e,this.name=vE.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let i=r.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return t.loadTextureImage(e,i.source,a)}},NE=class{constructor(e){this.parser=e,this.name=vE.EXT_TEXTURE_WEBP}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},PE=class{constructor(e){this.parser=e,this.name=vE.EXT_TEXTURE_AVIF}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},FE=class{constructor(e,t){this.name=t,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let e=n.extensions[this.name],r=this.parser.getDependency(`buffer`,e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}return null}},IE=class{constructor(e){this.name=vE.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let r=t.meshes[n.mesh];for(let e of r.primitives)if(e.mode!==qE.TRIANGLES&&e.mode!==qE.TRIANGLE_STRIP&&e.mode!==qE.TRIANGLE_FAN&&e.mode!==void 0)return null;let i=n.extensions[this.name].attributes,a=[],o={};for(let e in i)a.push(this.parser.getDependency(`accessor`,i[e]).then(t=>(o[e]=t,o[e])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new K,n=new G,a=new Ar,s=new G(1,1,1),c=new ss(e.geometry,e.material,r);for(let e=0;e<r;e++)o.TRANSLATION&&n.fromBufferAttribute(o.TRANSLATION,e),o.ROTATION&&a.fromBufferAttribute(o.ROTATION,e),o.SCALE&&s.fromBufferAttribute(o.SCALE,e),
vendor: 24,360 bytes, line 4128
4128c.setMatrixAt(e,t.compose(n,a,s));for(let t in o)if(t===`_COLOR_0`){let e=o[t];c.instanceColor=new $o(e.array,e.itemSize,e.normalized)}else t!==`TRANSLATION`&&t!==`ROTATION`&&t!==`SCALE`&&e.geometry.setAttribute(t,o[t]);Oi.prototype.copy.call(c,e),this.parser.assignFinalMaterial(c),i.push(c)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]}))}},LE=`glTF`,RE=12,zE={JSON:1313821514,BIN:5130562},BE=class{constructor(e){this.name=vE.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,RE),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==LE)throw Error(`THREE.GLTFLoader: Unsupported glTF-Binary header.`);if(this.header.version<2)throw Error(`THREE.GLTFLoader: Legacy binary file detected.`);let r=this.header.length-RE,i=new DataView(e,RE),a=0;for(;a<r;){let t=i.getUint32(a,!0);a+=4;let r=i.getUint32(a,!0);if(a+=4,r===zE.JSON){let r=new Uint8Array(e,RE+a,t);this.content=n.decode(r)}else if(r===zE.BIN){let n=RE+a;this.body=e.slice(n,n+t)}a+=t}if(this.content===null)throw Error(`THREE.GLTFLoader: JSON content not found.`)}},VE=class{constructor(e,t){if(!t)throw Error(`THREE.GLTFLoader: No DRACOLoader instance provided.`);this.name=vE.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},c={};for(let e in a){let t=QE[e]||e.toLowerCase();o[t]=a[e]}for(let t in e.attributes){let r=QE[t]||t.toLowerCase();if(a[t]!==void 0){let i=n.accessors[e.attributes[t]];c[r]=JE[i.componentType].name,s[r]=i.normalized===!0}}return t.getDependency(`bufferView`,i).then(function(e){return new Promise(function(t,n){r.decodeDracoFile(e,function(e){for(let t in e.attributes){let n=e.attributes[t],r=s[t];r!==void 0&&(n.normalized=r)}t(e)},o,c,gn,n)})})}},HE=class{constructor(){this.name=vE.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0?e:(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e)}},UE=class{constructor(){this.name=vE.KHR_MESH_QUANTIZATION}},WE=class extends Fu{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=o*2,c=o*3,l=r-t,u=(n-t)/l,d=u*u,f=d*u,p=e*c,m=p-c,h=-2*f+3*d,g=f-d,_=1-h,v=g-d+u;for(let e=0;e!==o;e++){let t=a[m+e+o],n=a[m+e+s]*l,r=a[p+e+o],c=a[p+e]*l;i[e]=_*t+v*n+h*r+g*c}return i}},GE=new Ar,KE=class extends WE{interpolate_(e,t,n,r){let i=super.interpolate_(e,t,n,r);return GE.fromArray(i).normalize().toArray(i),i}},qE={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},JE={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},YE={9728:Ie,9729:Ve,9984:Le,9985:He,9986:ze,9987:We},XE={33071:Pe,33648:Fe,10497:Ne},ZE={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},QE={POSITION:`position`,NORMAL:`normal`,TANGENT:`tangent`,TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`,COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},$E={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},eD={CUBICSPLINE:void 0,LINEAR:nn,STEP:tn},tD={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`};function nD(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new vu({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),e.DefaultMaterial}function rD(e,t,n){for(let r in n.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function iD(e,t){t.extras!==void 0&&(typeof t.extras==`object`?Object.assign(e.userData,t.extras):console.warn(`THREE.GLTFLoader: Ignoring primitive type .extras, `+t.extras))}function aD(e,t,n){let r=!1,i=!1,a=!1;for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n.POSITION!==void 0&&(r=!0),n.NORMAL!==void 0&&(i=!0),n.COLOR_0!==void 0&&(a=!0),r&&i&&a)break}if(!r&&!i&&!a)return Promise.resolve(e);let o=[],s=[],c=[];for(let l=0,u=t.length;l<u;l++){let u=t[l];if(r){let t=u.POSITION===void 0?e.attributes.position:n.getDependency(`accessor`,u.POSITION);o.push(t)}if(i){let t=u.NORMAL===void 0?e.attributes.normal:n.getDependency(`accessor`,u.NORMAL);s.push(t)}if(a){let t=u.COLOR_0===void 0?e.attributes.color:n.getDependency(`accessor`,u.COLOR_0);c.push(t)}}return Promise.all([Promise.all(o),Promise.all(s),Promise.all(c)]).then(function(t){let n=t[0],o=t[1],s=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=o),a&&(e.morphAttributes.color=s),e.morphTargetsRelative=!0,e})}function oD(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){let n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn(`THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.`)}}function sD(e){let t,n=e.extensions&&e.extensions[vE.KHR_DRACO_MESH_COMPRESSION];if(t=n?`draco:`+n.bufferView+`:`+n.indices+`:`+cD(n.attributes):e.indices+`:`+cD(e.attributes)+`:`+e.mode,e.targets!==void 0)for(let n=0,r=e.targets.length;n<r;n++)t+=`:`+cD(e.targets[n]);return t}function cD(e){let t=``,n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+`:`+e[n[r]]+`;`;return t}function lD(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error(`THREE.GLTFLoader: Unsupported normalized accessor component type.`)}}function uD(e){return e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0?`image/jpeg`:e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?`image/webp`:e.search(/\.ktx2($|\?)/i)>0||e.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}var dD=new K,fD=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new gE,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=-1,i=!1,a=-1;if(typeof navigator<`u`&&navigator.userAgent!==void 0){let e=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(e)===!0;let t=e.match(/Version\/(\d+)/);r=n&&t?parseInt(t[1],10):-1,i=e.indexOf(`Firefox`)>-1,a=i?e.match(/Firefox\/([0-9]+)\./)[1]:-1}this.textureLoader=typeof createImageBitmap>`u`||n&&r<17||i&&a<98?new dd(this.options.manager):new qd(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new id(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([n.getDependencies(`scene`),n.getDependencies(`animation`),n.getDependencies(`camera`)])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return rD(i,a,r),iD(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){let r=e[t];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(n[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;let r=n.clone(),i=(e,t)=>{let n=this.associations.get(e);n!=null&&this.associations.set(t,n);for(let[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+=`_instance_`+e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){let r=e(t[n]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let n=[];for(let r=0;r<t.length;r++){let i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){let n=e+`:`+t,r=this.cache.get(n);if(!r){switch(e){case`scene`:r=this.loadScene(t);break;case`node`:r=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case`mesh`:r=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case`accessor`:r=this.loadAccessor(t);break;case`bufferView`:r=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case`buffer`:r=this.loadBuffer(t);break;case`material`:r=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case`texture`:r=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case`skin`:r=this.loadSkin(t);break;case`animation`:r=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case`camera`:r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!r)throw Error(`Unknown type: `+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let n=this,r=this.json[e+(e===`mesh`?`es`:`s`)]||[];t=Promise.all(r.map(function(t,r){return n.getDependency(e,r)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!==`arraybuffer`)throw Error(`THREE.GLTFLoader: `+t.type+` buffer type is not supported.`);if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[vE.KHR_BINARY_GLTF].body);let r=this.options;return new Promise(function(e,i){n.load(Rd.resolveURL(t.uri,r.path),e,void 0,function(){i(Error(`THREE.GLTFLoader: Failed to load buffer "`+t.uri+`".`))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency(`buffer`,t.buffer).then(function(e){let n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)})}loadAccessor(e){let t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){let e=ZE[r.type],t=JE[r.componentType],n=r.normalized===!0,i=new t(r.count*e);return Promise.resolve(new Ca(i,e,n))}let i=[];return r.bufferView===void 0?i.push(null):i.push(this.getDependency(`bufferView`,r.bufferView)),r.sparse!==void 0&&(i.push(this.getDependency(`bufferView`,r.sparse.indices.bufferView)),i.push(this.getDependency(`bufferView`,r.sparse.values.bufferView))),Promise.all(i).then(function(e){let i=e[0],a=ZE[r.type],o=JE[r.componentType],s=o.BYTES_PER_ELEMENT,c=s*a,l=r.byteOffset||0,u=r.bufferView===void 0?void 0:n.bufferViews[r.bufferView].byteStride,d=r.normalized===!0,f,p;if(u&&u!==c){let e=Math.floor(l/u),n=`InterleavedBuffer:`+r.bufferView+`:`+r.componentType+`:`+e+`:`+r.count,c=t.cache.get(n);c||(f=new o(i,e*u,r.count*u/s),c=new Wa(f,u/s),t.cache.add(n,c)),p=new Ka(c,a,l%u/s,d)}else f=i===null?new o(r.count*a):new o(i,l,r.count*a),p=new Ca(f,a,d);if(r.sparse!==void 0){let t=ZE.SCALAR,n=JE[r.sparse.indices.componentType],s=r.sparse.indices.byteOffset||0,c=r.sparse.values.byteOffset||0,l=new n(e[1],s,r.sparse.count*t),u=new o(e[2],c,r.sparse.count*a);i!==null&&(p=new Ca(p.array.slice(),p.itemSize,p.normalized)),p.normalized=!1;for(let e=0,t=l.length;e<t;e++){let t=l[e];if(p.setX(t,u[e*a]),a>=2&&p.setY(t,u[e*a+1]),a>=3&&p.setZ(t,u[e*a+2]),a>=4&&p.setW(t,u[e*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}p.normalized=d}return p})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);e!==null&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+`:`+a.sampler;if(this.textureCache[s])return this.textureCache[s];let c=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||``,t.name===``&&typeof o.uri==`string`&&o.uri.startsWith(`data:image/`)===!1&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=YE[n.magFilter]||1006,t.minFilter=YE[n.minFilter]||1008,t.wrapS=XE[n.wrapS]||1e3,t.wrapT=XE[n.wrapT]||1e3,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==1003&&t.minFilter!==1006,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=c,c}loadImageSource(e,t){let n=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(e=>e.clone());let a=r.images[e],o=self.URL||self.webkitURL,s=a.uri||``,c=!1;if(a.bufferView!==void 0)s=n.getDependency(`bufferView`,a.bufferView).then(function(e){c=!0;let t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s});else if(a.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+e+` is missing URI and bufferView`);let l=Promise.resolve(s).then(function(e){return new Promise(function(n,r){let a=n;t.isImageBitmapLoader===!0&&(a=function(e){let t=new Jr(e);t.needsUpdate=!0,n(t)}),t.load(Rd.resolveURL(e,i.path),a,void 0,r)})}).then(function(e){return c===!0&&o.revokeObjectURL(s),iD(e,a),e.userData.mimeType=a.mimeType||uD(a.uri),e}).catch(function(e){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,s),e});return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){let i=this;return this.getDependency(`texture`,n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[vE.KHR_TEXTURE_TRANSFORM]){let e=n.extensions===void 0?void 0:n.extensions[vE.KHR_TEXTURE_TRANSFORM];if(e){let t=i.associations.get(a);a=i.extensions[vE.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return r!==void 0&&(a.colorSpace=r),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){let e=`PointsMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new Qs,Ja.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e=`LineBasicMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new Rs,Ja.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e=`ClonedMaterial:`+n.uuid+`:`;r&&(e+=`derivative-tangents:`),i&&(e+=`vertex-colors:`),a&&(e+=`flat-shading:`);let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return vu}loadMaterial(e){let t=this,n=this.json,r=this.extensions,i=n.materials[e],a,o={},s=i.extensions||{},c=[];if(s[vE.KHR_MATERIALS_UNLIT]){let e=r[vE.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,i,t))}else{let n=i.pbrMetallicRoughness||{};if(o.color=new q(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],gn),o.opacity=e[3]}n.baseColorTexture!==void 0&&c.push(t.assignTexture(o,`map`,n.baseColorTexture,hn)),o.metalness=n.metallicFactor===void 0?1:n.metallicFactor,o.roughness=n.roughnessFactor===void 0?1:n.roughnessFactor,n.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(o,`metalnessMap`,n.metallicRoughnessTexture)),c.push(t.assignTexture(o,`roughnessMap`,n.metallicRoughnessTexture))),a=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}i.doubleSided===!0&&(o.side=2);let l=i.alphaMode||tD.OPAQUE;if(l===tD.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===tD.MASK&&(o.alphaTest=i.alphaCutoff===void 0?.5:i.alphaCutoff)),i.normalTexture!==void 0&&a!==Co&&(c.push(t.assignTexture(o,`normalMap`,i.normalTexture)),o.normalScale=new W(1,1),i.normalTexture.scale!==void 0)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(i.occlusionTexture!==void 0&&a!==Co&&(c.push(t.assignTexture(o,`aoMap`,i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==Co){let e=i.emissiveFactor;o.emissive=new q().setRGB(e[0],e[1],e[2],gn)}return i.emissiveTexture!==void 0&&a!==Co&&c.push(t.assignTexture(o,`emissiveMap`,i.emissiveTexture,hn)),Promise.all(c).then(function(){let n=new a(o);return i.name&&(n.name=i.name),iD(n,i),t.associations.set(n,{materials:e}),i.extensions&&rD(r,n,i),n})}createUniqueName(e){let t=Nf.sanitizeNodeName(e||``);return t in this.nodeNamesUsed?t+`_`+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[vE.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return mD(n,e,t)})}let a=[];for(let n=0,o=e.length;n<o;n++){let o=e[n],s=sD(o),c=r[s];if(c)a.push(c.promise);else{let e;e=o.extensions&&o.extensions[vE.KHR_DRACO_MESH_COMPRESSION]?i(o):mD(new Ua,o,t),r[s]={primitive:o,promise:e},a.push(e)}}return Promise.all(a)}loadMesh(e){let t=this,n=this.json,r=this.extensions,i=n.meshes[e],a=i.primitives,o=[];for(let e=0,t=a.length;e<t;e++){let t=a[e].material===void 0?nD(this.cache):this.getDependency(`material`,a[e].material);o.push(t)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(n){let o=n.slice(0,n.length-1),s=n[n.length-1],c=[];for(let n=0,l=s.length;n<l;n++){let l=s[n],u=a[n],d,f=o[n];if(u.mode===qE.TRIANGLES||u.mode===qE.TRIANGLE_STRIP||u.mode===qE.TRIANGLE_FAN||u.mode===void 0)d=i.isSkinnedMesh===!0?new qo(l,f):new Fo(l,f),d.isSkinnedMesh===!0&&d.normalizeSkinWeights(),u.mode===qE.TRIANGLE_STRIP?d.geometry=fE(d.geometry,1):u.mode===qE.TRIANGLE_FAN&&(d.geometry=fE(d.geometry,2));else if(u.mode===qE.LINES)d=new Xs(l,f);else if(u.mode===qE.LINE_STRIP)d=new Ks(l,f);else if(u.mode===qE.LINE_LOOP)d=new Zs(l,f);else if(u.mode===qE.POINTS)d=new rc(l,f);else throw Error(`THREE.GLTFLoader: Primitive mode unsupported: `+u.mode);Object.keys(d.geometry.morphAttributes).length>0&&oD(d,i),d.name=t.createUniqueName(i.name||`mesh_`+e),iD(d,i),u.extensions&&rD(r,d,u),t.assignFinalMaterial(d),c.push(d)}for(let n=0,r=c.length;n<r;n++)t.associations.set(c[n],{meshes:e,primitives:n});if(c.length===1)return i.extensions&&rD(r,c[0],i),c[0];let l=new ki;i.extensions&&rD(r,l,i),t.associations.set(l,{meshes:e});for(let e=0,t=c.length;e<t;e++)l.add(c[e]);return l})}loadCamera(e){let t,n=this.json.cameras[e],r=n[n.type];if(!r){console.warn(`THREE.GLTFLoader: Missing camera parameters.`);return}return n.type===`perspective`?t=new Td(kr.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type===`orthographic`&&(t=new Ad(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),iD(t,n),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],n=[];for(let e=0,r=t.joints.length;e<r;e++)n.push(this._loadNodeShallow(t.joints[e]));return t.inverseBindMatrices===void 0?n.push(null):n.push(this.getDependency(`accessor`,t.inverseBindMatrices)),Promise.all(n).then(function(e){let n=e.pop(),r=e,i=[],a=[];for(let e=0,o=r.length;e<o;e++){let o=r[e];if(o){i.push(o);let t=new K;n!==null&&t.fromArray(n.array,e*16),a.push(t)}else console.warn(`THREE.GLTFLoader: Joint "%s" could not be found.`,t.joints[e])}return new Qo(i,a)})}loadAnimation(e){let t=this.json,n=this,r=t.animations[e],i=r.name?r.name:`animation_`+e,a=[],o=[],s=[],c=[],l=[];for(let e=0,t=r.channels.length;e<t;e++){let t=r.channels[e],n=r.samplers[t.sampler],i=t.target,u=i.node,d=r.parameters===void 0?n.input:r.parameters[n.input],f=r.parameters===void 0?n.output:r.parameters[n.output];i.node!==void 0&&(a.push(this.getDependency(`node`,u)),o.push(this.getDependency(`accessor`,d)),s.push(this.getDependency(`accessor`,f)),c.push(n),l.push(i))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(s),Promise.all(c),Promise.all(l)]).then(function(e){let t=e[0],a=e[1],o=e[2],s=e[3],c=e[4],l=[];for(let e=0,r=t.length;e<r;e++){let r=t[e],i=a[e],u=o[e],d=s[e],f=c[e];if(r===void 0)continue;r.updateMatrix&&r.updateMatrix();let p=n._createAnimationTracks(r,i,u,d,f);if(p)for(let e=0;e<p.length;e++)l.push(p[e])}let u=new Ju(i,void 0,l);return iD(u,r),u})}createNodeMesh(e){let t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency(`mesh`,r.mesh).then(function(e){let t=n._getNodeRef(n.meshCache,r.mesh,e);return r.weights!==void 0&&t.traverse(function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]}),t})}loadNode(e){let t=this.json,n=this,r=t.nodes[e],i=n._loadNodeShallow(e),a=[],o=r.children||[];for(let e=0,t=o.length;e<t;e++)a.push(n.getDependency(`node`,o[e]));let s=r.skin===void 0?Promise.resolve(null):n.getDependency(`skin`,r.skin);return Promise.all([i,Promise.all(a),s]).then(function(e){let t=e[0],n=e[1],r=e[2];r!==null&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(r,dD)});for(let e=0,r=n.length;e<r;e++)t.add(n[e]);if(t.userData.pivot!==void 0&&n.length>0){let e=t.userData.pivot,r=n[0];t.pivot=new G().fromArray(e),t.position.x-=e[0],t.position.y-=e[1],t.position.z-=e[2],r.position.set(0,0,0),delete t.userData.pivot}return t})}_loadNodeShallow(e){let t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let i=t.nodes[e],a=i.name?r.createUniqueName(i.name):``,o=[],s=r._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return s&&o.push(s),i.camera!==void 0&&o.push(r.getDependency(`camera`,i.camera).then(function(e){return r._getNodeRef(r.cameraCache,i.camera,e)})),r._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if(o=i.isBone===!0?new Jo:t.length>1?new ki:t.length===1?t[0]:new Oi,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),iD(o,i),i.extensions&&rD(n,o,i),i.matrix!==void 0){let e=new K;e.fromArray(i.matrix),o.applyMatrix4(e)}else i.translation!==void 0&&o.position.fromArray(i.translation),i.rotation!==void 0&&o.quaternion.fromArray(i.rotation),i.scale!==void 0&&o.scale.fromArray(i.scale);if(!r.associations.has(o))r.associations.set(o,{});else if(i.mesh!==void 0&&r.meshCache.refs[i.mesh]>1){let e=r.associations.get(o);r.associations.set(o,{...e})}return r.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],r=this,i=new ki;n.name&&(i.name=r.createUniqueName(n.name)),iD(i,n),n.extensions&&rD(t,i,n);let a=n.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(r.getDependency(`node`,a[e]));return Promise.all(o).then(function(e){for(let t=0,n=e.length;t<n;t++){let n=e[t];n.parent===null?i.add(n):i.add(pE(n))}return r.associations=(e=>{let t=new Map;for(let[e,n]of r.associations)(e instanceof Ja||e instanceof Jr)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);n!=null&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a=[],o=e.name?e.name:e.uuid,s=[];function c(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)}
vendor: 2,440 bytes, line 4128
4128$E[i.path]===$E.weights?(c(e),e.isGroup&&e.children.forEach(c)):s.push(o);let l;switch($E[i.path]){case $E.weights:l=Uu;break;case $E.rotation:l=Gu;break;case $E.translation:case $E.scale:l=qu;break;default:switch(n.itemSize){case 1:l=Uu;break;default:l=qu}}let u=r.interpolation===void 0?nn:eD[r.interpolation],d=this._getArrayFromAccessor(n);for(let e=0,n=s.length;e<n;e++){let n=new l(s[e]+`.`+$E[i.path],t.array,d,u);r.interpolation===`CUBICSPLINE`&&this._createCubicSplineTrackInterpolant(n),a.push(n)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=lD(t.constructor),n=new Float32Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=t[r]*e;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof Gu?KE:WE)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};function pD(e,t,n){let r=t.attributes,i=new ea;if(r.POSITION!==void 0){let e=n.json.accessors[r.POSITION],t=e.min,a=e.max;if(t!==void 0&&a!==void 0){if(i.set(new G(t[0],t[1],t[2]),new G(a[0],a[1],a[2])),e.normalized){let t=lD(JE[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}else{console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`);return}}else return;let a=t.targets;if(a!==void 0){let e=new G,t=new G;for(let r=0,i=a.length;r<i;r++){let i=a[r];if(i.POSITION!==void 0){let r=n.json.accessors[i.POSITION],a=r.min,o=r.max;if(a!==void 0&&o!==void 0){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),r.normalized){let e=lD(JE[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`)}}i.expandByVector(e)}e.boundingBox=i;let o=new Fa;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}function mD(e,t,n){let r=t.attributes,i=[];function a(t,r){return n.getDependency(`accessor`,t).then(function(t){e.setAttribute(r,t)})}for(let t in r){let n=QE[t]||t.toLowerCase();n in e.attributes||i.push(a(r[t],n))}if(t.indices!==void 0&&!e.index){let r=n.getDependency(`accessor`,t.indices).then(function(t){e.setIndex(t)});i.push(r)}return Rr.workingColorSpace!==`srgb-linear`&&`COLOR_0`in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Rr.workingColorSpace}
4128" not supported.`),iD(e,t),pD(e,t,n),Promise.all(i).then(function(){return t.targets===void 0?e:aD(e,t.targets,n)})}e(((e,t)=>{(function(n){var r;typeof e==`object`?t.exports=n():typeof define==`function`&&define.amd?define(n):(typeof window<`u`?r=window:typeof global<`u`?r=global:typeof self<`u`&&(r=self),r.objectHash=n())})(function(){return function e(t,r,i){function a(s,c){if(!r[s]){if(!t[s]){var l=typeof n==`function`&&n;if(!c&&l)return l(s,!0);if(o)return o(s,!0);throw Error(`Cannot find module '`+s+`'`)}c=r[s]={exports:{}},t[s][0].call(c.exports,function(e){var n=t[s][1][e];return a(n||e)},c,c.exports,e,t,r,i)}return r[s].exports}for(var o=typeof n==`function`&&n,s=0;s<i.length;s++)a(i[s]);return a}({1:[function(e,t,n){(function(r,i,a,o,s,c,l,u,d){var f=e(`crypto`);function p(e,t){t=g(e,t);var n;return(n=t.algorithm===`passthrough`?new y:f.createHash(t.algorithm)).write===void 0&&(n.write=n.update,n.end=n.update),v(t,n).dispatch(e),n.update||n.end(``),n.digest?n.digest(t.encoding===`buffer`?void 0:t.encoding):(e=n.read(),t.encoding===`buffer`?e:e.toString(t.encoding))}(n=t.exports=p).sha1=function(e){return p(e)},n.keys=function(e){return p(e,{excludeValues:!0,algorithm:`sha1`,encoding:`hex`})},n.MD5=function(e){return p(e,{algorithm:`md5`,encoding:`hex`})},n.keysMD5=function(e){return p(e,{algorithm:`md5`,encoding:`hex`,excludeValues:!0})};var m=f.getHashes?f.getHashes().slice():[`sha1`,`md5`],h=(m.push(`passthrough`),[`buffer`,`hex`,`binary`,`base64`]);function g(e,t){var n={};if(n.algorithm=(t||={}).algorithm||`sha1`,n.encoding=t.encoding||`hex`,n.excludeValues=!!t.excludeValues,n.algorithm=n.algorithm.toLowerCase(),n.encoding=n.encoding.toLowerCase(),n.ignoreUnknown=!0===t.ignoreUnknown,n.respectType=!1!==t.respectType,n.respectFunctionNames=!1!==t.respectFunctionNames,n.respectFunctionProperties=!1!==t.respectFunctionProperties,n.unorderedArrays=!0===t.unorderedArrays,n.unorderedSets=!1!==t.unorderedSets,n.unorderedObjects=!1!==t.unorderedObjects,n.replacer=t.replacer||void 0,n.excludeKeys=t.excludeKeys||void 0,e===void 0)throw Error(`Object argument required.`);for(var r=0;r<m.length;++r)m[r].toLowerCase()===n.algorithm.toLowerCase()&&(n.algorithm=m[r]);if(m.indexOf(n.algorithm)===-1)throw Error(`Algorithm "`+n.algorithm+`"  not supported. supported values: `+m.join(`, `));if(h.indexOf(n.encoding)===-1&&n.algorithm!==`passthrough`)throw Error(`Encoding "`+n.encoding+`"  not supported. supported values: `+h.join(`, `));return n}function _(e){if(typeof e==`function`)return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e))!=null}function v(e,t,n){n||=[];function r(e){return t.update?t.update(e,`utf8`):t.write(e,`utf8`)}return{dispatch:function(t){return this[`_`+((t=e.replacer?e.replacer(t):t)===null?`null`:typeof t)](t)},_object:function(t){var i,o=Object.prototype.toString.call(t),s=/\[object (.*)\]/i.exec(o);if(s=(s=s?s[1]:`unknown:[`+o+`]`).toLowerCase(),0<=(o=n.indexOf(t)))return this.dispatch(`[CIRCULAR:`+o+`]`);if(n.push(t),a!==void 0&&a.isBuffer&&a.isBuffer(t))return r(`buffer:`),r(t);if(s===`object`||s===`function`||s===`asyncfunction`)return o=Object.keys(t),e.unorderedObjects&&(o=o.sort()),!1===e.respectType||_(t)||o.splice(0,0,`prototype`,`__proto__`,`constructor`),e.excludeKeys&&(o=o.filter(function(t){return!e.excludeKeys(t)})),r(`object:`+o.length+`:`),i=this,o.forEach(function(n){i.dispatch(n),r(`:`),e.excludeValues||i.dispatch(t[n]),r(`,`)});if(!this[`_`+s]){if(e.ignoreUnknown)return r(`[`+s+`]`);throw Error(`Unknown object type "`+s+`"`)}this[`_`+s](t)},_array:function(t,i){i=i===void 0?!1!==e.unorderedArrays:i;var a=this;if(r(`array:`+t.length+`:`),!i||t.length<=1)return t.forEach(function(e){return a.dispatch(e)});var o=[],i=t.map(function(t){var r=new y,i=n.slice();return v(e,r,i).dispatch(t),o=o.concat(i.slice(n.length)),r.read().toString()});return n=n.concat(o),i.sort(),this._array(i,!1)},_date:function(e){return r(`date:`+e.toJSON())},_symbol:function(e){return r(`symbol:`+e.toString())},_error:function(e){return r(`error:`+e.toString())},_boolean:function(e){return r(`bool:`+e.toString())}
4128,_string:function(e){r(`string:`+e.length+`:`),r(e.toString())},_function:function(t){r(`fn:`),_(t)?this.dispatch(`[native]`):this.dispatch(t.toString()),!1!==e.respectFunctionNames&&this.dispatch(`function-name:`+String(t.name)),e.respectFunctionProperties&&this._object(t)},_number:function(e){return r(`number:`+e.toString())},_xml:function(e){return r(`xml:`+e.toString())},_null:function(){return r(`Null`)},_undefined:function(){return r(`Undefined`)},_regexp:function(e){return r(`regex:`+e.toString())},_uint8array:function(e){return r(`uint8array:`),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return r(`uint8clampedarray:`),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return r(`int8array:`),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return r(`uint16array:`),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return r(`int16array:`),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return r(`uint32array:`),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return r(`int32array:`),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return r(`float32array:`),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return r(`float64array:`),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return r(`arraybuffer:`),this.dispatch(new Uint8Array(e))},_url:function(e){return r(`url:`+e.toString())},_map:function(t){return r(`map:`),t=Array.from(t),this._array(t,!1!==e.unorderedSets)},_set:function(t){return r(`set:`),t=Array.from(t),this._array(t,!1!==e.unorderedSets)},_file:function(e){return r(`file:`),this.dispatch([e.name,e.size,e.type,e.lastModfied])},_blob:function(){if(e.ignoreUnknown)return r(`[blob]`);throw Error(`Hashing Blob objects is currently not supported
4129(see https://github.com/puleos/object-hash/issues/26)
4130Use "options.replacer" or "options.ignoreUnknown"
4131`)},_domwindow:function(){return r(`domwindow`)},_bigint:function(e){return r(`bigint:`+e.toString())},_process:function(){return r(`process`)},_timer:function(){return r(`timer`)},_pipe:function(){return r(`pipe`)},_tcp:function(){return r(`tcp`)},_udp:function(){return r(`udp`)},_tty:function(){return r(`tty`)},_statwatcher:function(){return r(`statwatcher`)},_securecontext:function(){return r(`securecontext`)},_connection:function(){return r(`connection`)},_zlib:function(){return r(`zlib`)},_context:function(){return r(`context`)},_nodescript:function(){return r(`nodescript`)},_httpparser:function(){return r(`httpparser`)},_dataview:function(){return r(`dataview`)},_signal:function(){return r(`signal`)},_fsevent:function(){return r(`fsevent`)},_tlswrap:function(){return r(`tlswrap`)}}}function y(){return{buf:``,write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){return this.buf}}}n.writeToStream=function(e,t,n){return n===void 0&&(n=t,t={}),v(t=g(e,t),n).dispatch(e)}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/fake_9a5aa49d.js`,`/`)},{buffer:3,crypto:5,lYpoI2:11}],2:[function(e,t,n){(function(e,t,r,i,a,o,s,c,l){(function(e){var t=typeof Uint8Array<`u`?Uint8Array:Array,n=43,r=47,i=48,a=97,o=65,s=45,c=95;function l(e){return e=e.charCodeAt(0),e===n||e===s?62:e===r||e===c?63:e<i?-1:e<i+10?e-i+26+26:e<o+26?e-o:e<a+26?e-a+26:void 0}e.toByteArray=function(e){var n,r;if(0<e.length%4)throw Error(`Invalid string. Length must be a multiple of 4`);var i=e.length,i=e.charAt(i-2)===`=`?2:+(e.charAt(i-1)===`=`),a=new t(3*e.length/4-i),o=0<i?e.length-4:e.length,s=0;function c(e){a[s++]=e}for(n=0;n<o;n+=4)c((16711680&(r=l(e.charAt(n))<<18|l(e.charAt(n+1))<<12|l(e.charAt(n+2))<<6|l(e.charAt(n+3))))>>16),c((65280&r)>>8),c(255&r);return i==2?c(255&(r=l(e.charAt(n))<<2|l(e.charAt(n+1))>>4)):i==1&&(c((r=l(e.charAt(n))<<10|l(e.charAt(n+1))<<4|l(e.charAt(n+2))>>2)>>8&255),c(255&r)),a},e.fromByteArray=function(e){var t,n,r,i,a=e.length%3,o=``;function s(e){return`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
4131+/`.charAt(e)}for(t=0,r=e.length-a;t<r;t+=3)n=(e[t]<<16)+(e[t+1]<<8)+e[t+2],o+=s((i=n)>>18&63)+s(i>>12&63)+s(i>>6&63)+s(63&i);switch(a){case 1:o=(o+=s((n=e[e.length-1])>>2))+s(n<<4&63)+`==`;break;case 2:o=(o=(o+=s((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+s(n>>4&63))+s(n<<2&63)+`=`}return o}})(n===void 0?this.base64js={}:n)}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js`,`/node_modules/gulp-browserify/node_modules/base64-js/lib`)},{buffer:3,lYpoI2:11}],3:[function(e,t,n){(function(t,r,i,a,o,s,c,l,u){var d=e(`base64-js`),f=e(`ieee754`);function i(e,t,n){if(!(this instanceof i))return new i(e,t,n);var r,a,o,s,c=typeof e;if(t===`base64`&&c==`string`)for(e=(s=e).trim?s.trim():s.replace(/^\s+|\s+$/g,``);e.length%4!=0;)e+=`=`;if(c==`number`)r=A(e);else if(c==`string`)r=i.byteLength(e,t);else{if(c!=`object`)throw Error(`First argument needs to be a number, array or string.`);r=A(e.length)}if(i._useTypedArrays?a=i._augment(new Uint8Array(r)):((a=this).length=r,a._isBuffer=!0),i._useTypedArrays&&typeof e.byteLength==`number`)a._set(e);else if(j(s=e)||i.isBuffer(s)||s&&typeof s==`object`&&typeof s.length==`number`)for(o=0;o<r;o++)i.isBuffer(e)?a[o]=e.readUInt8(o):a[o]=e[o];else if(c==`string`)a.write(e,0,t);else if(c==`number`&&!i._useTypedArrays&&!n)for(o=0;o<r;o++)a[o]=0;return a}function p(e,t,n,r){return i._charsWritten=ee(function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function m(e,t,n,r){return i._charsWritten=ee(function(e){for(var t,n,r=[],i=0;i<e.length;i++)n=e.charCodeAt(i),t=n>>8,n%=256,r.push(n),r.push(t);return r}(t),e,n,r)}function h(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;i++)r+=String.fromCharCode(e[i]);return r}function g(e,t,n,r){r||(I(typeof n==`boolean`,`missing or invalid endian`),I(t!=null,`missing offset`),I(t+1<e.length,`Trying to read beyond buffer length`));var i,r=e.length;if(!(r<=t))return n?(i=e[t],t+1<r&&(i|=e[t+1]<<8)):(i=e[t]<<8,t+1<r&&(i|=e[t+1])),i}function _(e,t,n,r){r||(I(typeof n==`boolean`,`missing or invalid endian`),I(t!=null,`missing offset`),I(t+3<e.length,`Trying to read beyond buffer length`));var i,r=e.length;if(!(r<=t))return n?(t+2<r&&(i=e[t+2]<<16),t+1<r&&(i|=e[t+1]<<8),i|=e[t],t+3<r&&(i+=e[t+3]<<24>>>0)):(t+1<r&&(i=e[t+1]<<16),t+2<r&&(i|=e[t+2]<<8),t+3<r&&(i|=e[t+3]),i+=e[t]<<24>>>0),i}function v(e,t,n,r){if(r||(I(typeof n==`boolean`,`missing or invalid endian`),I(t!=null,`missing offset`),I(t+1<e.length,`Trying to read beyond buffer length`)),!(e.length<=t))return r=g(e,t,n,!0),32768&r?-1*(65535-r+1):r}function y(e,t,n,r){if(r||(I(typeof n==`boolean`,`missing or invalid endian`),I(t!=null,`missing offset`),I(t+3<e.length,`Trying to read beyond buffer length`)),!(e.length<=t))return r=_(e,t,n,!0),2147483648&r?-1*(4294967295-r+1):r}function b(e,t,n,r){return r||(I(typeof n==`boolean`,`missing or invalid endian`),I(t+3<e.length,`Trying to read beyond buffer length`)),f.read(e,t,n,23,4)}function x(e,t,n,r){return r||(I(typeof n==`boolean`,`missing or invalid endian`),I(t+7<e.length,`Trying to read beyond buffer length`)),f.read(e,t,n,52,8)}function S(e,t,n,r,i){if(i||(I(t!=null,`missing value`),I(typeof r==`boolean`,`missing or invalid endian`),I(n!=null,`missing offset`),I(n+1<e.length,`trying to write beyond buffer length`),ne(t,65535)),i=e.length,!(i<=n))for(var a=0,o=Math.min(i-n,2);a<o;a++)e[n+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function C(e,t,n,r,i){if(i||(I(t!=null,`missing value`),I(typeof r==`boolean`,`missing or invalid endian`),I(n!=null,`missing offset`),I(n+3<e.length,`trying to write beyond buffer length`),ne(t,4294967295)),i=e.length,!(i<=n))for(var a=0,o=Math.min(i-n,4);a<o;a++)e[n+a]=t>>>8*(r?a:3-a)&255}function w(e,t,n,r,i){i||(I(t!=null,`missing value`),I(typeof r==`boolean`,`missing or invalid endian`),I(n!=null,`missing offset`),I(n+1<e.length,`Trying to write beyond buffer length`),re(t,32767,-32768)),e.length<=n||S(e,0<=t?t:65535+t+1,n,r,i)}function T(e,t,n,r,i){i||(I(t!=null,`missing value`),I(typeof r==`boolean`,`missing or invalid endian`),I(n!=null,`missing offset`),I(n+3<e.length,`Trying to write beyond buffer length`),re(t,2147483647,-2147483648)),e.length<=n||C(e,0<=t?t:4294967295+t+1,n,r,i)}function E(e,t,n,r,i){i||(I(t!=null,`missing value`),I(typeof r==`boolean`,`missing or invalid endian`),I(n!=null,`missing offset`),I(n+3<e.length,`Trying to write beyond buffer length`),F(t,34028234663852886e22,-34028234663852886e22)),e.length<=n||f.write(e,t,n,r,23,4)}function D(e,t,n,r,i){i||(I(t!=null,`missing value`),I(typeof r==`boolean`,`missing or invalid endian`),I(n!=null,`missing offset`),I(n+7<e.length,`Trying to write beyond buffer length`),F(t,17976931348623157e292,-17976931348623157e292)),e.length<=n||f.write(e,t,n,r,52,8)}n.Buffer=i,n.SlowBuffer=i,n.INSPECT_MAX_BYTES=50,i.poolSize=8192,i._useTypedArrays=function(){try{var e=new Uint8Array(new ArrayBuffer(0));return e.foo=function(){return 42},e.foo()===42&&typeof e.subarray==`function`}catch{return!1}}(),i.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`binary`:case`base64`:case`raw`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},i.isBuffer=function(e){return!(e==null||!e._isBuffer)},i.byteLength=function(e,t){var n;switch(e+=``,t||`utf8`){case`hex`:n=e.length/2;break;case`utf8`:case`utf-8`:n=N(e).length;break;case`ascii`:case`binary`:case`raw`:n=e.length;break;case`base64`:n=P(e).length;break;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:n=2*e.length;break;default:throw Error(`Unknown encoding`)}return n},i.concat=function(e,t){if(I(j(e),`Usage: Buffer.concat(list, [totalLength])
4132list should be an Array.`),e.length===0)return new i(0);if(e.length===1)return e[0];if(typeof t!=`number`)for(a=t=0;a<e.length;a++)t+=e[a].length;for(var n=new i(t),r=0,a=0;a<e.length;a++){var o=e[a];o.copy(n,r),r+=o.length}return n},i.prototype.write=function(e,t,n,r){isFinite(t)?isFinite(n)||(r=n,n=void 0):(l=r,r=t,t=n,n=l),t=Number(t)||0;var a,o,s,c,l=this.length-t;switch((!n||l<(n=Number(n)))&&(n=l),r=String(r||`utf8`).toLowerCase()){case`hex`:a=function(e,t,n,r){n=Number(n)||0;var a=e.length-n;(!r||a<(r=Number(r)))&&(r=a),I((a=t.length)%2==0,`Invalid hex string`),a/2<r&&(r=a/2);for(var o=0;o<r;o++){var s=parseInt(t.substr(2*o,2),16);I(!isNaN(s),`Invalid hex string`),e[n+o]=s}return i._charsWritten=2*o,o}(this,e,t,n);break;case`utf8`:case`utf-8`:o=this,s=t,c=n,a=i._charsWritten=ee(N(e),o,s,c);break;case`ascii`:case`binary`:a=p(this,e,t,n);break;case`base64`:o=this,s=t,c=n,a=i._charsWritten=ee(P(e),o,s,c);break;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:a=m(this,e,t,n);break;default:throw Error(`Unknown encoding`)}return a},i.prototype.toString=function(e,t,n){var r,i,a,o,s=this;if(e=String(e||`utf8`).toLowerCase(),t=Number(t)||0,(n=n===void 0?s.length:Number(n))===t)return``;switch(e){case`hex`:r=function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||r<n)&&(n=r);for(var i=``,a=t;a<n;a++)i+=M(e[a]);return i}(s,t,n);break;case`utf8`:case`utf-8`:r=function(e,t,n){var r=``,i=``;n=Math.min(e.length,n);for(var a=t;a<n;a++)e[a]<=127?(r+=te(i)+String.fromCharCode(e[a]),i=``):i+=`%`+e[a].toString(16);return r+te(i)}(s,t,n);break;case`ascii`:case`binary`:r=h(s,t,n);break;case`base64`:i=s,o=n,r=(a=t)===0&&o===i.length?d.fromByteArray(i):d.fromByteArray(i.slice(a,o));break;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:r=function(e,t,n){for(var r=e.slice(t,n),i=``,a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}(s,t,n);break;default:throw Error(`Unknown encoding`)}return r},i.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}},i.prototype.copy=function(e,t,n,r){if(t||=0,(r=r||r===0?r:this.length)!==(n||=0)&&e.length!==0&&this.length!==0){I(n<=r,`sourceEnd < sourceStart`),I(0<=t&&t<e.length,`targetStart out of bounds`),I(0<=n&&n<this.length,`sourceStart out of bounds`),I(0<=r&&r<=this.length,`sourceEnd out of bounds`),r>this.length&&(r=this.length);var a=(r=e.length-t<r-n?e.length-t+n:r)-n;if(a<100||!i._useTypedArrays)for(var o=0;o<a;o++)e[o+t]=this[o+n];else e._set(this.subarray(n,n+a),t)}},i.prototype.slice=function(e,t){var n=this.length;if(e=k(e,n,0),t=k(t,n,n),i._useTypedArrays)return i._augment(this.subarray(e,t));for(var r=t-e,a=new i(r,void 0,!0),o=0;o<r;o++)a[o]=this[o+e];return a},i.prototype.get=function(e){return console.log(`.get() is deprecated. Access using array indexes instead.`),this.readUInt8(e)},i.prototype.set=function(e,t){return console.log(`.set() is deprecated. Access using array indexes instead.`),this.writeUInt8(e,t)},i.prototype.readUInt8=function(e,t){if(t||(I(e!=null,`missing offset`),I(e<this.length,`Trying to read beyond buffer length`)),!(e>=this.length))return this[e]},i.prototype.readUInt16LE=function(e,t){return g(this,e,!0,t)},i.prototype.readUInt16BE=function(e,t){return g(this,e,!1,t)},i.prototype.readUInt32LE=function(e,t){return _(this,e,!0,t)},i.prototype.readUInt32BE=function(e,t){return _(this,e,!1,t)},i.prototype.readInt8=function(e,t){if(t||(I(e!=null,`missing offset`),I(e<this.length,`Trying to read beyond buffer length`)),!(e>=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){return v(this,e,!0,t)},i.prototype.readInt16BE=function(e,t){return v(this,e,!1,t)},i.prototype.readInt32LE=function(e,t){return y(this,e,!0,t)},i.prototype.readInt32BE=function(e,t){return y(this,e,!1,t)},i.prototype.readFloatLE=function(e,t){return b(this,e,!0,t)},i.prototype.readFloatBE=function(e,t){return b(this,e,!1,t)},i.prototype.readDoubleLE=function(e,t){return x(this,e,!0,t)},i.prototype.readDoubleBE=function(e,t){return x(this,e,!1,t)},i.prototype.writeUInt8=function(e,t,n){n||(I(e!=null,`missing value`),I(t!=null,`missing offset`),I(t<this.length,`trying to write beyond buffer length`),ne(e,255)),t>=this.length||(this[t]=e)},i.prototype.writeUInt16LE=function(e,t,n){S(this,e,t,!0,n)},i.prototype.writeUInt16BE=function(e,t,n){S(this,e,t,!1,n)},i.prototype.writeUInt32LE=function(e,t,n){C(this,e,t,!0,n)},i.prototype.writeUInt32BE=function(e,t,n){C(this,e,t,!1,n)},i.prototype.writeInt8=function(e,t,n){n||(I(e!=null,`missing value`),I(t!=null,`missing offset`),I(t<this.length,`Trying to write beyond buffer length`),re(e,127,-128)),t>=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},i.prototype.writeInt16LE=function(e,t,n){w(this,e,t,!0,n)},i.prototype.writeInt16BE=function(e,t,n){w(this,e,t,!1,n)},i.prototype.writeInt32LE=function(e,t,n){T(this,e,t,!0,n)},i.prototype.writeInt32BE=function(e,t,n){T(this,e,t,!1,n)},i.prototype.writeFloatLE=function(e,t,n){E(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){E(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){D(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){D(this,e,t,!1,n)},i.prototype.fill=function(e,t,n){if(t||=0,n||=this.length,I(typeof(e=typeof(e||=0)==`string`?e.charCodeAt(0):e)==`number`&&!isNaN(e),`value is not a number`),I(t<=n,`end < start`),n!==t&&this.length!==0){I(0<=t&&t<this.length,`start out of bounds`),I(0<=n&&n<=this.length,`end out of bounds`);for(var r=t;r<n;r++)this[r]=e}},i.prototype.inspect=function(){for(var e=[],t=this.length,r=0;r<t;r++)if(e[r]=M(this[r]),r===n.INSPECT_MAX_BYTES){e[r+1]=`...`;break}return`<Buffer `+e.join(` `)+`>`},i.prototype.toArrayBuffer=function(){if(typeof Uint8Array>`u`)throw Error(`Buffer.toArrayBuffer not supported in this browser`);if(i._useTypedArrays)return new i(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t<n;t+=1)e[t]=this[t];return e.buffer};var O=i.prototype;
vendor: 10,791 bytes, lines 4132-4133
4132function k(e,t,n){return typeof e==`number`?t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0:n}function A(e){return(e=~~Math.ceil(+e))<0?0:e}function j(e){return(Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`})(e)}function M(e){return e<16?`0`+e.toString(16):e.toString(16)}function N(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<=127)t.push(e.charCodeAt(n));else for(var i=n,a=(55296<=r&&r<=57343&&n++,encodeURIComponent(e.slice(i,n+1)).substr(1).split(`%`)),o=0;o<a.length;o++)t.push(parseInt(a[o],16))}return t}function P(e){return d.toByteArray(e)}function ee(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function te(e){try{return decodeURIComponent(e)}catch{return`�`}}function ne(e,t){I(typeof e==`number`,`cannot write a non-number as a number`),I(0<=e,`specified a negative value for writing an unsigned value`),I(e<=t,`value is larger than maximum value for type`),I(Math.floor(e)===e,`value has a fractional component`)}function re(e,t,n){I(typeof e==`number`,`cannot write a non-number as a number`),I(e<=t,`value larger than maximum allowed value`),I(n<=e,`value smaller than minimum allowed value`),I(Math.floor(e)===e,`value has a fractional component`)}function F(e,t,n){I(typeof e==`number`,`cannot write a non-number as a number`),I(e<=t,`value larger than maximum allowed value`),I(n<=e,`value smaller than minimum allowed value`)}function I(e,t){if(!e)throw Error(t||`Failed assertion`)}i._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=O.get,e.set=O.set,e.write=O.write,e.toString=O.toString,e.toLocaleString=O.toString,e.toJSON=O.toJSON,e.copy=O.copy,e.slice=O.slice,e.readUInt8=O.readUInt8,e.readUInt16LE=O.readUInt16LE,e.readUInt16BE=O.readUInt16BE,e.readUInt32LE=O.readUInt32LE,e.readUInt32BE=O.readUInt32BE,e.readInt8=O.readInt8,e.readInt16LE=O.readInt16LE,e.readInt16BE=O.readInt16BE,e.readInt32LE=O.readInt32LE,e.readInt32BE=O.readInt32BE,e.readFloatLE=O.readFloatLE,e.readFloatBE=O.readFloatBE,e.readDoubleLE=O.readDoubleLE,e.readDoubleBE=O.readDoubleBE,e.writeUInt8=O.writeUInt8,e.writeUInt16LE=O.writeUInt16LE,e.writeUInt16BE=O.writeUInt16BE,e.writeUInt32LE=O.writeUInt32LE,e.writeUInt32BE=O.writeUInt32BE,e.writeInt8=O.writeInt8,e.writeInt16LE=O.writeInt16LE,e.writeInt16BE=O.writeInt16BE,e.writeInt32LE=O.writeInt32LE,e.writeInt32BE=O.writeInt32BE,e.writeFloatLE=O.writeFloatLE,e.writeFloatBE=O.writeFloatBE,e.writeDoubleLE=O.writeDoubleLE,e.writeDoubleBE=O.writeDoubleBE,e.fill=O.fill,e.inspect=O.inspect,e.toArrayBuffer=O.toArrayBuffer,e}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/buffer/index.js`,`/node_modules/gulp-browserify/node_modules/buffer`)},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(e,t,n){(function(n,r,i,a,o,s,c,l,u){var i=e(`buffer`).Buffer,d=4,f=new i(d);f.fill(0),t.exports={hash:function(e,t,n,r){for(var a=t(function(e,t){e.length%d!=0&&(n=e.length+(d-e.length%d),e=i.concat([e,f],n));for(var n,r=[],a=t?e.readInt32BE:e.readInt32LE,o=0;o<e.length;o+=d)r.push(a.call(e,o));return r}(e=i.isBuffer(e)?e:new i(e),r),8*e.length),t=r,o=new i(n),s=t?o.writeInt32BE:o.writeInt32LE,c=0;c<a.length;c++)s.call(o,a[c],4*c,!0);return o}}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js`,`/node_modules/gulp-browserify/node_modules/crypto-browserify`)},{buffer:3,lYpoI2:11}],5:[function(e,t,n){(function(t,r,i,a,o,s,c,l,u){var i=e(`buffer`).Buffer,d=e(`./sha`),f=e(`./sha256`),p=e(`./rng`),m={sha1:d,sha256:f,md5:e(`./md5`)},h=64,g=new i(h);function _(e,t){var n=m[e||=`sha1`],r=[];return n||v(`algorithm:`,e,`is not yet supported`),{update:function(e){return i.isBuffer(e)||(e=new i(e)),r.push(e),e.length,this},digest:function(e){var a=i.concat(r),a=t?function(e,t,n){i.isBuffer(t)||(t=new i(t)),i.isBuffer(n)||(n=new i(n)),t.length>h?t=e(t):t.length<h&&(t=i.concat([t,g],h));for(var r=new i(h),a=new i(h),o=0;o<h;o++)r[o]=54^t[o],a[o]=92^t[o];return n=e(i.concat([r,n])),e(i.concat([a,n]))}(n,t,a):n(a);return r=null,e?a.toString(e):a}}}function v(){var e=[].slice.call(arguments).join(` `);throw Error([e,`we accept pull requests`,`http://github.com/dominictarr/crypto-browserify`].join(`
4133`))}g.fill(0),n.createHash=function(e){return _(e)},n.createHmac=_,n.randomBytes=function(e,t){if(!t||!t.call)return new i(p(e));try{t.call(this,void 0,new i(p(e)))}catch(e){t(e)}};var y,b=[`createCredentials`,`createCipher`,`createCipheriv`,`createDecipher`,`createDecipheriv`,`createSign`,`createVerify`,`createDiffieHellman`,`pbkdf2`],x=function(e){n[e]=function(){v(`sorry,`,e,`is not implemented yet`)}};for(y in b)x(b[y],y)}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js`,`/node_modules/gulp-browserify/node_modules/crypto-browserify`)},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(e,t,n){(function(n,r,i,a,o,s,c,l,u){var d=e(`./helpers`);function f(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,r=-271733879,i=-1732584194,a=271733878,o=0;o<e.length;o+=16){var s=n,c=r,l=i,u=a,n=m(n,r,i,a,e[o+0],7,-680876936),a=m(a,n,r,i,e[o+1],12,-389564586),i=m(i,a,n,r,e[o+2],17,606105819),r=m(r,i,a,n,e[o+3],22,-1044525330);n=m(n,r,i,a,e[o+4],7,-176418897),a=m(a,n,r,i,e[o+5],12,1200080426),i=m(i,a,n,r,e[o+6],17,-1473231341),r=m(r,i,a,n,e[o+7],22,-45705983),n=m(n,r,i,a,e[o+8],7,1770035416),a=m(a,n,r,i,e[o+9],12,-1958414417),i=m(i,a,n,r,e[o+10],17,-42063),r=m(r,i,a,n,e[o+11],22,-1990404162),n=m(n,r,i,a,e[o+12],7,1804603682),a=m(a,n,r,i,e[o+13],12,-40341101),i=m(i,a,n,r,e[o+14],17,-1502002290),n=h(n,r=m(r,i,a,n,e[o+15],22,1236535329),i,a,e[o+1],5,-165796510),a=h(a,n,r,i,e[o+6],9,-1069501632),i=h(i,a,n,r,e[o+11],14,643717713),r=h(r,i,a,n,e[o+0],20,-373897302),n=h(n,r,i,a,e[o+5],5,-701558691),a=h(a,n,r,i,e[o+10],9,38016083),i=h(i,a,n,r,e[o+15],14,-660478335),r=h(r,i,a,n,e[o+4],20,-405537848),n=h(n,r,i,a,e[o+9],5,568446438),a=h(a,n,r,i,e[o+14],9,-1019803690),i=h(i,a,n,r,e[o+3],14,-187363961),r=h(r,i,a,n,e[o+8],20,1163531501),n=h(n,r,i,a,e[o+13],5,-1444681467),a=h(a,n,r,i,e[o+2],9,-51403784),i=h(i,a,n,r,e[o+7],14,1735328473),n=g(n,r=h(r,i,a,n,e[o+12],20,-1926607734),i,a,e[o+5],4,-378558),a=g(a,n,r,i,e[o+8],11,-2022574463),i=g(i,a,n,r,e[o+11],16,1839030562),r=g(r,i,a,n,e[o+14],23,-35309556),n=g(n,r,i,a,e[o+1],4,-1530992060),a=g(a,n,r,i,e[o+4],11,1272893353),i=g(i,a,n,r,e[o+7],16,-155497632),r=g(r,i,a,n,e[o+10],23,-1094730640),n=g(n,r,i,a,e[o+13],4,681279174),a=g(a,n,r,i,e[o+0],11,-358537222),i=g(i,a,n,r,e[o+3],16,-722521979),r=g(r,i,a,n,e[o+6],23,76029189),n=g(n,r,i,a,e[o+9],4,-640364487),a=g(a,n,r,i,e[o+12],11,-421815835),i=g(i,a,n,r,e[o+15],16,530742520),n=_(n,r=g(r,i,a,n,e[o+2],23,-995338651),i,a,e[o+0],6,-198630844),a=_(a,n,r,i,e[o+7],10,1126891415),i=_(i,a,n,r,e[o+14],15,-1416354905),r=_(r,i,a,n,e[o+5],21,-57434055),n=_(n,r,i,a,e[o+12],6,1700485571),a=_(a,n,r,i,e[o+3],10,-1894986606),i=_(i,a,n,r,e[o+10],15,-1051523),r=_(r,i,a,n,e[o+1],21,-2054922799),n=_(n,r,i,a,e[o+8],6,1873313359),a=_(a,n,r,i,e[o+15],10,-30611744),i=_(i,a,n,r,e[o+6],15,-1560198380),r=_(r,i,a,n,e[o+13],21,1309151649),n=_(n,r,i,a,e[o+4],6,-145523070),a=_(a,n,r,i,e[o+11],10,-1120210379),i=_(i,a,n,r,e[o+2],15,718787259),r=_(r,i,a,n,e[o+9],21,-343485551),n=v(n,s),r=v(r,c),i=v(i,l),a=v(a,u)}return[n,r,i,a]}function p(e,t,n,r,i,a){return v((t=v(v(t,e),v(r,a)))<<i|t>>>32-i,n)}function m(e,t,n,r,i,a,o){return p(t&n|~t&r,e,t,i,a,o)}function h(e,t,n,r,i,a,o){return p(t&r|n&~r,e,t,i,a,o)}function g(e,t,n,r,i,a,o){return p(t^n^r,e,t,i,a,o)}function _(e,t,n,r,i,a,o){return p(n^(t|~r),e,t,i,a,o)}function v(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}t.exports=function(e){return d.hash(e,f,16)}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js`,`/node_modules/gulp-browserify/node_modules/crypto-browserify`)},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,t,n){(function(e,n,r,i,a,o,s,c,l){var u;t.exports=u||function(e){for(var t,n=Array(e),r=0;r<e;r++)!(3&r)&&(t=4294967296*Math.random()),n[r]=t>>>((3&r)<<3)&255;return n}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js`,`/node_modules/gulp-browserify/node_modules/crypto-browserify`)},{buffer:3,lYpoI2:11}],8:[function(e,t,n){(function(n,r,i,a,o,s,c,l,u){var d=e(`./helpers`);function f(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,r,i,a=Array(80),o=1732584193,s=-271733879,c=-1732584194,l=271733878,u=-1009589776,d=0;d<e.length;d+=16){for(var f=o,h=s,g=c,_=l,v=u,y=0;y<80;y++){a[y]=y<16?e[d+y]:m(a[y-3]^a[y-8]^a[y-14]^a[y-16],1);var b=p(p(m(o,5),(b=s,r=c,i=l,(n=y)<20?b&r|~b&i:!(n<40)&&n<60?b&r|b&i|r&i:b^r^i)),p(p(u,a[y]),(n=y)<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514)),u=l,l=c,c=m(s,30),s=o,o=b}o=p(o,f),s=p(s,h),c=p(c,g),l=p(l,_),u=p(u,v)}return[o,s,c,l,u]}function p(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function m(e,t){return e<<t|e>>>32-t}t.exports=function(e){return d.hash(e,f,20,!0)}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js`,`/node_modules/gulp-browserify/node_modules/crypto-browserify`)},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(e,t,n){(function(n,r,i,a,o,s,c,l,u){function d(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function f(e,t){var n,r=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
4133734187,3204031479,3329325298],i=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],a=Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var o,s,c=0;c<e.length;c+=16){for(var l=i[0],u=i[1],f=i[2],p=i[3],g=i[4],_=i[5],v=i[6],y=i[7],b=0;b<64;b++)a[b]=b<16?e[b+c]:d(d(d((s=a[b-2],m(s,17)^m(s,19)^h(s,10)),a[b-7]),(s=a[b-15],m(s,7)^m(s,18)^h(s,3))),a[b-16]),n=d(d(d(d(y,m(s=g,6)^m(s,11)^m(s,25)),g&_^~g&v),r[b]),a[b]),o=d(m(o=l,2)^m(o,13)^m(o,22),l&u^l&f^u&f),y=v,v=_,_=g,g=d(p,n),p=f,f=u,u=l,l=d(n,o);i[0]=d(l,i[0]),i[1]=d(u,i[1]),i[2]=d(f,i[2]),i[3]=d(p,i[3]),i[4]=d(g,i[4]),i[5]=d(_,i[5]),i[6]=d(v,i[6]),i[7]=d(y,i[7])}return i}var p=e(`./helpers`),m=function(e,t){return e>>>t|e<<32-t},h=function(e,t){return e>>>t};t.exports=function(e){return p.hash(e,f,32,!0)}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js`,`/node_modules/gulp-browserify/node_modules/crypto-browserify`)},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,n){(function(e,t,r,i,a,o,s,c,l){n.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,i=e[t+d];for(d+=f,a=i&(1<<-u)-1,i>>=-u,u+=s;0<u;a=256*a+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;0<u;o=256*o+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:1/0*(i?-1:1);o+=2**r,a-=l}return(i?-1:1)*o*2**(a-r)},n.write=function(e,t,n,r,i,a){var o,s,c=8*a-i-1,l=(1<<c)-1,u=l>>1,d=i===23?2**-24-2**-77:0,f=r?0:a-1,p=r?1:-1,a=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(r=2**-o)<1&&(o--,r*=2),2<=(t+=1<=o+u?d/r:d*2**(1-u))*r&&(o++,r/=2),l<=o+u?(s=0,o=l):1<=o+u?(s=(t*r-1)*2**i,o+=u):(s=t*2**(u-1)*2**i,o=0));8<=i;e[n+f]=255&s,f+=p,s/=256,i-=8);for(o=o<<i|s,c+=i;0<c;e[n+f]=255&o,f+=p,o/=256,c-=8);e[n+f-p]|=128*a}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/ieee754/index.js`,`/node_modules/gulp-browserify/node_modules/ieee754`)},{buffer:3,lYpoI2:11}],11:[function(e,t,n){(function(e,n,r,i,a,o,s,c,l){var u,d,f;function p(){}(e=t.exports={}).nextTick=(d=typeof window<`u`&&window.setImmediate,f=typeof window<`u`&&window.postMessage&&window.addEventListener,d?function(e){return window.setImmediate(e)}:f?(u=[],window.addEventListener(`message`,function(e){var t=e.source;t!==window&&t!==null||e.data!==`process-tick`||(e.stopPropagation(),0<u.length&&u.shift()())},!0),function(e){u.push(e),window.postMessage(`process-tick`,`*`)}):function(e){setTimeout(e,0)}),e.title=`browser`,e.browser=!0,e.env={},e.argv=[],e.on=p,e.addListener=p,e.once=p,e.off=p,e.removeListener=p,e.removeAllListeners=p,e.emit=p,e.binding=function(e){throw Error(`process.binding is not supported`)},e.cwd=function(){return`/`},e.chdir=function(e){throw Error(`process.chdir is not supported`)}}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/process/browser.js`,`/node_modules/gulp-browserify/node_modules/process`)},{buffer:3,lYpoI2:11}]},{},[1])(1)})}))();function hD(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function gD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var _D={autoSleep:120,force3D:`auto`,nullTargetWarn:1,units:{lineHeight:``}},vD={duration:.5,overwrite:!1,delay:0},yD,bD,xD,SD=1e8,CD=1/SD,wD=Math.PI*2,TD=wD/4,ED=0,DD=Math.sqrt,OD=Math.cos,kD=Math.sin,AD=function(e){return typeof e==`string`},jD=function(e){return typeof e==`function`},MD=function(e){return typeof e==`number`},ND=function(e){return e===void 0},PD=function(e){return typeof e==`object`},FD=function(e){return e!==!1},ID=function(){return typeof window<`u`},LD=function(e){return jD(e)||AD(e)},RD=typeof ArrayBuffer==`function`&&ArrayBuffer.isView||function(){},zD=Array.isArray,BD=/random\([^)]+\)/g,VD=/,\s*/g,HD=/(?:-?\.?\d|\.)+/gi,UD=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,WD=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,GD=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,K
vendor: 4,594 bytes, line 4133
4133D=/[+-]=-?[.\d]+/,qD=/[^,'"\[\]\s]+/gi,JD=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,YD,XD,ZD,QD,$D={},eO={},tO,nO=function(e){return(eO=PO(e,$D))&&ej},rO=function(e,t){return console.warn(`Invalid property`,e,`set to`,t,`Missing plugin? gsap.registerPlugin()`)},iO=function(e,t){return!t&&console.warn(e)},aO=function(e,t){return e&&($D[e]=t)&&eO&&(eO[e]=t)||$D},oO=function(){return 0},sO={suppressEvents:!0,isStart:!0,kill:!1},cO={suppressEvents:!0,kill:!1},lO={suppressEvents:!0},uO={},dO=[],fO={},pO,mO={},hO={},gO=30,_O=[],vO=``,yO=function(e){var t=e[0],n,r;if(PD(t)||jD(t)||(e=[e]),!(n=(t._gsap||{}).harness)){for(r=_O.length;r--&&!_O[r].targetTest(t););n=_O[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new uA(e[r],n)))||e.splice(r,1);return e},bO=function(e){return e._gsap||yO(_k(e))[0]._gsap},xO=function(e,t,n){return(n=e[t])&&jD(n)?e[t]():ND(n)&&e.getAttribute&&e.getAttribute(t)||n},SO=function(e,t){return(e=e.split(`,`)).forEach(t)||e},CO=function(e){return Math.round(e*1e5)/1e5||0},wO=function(e){return Math.round(e*1e7)/1e7||0},TO=function(e,t){var n=t.charAt(0),r=parseFloat(t.substr(2));return e=parseFloat(e),n===`+`?e+r:n===`-`?e-r:n===`*`?e*r:e/r},EO=function(e,t){for(var n=t.length,r=0;e.indexOf(t[r])<0&&++r<n;);return r<n},DO=function(){var e=dO.length,t=dO.slice(0),n,r;for(fO={},dO.length=0,n=0;n<e;n++)r=t[n],r&&r._lazy&&(r.render(r._lazy[0],r._lazy[1],!0)._lazy=0)},OO=function(e){return!!(e._initted||e._startAt||e.add)},kO=function(e,t,n,r){dO.length&&!bD&&DO(),e.render(t,n,r||!!(bD&&t<0&&OO(e))),dO.length&&!bD&&DO()},AO=function(e){var t=parseFloat(e);return(t||t===0)&&(e+``).match(qD).length<2?t:AD(e)?e.trim():e},jO=function(e){return e},MO=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},NO=function(e){return function(t,n){for(var r in n)r in t||r===`duration`&&e||r===`ease`||(t[r]=n[r])}},PO=function(e,t){for(var n in t)e[n]=t[n];return e},FO=function e(t,n){for(var r in n)r!==`__proto__`&&r!==`constructor`&&r!==`prototype`&&(t[r]=PD(n[r])?e(t[r]||(t[r]={}),n[r]):n[r]);return t},IO=function(e,t){var n={},r;for(r in e)r in t||(n[r]=e[r]);return n},LO=function(e){var t=e.parent||YD,n=e.keyframes?NO(zD(e.keyframes)):MO;if(FD(e.inherit))for(;t;)n(e,t.vars.defaults),t=t.parent||t._dp;return e},RO=function(e,t){for(var n=e.length,r=n===t.length;r&&n--&&e[n]===t[n];);return n<0},zO=function(e,t,n,r,i){n===void 0&&(n=`_first`),r===void 0&&(r=`_last`);var a=e[r],o;if(i)for(o=t[i];a&&a[i]>o;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[r]=t,t._prev=a,t.parent=t._dp=e,t},BO=function(e,t,n,r){n===void 0&&(n=`_first`),r===void 0&&(r=`_last`);var i=t._prev,a=t._next;i?i._next=a:e[n]===t&&(e[n]=a),a?a._prev=i:e[r]===t&&(e[r]=i),t._next=t._prev=t.parent=null},VO=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},HO=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},UO=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},WO=function(e,t,n,r){return e._startAt&&(bD?e._startAt.revert(cO):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},GO=function e(t){return!t||t._ts&&e(t.parent)},KO=function(e){return e._repeat?qO(e._tTime,e=e.duration()+e._rDelay)*e:0},qO=function(e,t){var n=Math.floor(e=wO(e/t));return e&&n===e?n-1:n},JO=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},YO=function(e){return e._end=wO(e._start+(e._tDur/Math.abs(e._ts||e._rts||CD)||0))},XO=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=wO(n._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),YO(e),n._dirty||HO(n,e)),e},ZO=function(e,t){var n;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(n=JO(e.rawTime(),t),(!t._dur||dk(0,t.totalDuration(),n)-t._tTime>CD)&&t.render(n,!0)),HO(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(n=e;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-CD}},QO=function(e,t,n,r){return t.parent&&VO(t),t._start=wO((MD(n)?n:n||e!==YD?ck(e,n,t):e._time)+t._delay),t._end=wO(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),zO(e,t,`_first`,`_last`,e._sort?`_start`:0),nk(t)||(e._recent=t),r||ZO(e,t),e._ts<0&&XO(e,e._tTime),e},$O=function(e,t){return($D.ScrollTrigger||rO(`scrollTrigger`,t))&&$D.ScrollTrigger.create(t,e)},ek=function(e,t,n,r,i){if(yA(e,t,i),!e._initted)return 1;if(!n&&e._pt&&!bD&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&pO
vendor: 27,722 bytes, line 4133
4133!==Yk.frame)return dO.push(e),e._lazy=[i,r],1},tk=function e(t){var n=t.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||e(n))},nk=function(e){var t=e.data;return t===`isFromStart`||t===`isStart`},rk=function(e,t,n,r){var i=e.ratio,a=t<0||!t&&(!e._start&&tk(e)&&(e._initted||!nk(e))||(e._ts<0||e._dp._ts<0)&&!nk(e))?0:1,o=e._rDelay,s=0,c,l,u;if(o&&e._repeat&&(s=dk(0,e._tDur,t),l=qO(s,o),e._yoyo&&l&1&&(a=1-a),l!==qO(e._tTime,o)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||bD||r||e._zTime===CD||!t&&e._zTime){if(!e._initted&&ek(e,t,r,n,s))return;for(u=e._zTime,e._zTime=t||(n?CD:0),n||=t&&!u,e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=s,c=e._pt;c;)c.r(a,c.d),c=c._next;t<0&&WO(e,t,n,!0),e._onUpdate&&!n&&Pk(e,`onUpdate`),s&&e._repeat&&!n&&e.parent&&Pk(e,`onRepeat`),(t>=e._tDur||t<0)&&e.ratio===a&&(a&&VO(e,1),!n&&!bD&&(Pk(e,a?`onComplete`:`onReverseComplete`,!0),e._prom&&e._prom()))}else e._zTime||=t},ik=function(e,t,n){var r;if(n>t)for(r=e._first;r&&r._start<=n;){if(r.data===`isPause`&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=n;){if(r.data===`isPause`&&r._start<t)return r;r=r._prev}},ak=function(e,t,n,r){var i=e._repeat,a=wO(t)||0,o=e._tTime/e._tDur;return o&&!r&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:wO(a*(i+1)+e._rDelay*i):a,o>0&&!r&&XO(e,e._tTime=e._tDur*o),e.parent&&YO(e),n||HO(e.parent,e),e},ok=function(e){return e instanceof fA?HO(e):ak(e,e._dur)},sk={_start:0,endTime:oO,totalDuration:oO},ck=function e(t,n,r){var i=t.labels,a=t._recent||sk,o=t.duration()>=SD?a.endTime(!1):t._dur,s,c,l;return AD(n)&&(isNaN(n)||n in i)?(c=n.charAt(0),l=n.substr(-1)===`%`,s=n.indexOf(`=`),c===`<`||c===`>`?(s>=0&&(n=n.replace(/=/,``)),(c===`<`?a._start:a.endTime(a._repeat>=0))+(parseFloat(n.substr(1))||0)*(l?(s<0?a:r).totalDuration()/100:1)):s<0?(n in i||(i[n]=o),i[n]):(c=parseFloat(n.charAt(s-1)+n.substr(s+1)),l&&r&&(c=c/100*(zD(r)?r[0]:r).totalDuration()),s>1?e(t,n.substr(0,s-1),r)+c:o+c)):n==null?o:+n},lk=function(e,t,n){var r=MD(t[1]),i=(r?2:1)+(e<2?0:1),a=t[i],o,s;if(r&&(a.duration=t[1]),a.parent=n,e){for(o=a,s=n;s&&!(`immediateRender`in o);)o=s.vars.defaults||{},s=FD(s.vars.inherit)&&s.parent;a.immediateRender=FD(o.immediateRender),e<2?a.runBackwards=1:a.startAt=t[i-1]}return new EA(t[0],a,t[i+1])},uk=function(e,t){return e||e===0?t(e):t},dk=function(e,t,n){return n<e?e:n>t?t:n},fk=function(e,t){return!AD(e)||!(t=JD.exec(e))?``:t[1]},pk=function(e,t,n){return uk(n,function(n){return dk(e,t,n)})},mk=[].slice,hk=function(e,t){return e&&PD(e)&&`length`in e&&(!t&&!e.length||e.length-1 in e&&PD(e[0]))&&!e.nodeType&&e!==XD},gk=function(e,t,n){return n===void 0&&(n=[]),e.forEach(function(e){var r;return AD(e)&&!t||hk(e,1)?(r=n).push.apply(r,_k(e)):n.push(e)})||n},_k=function(e,t,n){return xD&&!t&&xD.selector?xD.selector(e):AD(e)&&!n&&(ZD||!Xk())?mk.call((t||QD).querySelectorAll(e),0):zD(e)?gk(e,n):hk(e)?mk.call(e,0):e?[e]:[]},vk=function(e){return e=_k(e)[0]||iO(`Invalid scope`)||{},function(t){var n=e.current||e.nativeElement||e;return _k(t,n.querySelectorAll?n:n===e?iO(`Invalid scope`)||QD.createElement(`div`):e)}},yk=function(e){return e.sort(function(){return .5-Math.random()})},bk=function(e){if(jD(e))return e;var t=PD(e)?e:{each:e},n=aA(t.ease),r=t.from||0,i=parseFloat(t.base)||0,a={},o=r>0&&r<1,s=isNaN(r)||o,c=t.axis,l=r,u=r;return AD(r)?l=u={center:.5,edges:.5,end:1}[r]||0:!o&&s&&(l=r[0],u=r[1]),function(e,o,d){var f=(d||t).length,p=a[f],m,h,g,_,v,y,b,x,S;if(!p){if(S=t.grid===`auto`?0:(t.grid||[1,SD])[1],!S){for(b=-SD;b<(b=d[S++].getBoundingClientRect().left)&&S<f;);S<f&&S--}for(p=a[f]=[],m=s?Math.min(S,f)*l-.5:r%S,h=S===SD?0:s?f*u/S-.5:r/S|0,b=0,x=SD,y=0;y<f;y++)g=y%S-m,_=h-(y/S|0),p[y]=v=c?Math.abs(c===`y`?_:g):DD(g*g+_*_),v>b&&(b=v),v<x&&(x=v);r===`random`&&yk(p),p.max=b-x,p.min=x,p.v=f=(parseFloat(t.amount)||parseFloat(t.each)*(S>f?f-1:c?c===`y`?f/S:S:Math.max(S,f/S))||0)*(r===`edges`?-1:1),p.b=f<0?i-f:i,p.u=fk(t.amount||t.each)||0,n=n&&f<0?rA(n):n}return f=(p[e]-p.min)/p.max||0,wO(p.b+(n?n(f):f)*p.v)+p.u}},xk=function(e){var t=10**((e+``).split(`.`)[1]||``).length;return function(n){var r=wO(Math.round(parseFloat(n)/e)*e*t);return(r-r%1)/t+(MD(n)?0:fk(n))}},Sk=function(e,t){var n=zD(e),r,i;return!n&&PD(e)&&(r=n=e.radius||SD,e.values?(e=_k(e.values),(i=!MD(e[0]))&&(r*=r)):e=xk(e.increment)),uk(t,n?jD(e)?function(t){return i=e(t),Math.abs(i-t)<=r?i:t}:function(t){for(var n=parseFloat(i?t.x:t),a=parseFloat(i?t.y:0),o=SD,s=0,c=e.length,l,u;c--;)i?(l=e[c].x-n,u=e[c].y-a,l=l*l+u*u):l=Math.abs(e[c]-n),l<o&&(o=l,s=c);return s=!r||o<=r?e[s]:t,i||s===t||MD(t)?s:s+fk(t)}:xk(e))},Ck=function(e,t,n,r){return uk(zD(e)?!t:n===!0?!!(n=0):!r,function(){return zD(e)?e[~~(Math.random()*e.length)]:(n||=1e-5)&&(r=n<1?10**((n+``).length-2):1)&&Math.floor(Math.round((e-n/2+Math.random()*(t-e+n*.99))/n)*n*r)/r})},wk=function(){var e=[...arguments];return function(t){return e.reduce(function(e,t){return t(e)},t)}},Tk=function(e,t){return function(n){return e(parseFloat(n))+(t||fk(n))}},Ek=function(e,t,n){return jk(e,t,0,1,n)},Dk=function(e,t,n){return uk(n,function(n){return e[~~t(n)]})},Ok=function e(t,n,r){var i=n-t;return zD(t)?Dk(t,e(0,t.length),n):uk(r,function(e){return(i+(e-t)%i)%i+t})},kk=function e(t,n,r){var i=n-t,a=i*2;return zD(t)?Dk(t,e(0,t.length-1),n):uk(r,function(e){return e=(a+(e-t)%a)%a||0,t+(e>i?a-e:e)})},Ak=function(e){return e.replace(BD,function(e){var t=e.indexOf(`[`)+1,n=e.substring(t||7,t?e.indexOf(`]`):e.length-1).split(VD);return Ck(t?n:+n[0],t?0:+n[1],+n[2]||1e-5)})},jk=function(e,t,n,r,i){var a=t-e,o=r-n;return uk(i,function(t){return n+((t-e)/a*o||0)})},Mk=function e(t,n,r,i){var a=isNaN(t+n)?0:function(e){return(1-e)*t+e*n};if(!a){var o=AD(t),s={},c,l,u,d,f;if(r===!0&&(i=1)&&(r=null),o)t={p:t},n={p:n};else if(zD(t)&&!zD(n)){for(u=[],d=t.length,f=d-2,l=1;l<d;l++)u.push(e(t[l-1],t[l]));d--,a=function(e){e*=d;var t=Math.min(f,~~e);return u[t](e-t)},r=n}else i||(t=PO(zD(t)?[]:{},t));if(!u){for(c in n)mA.call(s,t,c,`get`,n[c]);a=function(e){return FA(e,s)||(o?t.p:t)}}}return uk(r,a)},Nk=function(e,t,n){var r=e.labels,i=SD,a,o,s;for(a in r)o=r[a]-t,o<0==!!n&&o&&i>(o=Math.abs(o))&&(s=a,i=o);return s},Pk=function(e,t,n){var r=e.vars,i=r[t],a=xD,o=e._ctx,s,c,l;if(i)return s=r[t+`Params`],c=r.callbackScope||e,n&&dO.length&&DO(),o&&(xD=o),l=s?i.apply(c,s):i.call(c),xD=a,l},Fk=function(e){return VO(e),e.scrollTrigger&&e.scrollTrigger.kill(!!bD),e.progress()<1&&Pk(e,`onInterrupt`),e},Ik,Lk=[],Rk=function(e){if(e){if(e=!e.name&&e.default||e,ID()||e.headless){var t=e.name,n=jD(e),r=t&&!n&&e.init?function(){this._props=[]}:e,i={init:oO,render:FA,add:mA,kill:LA,modifier:IA,rawVars:0},a={targetTest:0,get:0,getSetter:jA,aliases:{},register:0};if(Xk(),e!==r){if(mO[t])return;MO(r,MO(IO(e,i),a)),PO(r.prototype,PO(i,IO(e,a))),mO[r.prop=t]=r,e.targetTest&&(_O.push(r),uO[t]=1),t=(t===`css`?`CSS`:t.charAt(0).toUpperCase()+t.substr(1))+`Plugin`}aO(t,r),e.register&&e.register(ej,r,BA)}else Lk.push(e)}},zk=255,Bk={aqua:[0,zk,zk],lime:[0,zk,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zk],navy:[0,0,128],white:[zk,zk,zk],olive:[128,128,0],yellow:[zk,zk,0],orange:[zk,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zk,0,0],pink:[zk,192,203],cyan:[0,zk,zk],transparent:[zk,zk,zk,0]},Vk=function(e,t,n){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(n-t)*e*6:e<.5?n:e*3<2?t+(n-t)*(2/3-e)*6:t)*zk+.5|0},Hk=function(e,t,n){var r=e?MD(e)?[e>>16,e>>8&zk,e&zk]:0:Bk.black,i,a,o,s,c,l,u,d,f,p;if(!r){if(e.substr(-1)===`,`&&(e=e.substr(0,e.length-1)),Bk[e])r=Bk[e];else if(e.charAt(0)===`#`){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),o=e.charAt(3),e=`#`+i+i+a+a+o+o+(e.length===5?e.charAt(4)+e.charAt(4):``)),e.length===9)return r=parseInt(e.substr(1,6),16),[r>>16,r>>8&zk,r&zk,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),r=[e>>16,e>>8&zk,e&zk]}else if(e.substr(0,3)===`hsl`){if(r=p=e.match(HD),!t)s=r[0]%360/360,c=r[1]/100,l=r[2]/100,a=l<=.5?l*(c+1):l+c-l*c,i=l*2-a,r.length>3&&(r[3]*=1),r[0]=Vk(s+1/3,i,a),r[1]=Vk(s,i,a),r[2]=Vk(s-1/3,i,a);else if(~e.indexOf(`=`))return r=e.match(UD),n&&r.length<4&&(r[3]=1),r}else r=e.match(HD)||Bk.transparent;r=r.map(Number)}return t&&!p&&(i=r[0]/zk,a=r[1]/zk,o=r[2]/zk,u=Math.max(i,a,o),d=Math.min(i,a,o),l=(u+d)/2,u===d?s=c=0:(f=u-d,c=l>.5?f/(2-u-d):f/(u+d),s=u===i?(a-o)/f+(a<o?6:0):u===a?(o-i)/f+2:(i-a)/f+4,s*=60),r[0]=~~(s+.5),r[1]=~~(c*100+.5),r[2]=~~(l*100+.5)),n&&r.length<4&&(r[3]=1),r},Uk=function(e){var t=[],n=[],r=-1;return e.split(Gk).forEach(function(e){var i=e.match(WD)||[];t.push.apply(t,i),n.push(r+=i.length+1)}),t.c=n,t},Wk=function(e,t,n){var r=``,i=(e+r).match(Gk),a=t?`hsla(`:`rgba(`,o=0,s,c,l,u;if(!i)return e;if(i=i.map(function(e){return(e=Hk(e,t,1))&&a+(t?e[0]+`,`+e[1]+`%,`+e[2]+`%,`+e[3]:e.join(`,`))+`)`}),n&&(l=Uk(e),s=n.c,s.join(r)!==l.c.join(r)))for(c=e.replace(Gk,`1`).split(WD),u=c.length-1;o<u;o++)r+=c[o]+(~s.indexOf(o)?i.shift()||a+`0,0,0,0)`:(l.length?l:i.length?i:n).shift());if(!c)for(c=e.split(Gk),u=c.length-1;o<u;o++)r+=c[o]+i[o];return r+c[u]},Gk=function(){var e=`(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b`,t;for(t in Bk)e+=`|`+t+`\\b`;return RegExp(e+`)`,`gi`)}(),Kk=/hsl[a]?\(/,qk=function(e){var t=e.join(` `),n;if(Gk.lastIndex=0,Gk.test(t))return n=Kk.test(t),e[1]=Wk(e[1],n),e[0]=Wk(e[0],n,Uk(e[1])),!0},Jk,Yk=function(){var e=Date.now,t=500,n=33,r=e(),i=r,a=1e3/240,o=a,s=[],c,l,u,d,f,p,m=function u(m){var h=e()-i,g=m===!0,_,v,y,b;if((h>t||h<0)&&(r+=h-n),i+=h,y=i-r,_=y-o,(_>0||g)&&(b=++d.frame,f=y-d.time*1e3,d.time=y/=1e3,o+=_+(_>=a?4:a-_),v=1),g||(c=l(u)),v)for(p=0;p<s.length;p++)s[p](y,f,b,m)};return d={time:0,frame:0,tick:function(){m(!0)},deltaRatio:function(e){return f/(1e3/(e||60))},wake:function(){tO&&(!ZD&&ID()&&(XD=ZD=window,QD=XD.document||{},$D.gsap=ej,(XD.gsapVersions||(XD.gsapVersions=[])).push(ej.version),nO(eO||XD.GreenSockGlobals||!XD.gsap&&XD||{}),Lk.forEach(Rk)),u=typeof requestAnimationFrame<`u`&&requestAnimationFrame,c&&d.sleep(),l=u||function(e){return setTimeout(e,o-d.time*1e3+1|0)},Jk=1,m(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(c),Jk=0,l=oO},lagSmoothing:function(e,r){t=e||1/0,n=Math.min(r||33,t)},fps:function(e){a=1e3/(e||240),o=d.time*1e3+a},add:function(e,t,n){var r=t?function(t,n,i,a){e(t,n,i,a),d.remove(r)}:e;return d.remove(e),s[n?`unshift`:`push`](r),Xk(),r},remove:function(e,t){~(t=s.indexOf(e))&&s.splice(t,1)&&p>=t&&p--},_listeners:s},d}(),Xk=function(){return!Jk&&Yk.wake()},Zk={},Qk=/^[\d.\-M][\d.\-,\s]/,$k=/["']/g,eA=function(e){for(var t={},n=e.substr(1,e.length-3).split(`:`),r=n[0],i=1,a=n.length,o,s,c;i<a;i++)s=n[i],o=i===a-1?s.length:s.lastIndexOf(`,`),c=s.substr(0,o),t[r]=isNaN(c)?c.replace($k,``).trim():+c,r=s.substr(o+1).trim();return t},tA=function(e){var t=e.indexOf(`(`)+1,n=e.indexOf(`)`),r=e.indexOf(`(`,t);return e.substring(t,~r&&r<n?e.indexOf(`)`,n+1):n)},nA=function(e){var t=(e+``).split(`(`),n=Zk[t[0]];return n&&t.length>1&&n.config?n.config.apply(null,~e.indexOf(`{`)?[eA(t[1])]:tA(e).split(`,`).map(AO)):Zk._CE&&Qk.test(e)?Zk._CE(``,e):n},rA=function(e){return function(t){return 1-e(1-t)}},iA=function e(t,n){for(var r=t._first,i;r;)r instanceof fA?e(r,n):r.vars.yoyoEase&&(!r._yoyo||!r._repeat)&&r._yoyo!==n&&(r.timeline?e(r.timeline,n):(i=r._ease,r._ease=r._yEase,r._yEase=i,r._yoyo=n)),r=r._next},aA=function(e,t){return e&&(jD(e)?e:Zk[e]||nA(e))||t},oA=function(e,t,n,r){n===void 0&&(n=function(e){return 1-t(1-e)}),r===void 0&&(r=function(e){return e<.5?t(e*2)/2:1-t((1-e)*2)/2});var i={easeIn:t,easeOut:n,easeInOut:r},a;return SO(e,function(e){for(var t in Zk[e]=$D[e]=i,Zk[a=e.toLowerCase()]=n,i)Zk[a+(t===`easeIn`?`.in`:t===`easeOut`?`.out`:`.inOut`)]=Zk[e+`.`+t]=i[t]}),i},sA=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},cA=function e(t,n,r){var i=n>=1?n:1,a=(r||(t?.3:.45))/(n<1?n:1),o=a/wD*(Math.asin(1/i)||0),s=function(e){return e===1?1:i*2**(-10*e)*kD((e-o)*a)+1},c=t===`out`?s:t===`in`?function(e){return 1-s(1-e)}:sA(s);return a=wD/a,c.config=function(n,r){return e(t,n,r)},c},lA=function e(t,n){n===void 0&&(n=1.70158);var r=function(e){return e?--e*e*((n+1)*e+n)+1:0},i=t===`out`?r:t===`in`?function(e){return 1-r(1-e)}:sA(r);return i.config=function(n){return e(t,n)},i};SO(`Linear,Quad,Cubic,Quart,Quint,Strong`,function(e,t){var n=t<5?t+1:t;oA(e+`,Power`+(n-1),t?function(e){return e**+n}:function(e){return e},function(e){return 1-(1-e)**n},function(e){return e<.5?(e*2)**n/2:1-((1-e)*2)**n/2})}),Zk.Linear.easeNone=Zk.none=Zk.Linear.easeIn,oA(`Elastic`,cA(`in`),cA(`out`),cA()),(function(e,t){var n=1/t,r=2*n,i=2.5*n,a=function(a){return a<n?e*a*a:a<r?e*(a-1.5/t)**2+.75:a<i?e*(a-=2.25/t)*a+.9375:e*(a-2.625/t)**2+.984375};oA(`Bounce`,function(e){return 1-a(1-e)},a)})(7.5625,2.75),oA(`Expo`,function(e){return 2**(10*(e-1))*e+e*e*e*e*e*e*(1-e)}),oA(`Circ`,function(e){return-(DD(1-e*e)-1)}),oA(`Sine`,function(e){return e===1?1:-OD(e*TD)+1}),oA(`Back`,lA(`in`),lA(`out`),lA()),Zk.SteppedEase=Zk.steps=$D.SteppedEase={config:function(e,t){e===void 0&&(e=1);var n=1/e,r=e+ +!t,i=+!!t,a=1-CD;return function(e){return((r*dk(0,a,e)|0)+i)*n}}},vD.ease=Zk[`quad.out`],SO(`onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt`,function(e){return vO+=e+`,`+e+`Params,`});var uA=function(e,t){this.id=ED++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:xO,this.set=t?t.getSetter:jA},dA=function(){function e(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,ak(this,+e.duration,1,1),this.data=e.data,xD&&(this._ctx=xD,xD.data.push(this)),Jk||Yk.wake()}var t=e.prototype;return t.delay=function(e){return e||e===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+e-this._delay),this._delay=e,this):this._delay},t.duration=function(e){return arguments.length?this.totalDuration(this._repeat>0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,ak(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(Xk(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(XO(this,e),!n._dp||n.parent||ZO(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e<this._tDur||this._ts<0&&e>0||!this._tDur&&!e)&&QO(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&Math.abs(this._zTime)===CD||!this._initted&&this._dur&&e||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),kO(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+KO(this))%(this._dur+this._rDelay)||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-e:e)+KO(this),t):this.duration()?Math.min(1,this._time/this._dur):+(this.rawTime()>0)},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?qO(this._tTime,n)+1:1},t.timeScale=function(e,t){if(!arguments.length)return this._rts===-CD?0:this._rts;if(this._rts===e)return this;var n=this.parent&&this._ts?JO(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||e===-CD?0:this._rts,this.totalTime(dk(-Math.abs(this._delay),this.totalDuration(),n),t!==!1),YO(this),UO(this)},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Xk(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==CD&&(this._tTime-=CD)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=wO(e);var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&QO(t,this,this._start-this._delay),this}return this._start},t.endTime=function(e){return this._start+(FD(e)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?JO(t.rawTime(e),this):this._tTime:this._tTime},t.revert=function(e){e===void 0&&(e=lO);var t=bD;return bD=e,OO(this)&&(this.timeline&&this.timeline.revert(e),this.totalTime(-.01,e.suppressEvents)),this.data!==`nested`&&e.kill!==!1&&this.kill(),bD=t,this},t.globalTime=function(e){for(var t=this,n=arguments.length?e:t.rawTime();t;)n=t._start+n/(Math.abs(t._ts)||1),t=t._dp;return!this.parent&&this._sat?this._sat.globalTime(e):n},t.repeat=function(e){return arguments.length?(this._repeat=e===1/0?-2:e,ok(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(e){if(arguments.length){var t=this._time;return this._rDelay=e,ok(this),t?this.time(t):this}return this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(ck(this,e),FD(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,FD(t)),this._dur||(this._zTime=-CD),this},t.play=function(e,t){return e!=null&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return e!=null&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return e!=null&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-CD:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-CD,this},t.isActive=function(){var e=this.parent||this._dp,t=this._start,n;return!!(!e||this._ts&&this._initted&&e.isActive()&&(n=e.rawTime(!0))>=t&&n<this.endTime(!0)-CD)},t.eventCallback=function(e,t,n){var r=this.vars;return arguments.length>1?(t?(r[e]=t,n&&(r[e+`Params`]=n),e===`onUpdate`&&(this._onUpdate=t)):delete r[e],this):r[e]},t.then=function(e){var t=this,n=t._prom;return new Promise(function(r){var i=jD(e)?e:jO,a=function(){var e=t.then;t.then=null,n&&n(),jD(i)&&(i=i(t))&&(i.then||i===t)&&(t.then=e),r(i),t.then=e};t._initted&&t.totalProgress()===1&&t._ts>=0||!t._tTime&&t._ts<0?a():t._prom=a})},t.kill=function(){Fk(this)},e}();MO(dA.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-CD,_prom:0,_ps:!1,_rts:1});var fA=function(e){gD(t,e);function t(t,n){var r;return t===void 0&&(t={}),r=e.call(this,t)||this,r.labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=FD(t.sortChildren),YD&&QO(t.parent||YD,hD(r),n),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&$O(hD(r),t.scrollTrigger),r}var n=t.prototype;return n.to=function(e,t,n){return lk(0,arguments,this),this},n.from=function(e,t,n){return lk(1,arguments,this),this},n.fromTo=function(e,t,n,r){return lk(2,arguments,this),this},n.set=function(e,t,n){return t.duration=0,t.parent=this,LO(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new EA(e,t,ck(this,n),1),this},n.call=function(e,t,n){return QO(this,EA.delayedCall(0,e,t),n)},n.staggerTo=function(e,t,n,r,i,a,o){return n.duration=t,n.stagger=n.stagger||r,n.onComplete=a,n.onCompleteParams=o,n.parent=this,new EA(e,n,ck(this,i)),this},n.staggerFrom=function(e,t,n,r,i,a,o){return n.runBackwards=1,LO(n).immediateRender=FD(n.immediateRender),this.staggerTo(e,t,n,r,i,a,o)},n.staggerFromTo=function(e,t,n,r,i,a,o,s){return r.startAt=n,LO(r).immediateRender=FD(r.immediateRender),this.staggerTo(e,t,r,i,a,o,s)},n.render=function(e,t,n){var r=this._time,i=this._dirty?this.totalDuration():this._tDur,a=this._dur,o=e<=0?0:wO(e),s=this._zTime<0!=e<0&&(this._initted||!a),c,l,u,d,f,p,m,h,g,_,v,y;if(this!==YD&&o>i&&e>=0&&(o=i),o!==this._tTime||n||s){if(r!==this._time&&a&&(o+=this._time-r,e+=this._time-r),c=o,g=this._start,h=this._ts,p=!h,s&&(a||(r=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat){if(v=this._yoyo,f=a+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(f*100+e,t,n);if(c=wO(o%f),o===i?(d=this._repeat,c=a):(_=wO(o/f),d=~~_,d&&d===_&&(c=a,d--),c>a&&(c=a)),_=qO(this._tTime,f),!r&&this._tTime&&_!==d&&this._tTime-_*f-this._dur<=0&&(_=d),v&&d&1&&(c=a-c,y=1),d!==_&&!this._lock){var b=v&&_&1,x=b===(v&&d&1);if(d<_&&(b=!b),r=b?0:o%a?a:o,this._lock=1,this.render(r||(y?0:wO(d*f)),t,!a)._lock=0,this._tTime=o,!t&&this.parent&&Pk(this,`onRepeat`),this.vars.repeatRefresh&&!y&&(this.invalidate()._lock=1,_=d),r&&r!==this._time||p!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act||(a=this._dur,i=this._tDur,x&&(this._lock=2,r=b?a:-1e-4,this.render(r,!0),this.vars.repeatRefresh&&!y&&this.invalidate()),this._lock=0,!this._ts&&!p))return this;iA(this,y)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(m=ik(this,wO(r),wO(c)),m&&(o-=c-(c=m._start))),this._tTime=o,this._time=c,this._act=!h,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=e,r=0),!r&&o&&a&&!t&&!_&&(Pk(this,`onStart`),this._tTime!==o))return this;if(c>=r&&e>=0)for(l=this._first;l;){if(u=l._next,(l._act||c>=l._start)&&l._ts&&m!==l){if(l.parent!==this)return this.render(e,t,n);if(l.render(l._ts>0?(c-l._start)*l._ts:(l._dirty?l.totalDuration():l._tDur)+(c-l._start)*l._ts,t,n),c!==this._time||!this._ts&&!p){m=0,u&&(o+=this._zTime=-CD);break}}l=u}else{l=this._last;for(var S=e<0?e:c;l;){if(u=l._prev,(l._act||S<=l._end)&&l._ts&&m!==l){if(l.parent!==this)return this.render(e,t,n);if(l.render(l._ts>0?(S-l._start)*l._ts:(l._dirty?l.totalDuration():l._tDur)+(S-l._start)*l._ts,t,n||bD&&OO(l)),c!==this._time||!this._ts&&!p){m=0,u&&(o+=this._zTime=S?-CD:CD);break}}l=u}}if(m&&!t&&(this.pause(),m.render(c>=r?0:-CD)._zTime=c>=r?1:-1,this._ts))return this._start=g,YO(this),this.render(e,t,n);this._onUpdate&&!t&&Pk(this,`onUpdate`,!0),(o===i&&this._tTime>=this.totalDuration()||!o&&r)&&(g===this._start||Math.abs(h)!==Math.abs(this._ts))&&(this._lock||((e||!a)&&(o===i&&this._ts>0||!o&&this._ts<0)&&VO(this,1),!t&&!(e<0&&!r)&&(o||r||!i)&&(Pk(this,o===i&&e>=0?`onComplete`:`onReverseComplete`,!0),this._prom&&!(o<i&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(e,t){var n=this;if(MD(t)||(t=ck(this,t,e)),!(e instanceof dA)){if(zD(e))return e.forEach(function(e){return n.add(e,t)}),this;if(AD(e))return this.addLabel(e,t);if(jD(e))e=EA.delayedCall(0,e);else return this}return this===e?this:QO(this,e,t)},n.getChildren=function(e,t,n,r){e===void 0&&(e=!0),t===void 0&&(t=!0),n===void 0&&(n=!0),r===void 0&&(r=-SD);for(var i=[],a=this._first;a;)a._start>=r&&(a instanceof EA?t&&i.push(a):(n&&i.push(a),e&&i.push.apply(i,a.getChildren(!0,t,n)))),a=a._next;return i},n.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},n.remove=function(e){return AD(e)?this.removeLabel(e):jD(e)?this.killTweensOf(e):(e.parent===this&&BO(this,e),e===this._recent&&(this._recent=this._last),HO(this))},n.totalTime=function(t,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=wO(Yk.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts))),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},n.addLabel=function(e,t){return this.labels[e]=ck(this,t),this},n.removeLabel=function(e){return delete this.labels[e],this},n.addPause=function(e,t,n){var r=EA.delayedCall(0,t||oO,n);return r.data=`isPause`,this._hasPause=1,QO(this,r,ck(this,e))},n.removePause=function(e){var t=this._first;for(e=ck(this,e);t;)t._start===e&&t.data===`isPause`&&VO(t),t=t._next},n.killTweensOf=function(e,t,n){for(var r=this.getTweensOf(e,n),i=r.length;i--;)_A!==r[i]&&r[i].kill(e,t);return this},n.getTweensOf=function(e,t){for(var n=[],r=_k(e),i=this._first,a=MD(t),o;i;)i instanceof EA?EO(i._targets,r)&&(a?(!_A||i._initted&&i._ts)&&i.globalTime(0)<=t&&i.globalTime(i.totalDuration())>t:!t||i.isActive())&&n.push(i):(o=i.getTweensOf(r,t)).length&&n.push.apply(n,o),i=i._next;return n},n.tweenTo=function(e,t){t||={};var n=this,r=ck(n,e),i=t,a=i.startAt,o=i.onStart,s=i.onStartParams,c=i.immediateRender,l,u=EA.to(n,MO({ease:t.ease||`none`,lazy:!1,immediateRender:!1,time:r,overwrite:`auto`,duration:t.duration||Math.abs((r-(a&&`time`in a?a.time:n._time))/n.timeScale())||CD,onStart:function(){if(n.pause(),!l){var e=t.duration||Math.abs((r-(a&&`time`in a?a.time:n._time))/n.timeScale());u._dur!==e&&ak(u,e,0,1).render(u._time,!0,!0),l=1}o&&o.apply(u,s||[])}},t));return c?u.render(0):u},n.tweenFromTo=function(e,t,n){return this.tweenTo(t,MO({startAt:{time:ck(this,e)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(e){return e===void 0&&(e=this._time),Nk(this,ck(this,e))},n.previousLabel=function(e){return e===void 0&&(e=this._time),Nk(this,ck(this,e),1)},n.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+CD)},n.shiftChildren=function(e,t,n){n===void 0&&(n=0);var r=this._first,i=this.labels,a;for(e=wO(e);r;)r._start>=n&&(r._start+=e,r._end+=e),r=r._next;if(t)for(a in i)i[a]>=n&&(i[a]+=e);return HO(this)},n.invalidate=function(t){var n=this._first;for(this._lock=0;n;)n.invalidate(t),n=n._next;return e.prototype.invalidate.call(this,t)},n.clear=function(e){e===void 0&&(e=!0);for(var t=this._first,n;t;)n=t._next,this.remove(t),t=n;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),HO(this)},n.totalDuration=function(e){var t=0,n=this,r=n._last,i=SD,a,o,s;if(arguments.length)return n.timeScale((n._repeat<0?n.duration():n.totalDuration())/(n.reversed()?-e:e));if(n._dirty){for(s=n.parent;r;)a=r._prev,r._dirty&&r.totalDuration(),o=r._start,o>i&&n._sort&&r._ts&&!n._lock?(n._lock=1,QO(n,r,o-r._delay,1)._lock=0):i=o,o<0&&r._ts&&(t-=o,(!s&&!n._dp||s&&s.smoothChildTiming)&&(n._start+=wO(o/n._ts),n._time-=o,n._tTime-=o),n.shiftChildren(-o,!1,-1/0),i=0),r._end>t&&r._ts&&(t=r._end),r=a;ak(n,n===YD&&n._time>t?n._time:t,1,1),n._dirty=0}return n._tDur},t.updateRoot=function(e){if(YD._ts&&(kO(YD,JO(e,YD)),pO=Yk.frame),Yk.frame>=gO){gO+=_D.autoSleep||120;var t=YD._first;if((!t||!t._ts)&&_D.autoSleep&&Yk._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||Yk.sleep()}}},t}(dA);MO(fA.prototype,{_lock:0,_hasPause:0,_forcing:0});var pA=function(e,t,n,r,i,a,o){var s=new BA(this._pt,e,t,0,1,PA,null,i),c=0,l=0,u,d,f,p,m,h,g,_;for(s.b=n,s.e=r,n+=``,r+=``,(g=~r.indexOf(`random(`))&&(r=Ak(r)),a&&(_=[n,r],a(_,e,t),n=_[0],r=_[1]),d=n.match(GD)||[];u=GD.exec(r);)p=u[0],m=r.substring(c,u.index),f?f=(f+1)%5:m.substr(-5)===`rgba(`&&(f=1),p!==d[l++]&&(h=parseFloat(d[l-1])||0,s._pt={_next:s._pt,p:m||l===1?m:`,`,s:h,c:p.charAt(1)===`=`?TO(h,p)-h:parseFloat(p)-h,m:f&&f<4?Math.round:0},c=GD.lastIndex);return s.c=c<r.length?r.substring(c,r.length):``,s.fp=o,(KD.test(r)||g)&&(s.e=0),this._pt=s,s},mA=function(e,t,n,r,i,a,o,s,c,l){jD(r)&&(r=r(i||0,e,a));var u=e[t],d=n===`get`?jD(u)?c?e[t.indexOf(`set`)||!jD(e[`get`+t.substr(3)])?t:`get`+t.substr(3)](c):e[t]():u:n,f=jD(u)?c?kA:OA:DA,p;if(AD(r)&&(~r.indexOf(`random(`)&&(r=Ak(r)),r.charAt(1)===`=`&&(p=TO(d,r)+(fk(d)||0),(p||p===0)&&(r=p))),!l||d!==r||vA)return!isNaN(d*r)&&r!==``?(p=new BA(this._pt,e,t,+d||0,r-(d||0),typeof u==`boolean`?NA:MA,0,f),c&&
vendor: 3,693 bytes, line 4133
4133(p.fp=c),o&&p.modifier(o,this,e),this._pt=p):(!u&&!(t in e)&&rO(t,r),pA.call(this,e,t,d,r,f,s||_D.stringFilter,c))},hA=function(e,t,n,r,i){if(jD(e)&&(e=CA(e,i,t,n,r)),!PD(e)||e.style&&e.nodeType||zD(e)||RD(e))return AD(e)?CA(e,i,t,n,r):e;var a={},o;for(o in e)a[o]=CA(e[o],i,t,n,r);return a},gA=function(e,t,n,r,i,a){var o,s,c,l;if(mO[e]&&(o=new mO[e]).init(i,o.rawVars?t[e]:hA(t[e],r,i,a,n),n,r,a)!==!1&&(n._pt=s=new BA(n._pt,i,e,0,1,o.render,o,0,o.priority),n!==Ik))for(c=n._ptLookup[n._targets.indexOf(i)],l=o._props.length;l--;)c[o._props[l]]=s;return o},_A,vA,yA=function e(t,n,r){var i=t.vars,a=i.ease,o=i.startAt,s=i.immediateRender,c=i.lazy,l=i.onUpdate,u=i.runBackwards,d=i.yoyoEase,f=i.keyframes,p=i.autoRevert,m=t._dur,h=t._startAt,g=t._targets,_=t.parent,v=_&&_.data===`nested`?_.vars.targets:g,y=t._overwrite===`auto`&&!yD,b=t.timeline,x,S,C,w,T,E,D,O,k,A,j,M,N;if(b&&(!f||!a)&&(a=`none`),t._ease=aA(a,vD.ease),t._yEase=d?rA(aA(d===!0?a:d,vD.ease)):0,d&&t._yoyo&&!t._repeat&&(d=t._yEase,t._yEase=t._ease,t._ease=d),t._from=!b&&!!i.runBackwards,!b||f&&!i.stagger){if(O=g[0]?bO(g[0]).harness:0,M=O&&i[O.prop],x=IO(i,uO),h&&(h._zTime<0&&h.progress(1),n<0&&u&&s&&!p?h.render(-1,!0):h.revert(u&&m?cO:sO),h._lazy=0),o){if(VO(t._startAt=EA.set(g,MO({data:`isStart`,overwrite:!1,parent:_,immediateRender:!0,lazy:!h&&FD(c),startAt:null,delay:0,onUpdate:l&&function(){return Pk(t,`onUpdate`)},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,n<0&&(bD||!s&&!p)&&t._startAt.revert(cO),s&&m&&n<=0&&r<=0){n&&(t._zTime=n);return}}else if(u&&m&&!h){if(n&&(s=!1),C=MO({overwrite:!1,data:`isFromStart`,lazy:s&&!h&&FD(c),immediateRender:s,stagger:0,parent:_},x),M&&(C[O.prop]=M),VO(t._startAt=EA.set(g,C)),t._startAt._dp=0,t._startAt._sat=t,n<0&&(bD?t._startAt.revert(cO):t._startAt.render(-1,!0)),t._zTime=n,!s)e(t._startAt,CD,CD);else if(!n)return}for(t._pt=t._ptCache=0,c=m&&FD(c)||c&&!m,S=0;S<g.length;S++){if(T=g[S],D=T._gsap||yO(g)[S]._gsap,t._ptLookup[S]=A={},fO[D.id]&&dO.length&&DO(),j=v===g?S:v.indexOf(T),O&&(k=new O).init(T,M||x,t,j,v)!==!1&&(t._pt=w=new BA(t._pt,T,k.name,0,1,k.render,k,0,k.priority),k._props.forEach(function(e){A[e]=w}),k.priority&&(E=1)),!O||M)for(C in x)mO[C]&&(k=gA(C,x,t,j,T,v))?k.priority&&(E=1):A[C]=w=mA.call(t,T,C,`get`,x[C],j,v,0,i.stringFilter);t._op&&t._op[S]&&t.kill(T,t._op[S]),y&&t._pt&&(_A=t,YD.killTweensOf(T,A,t.globalTime(n)),N=!t.parent,_A=0),t._pt&&c&&(fO[D.id]=1)}E&&zA(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!N,f&&n<=0&&b.render(SD,!0,!0)},bA=function(e,t,n,r,i,a,o,s){var c=(e._pt&&e._ptCache||(e._ptCache={}))[t],l,u,d,f;if(!c)for(c=e._ptCache[t]=[],d=e._ptLookup,f=e._targets.length;f--;){if(l=d[f][t],l&&l.d&&l.d._pt)for(l=l.d._pt;l&&l.p!==t&&l.fp!==t;)l=l._next;if(!l)return vA=1,e.vars[t]=`+=0`,yA(e,o),vA=0,s?iO(t+` not eligible for reset`):1;c.push(l)}for(f=c.length;f--;)u=c[f],l=u._pt||u,l.s=(r||r===0)&&!i?r:l.s+(r||0)+a*l.c,l.c=n-l.s,u.e&&(u.e=CO(n)+fk(u.e)),u.b&&(u.b=l.s+fk(u.b))},xA=function(e,t){var n=e[0]?bO(e[0]).harness:0,r=n&&n.aliases,i,a,o,s;if(!r)return t;for(a in i=PO({},t),r)if(a in i)for(s=r[a].split(`,`),o=s.length;o--;)i[s[o]]=i[a];return i},SA=function(e,t,n,r){var i=t.ease||r||`power1.inOut`,a,o;if(zD(t))o=n[e]||(n[e]=[]),t.forEach(function(e,n){return o.push({t:n/(t.length-1)*100,v:e,e:i})});else for(a in t)o=n[a]||(n[a]=[]),a===`ease`||o.push({t:parseFloat(e),v:t[a],e:i})},CA=function(e,t,n,r,i){return jD(e)?e.call(t,n,r,i):AD(e)&&~e.indexOf(`random(`)?Ak(e):e},wA=vO+`repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert`,TA={};SO(wA+`,id,stagger,delay,duration,paused,scrollTrigger`,function(e){return TA[e]=1});var EA=function(e){gD(t,e);function t(t,n,r,i){var a;
vendor: 4,262 bytes, line 4133
4133typeof n==`number`&&(r.duration=n,n=r,r=null),a=e.call(this,i?n:LO(n))||this;var o=a.vars,s=o.duration,c=o.delay,l=o.immediateRender,u=o.stagger,d=o.overwrite,f=o.keyframes,p=o.defaults,m=o.scrollTrigger,h=o.yoyoEase,g=n.parent||YD,_=(zD(t)||RD(t)?MD(t[0]):`length`in n)?[t]:_k(t),v,y,b,x,S,C,w,T;if(a._targets=_.length?yO(_):iO(`GSAP target `+t+` not found. https://gsap.com`,!_D.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=d,f||u||LD(s)||LD(c)){if(n=a.vars,v=a.timeline=new fA({data:`nested`,defaults:p||{},targets:g&&g.data===`nested`?g.vars.targets:_}),v.kill(),v.parent=v._dp=hD(a),v._start=0,u||LD(s)||LD(c)){if(x=_.length,w=u&&bk(u),PD(u))for(S in u)~wA.indexOf(S)&&(T||={},T[S]=u[S]);for(y=0;y<x;y++)b=IO(n,TA),b.stagger=0,h&&(b.yoyoEase=h),T&&PO(b,T),C=_[y],b.duration=+CA(s,hD(a),y,C,_),b.delay=(+CA(c,hD(a),y,C,_)||0)-a._delay,!u&&x===1&&b.delay&&(a._delay=c=b.delay,a._start+=c,b.delay=0),v.to(C,b,w?w(y,C,_):0),v._ease=Zk.none;v.duration()?s=c=0:a.timeline=0}else if(f){LO(MO(v.vars.defaults,{ease:`none`})),v._ease=aA(f.ease||n.ease||`none`);var E=0,D,O,k;if(zD(f))f.forEach(function(e){return v.to(_,e,`>`)}),v.duration();else{for(S in b={},f)S===`ease`||S===`easeEach`||SA(S,f[S],b,f.easeEach);for(S in b)for(D=b[S].sort(function(e,t){return e.t-t.t}),E=0,y=0;y<D.length;y++)O=D[y],k={ease:O.e,duration:(O.t-(y?D[y-1].t:0))/100*s},k[S]=O.v,v.to(_,k,E),E+=k.duration;v.duration()<s&&v.to({},{duration:s-v.duration()})}}s||a.duration(s=v.duration())}else a.timeline=0;return d===!0&&!yD&&(_A=hD(a),YD.killTweensOf(_),_A=0),QO(g,hD(a),r),n.reversed&&a.reverse(),n.paused&&a.paused(!0),(l||!s&&!f&&a._start===wO(g._time)&&FD(l)&&GO(hD(a))&&g.data!==`nested`)&&(a._tTime=-CD,a.render(Math.max(0,-c)||0)),m&&$O(hD(a),m),a}var n=t.prototype;return n.render=function(e,t,n){var r=this._time,i=this._tDur,a=this._dur,o=e<0,s=e>i-CD&&!o?i:e<CD?0:e,c,l,u,d,f,p,m,h,g;if(!a)rk(this,e,t,n);else if(s!==this._tTime||!e||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==o||this._lazy){if(c=s,h=this.timeline,this._repeat){if(d=a+this._rDelay,this._repeat<-1&&o)return this.totalTime(d*100+e,t,n);if(c=wO(s%d),s===i?(u=this._repeat,c=a):(f=wO(s/d),u=~~f,u&&u===f?(c=a,u--):c>a&&(c=a)),p=this._yoyo&&u&1,p&&(g=this._yEase,c=a-c),f=qO(this._tTime,d),c===r&&!n&&this._initted&&u===f)return this._tTime=s,this;u!==f&&(h&&this._yEase&&iA(h,p),this.vars.repeatRefresh&&!p&&!this._lock&&c!==d&&this._initted&&(this._lock=n=1,this.render(wO(d*u),!0).invalidate()._lock=0))}if(!this._initted){if(ek(this,o?e:c,n,t,s))return this._tTime=0,this;if(r!==this._time&&!(n&&this.vars.repeatRefresh&&u!==f))return this;if(a!==this._dur)return this.render(e,t,n)}if(this._tTime=s,this._time=c,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=m=(g||this._ease)(c/a),this._from&&(this.ratio=m=1-m),!r&&s&&!t&&!f&&(Pk(this,`onStart`),this._tTime!==s))return this;for(l=this._pt;l;)l.r(m,l.d),l=l._next;h&&h.render(e<0?e:h._dur*h._ease(c/this._dur),t,n)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(o&&WO(this,e,t,n),Pk(this,`onUpdate`)),this._repeat&&u!==f&&this.vars.onRepeat&&!t&&this.parent&&Pk(this,`onRepeat`),(s===this._tDur||!s)&&this._tTime===s&&(o&&!this._onUpdate&&WO(this,e,!0,!0),(e||!a)&&(s===this._tDur&&this._ts>0||!s&&this._ts<0)&&VO(this,1),!t&&(!o||r)&&(s||r||p)&&(Pk(this,s===i?`onComplete`:`onReverseComplete`,!0),this._prom&&!(s<i&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(t){return(!t||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),e.prototype.invalidate.call(this,t)},n.resetTo=function(e,t,n,r,i){Jk||Yk.wake(),this._ts||this.play();var a=Math.min(this._dur,(this._dp._time-this._start)*this._ts),o;return this._initted||yA(this,a),o=this._ease(a/this._dur),bA(this,e,t,n,r,o,a,i)?this.resetTo(e,t,n,r,1):(XO(this,0),this.parent||zO(this._dp,this,`_first`,`_last`,this._dp._sort?`_start`:0),this.render(0))},n.kill=function(e,t){if(t===void 0&&(t=`all`),!e&&(!t||t===`all`))return this._lazy=this._pt=0,this.parent?Fk(this):this.scrollTrigger&&this.scrollTrigger.kill(!!bD),this;if(this.timeline){var n=this.timeline.totalDuration();
vendor: 4,557 bytes, line 4133
4133return this.timeline.killTweensOf(e,t,_A&&_A.vars.overwrite!==!0)._first||Fk(this),this.parent&&n!==this.timeline.totalDuration()&&ak(this,this._dur*this.timeline._tDur/n,0,1),this}var r=this._targets,i=e?_k(e):r,a=this._ptLookup,o=this._pt,s,c,l,u,d,f,p;if((!t||t===`all`)&&RO(r,i))return t===`all`&&(this._pt=0),Fk(this);for(s=this._op=this._op||[],t!==`all`&&(AD(t)&&(d={},SO(t,function(e){return d[e]=1}),t=d),t=xA(r,t)),p=r.length;p--;)if(~i.indexOf(r[p]))for(d in c=a[p],t===`all`?(s[p]=t,u=c,l={}):(l=s[p]=s[p]||{},u=t),u)f=c&&c[d],f&&((!(`kill`in f.d)||f.d.kill(d)===!0)&&BO(this,f,`_pt`),delete c[d]),l!==`all`&&(l[d]=1);return this._initted&&!this._pt&&o&&Fk(this),this},t.to=function(e,n){return new t(e,n,arguments[2])},t.from=function(e,t){return lk(1,arguments)},t.delayedCall=function(e,n,r,i){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},t.fromTo=function(e,t,n){return lk(2,arguments)},t.set=function(e,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(e,n)},t.killTweensOf=function(e,t,n){return YD.killTweensOf(e,t,n)},t}(dA);MO(EA.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),SO(`staggerTo,staggerFrom,staggerFromTo`,function(e){EA[e]=function(){var t=new fA,n=mk.call(arguments,0);return n.splice(e===`staggerFromTo`?5:4,0,0),t[e].apply(t,n)}});var DA=function(e,t,n){return e[t]=n},OA=function(e,t,n){return e[t](n)},kA=function(e,t,n,r){return e[t](r.fp,n)},AA=function(e,t,n){return e.setAttribute(t,n)},jA=function(e,t){return jD(e[t])?OA:ND(e[t])&&e.setAttribute?AA:DA},MA=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},NA=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},PA=function(e,t){var n=t._pt,r=``;if(!e&&t.b)r=t.b;else if(e===1&&t.e)r=t.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+r,n=n._next;r+=t.c}t.set(t.t,t.p,r,t)},FA=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},IA=function(e,t,n,r){for(var i=this._pt,a;i;)a=i._next,i.p===r&&i.modifier(e,t,n),i=a},LA=function(e){for(var t=this._pt,n,r;t;)r=t._next,t.p===e&&!t.op||t.op===e?BO(this,t,`_pt`):t.dep||(n=1),t=r;return!n},RA=function(e,t,n,r){r.mSet(e,t,r.m.call(r.tween,n,r.mt),r)},zA=function(e){for(var t=e._pt,n,r,i,a;t;){for(n=t._next,r=i;r&&r.pr>t.pr;)r=r._next;(t._prev=r?r._prev:a)?t._prev._next=t:i=t,(t._next=r)?r._prev=t:a=t,t=n}e._pt=i},BA=function(){function e(e,t,n,r,i,a,o,s,c){this.t=t,this.s=r,this.c=i,this.p=n,this.r=a||MA,this.d=o||this,this.set=s||DA,this.pr=c||0,this._next=e,e&&(e._prev=this)}var t=e.prototype;return t.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=RA,this.m=e,this.mt=n,this.tween=t},e}();SO(vO+`parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger`,function(e){return uO[e]=1}),$D.TweenMax=$D.TweenLite=EA,$D.TimelineLite=$D.TimelineMax=fA,YD=new fA({sortChildren:!1,defaults:vD,autoRemoveChildren:!0,id:`root`,smoothChildTiming:!0}),_D.stringFilter=qk;var VA=[],HA={},UA=[],WA=0,GA=0,KA=function(e){return(HA[e]||UA).map(function(e){return e()})},qA=function(){var e=Date.now(),t=[];e-WA>2&&(KA(`matchMediaInit`),VA.forEach(function(e){var n=e.queries,r=e.conditions,i,a,o,s;for(a in n)i=XD.matchMedia(n[a]).matches,i&&(o=1),i!==r[a]&&(r[a]=i,s=1);s&&(e.revert(),o&&t.push(e))}),KA(`matchMediaRevert`),t.forEach(function(e){return e.onMatch(e,function(t){return e.add(null,t)})}),WA=e,KA(`matchMedia`))},JA=function(){function e(e,t){this.selector=t&&vk(t),this.data=[],this._r=[],this.isReverted=!1,this.id=GA++,e&&this.add(e)}var t=e.prototype;return t.add=function(e,t,n){jD(e)&&(n=t,t=e,e=jD);var r=this,i=function(){var e=xD,i=r.selector,a;return e&&e!==r&&e.data.push(r),n&&(r.selector=vk(n)),xD=r,a=t.apply(r,arguments),jD(a)&&r._r.push(a),xD=e,r.selector=i,r.isReverted=!1,a};return r.last=i,e===jD?i(r,function(e){return r.add(null,e)}):e?r[e]=i:i},t.ignore=function(e){var t=xD;xD=null,e(this),xD=t},t.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof e?t.push.apply(t,n.getTweens()):n instanceof EA&&!(n.parent&&n.parent.data===`nested`)&&t.push(n)}),t},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(e,t){var n=this;if(e?(function(){for(var t=n.getTweens(),r=n.data.length,i;r--;)i=n.data[r],i.data===`isFlip`&&(i.revert(),i.getChildren(!0,!0,!1).forEac
4133h(function(e){return t.splice(t.indexOf(e),1)}));for(t.map(function(e){return{g:e._dur||e._delay||e._sat&&!e._sat.vars.immediateRender?e.globalTime(0):-1/0,t:e}}).sort(function(e,t){return t.g-e.g||-1/0}).forEach(function(t){return t.t.revert(e)}),r=n.data.length;r--;)i=n.data[r],i instanceof fA?i.data!==`nested`&&(i.scrollTrigger&&i.scrollTrigger.revert(),i.kill()):!(i instanceof EA)&&i.revert&&i.revert(e);n._r.forEach(function(t){return t(e,n)}),n.isReverted=!0})():this.data.forEach(function(e){return e.kill&&e.kill()}),this.clear(),t)for(var r=VA.length;r--;)VA[r].id===this.id&&VA.splice(r,1)},t.revert=function(e){this.kill(e||{})},e}(),YA=function(){function e(e){this.contexts=[],this.scope=e,xD&&xD.data.push(this)}var t=e.prototype;return t.add=function(e,t,n){PD(e)||(e={matches:e});var r=new JA(0,n||this.scope),i=r.conditions={},a,o,s;for(o in xD&&!r.selector&&(r.selector=xD.selector),this.contexts.push(r),t=r.add(`onMatch`,t),r.queries=e,e)o===`all`?s=1:(a=XD.matchMedia(e[o]),a&&(VA.indexOf(r)<0&&VA.push(r),(i[o]=a.matches)&&(s=1),a.addListener?a.addListener(qA):a.addEventListener(`change`,qA)));return s&&t(r,function(e){return r.add(null,e)}),this},t.revert=function(e){this.kill(e||{})}
vendor: 8,151 bytes, line 4133
4133,t.kill=function(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},e}(),XA={registerPlugin:function(){[...arguments].forEach(function(e){return Rk(e)})},timeline:function(e){return new fA(e)},getTweensOf:function(e,t){return YD.getTweensOf(e,t)},getProperty:function(e,t,n,r){AD(e)&&(e=_k(e)[0]);var i=bO(e||{}).get,a=n?jO:AO;return n===`native`&&(n=``),e&&(t?a((mO[t]&&mO[t].get||i)(e,t,n,r)):function(t,n,r){return a((mO[t]&&mO[t].get||i)(e,t,n,r))})},quickSetter:function(e,t,n){if(e=_k(e),e.length>1){var r=e.map(function(e){return ej.quickSetter(e,t,n)}),i=r.length;return function(e){for(var t=i;t--;)r[t](e)}}e=e[0]||{};var a=mO[t],o=bO(e),s=o.harness&&(o.harness.aliases||{})[t]||t,c=a?function(t){var r=new a;Ik._pt=0,r.init(e,n?t+n:t,Ik,0,[e]),r.render(1,r),Ik._pt&&FA(1,Ik)}:o.set(e,s);return a?c:function(t){return c(e,s,n?t+n:t,o,1)}},quickTo:function(e,t,n){var r,i=ej.to(e,MO((r={},r[t]=`+=0.1`,r.paused=!0,r.stagger=0,r),n||{})),a=function(e,n,r){return i.resetTo(t,e,n,r)};return a.tween=i,a},isTweening:function(e){return YD.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=aA(e.ease,vD.ease)),FO(vD,e||{})},config:function(e){return FO(_D,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,r=e.plugins,i=e.defaults,a=e.extendTimeline;(r||``).split(`,`).forEach(function(e){return e&&!mO[e]&&!$D[e]&&iO(t+` effect requires `+e+` plugin.`)}),hO[t]=function(e,t,r){return n(_k(e),MO(t||{},i),r)},a&&(fA.prototype[t]=function(e,n,r){return this.add(hO[t](e,PD(n)?n:(r=n)&&{},this),r)})},registerEase:function(e,t){Zk[e]=aA(t)},parseEase:function(e,t){return arguments.length?aA(e,t):Zk},getById:function(e){return YD.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var n=new fA(e),r,i;for(n.smoothChildTiming=FD(e.smoothChildTiming),YD.remove(n),n._dp=0,n._time=n._tTime=YD._time,r=YD._first;r;)i=r._next,(t||!(!r._dur&&r instanceof EA&&r.vars.onComplete===r._targets[0]))&&QO(n,r,r._start-r._delay),r=i;return QO(YD,n,0),n},context:function(e,t){return e?new JA(e,t):xD},matchMedia:function(e){return new YA(e)},matchMediaRefresh:function(){return VA.forEach(function(e){var t=e.conditions,n,r;for(r in t)t[r]&&(t[r]=!1,n=1);n&&e.revert()})||qA()},addEventListener:function(e,t){var n=HA[e]||(HA[e]=[]);~n.indexOf(t)||n.push(t)},removeEventListener:function(e,t){var n=HA[e],r=n&&n.indexOf(t);r>=0&&n.splice(r,1)},utils:{wrap:Ok,wrapYoyo:kk,distribute:bk,random:Ck,snap:Sk,normalize:Ek,getUnit:fk,clamp:pk,splitColor:Hk,toArray:_k,selector:vk,mapRange:jk,pipe:wk,unitize:Tk,interpolate:Mk,shuffle:yk},install:nO,effects:hO,ticker:Yk,updateRoot:fA.updateRoot,plugins:mO,globalTimeline:YD,core:{PropTween:BA,globals:aO,Tween:EA,Timeline:fA,Animation:dA,getCache:bO,_removeLinkedListItem:BO,reverting:function(){return bD},context:function(e){return e&&xD&&(xD.data.push(e),e._ctx=xD),xD},suppressOverwrites:function(e){return yD=e}}};SO(`to,from,fromTo,delayedCall,set,killTweensOf`,function(e){return XA[e]=EA[e]}),Yk.add(fA.updateRoot),Ik=XA.to({},{duration:0});var ZA=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},QA=function(e,t){var n=e._targets,r,i,a;for(r in t)for(i=n.length;i--;)a=e._ptLookup[i][r],(a&&=a.d)&&(a._pt&&(a=ZA(a,r)),a&&a.modifier&&a.modifier(t[r],e,n[i],r))},$A=function(e,t){return{name:e,headless:1,rawVars:1,init:function(e,n,r){r._onInit=function(e){var r,i;if(AD(n)&&(r={},SO(n,function(e){return r[e]=1}),n=r),t){for(i in r={},n)r[i]=t(n[i]);n=r}QA(e,n)}}}},ej=XA.registerPlugin({name:`attr`,init:function(e,t,n,r,i){var a,o,s;for(a in this.tween=n,t)s=e.getAttribute(a)||``,o=this.add(e,`setAttribute`,(s||0)+``,t[a],r,i,0,0,a),o.op=a,o.b=s,this._props.push(a)},render:function(e,t){for(var n=t._pt;n;)bD?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:`endArray`,headless:1,init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n],0,0,0,0,0,1)}},$A(`roundProps`,xk),$A(`modifiers`),$A(`snap`,Sk))||XA;EA.version=fA.version=ej.version=`3.14.1`,tO=1,ID()&&Xk(),Zk.Power0,Zk.Power1,Zk.Power2,Zk.Power3,Zk.Power4,Zk.Linear,Zk.Quad,Zk.Cubic,Zk.Quart,Zk.Quint,Zk.Strong,Zk.Elastic,Zk.Back,Zk.SteppedEase,Zk.Bounce,Zk.Sine,Zk.Expo,Zk.Circ;var tj,nj,rj,ij,aj,oj,sj,cj=function(){return typeof window<`u`},lj={},uj=180/Math.PI,dj=Math.PI/180,fj=Math.atan2,pj=1e8,mj=/([A-Z])/g,hj=/(left|right|width|margin|padding|x)/i,gj=/[\s,\(]\S/,_j={autoAlpha:`opacity,visibility`,scale:`scaleX,scaleY`,alpha:`opacity`},vj=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},yj=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},bj=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},xj=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},Sj=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},Cj=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},wj=function(e,t){return t.set(t.t,t.p,e===1?t.e:t.b,t)},Tj=function(e,t,n){return e.style[t]=n},Ej=function(e,t,n){return e.style.setProperty(t,n)},Dj=function(e,t,n){return e._gsap[t]=n},Oj=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},kj=function(e,t,n,r,i){var a=e._gsap;a.scaleX=a.scaleY=n,a.renderTransform(i,a)},Aj=function(e,t,n,r,i){var a=e._gsap;a[t]=n,a.renderTransform(i,a)},jj=`transform`,Mj=jj+`Origin`,Nj=function e(t,n){var r=this,i=this.target,a=i.style,o=i._gsap;if(t in lj&&a){if(this.tfm=this.tfm||{},t!==`transform`)t=_j[t]||t,~t.indexOf(`,`)?t.split(`,`).forEach(function(e){return r.tfm[e]=Qj(i,e)}):this.tfm[t]=o.x?o[t]:Qj(i,t),t===Mj&&(this.tfm.zOrigin=o.zOrigin);else return _j.transform.split(`,`).forEach(function(t){return e.call(r,t,n)});if(this.props.indexOf(jj)>=0)return;o.svg&&(this.svgo=i.getAttribute(`data-svg-origin`),this.props.push(Mj,n,``)),t=jj}(a||n)&&this.props.push(t,n,a[t])},Pj=function(e){e.translate&&(e.removeProperty(`translate`),e.removeProperty(`scale`),e.removeProperty(`rotate`))},Fj=function(){for(var e=this.props,t=this.target,n=t.style,r=t._gsap,i=0,a;i<e.length;i+=3)e[i+1]?e[i+1]===2?t[e[i]](e[i+2]):t[e[i]]=e[i+2]:e[i+2]?n[e[i]]=e[i+2]:n.removeProperty(e[i].substr(0,2)===`--`?e[i]:e[i].replace(mj,`-$1`).toLowerCase());if(this.tfm){for(a in this.tfm)r[a]=this.tfm[a];r.svg&&(r.renderTransform(),t.setAttribute(`data-svg-origin`,this.svgo||``)),i=sj(),(!i||!i.isStart)&&!n[jj]&&(Pj(n),r.zOrigin&&n[Mj]&&(n[Mj]+=` `+r.zOrigin+`px`,r.zOrigin=0,r.renderTransform()),r.uncache=1)}},Ij=function(e,t){var n={target:e,props:[],revert:Fj,save:Nj};return e._gsap||ej.core.getCache(e),t&&e.style&&e.nodeType&&t.split(`,`).forEach(function(e){return n.save(e)}),n},Lj,Rj=function(e,t){var n=nj.createElementNS?nj.createElementNS((t||`http://www.w3.org/1999/xhtml`).replace(/^https/,`http`),e):nj.createElement(e);return n&&n.style?n:nj.createElement(e)},zj=function e(t,n,r){var i=getComputedStyle(t);return i[n]||i.getPropertyValue(n.replace(mj,`-$1`).toLowerCase())||i.getPropertyValue(n)||!r&&e(t,Vj(n)||n,1)||``},Bj=`O,Moz,ms,Ms,Webkit`.split(`,`),Vj=function(e,t,n){var r=(t||aj).style,i=5;if(e in r&&!n)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);i--&&!(Bj[i]+e in r););return i<0?null:(i===3?`ms`:i>=0?Bj[i]:``)+e},Hj=function(){cj()&&window.document&&(tj=window,nj=tj.document,rj=nj.documentElement,aj=Rj(`div`)||{style:{}},Rj(`div`),jj=Vj(jj),Mj=jj+`Origin`,aj.style.cssText=`border-width:0;line-height:0;position:absolute;padding:0`,Lj=!!Vj(`perspective`),sj=ej.core.reverting,ij=1)},Uj=function(e){var t=e.ownerSVGElement,n=Rj(`svg`,t&&t.getAttribute(`xmlns`)||`http://www.w3.org/2000/svg`),r=e.cloneNode(!0),i;r.style.display=`block`,n.appendChild(r),rj.appendChild(n);try{i=r.getBBox()}catch{}return n.removeChild(r),rj.removeChild(n),i},Wj=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},Gj=function(e){var t,n;try{t=e.getBBox()}catch{t=Uj(e),n=1}return t&&(t.width||t.height)||n||(t=Uj(e)),t&&!t.width&&!t.x&&!t.y?{x:+Wj(e,[`x`,`cx`,`x1`])||0,y:+Wj(e,[`y`,`cy`,`y1`])||0,width:0,height:0}:t},Kj=function(e){return!(!e.getCTM||e.parentNode&&!e.ownerSVGElement||!Gj(e))},qj=function(e,t){if(t){var n=e.style,r;
vendor: 5,528 bytes, line 4133
4133t in lj&&t!==Mj&&(t=jj),n.removeProperty?(r=t.substr(0,2),(r===`ms`||t.substr(0,6)===`webkit`)&&(t=`-`+t),n.removeProperty(r===`--`?t:t.replace(mj,`-$1`).toLowerCase())):n.removeAttribute(t)}},Jj=function(e,t,n,r,i,a){var o=new BA(e._pt,t,n,0,1,a?wj:Cj);return e._pt=o,o.b=r,o.e=i,e._props.push(n),o},Yj={deg:1,rad:1,turn:1},Xj={grid:1,flex:1},Zj=function e(t,n,r,i){var a=parseFloat(r)||0,o=(r+``).trim().substr((a+``).length)||`px`,s=aj.style,c=hj.test(n),l=t.tagName.toLowerCase()===`svg`,u=(l?`client`:`offset`)+(c?`Width`:`Height`),d=100,f=i===`px`,p=i===`%`,m,h,g,_;if(i===o||!a||Yj[i]||Yj[o])return a;if(o!==`px`&&!f&&(a=e(t,n,r,`px`)),_=t.getCTM&&Kj(t),(p||o===`%`)&&(lj[n]||~n.indexOf(`adius`)))return m=_?t.getBBox()[c?`width`:`height`]:t[u],CO(p?a/m*d:a/100*m);if(s[c?`width`:`height`]=d+(f?o:i),h=i!==`rem`&&~n.indexOf(`adius`)||i===`em`&&t.appendChild&&!l?t:t.parentNode,_&&(h=(t.ownerSVGElement||{}).parentNode),(!h||h===nj||!h.appendChild)&&(h=nj.body),g=h._gsap,g&&p&&g.width&&c&&g.time===Yk.time&&!g.uncache)return CO(a/g.width*d);if(p&&(n===`height`||n===`width`)){var v=t.style[n];t.style[n]=d+i,m=t[u],v?t.style[n]=v:qj(t,n)}else(p||o===`%`)&&!Xj[zj(h,`display`)]&&(s.position=zj(t,`position`)),h===t&&(s.position=`static`),h.appendChild(aj),m=aj[u],h.removeChild(aj),s.position=`absolute`;return c&&p&&(g=bO(h),g.time=Yk.time,g.width=h[u]),CO(f?m*a/d:m&&a?d/m*a:0)},Qj=function(e,t,n,r){var i;return ij||Hj(),t in _j&&t!==`transform`&&(t=_j[t],~t.indexOf(`,`)&&(t=t.split(`,`)[0])),lj[t]&&t!==`transform`?(i=uM(e,r),i=t===`transformOrigin`?i.svg?i.origin:dM(zj(e,Mj))+` `+i.zOrigin+`px`:i[t]):(i=e.style[t],(!i||i===`auto`||r||~(i+``).indexOf(`calc(`))&&(i=rM[t]&&rM[t](e,t,n)||zj(e,t)||xO(e,t)||+(t===`opacity`))),n&&!~(i+``).trim().indexOf(` `)?Zj(e,t,i,n)+n:i},$j=function(e,t,n,r){if(!n||n===`none`){var i=Vj(t,e,1),a=i&&zj(e,i,1);a&&a!==n?(t=i,n=a):t===`borderColor`&&(n=zj(e,`borderTopColor`))}var o=new BA(this._pt,e.style,t,0,1,PA),s=0,c=0,l,u,d,f,p,m,h,g,_,v,y,b;if(o.b=n,o.e=r,n+=``,r+=``,r.substring(0,6)===`var(--`&&(r=zj(e,r.substring(4,r.indexOf(`)`)))),r===`auto`&&(m=e.style[t],e.style[t]=r,r=zj(e,t)||r,m?e.style[t]=m:qj(e,t)),l=[n,r],qk(l),n=l[0],r=l[1],d=n.match(WD)||[],b=r.match(WD)||[],b.length){for(;u=WD.exec(r);)h=u[0],_=r.substring(s,u.index),p?p=(p+1)%5:(_.substr(-5)===`rgba(`||_.substr(-5)===`hsla(`)&&(p=1),h!==(m=d[c++]||``)&&(f=parseFloat(m)||0,y=m.substr((f+``).length),h.charAt(1)===`=`&&(h=TO(f,h)+y),g=parseFloat(h),v=h.substr((g+``).length),s=WD.lastIndex-v.length,v||(v=v||_D.units[t]||y,s===r.length&&(r+=v,o.e+=v)),y!==v&&(f=Zj(e,t,m,v)||0),o._pt={_next:o._pt,p:_||c===1?_:`,`,s:f,c:g-f,m:p&&p<4||t===`zIndex`?Math.round:0});o.c=s<r.length?r.substring(s,r.length):``}else o.r=t===`display`&&r===`none`?wj:Cj;return KD.test(r)&&(o.e=0),this._pt=o,o},eM={top:`0%`,bottom:`100%`,left:`0%`,right:`100%`,center:`50%`},tM=function(e){var t=e.split(` `),n=t[0],r=t[1]||`50%`;return(n===`top`||n===`bottom`||r===`left`||r===`right`)&&(e=n,n=r,r=e),t[0]=eM[n]||n,t[1]=eM[r]||r,t.join(` `)},nM=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var n=t.t,r=n.style,i=t.u,a=n._gsap,o,s,c;if(i===`all`||i===!0)r.cssText=``,s=1;else for(i=i.split(`,`),c=i.length;--c>-1;)o=i[c],lj[o]&&(s=1,o=o===`transformOrigin`?Mj:jj),qj(n,o);s&&(qj(n,jj),a&&(a.svg&&n.removeAttribute(`transform`),r.scale=r.rotate=r.translate=`none`,uM(n,1),a.uncache=1,Pj(r)))}},rM={clearProps:function(e,t,n,r,i){if(i.data!==`isFromStart`){var a=e._pt=new BA(e._pt,t,n,0,0,nM);return a.u=r,a.pr=-10,a.tween=i,e._props.push(n),1}}},iM=[1,0,0,1,0,0],aM={},oM=function(e){return e===`matrix(1, 0, 0, 1, 0, 0)`||e===`none`||!e},sM=function(e){var t=zj(e,jj);return oM(t)?iM:t.substr(7).match(UD).map(CO)},cM=function(e,t){var n=e._gsap||bO(e),r=e.style,i=sM(e),a,o,s,c;return n.svg&&e.getAttribute(`transform`)?(s=e.transform.baseVal.consolidate().matrix,i=[s.a,s.b,s.c,s.d,s.e,s.f],i.join(`,`)===`1,0,0,1,0,0`?iM:i):(i===iM&&!e.offsetParent&&e!==rj&&!n.svg&&(s=r.display,r.display=`block`,a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(c=1,o=e.nextElementSibling,rj.appendChild(e)),i=sM(e),s?r.display=s:qj(e,`display`),c&&(o?a.insertBefore(e,o):a?a.appendChild(e):rj.removeChild(e))),t&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},lM=function(e,t,n,r,i,a){var o=e._gsap,s=i||cM(e,!0),c=o.xOrigin||0,l=o.yOrigin||0,u=o.xOffset||0,d=o.yOffset||0,f=s[0],p=s[1],m=s[2],h=s[3],g=s[4],_=s[5],v=t.split(` `),y=parseFloat(v[0])||0,b=parseFloat(v[1])||0,x,S,C,w;n?s!==iM&&(S=f*h-p*m)&&(C=h/S*y+b*(-m/S)+(m*_-h*g)/S,w=y*(-p/S)+f/S*b-(f*_-p*g)/S,y=C,b=w):(x=Gj(e),y=x.x+(~v[0].indexOf(`%`)?y/100*x.width:y),b=x.y+(~(v[1]||v[0]).indexOf(`%`)?b/100*x.height:b)),r||r!==!1&&o.smooth?(g=y-c,_=b-l,o.xOffset=u+(g*f+_*m)-g,o.yOffset=d+(g*p+_*h)-_):o.xOffset=o.yOffset=0,o.xOrigin=y,o.yOrigin=b,o.smooth=!!r,o.origin=t,o.originIsAbsolute=!!n,e.style[Mj]=`0px 0px`,a&&(Jj(a,o,`xOrigin`,c,y),Jj(a,o,`yOrigin`,l,b),Jj(a,o,`xOffset`,u,o.xOffset),Jj(a,o,`yOffset`,d,o.yOffset)),e.setAttribute(`data-svg-origin`,y+` `+b)},uM=function(e,t){var n=e._gsap||new uA(e);if(`x`in n&&!t&&!n.uncache)return n;var r=e.style,i=n.scaleX<0,a=`px`,o=`deg`,s=getComputedStyle(e),c=zj(e,Mj)||`0`,l=u=d=m=h=g=_=v=y=0,u,d,f=p=1,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,ee,te,ne,re,F,I;return n.svg=!!(e.getCTM&&Kj(e)),s.translate&&((s.translate!==`none`||s.scale!==`none`||s.rotate!==`none`)&&(r[jj]=(s.translate===`none`?``:`translate3d(`+(s.translate+` 0 0`).split(` `).slice(0,3).join(`, `)+`) `)+(s.rotate===`
4133none`?``:`rotate(`+s.rotate+`) `)+(s.scale===`none`?``:`scale(`+s.scale.split(` `).join(`,`)+`) `)+(s[jj]===`none`?``:s[jj])),r.scale=r.rotate=r.translate=`none`),S=cM(e,n.svg),n.svg&&(n.uncache?(N=e.getBBox(),c=n.xOrigin-N.x+`px `+(n.yOrigin-N.y)+`px`,M=``):M=!t&&e.getAttribute(`data-svg-origin`),lM(e,M||c,!!M||n.originIsAbsolute,n.smooth!==!1,S)),b=n.xOrigin||0,x=n.yOrigin||0,S!==iM&&(E=S[0],D=S[1],O=S[2],k=S[3],l=A=S[4],u=j=S[5],S.length===6?(f=Math.sqrt(E*E+D*D),p=Math.sqrt(k*k+O*O),m=E||D?fj(D,E)*uj:0,_=O||k?fj(O,k)*uj+m:0,_&&(p*=Math.abs(Math.cos(_*dj))),n.svg&&(l-=b-(b*E+x*O),u-=x-(b*D+x*k))):(I=S[6],re=S[7],ee=S[8],te=S[9],ne=S[10],F=S[11],l=S[12],u=S[13],d=S[14],C=fj(I,ne),h=C*uj,C&&(w=Math.cos(-C),T=Math.sin(-C),M=A*w+ee*T,N=j*w+te*T,P=I*w+ne*T,ee=A*-T+ee*w,te=j*-T+te*w,ne=I*-T+ne*w,F=re*-T+F*w,A=M,j=N,I=P),C=fj(-O,ne),g=C*uj,C&&(w=Math.cos(-C),T=Math.sin(-C),M=E*w-ee*T,N=D*w-te*T,P=O*w-ne*T,F=k*T+F*w,E=M,D=N,O=P),C=fj(D,E),m=C*uj,C&&(w=Math.cos(C),T=Math.sin(C),M=E*w+D*T,N=A*w+j*T,D=D*w-E*T,j=j*w-A*T,E=M,A=N),h&&Math.abs(h)+Math.abs(m)>359.9&&(h=m=0,g=180-g),f=CO(Math.sqrt(E*E+D*D+O*O)),p=CO(Math.sqrt(j*j+I*I)),C=fj(A,j),_=Math.abs(C)>2e-4?C*uj:0,y=F?1/(F<0?-F:F):0),n.svg&&(M=e.getAttribute(`transform`),n.forceCSS=e.setAttribute(`transform`,``)||!oM(zj(e,jj)),M&&e.setAttribute(`transform`,M))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(f*=-1,_+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,_+=_<=0?180:-180)),t||=n.uncache,n.x=l-((n.xPercent=l&&(!t&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-l)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+a,n.y=u-((n.yPercent=u&&(!t&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-u)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+a,n.z=d+a,n.scaleX=CO(f),n.scaleY=CO(p),n.rotation=CO(m)+o,n.rotationX=CO(h)+o,n.rotationY=CO(g)+o,n.skewX=_+o,n.skewY=v+o,n.transformPerspective=y+a,(n.zOrigin=parseFloat(c.split(` `)[2])||!t&&n.zOrigin||0)&&(r[Mj]=dM(c)),n.xOffset=n.yOffset=0,n.force3D=_D.force3D,n.renderTransform=n.svg?vM:Lj?_M:pM,n.uncache=0,n},dM=function(e){return(e=e.split(` `))[0]+` `+e[1]},fM=function(e,t,n){var r=fk(t);return CO(parseFloat(t)+parseFloat(Zj(e,`x`,n+`px`,r)))+r},pM=function(e,t){t.z=`0px`,t.rotationY=t.rotationX=`0deg`,t.force3D=0,_M(e,t)},mM=`0deg`,hM=`0px`,gM=`) `,_M=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,a=n.x,o=n.y,s=n.z,c=n.rotation,l=n.rotationY,u=n.rotationX,d=n.skewX,f=n.skewY,p=n.scaleX,m=n.scaleY,h=n.transformPerspective,g=n.force3D,_=n.target,v=n.zOrigin,y=``,b=g===`auto`&&e&&e!==1||g===!0;if(v&&(u!==mM||l!==mM)){var x=parseFloat(l)*dj,S=Math.sin(x),C=Math.cos(x),w;x=parseFloat(u)*dj,w=Math.cos(x),a=fM(_,a,S*w*-v),o=fM(_,o,-Math.sin(x)*-v),s=fM(_,s,C*w*-v+v)}h!==hM&&(y+=`perspective(`+h+gM),(r||i)&&(y+=`translate(`+r+`%, `+i+`%) `),(b||a!==hM||o!==hM||s!==hM)&&(y+=s!==hM||b?`translate3d(`+a+`, `+o+`, `+s+`) `:`translate(`+a+`, `+o+gM),c!==mM&&(y+=`rotate(`+c+gM),l!==mM&&(y+=`rotateY(`+l+gM),u!==mM&&(y+=`rotateX(`+u+gM),(d!==mM||f!==mM)&&(y+=`skew(`+d+`, `+f+gM),(p!==1||m!==1)&&(y+=`scale(`+p+`, `+m+gM),_.style[jj]=y||`translate(0, 0)`},vM=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,a=n.x,o=n.y,s=n.rotation,c=n.skewX,l=n.skewY,u=n.scaleX,d=n.scaleY,f=n.target,p=n.xOrigin,m=n.yOrigin,h=n.xOffset,g=n.yOffset,_=n.forceCSS,v=parseFloat(a),y=parseFloat(o),b,x,S,C,w;
vendor: 4,327 bytes, line 4133
4133s=parseFloat(s),c=parseFloat(c),l=parseFloat(l),l&&(l=parseFloat(l),c+=l,s+=l),s||c?(s*=dj,c*=dj,b=Math.cos(s)*u,x=Math.sin(s)*u,S=Math.sin(s-c)*-d,C=Math.cos(s-c)*d,c&&(l*=dj,w=Math.tan(c-l),w=Math.sqrt(1+w*w),S*=w,C*=w,l&&(w=Math.tan(l),w=Math.sqrt(1+w*w),b*=w,x*=w)),b=CO(b),x=CO(x),S=CO(S),C=CO(C)):(b=u,C=d,x=S=0),(v&&!~(a+``).indexOf(`px`)||y&&!~(o+``).indexOf(`px`))&&(v=Zj(f,`x`,a,`px`),y=Zj(f,`y`,o,`px`)),(p||m||h||g)&&(v=CO(v+p-(p*b+m*S)+h),y=CO(y+m-(p*x+m*C)+g)),(r||i)&&(w=f.getBBox(),v=CO(v+r/100*w.width),y=CO(y+i/100*w.height)),w=`matrix(`+b+`,`+x+`,`+S+`,`+C+`,`+v+`,`+y+`)`,f.setAttribute(`transform`,w),_&&(f.style[jj]=w)},yM=function(e,t,n,r,i){var a=360,o=AD(i),s=parseFloat(i)*(o&&~i.indexOf(`rad`)?uj:1)-r,c=r+s+`deg`,l,u;return o&&(l=i.split(`_`)[1],l===`short`&&(s%=a,s!==s%(a/2)&&(s+=s<0?a:-a)),l===`cw`&&s<0?s=(s+a*pj)%a-~~(s/a)*a:l===`ccw`&&s>0&&(s=(s-a*pj)%a-~~(s/a)*a)),e._pt=u=new BA(e._pt,t,n,r,s,yj),u.e=c,u.u=`deg`,e._props.push(n),u},bM=function(e,t){for(var n in t)e[n]=t[n];return e},xM=function(e,t,n){var r=bM({},n._gsap),i=`perspective,force3D,transformOrigin,svgOrigin`,a=n.style,o,s,c,l,u,d,f,p;for(s in r.svg?(c=n.getAttribute(`transform`),n.setAttribute(`transform`,``),a[jj]=t,o=uM(n,1),qj(n,jj),n.setAttribute(`transform`,c)):(c=getComputedStyle(n)[jj],a[jj]=t,o=uM(n,1),a[jj]=c),lj)c=r[s],l=o[s],c!==l&&i.indexOf(s)<0&&(f=fk(c),p=fk(l),u=f===p?parseFloat(c):Zj(n,s,c,p),d=parseFloat(l),e._pt=new BA(e._pt,o,s,u,d-u,vj),e._pt.u=p||0,e._props.push(s));bM(o,r)};SO(`padding,margin,Width,Radius`,function(e,t){var n=`Top`,r=`Right`,i=`Bottom`,a=`Left`,o=(t<3?[n,r,i,a]:[n+a,n+r,i+r,i+a]).map(function(n){return t<2?e+n:`border`+n+e});rM[t>1?`border`+e:e]=function(e,t,n,r,i){var a,s;if(arguments.length<4)return a=o.map(function(t){return Qj(e,t,n)}),s=a.join(` `),s.split(a[0]).length===5?a[0]:s;a=(r+``).split(` `),s={},o.forEach(function(e,t){return s[e]=a[t]=a[t]||a[(t-1)/2|0]}),e.init(t,s,i)}});var SM={name:`css`,register:Hj,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,r,i){var a=this._props,o=e.style,s=n.vars.startAt,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w;for(m in ij||Hj(),this.styles=this.styles||Ij(e),C=this.styles.props,this.tween=n,t)if(m!==`autoRound`&&(l=t[m],!(mO[m]&&gA(m,t,n,r,e,i)))){if(f=typeof l,p=rM[m],f===`function`&&(l=l.call(n,r,e,i),f=typeof l),f===`string`&&~l.indexOf(`random(`)&&(l=Ak(l)),p)p(this,e,m,l,n)&&(S=1);else if(m.substr(0,2)===`--`)c=(getComputedStyle(e).getPropertyValue(m)+``).trim(),l+=``,Gk.lastIndex=0,Gk.test(c)||(h=fk(c),g=fk(l),g?h!==g&&(c=Zj(e,m,c,g)+g):h&&(l+=h)),this.add(o,`setProperty`,c,l,r,i,0,0,m),a.push(m),C.push(m,0,o[m]);else if(f!==`undefined`){if(s&&m in s?(c=typeof s[m]==`function`?s[m].call(n,r,e,i):s[m],AD(c)&&~c.indexOf(`random(`)&&(c=Ak(c)),fk(c+``)||c===`auto`||(c+=_D.units[m]||fk(Qj(e,m))||``),(c+``).charAt(1)===`=`&&(c=Qj(e,m))):c=Qj(e,m),d=parseFloat(c),_=f===`string`&&l.charAt(1)===`=`&&l.substr(0,2),_&&(l=l.substr(2)),u=parseFloat(l),m in _j&&(m===`autoAlpha`&&(d===1&&Qj(e,`visibility`)===`hidden`&&u&&(d=0),C.push(`visibility`,0,o.visibility),Jj(this,o,`visibility`,d?`inherit`:`hidden`,u?`inherit`:`hidden`,!u)),m!==`scale`&&m!==`transform`&&(m=_j[m],~m.indexOf(`,`)&&(m=m.split(`,`)[0]))),v=m in lj,v){if(this.styles.save(m),w=l,f===`string`&&l.substring(0,6)===`var(--`){if(l=zj(e,l.substring(4,l.indexOf(`)`))),l.substring(0,5)===`calc(`){var T=e.style.perspective;e.style.perspective=l,l=zj(e,`perspective`),T?e.style.perspective=T:qj(e,`perspective`)}u=parseFloat(l)}if(y||(b=e._gsap,b.renderTransform&&!t.parseTransform||uM(e,t.parseTransform),x=t.smoothOrigin!==!1&&b.smooth,y=this._pt=new BA(this._pt,o,jj,0,1,b.renderTransform,b,0,-1),y.dep=1),m===`scale`)this._pt=new BA(this._pt,b,`scaleY`,b.scaleY,(_?TO(b.scaleY,_+u):u)-b.scaleY||0,vj),this._pt.u=0,a.push(`scaleY`,m),m+=`X`;else if(m===`transformOrigin`){C.push(Mj,0,o[Mj]),l=tM(l),b.svg?lM(e,l,0,x,0,this):(g=parseFloat(l.split(` `)[2])||0,g!==b.zOrigin&&Jj(this,b,`zOrigin`,b.zOrigin,g),Jj(this,o,m,dM(c),dM(l)));continue}else if(m===`svgOrigin`){lM(e,l,1,x,0,this);continue}else if(m in aM){yM(this,b,m,d,_?TO(d,_+l):l);continue}else if(m===`smoothOrigin`){Jj(this,b,`smooth`,b.smooth,l);continue}else if(m===`force3D`){b[m]=l;continue}else if(m===`transform`){xM(this,l,e);continue}}else m in o||(m=Vj(m)||m);
4133if(v||(u||u===0)&&(d||d===0)&&!gj.test(l)&&m in o)h=(c+``).substr((d+``).length),u||=0,g=fk(l)||(m in _D.units?_D.units[m]:h),h!==g&&(d=Zj(e,m,c,g)),this._pt=new BA(this._pt,v?b:o,m,d,(_?TO(d,_+u):u)-d,!v&&(g===`px`||m===`zIndex`)&&t.autoRound!==!1?Sj:vj),this._pt.u=g||0,v&&w!==l?(this._pt.b=c,this._pt.e=w,this._pt.r=xj):h!==g&&g!==`%`&&(this._pt.b=c,this._pt.r=bj);else if(m in o)$j.call(this,e,m,c,_?_+l:l);else if(m in e)this.add(e,m,c||e[m],_?_+l:l,r,i);else if(m!==`parseTransform`){rO(m,l);continue}v||(m in o?C.push(m,0,o[m]):typeof e[m]==`function`?C.push(m,2,e[m]()):C.push(m,1,c||e[m])),a.push(m)}}S&&zA(this)},render:function(e,t){if(t.tween._time||!sj())for(var n=t._pt;n;)n.r(e,n.d),n=n._next;else t.styles.revert()},get:Qj,aliases:_j,getSetter:function(e,t,n){var r=_j[t];return r&&r.indexOf(`,`)<0&&(t=r),t in lj&&t!==Mj&&(e._gsap.x||Qj(e,`x`))?n&&oj===n?t===`scale`?Oj:Dj:(oj=n||{})&&(t===`scale`?kj:Aj):e.style&&!ND(e.style[t])?Tj:~t.indexOf(`-`)?Ej:jA(e,t)},core:{_removeProperty:qj,_getMatrix:cM}};ej.utils.checkPrefix=Vj,ej.core.getStyleSaver=Ij,(function(e,t,n,r){var i=SO(e+`,`+t+`,`+n,function(e){lj[e]=1});SO(t,function(e){_D.units[e]=`deg`,aM[e]=1}),_j[i[13]]=e+`,`+t,SO(r,function(e){var t=e.split(`:`);_j[t[1]]=i[t[0]]})})(`x,y,z,scale,scaleX,scaleY,xPercent,yPercent`,`rotation,rotationX,rotationY,skewX,skewY`,`transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective`,`0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY`),SO(`x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective`,function(e){_D.units[e]=`px`}),ej.registerPlugin(SM);var CM=ej.registerPlugin(SM)||ej;CM.core.Tween;var wM=Object.create,TM=Object.defineProperty,EM=Object.getOwnPropertyDescriptor,DM=Object.getOwnPropertyNames,OM=Object.getPrototypeOf,kM=Object.prototype.hasOwnProperty,AM=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),jM=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=DM(t),a=0,o=i.length,s;a<o;a++)s=i[a],!kM.call(e,s)&&s!==n&&TM(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=EM(t,s))||r.enumerable});return e},MM=(e,t,n)=>(n=e==null?{}:wM(OM(e)),jM(t||!e||!e.__esModule?TM(n,`default`,{value:e,enumerable:!0}):n,e)),NM={ARTIST_WORKSHOP:`artist_workshop_2k.hdr`,LUXURY_ROOM:`luxury_room_2k.hdr`,LUXURY_ROOM_1K:`luxury_room_1k.hdr`},PM={[NM.ARTIST_WORKSHOP]:[0,0,0],[NM.LUXURY_ROOM]:[0,kr.degToRad(-15),0],[NM.LUXURY_ROOM_1K]:[0,kr.degToRad(-15),0]},FM={ERROR:0,LOG:2,SILENT:-1/0,WARN:1},IM=`[3d-preview]`,LM={ERROR_LOADING_ENVIRONMENT:`Error Loading Environment`,ERROR_LOADING_FRAME_MODEL:`Error Loading Frame Model`,ERROR_LOADING_IMAGE_TEXTURE:`Error Loading Image Texture`,ERROR_LOADING_MODEL:`Error Loading Model`,ERROR_LOADING_MOLDING_TEXTURE:`Error Loading Molding Texture`,ERROR_LOADING_PASSEPARTOUT_MODEL:`Error Loading Passepartout Model`,ERROR_NO_FRAME_MATERIAL:`No frame material found`,ERROR_NO_IMAGE_MATERIAL:`No image material found`,ERROR_NO_PASSEPARTOUT_MATERIAL:`No passepartout material found`,ERROR_NO_SCALING_BONES:`No scaling bones found in model`,ERROR_UNSUPPORTED_FRAME_TYPE:`No 3D model for frame type`,LOG_PRODUCT_OPTION_CHANGE:`Product option change`,LOG_SIZE_CHANGE:`Size change`,LOG_TILT_CHANGE:`Tilt change`,SUCCESS_ENVIRONMENT_LOADED:`Successfully loaded environment`,SUCCESS_IMAGE_TEXTURE_LOADED:`Successfully loaded image texture`},RM={animations:{init:{duration:2.1},productChange:{duration:.35}},baseUrl:`https://mp-prod-shared-product-images.s3-eu-central-1.amazonaws.com`,dimension:{height:600,width:800},environmentFile:NM.LUXURY_ROOM_1K,framesBaseUrl:`https://mp-prod-de-frames.s3-eu-central-1.amazonaws.com`,imageUrl:`/images/leinwand-landscape.png`,inactivityTimeout:5e3,isTilting:!1,lighting:{ambient:0},logLevel:FM.WARN,modelFile:z[`poster-laminierung-keine`],paddingFraction:.05,showBackground:!1,showStats:!1},zM=(e,t,n,r)=>{let i=e.geometry.attributes.skinIndex,a=e.geometry.attributes.skinWeight;n.elements.fill(0);for(let o=0;o<4;o++){let s=a.getComponent(t,o);if(s===0)continue;let c=i.getComponent(t,o);r.multiplyMatrices(e.skeleton.bones[c].matrixWorld,e.skeleton.boneInverses[c]);for(let e=0;e<16;e++)n.elements[e]+=r.elements[e]*s}return n.multiply(e.bindMatrix).premultiply(e.bindMatrixInverse)},BM=e=>{let t=e.geometry.clone(),n=t.attributes.position,r=t.attributes.normal,i=new K,a=new K,o=new G;for(let t=0;t<n.count;t++)zM(e,t,i,a),o.fromBufferAttribute(n,t).applyMatrix4(i),n.setXYZ(t,o.x,o.y,o.z),r&&(o.fromBufferAttribute(r,t).transformDirection(i),r.setXYZ(t,o.x,o.y,o.z));return t.deleteAttribute(`skinIndex`),t.deleteAttribute(`skinWeight`),t},VM=e=>{e.updateMatrixWorld(!0);let t=new ki;return e.traverse(e=>{if(!e.isMesh)return;let n=e,r=new Fo(n.isSkinnedMesh?BM(n):n.geometry,n.material);r.name=n.name,r.matrixAutoUpdate=!1,r.matrix.copy(n.matrixWorld),t.add(r)}),t},HM=`3d`,UM={ENV:`${HM}/env`,MODELS:`${HM}/models`,MOLDINGS:`resources/moldings`},WM=e=>!Array.isArray(e)&&e.name===`Image`,GM=e=>!Array.isArray(e)&&e.name.startsWith(`Frame`),KM=e=>!Array.isArray(e)&&e.name===`Passepartout`,qM=e=>e?.matType&&e.matType!==Ee.NONE&&e.matSize?e.matSize:0,JM=(e,t=[])=>{e.traverse(e=>{if(!Ow(e))return;e.geometry.dispose(),e.isSkinnedMesh&&e.skeleton.dispose();let n=Array.isArray(e.material)?e.material:[e.material];for(let e of n){for(let n of Object.values(e))n instanceof Jr&&!t.includes(n)&&n.dispose();e.dispose()}})},YM=e=>`${e.baseUrl}/${UM.MODELS}/${e.modelFile}`,XM=e=>`${e.baseUrl}/${UM.ENV}/${e.environmentFile}`,ZM=(e,t)=>`${e.baseUrl}/${UM.MODELS}/${Te(t)?.modelFile}`,QM=e=>`${e.baseUrl}/${UM.MODELS}/${Oe}`,$M=(e,t)=>`${e.framesBaseUrl}/${UM.MOLDINGS}/${t.frameType}-textur.jpg`,eN=({height:e,width:t})=>t/e,tN=e=>e/1e3,nN=(e,t)=>{let n=t&&Te(t);if(!n)return e;let r=2*(qM(t)+n.gapWidth+n.moldingWidth);return{height:e.height+r,width:e.width+r}},rN=(e,t)=>Math.tan(kr.degToRad(t))*e,iN=e=>{let t=new Map;return e.traverse(e=>{e.isBone&&t.set(e,e.position.clone())}),t.size>0?t:null},aN=(e,t,n)=>Math.sign(e)*(t/2+n),oN=(e,{height:t,width:n},{offset:r=0,outerOffset:i=r}={})=>{for(let[a,o]of e){let e=a.name.endsWith(`-outer`)?i:r;a.position.set(aN(o.x,tN(n),e),o.y,aN(o.z,tN(t),e))}},sN=e=>{let t=new G,n=0,r=0;for(let i of e)i.getWorldPosition(t),n=Math.max(n,Math.abs(t.y)),r=Math.max(r,Math.abs(t.z));return r>n},cN=e=>{e.traverse(e=>{e.isSkinnedMesh&&(e.frustumCulled=!1)})},lN=new uE;
4133lN.setDecoderPath(`https://www.gstatic.com/draco/versioned/decoders/1.5.6/`);var uN=new hE;uN.setDRACOLoader(lN);var dN=(e,t,n,r)=>{let i=r*n,a=e=>e+2*t+2*n;return{repeatHorizontal:a(e.width)/i,repeatVertical:a(e.height)/i}},fN=(e,t)=>{let n=eN(t)/eN(e),r=1;return n>1&&(n=1,r=eN(e)/eN(t)),{offsetX:(1-n)/2,offsetY:(1-r)/2,repeatX:n,repeatY:r}},pN=new dd,mN=(e,t)=>{e.traverse(e=>{if(e.isMesh){let n=e;for(let e of Array.isArray(n.material)?n.material:[n.material])t(e,n)}})},hN=async(e,t,n)=>{let{scene:r}=await uN.loadAsync(e),i=iN(r);if(!i)throw Error(`Model has no scaling bones: ${e}`);return sN(i.keys())&&(r.rotation.x=Math.PI/2),oN(i,t,n),r},gN=e=>{e.flipY=!1,e.colorSpace=hn,e.minFilter=Ge,e.magFilter=Ve,e.needsUpdate=!0},_N=async(e,t)=>{let n=await pN.loadAsync(t.imageUrl);gN(n);let{offsetX:r,offsetY:i,repeatX:a,repeatY:o}=fN({height:n.image.height,width:n.image.width},t.dimension);n.repeat.set(a,o),n.offset.set(r,i),mN(e,e=>{WM(e)&&(e.map=n)})},vN=async(e,t)=>{let n=t.frame,{gapWidth:r=0,moldingWidth:i=0}=Te(n)??{},a=await pN.loadAsync($M(t,n));gN(a),a.wrapS=Fe,a.wrapT=Fe;let o=a.clone(),{height:s,width:c}=a.image,{repeatHorizontal:l,repeatVertical:u}=dN(t.dimension,qM(n)+r,i,c/s);a.repeat.set(l,1),o.repeat.set(u,1),mN(e,e=>{GM(e)&&(e.map=e.name===`Frame Vertical`?o:a)})},yN=(e,t)=>{let n=t.frame?.matType;n&&n!==Ee.NONE&&mN(e,e=>{KM(e)&&e.color.set(De[n])})},bN=e=>{mN(e,e=>{let t=e;t.transmission>0&&(t.transparent=!0,t.opacity=.15,t.alphaTest=0)})},xN=async e=>{let t={...oe(e,RM),frame:e.frame??void 0},{dimension:n,frame:r}=t,i=r?Te(r):null;if(r&&!i)throw Error(`Unsupported frame type: ${r.frameType}`);let a=qM(r),o=new ki,s=[],c=await hN(YM(t),n);if(s.push(_N(c,t)),o.add(c),r&&i){let e=await hN(ZM(t,r),n,{offset:tN(a+i.gapWidth)});if(s.push(vN(e,t)),o.add(e),a>0){let e=await hN(QM(t),n,{offset:0,outerOffset:tN(a)});yN(e,t),o.add(e)}}await Promise.all(s),bN(o);let l=new ki;l.rotation.x=-Math.PI/2,l.add(VM(o));let u=new ki;u.add(l),u.updateMatrixWorld(!0);let d=await new sv().parseAsync(u,{ar:{anchoring:{type:`plane`},planeAnchoring:{alignment:`vertical`}},includeAnchoringProperties:!0,maxTextureSize:2048,quickLookCompatible:!0});JM(u),JM(o);let f=new Uint8Array(d.byteLength);return f.set(d),new Blob([f],{type:`model/vnd.usdz+zip`})},SN=/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//,CN=()=>typeof document>`u`||typeof navigator>`u`||!(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1)?!1:SN.test(navigator.userAgent)?!0:!!document.createElement(`a`).relList?.supports?.(`ar`),wN=async e=>{if(!CN())throw Error(`AR Quick Look is not supported on this device`);let t=await xN(e),n=URL.createObjectURL(t),r=document.createElement(`a`);r.setAttribute(`rel`,`ar`),r.setAttribute(`download`,`myposter.usdz`),r.setAttribute(`href`,`${n}#allowsContentScaling=0`),r.appendChild(document.createElement(`img`)),r.style.display=`none`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)},TN=parseInt(`184`.replace(/\D+/g,``)),EN=Object.defineProperty,DN=(e,t,n)=>t in e?EN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ON=(e,t,n)=>(DN(e,typeof t==`symbol`?t:t+``,n),n),kN=(()=>{let e=class extends Fo{constructor(t,n={}){super(t),this.isReflector=!0,this.type=`Reflector`,this.camera=new Td;let r=this,i=n.color===void 0?new q(8355711):new q(n.color),a=n.textureWidth||512,o=n.textureHeight||512,s=n.clipBias||0,c=n.shader||e.ReflectorShader,l=n.multisample===void 0?4:n.multisample,u=new ds,d=new G,f=new G,p=new G,m=new K,h=new G(0,0,-1),g=new Yr,_=new G,v=new G,y=new Yr,b=new K,x=this.camera,S=new Zr(a,o,{samples:l,type:$e}),C=new gu({uniforms:pu.clone(c.uniforms),fragmentShader:c.fragmentShader,vertexShader:c.vertexShader});C.uniforms.tDiffuse.value=S.texture,C.uniforms.color.value=i,C.uniforms.textureMatrix.value=b,this.material=C,this.onBeforeRender=function(e,t,n){if(f.setFromMatrixPosition(r.matrixWorld),p.setFromMatrixPosition(n.matrixWorld),m.extractRotation(r.matrixWorld),d.set(0,0,1),d.applyMatrix4(m),_.subVectors(f,p),_.dot(d)>0)return;_.reflect(d).negate(),_.add(f),m.extractRotation(n.matrixWorld),h.set(0,0,-1),h.applyMatrix4(m),h.add(p),v.subVectors(f,h),v.reflect(d).negate(),v.add(f),x.position.copy(_),x.up.set(0,1,0),x.up.applyMatrix4(m),x.up.reflect(d),x.lookAt(v),x.far=n.far,x.updateMatrixWorld(),x.projectionMatrix.copy(n.projectionMatrix),b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(x.projectionMatrix),b.multiply(x.matrixWorldInverse),b.multiply(r.matrixWorld),u.setFromNormalAndCoplanarPoint(d,f),u.applyMatrix4(x.matrixWorldInverse),g.set(u.normal.x,u.normal.y,u.normal.z,u.constant);let i=x.projectionMatrix;y.x=(Math.sign(g.x)+i.elements[8])/i.elements[0],y.y=(Math.sign(g.y)+i.elements[9])/i.elements[5],y.z=-1,y.w=(1+i.elements[10])/i.elements[14],g.multiplyScalar(2/g.dot(y)),i.elements[2]=g.x,i.elements[6]=g.y,i.elements[10]=g.z+1-s,i.elements[14]=g.w,r.visible=!1;let a=e.getRenderTarget(),o=e.xr.enabled,c=e.shadowMap.autoUpdate,l=e.toneMapping,C=!1;
4133C=`outputColorSpace`in e?e.outputColorSpace===`srgb`:e.outputEncoding===3001,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,`outputColorSpace`in e?e.outputColorSpace=`srgb-linear`:e.outputEncoding=3e3,e.toneMapping=0,e.setRenderTarget(S),e.state.buffers.depth.setMask(!0),e.autoClear===!1&&e.clear(),e.render(t,x),e.xr.enabled=o,e.shadowMap.autoUpdate=c,e.toneMapping=l,`outputColorSpace`in e?e.outputColorSpace=C?`srgb`:`srgb-linear`:e.outputEncoding=C?3001:3e3,e.setRenderTarget(a);let w=n.viewport;w!==void 0&&e.state.viewport(w),r.visible=!0},this.getRenderTarget=function(){return S},this.dispose=function(){S.dispose(),r.material.dispose()}}},t=e;return ON(t,`ReflectorShader`,{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:`
4134		uniform mat4 textureMatrix;
4135		varying vec4 vUv;
4136
4137		#include <common>
4138		#include <logdepthbuf_pars_vertex>
4139
4140		void main() {
4141
4142			vUv = textureMatrix * vec4( position, 1.0 );
4143
4144			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4145
4146			#include <logdepthbuf_vertex>
4147
4148		}`,fragmentShader:`
4149		uniform vec3 color;
4150		uniform sampler2D tDiffuse;
4151		varying vec4 vUv;
4152
4153		#include <logdepthbuf_pars_fragment>
4154
4155		float blendOverlay( float base, float blend ) {
4156
4157			return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );
4158
4159		}
4160
4161		vec3 blendOverlay( vec3 base, vec3 blend ) {
4162
4163			return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );
4164
4165		}
4166
4167		void main() {
4168
4169			#include <logdepthbuf_fragment>
4170
4171			vec4 base = texture2DProj( tDiffuse, vUv );
4172			gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );
4173
4174			#include <tonemapping_fragment>
4175			#include <${TN>=154?`colorspace_fragment`:`encodings_fragment`}>
4176
4177		}`}),t})(),AN=class extends ud{constructor(e){super(e),this.type=$e}parse(e){let t=function(e,t){switch(e){case 1:throw Error(`THREE.RGBELoader: Read Error: `+(t||``));case 2:throw Error(`THREE.RGBELoader: Write Error: `+(t||``));case 3:throw Error(`THREE.RGBELoader: Bad File Format: `+(t||``));default:case 4:throw Error(`THREE.RGBELoader: Memory Error: `+(t||``))}},n=function(e,t,n){t||=1024;let r=e.pos,i=-1,a=0,o=``,s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=s.indexOf(`
4178`))&&a<t&&r<e.byteLength;)o+=s,a+=s.length,r+=128,s+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<i&&(!1!==n&&(e.pos+=a+i+1),o+s.slice(0,i))},r=function(e){let r=/^#\?(\S+)/,i=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,a=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,o=/^\s*FORMAT=(\S+)\s*$/,s=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,c={valid:0,string:``,comments:``,programtype:`RGBE`,format:``,gamma:1,exposure:1,width:0,height:0},l,u;for((e.pos>=e.byteLength||!(l=n(e)))&&t(1,`no header found`),(u=l.match(r))||t(3,`bad initial token`),c.valid|=1,c.programtype=u[1],c.string+=l+`
4179`;l=n(e),!1!==l;){if(c.string+=l+`
4180`,l.charAt(0)===`#`){c.comments+=l+`
4181`;continue}if((u=l.match(i))&&(c.gamma=parseFloat(u[1])),(u=l.match(a))&&(c.exposure=parseFloat(u[1])),(u=l.match(o))&&(c.valid|=2,c.format=u[1]),(u=l.match(s))&&(c.valid|=4,c.height=parseInt(u[1],10),c.width=parseInt(u[2],10)),c.valid&2&&c.valid&4)break}return c.valid&2||t(3,`missing format specifier`),c.valid&4||t(3,`missing image size specifier`),c},i=function(e,n,r){let i=n;if(i<8||i>32767||e[0]!==2||e[1]!==2||e[2]&128)return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,`wrong scanline width`);let a=new Uint8Array(4*n*r);a.length||t(4,`unable to allocate buffer space`);let o=0,s=0,c=4*i,l=new Uint8Array(4),u=new Uint8Array(c),d=r;for(;d>0&&s<e.byteLength;){s+4>e.byteLength&&t(1),l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++],(l[0]!=2||l[1]!=2||(l[2]<<8|l[3])!=i)&&t(3,`bad rgbe scanline format`);let n=0,r;for(;n<c&&s<e.byteLength;){r=e[s++];let i=r>128;if(i&&(r-=128),(r===0||n+r>c)&&t(3,`bad scanline data`),i){let t=e[s++];for(let e=0;e<r;e++)u[n++]=t}else u.set(e.subarray(s,s+r),n),n+=r,s+=r}let f=i;for(let e=0;e<f;e++){let t=0;a[o]=u[e+t],t+=i,a[o+1]=u[e+t],t+=i,a[o+2]=u[e+t],t+=i,a[o+3]=u[e+t],o+=4}d--}return a},a=function(e,t,n,r){let i=2**(e[t+3]-128)/255;n[r+0]=e[t+0]*i,n[r+1]=e[t+1]*i,n[r+2]=e[t+2]*i,n[r+3]=1},o=function(e,t,n,r){let i=2**(e[t+3]-128)/255;n[r+0]=ya.toHalfFloat(Math.min(e[t+0]*i,65504)),n[r+1]=ya.toHalfFloat(Math.min(e[t+1]*i,65504)),n[r+2]=ya.toHalfFloat(Math.min(e[t+2]*i,65504)),n[r+3]=ya.toHalfFloat(1)},s=new Uint8Array(e);s.pos=0;let c=r(s),l=c.width,u=c.height,d=i(s.subarray(s.pos),l,u),f,p,m;switch(this.type){case Qe:m=d.length/4;let e=new Float32Array(m*4);for(let t=0;t<m;t++)a(d,t*4,e,t*4);f=e,p=Qe;break;case $e:m=d.length/4;let t=new Uint16Array(m*4);for(let e=0;e<m;e++)o(d,e*4,t,e*4);f=t,p=$e;break;default:throw Error(`THREE.RGBELoader: Unsupported type: `+this.t
4181ype)}return{width:l,height:u,data:f,header:c.string,gamma:c.gamma,exposure:c.exposure,type:p}}setDataType(e){return this.type=e,this}load(e,t,n,r){function i(e,n){switch(e.type){case Qe:case $e:`colorSpace`in e?e.colorSpace=`srgb-linear`:e.encoding=3e3,e.minFilter=Ve,e.magFilter=Ve,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,n)}return super.load(e,i,n,r)}},jN={LEFT:1,RIGHT:2,MIDDLE:4},Q=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),MN={NONE:0,IN:1,OUT:-1};function NN(e){return e.isPerspectiveCamera}function PN(e){return e.isOrthographicCamera}var FN=Math.PI*2,IN=Math.PI/2,LN=1e-5,RN=Math.PI/180;function zN(e,t,n){return Math.max(t,Math.min(n,e))}function BN(e,t=LN){return Math.abs(e)<t}function VN(e,t,n=LN){return BN(e-t,n)}function HN(e,t){return Math.round(e/t)*t}function UN(e){return isFinite(e)?e:e<0?-Number.MAX_VALUE:Number.MAX_VALUE}function WN(e){return Math.abs(e)<Number.MAX_VALUE?e:e*(1/0)}function GN(e,t,n,r,i=1/0,a){r=Math.max(1e-4,r);let o=2/r,s=o*a,c=1/(1+s+.48*s*s+.235*s*s*s),l=e-t,u=t,d=i*r;
vendor: 44,023 bytes, line 4181
4181l=zN(l,-d,d),t=e-l;let f=(n.value+o*l)*a;n.value=(n.value-o*f)*c;let p=t+(l+f)*c;return u-e>0==p>u&&(p=u,n.value=(p-u)/a),p}function KN(e,t,n,r,i=1/0,a,o){r=Math.max(1e-4,r);let s=2/r,c=s*a,l=1/(1+c+.48*c*c+.235*c*c*c),u=t.x,d=t.y,f=t.z,p=e.x-u,m=e.y-d,h=e.z-f,g=u,_=d,v=f,y=i*r,b=y*y,x=p*p+m*m+h*h;if(x>b){let e=Math.sqrt(x);p=p/e*y,m=m/e*y,h=h/e*y}u=e.x-p,d=e.y-m,f=e.z-h;let S=(n.x+s*p)*a,C=(n.y+s*m)*a,w=(n.z+s*h)*a;n.x=(n.x-s*S)*l,n.y=(n.y-s*C)*l,n.z=(n.z-s*w)*l,o.x=u+(p+S)*l,o.y=d+(m+C)*l,o.z=f+(h+w)*l;let T=g-e.x,E=_-e.y,D=v-e.z,O=o.x-g,k=o.y-_,A=o.z-v;return T*O+E*k+D*A>0&&(o.x=g,o.y=_,o.z=v,n.x=(o.x-g)/a,n.y=(o.y-_)/a,n.z=(o.z-v)/a),o}function qN(e,t){t.set(0,0),e.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=e.length,t.y/=e.length}function JN(e,t){return PN(e)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}var YN=class{constructor(){this._listeners={}}addEventListener(e,t){let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners[e];if(n!==void 0){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){let t=this._listeners[e.type];if(t!==void 0){e.target=this;let n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e)}}},XN=`2.10.1`,ZN=1/8,QN=/Mac/.test((globalThis==null?void 0:globalThis.navigator)?.platform),$,$N,eP,tP,nP,rP,iP,aP,oP,sP,cP,lP,uP,dP,fP,pP,mP,hP,gP,_P,vP,yP,bP,xP=class e extends YN{static install(e){$=e.THREE,$N=Object.freeze(new $.Vector3(0,0,0)),eP=Object.freeze(new $.Vector3(0,1,0)),tP=Object.freeze(new $.Vector3(0,0,1)),nP=new $.Vector2,rP=new $.Vector3,iP=new $.Vector3,aP=new $.Vector3,oP=new $.Vector3,sP=new $.Vector3,cP=new $.Vector3,lP=new $.Vector3,uP=new $.Vector3,dP=new $.Vector3,fP=new $.Spherical,pP=new $.Spherical,mP=new $.Box3,hP=new $.Box3,gP=new $.Sphere,_P=new $.Quaternion,vP=new $.Quaternion,yP=new $.Matrix4,bP=new $.Raycaster}static get ACTION(){return Q}set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(t,n){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=2**-52,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=Q.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=MN.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new $.Vector3,this._focalOffsetVelocity=new $.Vector3,this._zoomVelocity={value:0},this._truckInternal=(e,t,n,r)=>{let i,a;if(NN(this._camera)){let n=rP.copy(this._camera.position).sub(this._target),r=this._camera.getEffectiveFOV()*RN,o=n.length()*Math.tan(r*.5);i=this.truckSpeed*e*o/this._elementRect.height,a=this.truckSpeed*t*o/this._elementRect.height}else if(PN(this._camera)){let n=this._camera;i=this.truckSpeed*e*(n.right-n.left)/n.zoom/this._elementRect.width,a=this.truckSpeed*t*(n.top-n.bottom)/n.zoom/this._elementRect.height}else return;r?(n?this.setFocalOffset(this._focalOffsetEnd.x+i,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(i,0,!0),this.forward(-a,!0)):n?this.setFocalOffset(this._focalOffsetEnd.x+i,this._focalOffsetEnd.y+a,this._focalOffsetEnd.z,!0):this.truck(i,a,!0)},this._rotateInternal=(e,t)=>{let n=FN*this.azimuthRotateSpeed*e/this._elementRect.height,r=FN*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(n,r,!0)},this._dollyInternal=(e,t,n)=>{let r=.95**(-e*this.dollySpeed),i=this._sphericalEnd.radius,a=this._sphericalEnd.radius*r,o=zN(a,this.minDistance,this.maxDistance),s=o-a;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(a,!0):(this.infinityDolly&&!this.dollyToCursor&&this.dollyInFixed(s,!0),this._dollyToNoClamp(o,!0)),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?a:o)-i,this._dollyControlCoord.set(t,n)),this._lastDollyDirection=Math.sign(-e)},this._zoomInternal=(e,t,n)=>{let r=.95**(e*this.dollySpeed),i=this._zoom,a=this._zoom*r;this.zoomTo(a,!0),this.dollyToCursor&&(this._changedZoom+=a-i,this._dollyControlCoord.set(t,n))},$===void 0&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new $.Quaternion().setFromUnitVectors(this._camera.up,eP),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=Q.NONE,this._target=new $.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new $.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new $.Spherical().setFromVector3(rP.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new $.Vector3,new $.Vector3,new $.Vector3,new $.Vector3],this._updateNearPlaneCorners(),this._boundary=new $.Box3(new $.Vector3(-1/0,-1/0,-1/0),new $.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new $.Vector2,this.mouseButtons={left:Q.ROTATE,middle:Q.DOLLY,right:Q.TRUCK,wheel:NN(this._camera)?Q.DOLLY:PN(this._camera)?Q.ZOOM:Q.NONE},this.touches={one:Q.TOUCH_ROTATE,two:NN(this._camera)?Q.TOUCH_DOLLY_TRUCK:PN(this._camera)?Q.TOUCH_ZOOM_TRUCK:Q.NONE,three:Q.TOUCH_TRUCK};let r=new $.Vector2,i=new $.Vector2,a=new $.Vector2,o=e=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){let t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}let t=e.pointerType===`mouse`?(e.buttons&jN.LEFT)===jN.LEFT?jN.LEFT:(e.buttons&jN.MIDDLE)===jN.MIDDLE?jN.MIDDLE:(e.buttons&jN.RIGHT)===jN.RIGHT?jN.RIGHT:null:null;if(t!==null){let e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}if((e.buttons&jN.LEFT)===jN.LEFT&&this._lockedPointer)return;let n={pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:t};this._activePointers.push(n),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.ownerDocument.addEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.addEventListener(`pointerup`,c),this._isDragging=!0,f(e)},s=e=>{e.cancelable&&e.preventDefault();let t=e.pointerId,n=this._lockedPointer||this._findPointerById(t);if(n){if(n.clientX=e.clientX,n.clientY=e.clientY,n.deltaX=e.movementX,n.deltaY=e.movementY,this._state=0,e.pointerType===`touch`)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(e.buttons&jN.LEFT)===jN.LEFT)&&(this._state|=this.mouseButtons.left),this._isDragging&&(e.buttons&jN.MIDDLE)===jN.MIDDLE&&(this._state|=this.mouseButtons.middle),this._isDragging&&(e.buttons&jN.RIGHT)===jN.RIGHT&&(this._state|=this.mouseButtons.right);p()}},c=e=>{let t=this._findPointerById(e.pointerId);if(!(t&&t===this._lockedPointer)){if(t&&this._disposePointer(t),e.pointerType===`touch`)switch(this._activePointers.length){case 0:this._state=Q.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._state=Q.NONE;m()}},l=-1,u=e=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===Q.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){let t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}if(e.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===Q.ROTATE||this.mouseButtons.wheel===Q.TRUCK){let e=performance.now();l-e<1e3&&this._getClientRect(this._elementRect),l=e}let t=QN?-1:-3,n=e.deltaMode===1||e.ctrlKey?e.deltaY/t:e.deltaY/(t*10),r=this.dollyToCursor?(e.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,i=this.dollyToCursor?(e.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case Q.ROTATE:this._rotateInternal(e.deltaX,e.deltaY),this._isUserControllingRotate=!0;break;case Q.TRUCK:this._truckInternal(e.deltaX,e.deltaY,!1,!1),this._isUserControllingTruck=!0;break;case Q.SCREEN_PAN:this._truckInternal(e.deltaX,e.deltaY,!1,!0),this._isUserControllingTruck=!0;break;case Q.OFFSET:this._truckInternal(e.deltaX,e.deltaY,!0,!1),this._isUserControllingOffset=!0;break;case Q.DOLLY:this._dollyInternal(-n,r,i),this._isUserControllingDolly=!0;break;case Q.ZOOM:this._zoomInternal(-n,r,i),this._isUserControllingZoom=!0}this.dispatchEvent({type:`control`})},d=t=>{if(this._domElement&&this._enabled){if(this.mouseButtons.right===e.ACTION.NONE){let e=t instanceof PointerEvent?t.pointerId:0,n=this._findPointerById(e);n&&this._disposePointer(n),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c);return}t.preventDefault()}},f=e=>{if(this._enabled){if(qN(this._activePointers,nP),this._getClientRect(this._elementRect),r.copy(nP),i.copy(nP),this._activePointers.length>=2){let e=nP.x-this._activePointers[1].clientX,t=nP.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t);a.set(0,n);let r=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,o=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(r,o)}if(this._state=0,!e)this._lockedPointer&&(this._state|=this.mouseButtons.left);else if(`pointerType`in e&&e.pointerType===`touch`)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else!this._lockedPointer&&(e.buttons&jN.LEFT)===jN.LEFT&&(this._state|=this.mouseButtons.left),(e.buttons&jN.MIDDLE)===jN.MIDDLE&&(this._state|=this.mouseButtons.middle),(e.buttons&jN.RIGHT)===jN.RIGHT&&(this._state|=this.mouseButtons.right);((this._state&Q.ROTATE)===Q.ROTATE||(this._state&Q.TOUCH_ROTATE)===Q.TOUCH_ROTATE||(this._state&Q.TOUCH_DOLLY_ROTATE)===Q.TOUCH_DOLLY_ROTATE||(this._state&Q.TOUCH_ZOOM_ROTATE)===Q.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&Q.TRUCK)===Q.TRUCK||(this._state&Q.SCREEN_PAN)===Q.SCREEN_PAN||(this._state&Q.TOUCH_TRUCK)===Q.TOUCH_TRUCK||(this._state&Q.TOUCH_SCREEN_PAN)===Q.TOUCH_SCREEN_PAN||(this._state&Q.TOUCH_DOLLY_TRUCK)===Q.TOUCH_DOLLY_TRUCK||(this._state&Q.TOUCH_DOLLY_SCREEN_PAN)===Q.TOUCH_DOLLY_SCREEN_PAN||(this._state&Q.TOUCH_ZOOM_TRUCK)===Q.TOUCH_ZOOM_TRUCK||(this._state&Q.TOUCH_ZOOM_SCREEN_PAN)===Q.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&Q.DOLLY)===Q.DOLLY||(this._state&Q.TOUCH_DOLLY)===Q.TOUCH_DOLLY||(this._state&Q.TOUCH_DOLLY_TRUCK)===Q.TOUCH_DOLLY_TRUCK||(this._state&Q.TOUCH_DOLLY_SCREEN_PAN)===Q.TOUCH_DOLLY_SCREEN_PAN||(this._state&Q.TOUCH_DOLLY_OFFSET)===Q.TOUCH_DOLLY_OFFSET||(this._state&Q.TOUCH_DOLLY_ROTATE)===Q.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&Q.ZOOM)===Q.ZOOM||(this._state&Q.TOUCH_ZOOM)===Q.TOUCH_ZOOM||(this._state&Q.TOUCH_ZOOM_TRUCK)===Q.TOUCH_ZOOM_TRUCK||(this._state&Q.TOUCH_ZOOM_SCREEN_PAN)===Q.TOUCH_ZOOM_SCREEN_PAN||(this._state&Q.TOUCH_ZOOM_OFFSET)===Q.TOUCH_ZOOM_OFFSET||(this._state&Q.TOUCH_ZOOM_ROTATE)===Q.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&Q.OFFSET)===Q.OFFSET||(this._state&Q.TOUCH_OFFSET)===Q.TOUCH_OFFSET||(this._state&Q.TOUCH_DOLLY_OFFSET)===Q.TOUCH_DOLLY_OFFSET||(this._state&Q.TOUCH_ZOOM_OFFSET)===Q.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:`controlstart`})}},p=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,qN(this._activePointers,nP);let e=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,t=e?-e.deltaX:i.x-nP.x,n=e?-e.deltaY:i.y-nP.y;if(i.copy(nP),((this._state&Q.ROTATE)===Q.ROTATE||(this._state&Q.TOUCH_ROTATE)===Q.TOUCH_ROTATE||(this._state&Q.TOUCH_DOLLY_ROTATE)===Q.TOUCH_DOLLY_ROTATE||(this._state&Q.TOUCH_ZOOM_ROTATE)===Q.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(t,n),this._isUserControllingRotate=!0),(this._state&Q.DOLLY)===Q.DOLLY||(this._state&Q.ZOOM)===Q.ZOOM){let e=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,t=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0,i=this.dollyDragInverted?-1:1;(this._state&Q.DOLLY)===Q.DOLLY?(this._dollyInternal(i*n*ZN,e,t),this._isUserControllingDolly=!0):(this._zoomInternal(i*n*ZN,e,t),this._isUserControllingZoom=!0)}if((this._state&Q.TOUCH_DOLLY)===Q.TOUCH_DOLLY||(this._state&Q.TOUCH_ZOOM)===Q.TOUCH_ZOOM||(this._state&Q.TOUCH_DOLLY_TRUCK)===Q.TOUCH_DOLLY_TRUCK||(this._state&Q.TOUCH_ZOOM_TRUCK)===Q.TOUCH_ZOOM_TRUCK||(this._state&Q.TOUCH_DOLLY_SCREEN_PAN)===Q.TOUCH_DOLLY_SCREEN_PAN||(this._state&Q.TOUCH_ZOOM_SCREEN_PAN)===Q.TOUCH_ZOOM_SCREEN_PAN||(this._state&Q.TOUCH_DOLLY_OFFSET)===Q.TOUCH_DOLLY_OFFSET||(this._state&Q.TOUCH_ZOOM_OFFSET)===Q.TOUCH_ZOOM_OFFSET||(this._state&Q.TOUCH_DOLLY_ROTATE)===Q.TOUCH_DOLLY_ROTATE||(this._state&Q.TOUCH_ZOOM_ROTATE)===Q.TOUCH_ZOOM_ROTATE){let e=nP.x-this._activePointers[1].clientX,t=nP.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t),r=a.y-n;a.set(0,n);let o=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,s=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&Q.TOUCH_DOLLY)===Q.TOUCH_DOLLY||(this._state&Q.TOUCH_DOLLY_ROTATE)===Q.TOUCH_DOLLY_ROTATE||(this._state&Q.TOUCH_DOLLY_TRUCK)===Q.TOUCH_DOLLY_TRUCK||(this._state&Q.TOUCH_DOLLY_SCREEN_PAN)===Q.TOUCH_DOLLY_SCREEN_PAN||(this._state&Q.TOUCH_DOLLY_OFFSET)===Q.TOUCH_DOLLY_OFFSET?(this._dollyInternal(r*ZN,o,s),this._isUserControllingDolly=!0):(this._zoomInternal(r*ZN,o,s),this._isUserControllingZoom=!0)}((this._state&Q.TRUCK)===Q.TRUCK||(this._state&Q.TOUCH_TRUCK)===Q.TOUCH_TRUCK||(this._state&Q.TOUCH_DOLLY_TRUCK)===Q.TOUCH_DOLLY_TRUCK||(this._state&Q.TOUCH_ZOOM_TRUCK)===Q.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(t,n,!1,!1),this._isUserControllingTruck=!0),((this._state&Q.SCREEN_PAN)===Q.SCREEN_PAN||(this._state&Q.TOUCH_SCREEN_PAN)===Q.TOUCH_SCREEN_PAN||(this._state&Q.TOUCH_DOLLY_SCREEN_PAN)===Q.TOUCH_DOLLY_SCREEN_PAN||(this._state&Q.TOUCH_ZOOM_SCREEN_PAN)===Q.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(t,n,!1,!0),this._isUserControllingTruck=!0),((this._state&Q.OFFSET)===Q.OFFSET||(this._state&Q.TOUCH_OFFSET)===Q.TOUCH_OFFSET||(this._state&Q.TOUCH_DOLLY_OFFSET)===Q.TOUCH_DOLLY_OFFSET||(this._state&Q.TOUCH_ZOOM_OFFSET)===Q.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(t,n,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:`control`})},m=()=>{qN(this._activePointers,nP),i.copy(nP),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this.dispatchEvent({type:`controlend`}))};this.lockPointer=()=>{this._enabled&&this._domElement&&(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener(`pointerlockchange`,h),this._domElement.ownerDocument.addEventListener(`pointerlockerror`,g),this._domElement.ownerDocument.addEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.addEventListener(`pointerup`,c),f())},this.unlockPointer=()=>{var e,t,n;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(e=this._domElement)==null||e.ownerDocument.exitPointerLock(),(t=this._domElement)==null||t.ownerDocument.removeEventListener(`pointerlockchange`,h),(n=this._domElement)==null||n.ownerDocument.removeEventListener(`pointerlockerror`,g),this.cancel()};let h=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},g=()=>{this.unlockPointer()};this._addAllEventListeners=e=>{this._domElement=e,this._domElement.style.touchAction=`none`,this._domElement.style.userSelect=`none`,this._domElement.style.webkitUserSelect=`none`,this._domElement.addEventListener(`pointerdown`,o),this._domElement.addEventListener(`pointercancel`,c),this._domElement.addEventListener(`wheel`,u,{passive:!1}),this._domElement.addEventListener(`contextmenu`,d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction=``,this._domElement.style.userSelect=``,this._domElement.style.webkitUserSelect=``,this._domElement.removeEventListener(`pointerdown`,o),this._domElement.removeEventListener(`pointercancel`,c),this._domElement.removeEventListener(`wheel`,u,{passive:!1}),this._domElement.removeEventListener(`contextmenu`,d),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.ownerDocument.removeEventListener(`pointerlockchange`,h),this._domElement.ownerDocument.removeEventListener(`pointerlockerror`,g))},this.cancel=()=>{this._state!==Q.NONE&&(this._state=Q.NONE,this._activePointers.length=0,m())},n&&this.connect(n),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction=`none`,this._domElement.style.userSelect=`none`,this._domElement.style.webkitUserSelect=`none`):(this.cancel(),this._domElement.style.touchAction=``,this._domElement.style.userSelect=``,this._domElement.style.webkitUserSelect=``))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){(this._spherical.radius!==e||this._sphericalEnd.radius!==e)&&(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){(this._spherical.theta!==e||this._sphericalEnd.theta!==e)&&(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){(this._spherical.phi!==e||this._sphericalEnd.phi!==e)&&(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=zN(e.width,0,1),this._interactiveArea.height=zN(e.height,0,1),this._interactiveArea.x=zN(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=zN(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,n=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,n=!1){this._isUserControllingRotate=!1;let r=zN(e,this.minAzimuthAngle,this.maxAzimuthAngle),i=zN(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=i,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);let a=!n||VN(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&VN(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(a)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=MN.NONE,this._changedDolly=0,this._dollyToNoClamp(zN(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){let n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){let t=this._collisionTest(),r=VN(t,this._spherical.radius);if(!(n>e)&&r)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,t)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);let r=!t||VN(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(oP).multiplyScalar(e)),t||this._target.copy(this._targetEnd);let n=!t||VN(this._target.x,this._targetEnd.x,this.restThreshold)&&VN(this._target.y,this._targetEnd.y,this.restThreshold)&&VN(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=zN(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);let n=!t||VN(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t,n=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t,n=!1){this._camera.updateMatrix(),sP.setFromMatrixColumn(this._camera.matrix,0),cP.setFromMatrixColumn(this._camera.matrix,1),sP.multiplyScalar(e),cP.multiplyScalar(-t);let r=rP.copy(sP).add(cP),i=iP.copy(this._targetEnd).add(r);return this.moveTo(i.x,i.y,i.z,n)}forward(e,t=!1){rP.setFromMatrixColumn(this._camera.matrix,0),rP.crossVectors(this._camera.up,rP),rP.multiplyScalar(e);let n=iP.copy(this._targetEnd).add(rP);return this.moveTo(n.x,n.y,n.z,t)}elevate(e,t=!1){return rP.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+rP.x,this._targetEnd.y+rP.y,this._targetEnd.z+rP.z,t)}moveTo(e,t,n,r=!1){this._isUserControllingTruck=!1;let i=rP.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,i,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);let a=!r||VN(this._target.x,this._targetEnd.x,this.restThreshold)&&VN(this._target.y,this._targetEnd.y,this.restThreshold)&&VN(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}lookInDirectionOf(e,t,n,r=!1){let i=rP.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(i.x,i.y,i.z,r)}fitToBox(e,t,{cover:n=!1,paddingLeft:r=0,paddingRight:i=0,paddingBottom:a=0,paddingTop:o=0}={}){let s=[],c=e.isBox3?mP.copy(e):mP.setFromObject(e);c.isEmpty()&&(console.warn(`camera-controls: fitTo() cannot be used with an empty box. Aborting`),Promise.resolve());let l=HN(this._sphericalEnd.theta,IN),u=HN(this._sphericalEnd.phi,IN);s.push(this.rotateTo(l,u,t));let d=rP.setFromSpherical(this._sphericalEnd).normalize(),f=_P.setFromUnitVectors(d,tP),p=VN(Math.abs(d.y),1);p&&f.multiply(vP.setFromAxisAngle(eP,l)),f.multiply(this._yAxisUpSpaceInverse);let m=hP.makeEmpty();iP.copy(c.min).applyQuaternion(f),m.expandByPoint(iP),iP.copy(c.min).setX(c.max.x).applyQuaternion(f),m.expandByPoint(iP),iP.copy(c.min).setY(c.max.y).applyQuaternion(f),m.expandByPoint(iP),iP.copy(c.max).setZ(c.min.z).applyQuaternion(f),m.expandByPoint(iP),iP.copy(c.min).setZ(c.max.z).applyQuaternion(f),m.expandByPoint(iP),iP.copy(c.max).setY(c.min.y).applyQuaternion(f),m.expandByPoint(iP),iP.copy(c.max).setX(c.min.x).applyQuaternion(f),m.expandByPoint(iP),iP.copy(c.max).applyQuaternion(f),m.expandByPoint(iP),m.min.x-=r,m.min.y-=a,m.max.x+=i,m.max.y+=o,f.setFromUnitVectors(tP,d),p&&f.premultiply(vP.invert()),f.premultiply(this._yAxisUpSpace);let h=m.getSize(rP),g=m.getCenter(iP).applyQuaternion(f);if(NN(this._camera)){let e=this.getDistanceToFitBox(h.x,h.y,h.z,n);s.push(this.moveTo(g.x,g.y,g.z,t)),s.push(this.dollyTo(e,t)),s.push(this.setFocalOffset(0,0,0,t))}else if(PN(this._camera)){let e=this._camera,r=e.right-e.left,i=e.top-e.bottom,a=n?Math.max(r/h.x,i/h.y):Math.min(r/h.x,i/h.y);s.push(this.moveTo(g.x,g.y,g.z,t)),s.push(this.zoomTo(a,t)),s.push(this.setFocalOffset(0,0,0,t))}return Promise.all(s)}fitToSphere(t,n){let r=[],i=`isObject3D`in t?e.createBoundingSphere(t,gP):gP.copy(t);if(r.push(this.moveTo(i.center.x,i.center.y,i.center.z,n)),NN(this._camera)){let e=this.getDistanceToFitSphere(i.radius);r.push(this.dollyTo(e,n))}else if(PN(this._camera)){let e=this._camera.right-this._camera.left,t=this._camera.top-this._camera.bottom,a=2*i.radius,o=Math.min(e/a,t/a);r.push(this.zoomTo(o,n))}return r.push(this.setFocalOffset(0,0,0,n)),Promise.all(r)}setLookAt(e,t,n,r,i,a,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=MN.NONE,this._changedDolly=0;let s=iP.set(r,i,a),c=rP.set(e,t,n);this._targetEnd.copy(s),this._sphericalEnd.setFromVector3(c.sub(s).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let l=!o||VN(this._target.x,this._targetEnd.x,this.restThreshold)&&VN(this._target.y,this._targetEnd.y,this.restThreshold)&&VN(this._target.z,this._targetEnd.z,this.restThreshold)&&VN(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&VN(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&VN(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(l)}lerpLookAt(e,t,n,r,i,a,o,s,c,l,u,d,f,p=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=MN.NONE,this._changedDolly=0;let m=rP.set(r,i,a),h=iP.set(e,t,n);fP.setFromVector3(h.sub(m).applyQuaternion(this._yAxisUpSpace));let g=aP.set(l,u,d),_=iP.set(o,s,c);pP.setFromVector3(_.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(m.lerp(g,f));let v=pP.theta-fP.theta,y=pP.phi-fP.phi,b=pP.radius-fP.radius;this._sphericalEnd.set(fP.radius+b*f,fP.phi+y*f,fP.theta+v*f),this.normalizeRotations(),this._needsUpdate=!0,p||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let x=!p||VN(this._target.x,this._targetEnd.x,this.restThreshold)&&VN(this._target.y,this._targetEnd.y,this.restThreshold)&&VN(this._target.z,this._targetEnd.z,this.restThreshold)&&VN(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&VN(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&VN(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(x)}setPosition(e,t,n,r=!1){return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n,r=!1){let i=this.getPosition(rP),a=this.setLookAt(i.x,i.y,i.z,e,t,n,r);return this._sphericalEnd.phi=zN(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),a}setFocalOffset(e,t,n,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);let i=!r||VN(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&VN(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&VN(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),sP.setFromMatrixColumn(this._camera.matrixWorldInverse,0),cP.setFromMatrixColumn(this._camera.matrixWorldInverse,1),lP.setFromMatrixColumn(this._camera.matrixWorldInverse,2);let r=rP.set(e,t,n),i=r.distanceTo(this._camera.position),a=r.sub(this._camera.position);sP.multiplyScalar(a.x),cP.multiplyScalar(a.y),lP.multiplyScalar(a.z),rP.copy(sP).add(cP).add(lP),rP.z+=i,this.dollyTo(i,!1),this.setFocalOffset(-rP.x,rP.y,-rP.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new $.Vector4,typeof e==`number`?this._viewport.set(e,t,n,r):this._viewport.copy(e)}getDistanceToFitBox(e,t,n,r=!1){if(JN(this._camera,`getDistanceToFitBox`))return this._spherical.radius;let i=e/t,a=this._camera.getEffectiveFOV()*RN,o=this._camera.aspect;return((r?i>o:i<o)?t:e/o)*.5/Math.tan(a*.5)+n*.5}getDistanceToFitSphere(e){if(JN(this._camera,`getDistanceToFitSphere`))return this._spherical.radius;let t=this._camera.getEffectiveFOV()*RN,n=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,r=1<this._camera.aspect?t:n;return e/Math.sin(r*.5)}getTarget(e,t=!0){return(e&&e.isVector3?e:new $.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new $.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new $.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new $.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%FN,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=FN),this._spherical.theta+=FN*Math.round((this._sphericalEnd.theta-this._spherical.theta)/FN)}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!VN(this._camera.up.x,this._cameraUp0.x)||!VN(this._camera.up.y,this._cameraUp0.y)||!VN(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);let e=this.getPosition(rP);this.updateCameraUp(),this.setPosition(e.x,e.y,e.z)}let t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,eP),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){let e=rP.subVectors(this._target,this._camera.position).normalize(),t=iP.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();let n=this.getPosition(rP);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}update(e){let t=this._sphericalEnd.theta-this._spherical.theta,n=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,i=uP.subVectors(this._targetEnd,this._target),a=dP.subVectors(this._focalOffsetEnd,this._focalOffset),o=this._zoomEnd-this._zoom;if(BN(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{let t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=GN(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,t,1/0,e),this._needsUpdate=!0}if(BN(n))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{let t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=GN(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,t,1/0,e),this._needsUpdate=!0}if(BN(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{let t=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=GN(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,t,this.maxSpeed,e),this._needsUpdate=!0}if(BN(i.x)&&BN(i.y)&&BN(i.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{let t=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;KN(this._target,this._targetEnd,this._targetVelocity,t,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(BN(a.x)&&BN(a.y)&&BN(a.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{let t=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;KN(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,t,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(BN(o))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{let t=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=GN(this._zoom,this._zoomEnd,this._zoomVelocity,t,1/0,e)}if(this.dollyToCursor){if(NN(this._camera)&&this._changedDolly!==0){let e=this._spherical.radius-this._lastDistance,t=this._camera,n=this._getCameraDirection(oP),r=rP.copy(n).cross(t.up).normalize();r.lengthSq()===0&&(r.x=1);let i=iP.crossVectors(r,n),a=this._sphericalEnd.radius*Math.tan(t.getEffectiveFOV()*RN*.5),o=(this._sphericalEnd.radius-e-this._sphericalEnd.radius)/this._sphericalEnd.radius,s=aP.copy(this._targetEnd).add(r.multiplyScalar(this._dollyControlCoord.x*a*t.aspect)).add(i.multiplyScalar(this._dollyControlCoord.y*a)),c=rP.copy(this._targetEnd).lerp(s,o),l=this._lastDollyDirection===MN.IN&&this._spherical.radius<=this.minDistance,u=this._lastDollyDirection===MN.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(l||u)){this._sphericalEnd.radius-=e,this._spherical.radius-=e;let t=iP.copy(n).multiplyScalar(-e);c.add(t)}this._boundary.clampPoint(c,c);let d=iP.subVectors(c,this._targetEnd);this._targetEnd.copy(c),this._target.add(d),this._changedDolly-=e,BN(this._changedDolly)&&(this._changedDolly=0)}else if(PN(this._camera)&&this._changedZoom!==0){let e=this._zoom-this._lastZoom,t=this._camera,n=rP.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(t.near+t.far)/(t.near-t.far)).unproject(t),r=iP.set(0,0,-1).applyQuaternion(t.quaternion),i=aP.copy(n).add(r.multiplyScalar(-n.dot(t.up))),a=-(this._zoom-e-this._zoom)/this._zoom,o=this._getCameraDirection(oP),s=this._targetEnd.dot(o),c=rP.copy(this._targetEnd).lerp(i,a),l=c.dot(o),u=o.multiplyScalar(l-s);c.sub(u),this._boundary.clampPoint(c,c);let d=iP.subVectors(c,this._targetEnd);this._targetEnd.copy(c),this._target.add(d),this._changedZoom-=e,BN(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;let s=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,s),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!BN(this._focalOffset.x)||!BN(this._focalOffset.y)||!BN(this._focalOffset.z))&&(sP.setFromMatrixColumn(this._camera.matrix,0),cP.setFromMatrixColumn(this._camera.matrix,1),lP.setFromMatrixColumn(this._camera.matrix,2),sP.multiplyScalar(this._focalOffset.x),cP.multiplyScalar(-this._focalOffset.y),lP.multiplyScalar(this._focalOffset.z),rP.copy(sP).add(cP).add(lP),this._camera.position.add(rP),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),rP.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);let c=this._needsUpdate;return c&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:`wake`}),this.dispatchEvent({type:`update`})):c?(this.dispatchEvent({type:`update`}),BN(t,this.restThreshold)&&BN(n,this.restThreshold)&&BN(r,this.restThreshold)&&BN(i.x,this.restThreshold)&&BN(i.y,this.restThreshold)&&BN(i.z,this.restThreshold)&&BN(a.x,this.restThreshold)&&BN(a.y,this.restThreshold)&&BN(a.z,this.restThreshold)&&BN(o,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:`rest`}))):!c&&this._updatedLastTime&&this.dispatchEvent({type:`sleep`}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=c,this._needsUpdate=!1,c}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:UN(this.maxDistance),minZoom:this.minZoom,maxZoom:UN(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:UN(this.maxPolarAngle),minAzimuthAngle:UN(this.minAzimuthAngle),maxAzimuthAngle:UN(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:rP.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){let n=JSON.parse(e);this.enabled=n.enabled,this.minDistance=n.minDistance,this.maxDistance=WN(n.maxDistance),this.minZoom=n.minZoom,this.maxZoom=WN(n.maxZoom),this.minPolarAngle=n.minPolarAngle,this.maxPolarAngle=WN(n.maxPolarAngle),this.minAzimuthAngle=WN(n.minAzimuthAngle),this.maxAzimuthAngle=WN(n.maxAzimuthAngle),this.smoothTime=n.smoothTime,this.draggingSmoothTime=n.draggingSmoothTime,this.dollySpeed=n.dollySpeed,this.truckSpeed=n.truckSpeed,this.dollyToCursor=n.dollyToCursor,this._target0.fromArray(n.target0),this._position0.fromArray(n.position0),this._zoom0=n.zoom0,this._focalOffset0.fromArray(n.focalOffset0),this.moveTo(n.target[0],n.target[1],n.target[2],t),fP.setFromVector3(rP.fromArray(n.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(fP.theta,fP.phi,t),this.dollyTo(fP.radius,t),this.zoomTo(n.zoom,t),this.setFocalOffset(n.focalOffset[0],n.focalOffset[1],n.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn(`camera-controls is already connected.`);return}e.setAttribute(`data-camera-controls-version`,XN),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&=(this._domElement.removeAttribute(`data-camera-controls-version`),void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){let r=t.lengthSq();if(r===0)return e;let i=iP.copy(t).add(e),a=this._boundary.clampPoint(i,aP).sub(i),o=a.lengthSq();if(o===0)return e.add(t);if(o===r)return e;if(n===0)return e.add(t).add(a);{let r=1+n*o/t.dot(a);return e.add(iP.copy(t).multiplyScalar(r)).add(a.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(NN(this._camera)){let e=this._camera,t=e.near,n=e.getEffectiveFOV()*RN,r=Math.tan(n*.5)*t,i=r*e.aspect;this._nearPlaneCorners[0].set(-i,-r,0),this._nearPlaneCorners[1].set(i,-r,0),this._nearPlaneCorners[2].set(i,r,0),this._nearPlaneCorners[3].set(-i,r,0)}else if(PN(this._camera)){let e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,i=e.top*t,a=e.bottom*t;this._nearPlaneCorners[0].set(n,i,0),this._nearPlaneCorners[1].set(r,i,0),this._nearPlaneCorners[2].set(r,a,0),this._nearPlaneCorners[3].set(n,a,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||JN(this._camera,`_collisionTest`))return e;let t=this._getTargetDirection(oP);yP.lookAt($N,t,this._camera.up);for(let n=0;n<4;n++){let r=iP.copy(this._nearPlaneCorners[n]);r.applyMatrix4(yP);let i=aP.addVectors(this._target,r);bP.set(i,t),bP.far=this._spherical.radius+1;let a=bP.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance<e&&(e=a[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;let t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:`transitionstart`}),new Promise(e=>{let t=()=>{this.removeEventListener(`rest`,t),e()};this.addEventListener(`rest`,t)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(`.dampingFactor has been deprecated. use smoothTime (in seconds) instead.`),0}set dampingFactor(e){console.warn(`.dampingFactor has been deprecated. use smoothTime (in seconds) instead.`)}get draggingDampingFactor(){return console.warn(`.draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.`),0}set draggingDampingFactor(e){console.warn(`.draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.`)}static createBoundingSphere(e,t=new $.Sphere){let n=t,r=n.center;mP.makeEmpty(),e.traverseVisible(e=>{e.isMesh&&mP.expandByObject(e)}),mP.getCenter(r);let i=0;return e.traverseVisible(e=>{if(!e.isMesh)return;let t=e;if(!t.geometry)return;let n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);let a=n.attributes.position;for(let e=0,t=a.count;e<t;e++)rP.fromBufferAttribute(a,e),i=Math.max(i,r.distanceToSquared(rP))}),n.radius=Math.sqrt(i),n}},SP=MM(AM(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.Stats=r()})(e,function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;t<i.children.length;t++)i.children[t].style.display=t===e?`block`:`none`;
4181r=e}var r=0,i=document.createElement(`div`);i.style.cssText=`position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000`,i.addEventListener(`click`,function(e){e.preventDefault(),n(++r%i.children.length)},!1);var a=(performance||Date).now(),o=a,s=0,c=t(new e.Panel(`FPS`,`#0ff`,`#002`)),l=t(new e.Panel(`MS`,`#0f0`,`#020`));if(self.performance&&self.performance.memory)var u=t(new e.Panel(`MB`,`#f08`,`#201`));return n(0),{REVISION:16,dom:i,addPanel:t,showPanel:n,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(l.update(e-a,200),e>o+1e3&&(c.update(1e3*s/(e-o),100),o=e,s=0,u)){var t=performance.memory;u.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}};return e.Panel=function(e,t,n){var r=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,c=48*o,l=3*o,u=2*o,d=3*o,f=15*o,p=74*o,m=30*o,h=document.createElement(`canvas`);h.width=s,h.height=c,h.style.cssText=`width:80px;height:48px`;var g=h.getContext(`2d`);return g.font=`bold `+9*o+`px Helvetica,Arial,sans-serif`,g.textBaseline=`top`,g.fillStyle=n,g.fillRect(0,0,s,c),g.fillStyle=t,g.fillText(e,l,u),g.fillRect(d,f,p,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d,f,p,m),{dom:h,update:function(c,_){r=Math.min(r,c),i=Math.max(i,c),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(a(c)+` `+e+` (`+a(r)+`-`+a(i)+`)`,l,u),g.drawImage(h,d+o,f,p-o,m,d,f,p-o,m),g.fillRect(d+p-o,f,o,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d+p-o,f,o,a((1-c/_)*m))}}},e})}))(),1),CP=class{constructor(e,t,n){this.name=e,this.fg=t,this.bg=n,this.gradient=null,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement(`canvas`),this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.width=`90px`,this.canvas.style.height=`48px`,this.canvas.style.position=`absolute`,this.canvas.style.cssText=`width:90px;height:48px`,this.context=this.canvas.getContext(`2d`),this.initializeCanvas()}createGradient(){if(!this.context)throw Error(`No context`);let e=this.context.createLinearGradient(0,this.GRAPH_Y,0,this.GRAPH_Y+this.GRAPH_HEIGHT),t,n=this.fg;switch(this.fg.toLowerCase()){case`#0ff`:t=`#006666`;break;case`#0f0`:t=`#006600`;break;case`#ff0`:t=`#666600`;break;case`#e1e1e1`:t=`#666666`;break;default:t=this.bg}return e.addColorStop(0,t),e.addColorStop(1,n),e}initializeCanvas(){this.context&&(this.context.font=`bold `+9*this.PR+`px Helvetica,Arial,sans-serif`,this.context.textBaseline=`top`,this.gradient=this.createGradient(),this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillStyle=this.fg,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(e,t,n,r,i=0){if(!this.context||!this.gradient)return;let a=Math.min(1/0,e),o=Math.max(n,e);r=Math.max(r,t),this.context.globalAlpha=1,this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(`${e.toFixed(i)} ${this.name} (${a.toFixed(i)}-${parseFloat(o.toFixed(i))})`,this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT);let s=this.GRAPH_HEIGHT-(1-t/r)*this.GRAPH_HEIGHT;s>0&&(this.context.globalAlpha=1,this.context.fillStyle=this.gradient,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y+this.GRAPH_HEIGHT-s,this.PR,s))}},wP=class e{constructor({trackGPU:t=!1,logsPerSecond:n=30,samplesLog:r=60,samplesGraph:i=10,precision:a=2,minimal:o=!1,horizontal:s=!0,mode:c=0}={}){this.gl=null,this.ext=null,this.activeQuery=null,this.gpuQueries=[],this.threeRendererPatched=!1,this.frames=0,this.renderCount=0,this.isRunningCPUProfiling=!1,this.totalCpuDuration=0,this.totalGpuDuration=0,this.totalGpuDurationCompute=0,this.totalFps=0,this.gpuPanel=null,this.gpuPanelCompute=null,this.averageFps={logs:[],graph:[]},this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.averageGpuCompute={logs:[],graph:[]},this.handleClick=e=>{e.preventDefault(),this.showPanel(++this.mode%this.dom.children.length)},this.handleResize=()=>{this.resizePanel(this.fpsPanel,0),this.resizePanel(this.msPanel,1),this.gpuPanel&&this.resizePanel(this.gpuPanel,2),this.gpuPanelCompute&&this.resizePanel(this.gpuPanelCompute,3)},this.mode=c,this.horizontal=s,this.minimal=o,this.trackGPU=t,this.samplesLog=r,this.samplesGraph=i,this.precision=a,this.logsPerSecond=n,this.dom=document.createElement(`div`),this.initializeDOM(),this.beginTime=performance.now(),this.prevTime=this.beginTime,this.prevCpuTime=this.beginTime,this.fpsPanel=this.addPanel
4181(new e.Panel(`FPS`,`#0ff`,`#002`),0),this.msPanel=this.addPanel(new e.Panel(`CPU`,`#0f0`,`#020`),1),this.setupEventListeners()}initializeDOM(){this.dom.style.cssText=`
4182      position: fixed;
4183      top: 0;
4184      left: 0;
4185      opacity: 0.9;
4186      z-index: 10000;
4187      ${this.minimal?`cursor: pointer;`:``}
4188    `}setupEventListeners(){this.minimal?(this.dom.addEventListener(`click`,this.handleClick),this.showPanel(this.mode)):window.addEventListener(`resize`,this.handleResize)}async init(e){if(!e){console.error(`Stats: The "canvas" parameter is undefined.`);return}this.handleThreeRenderer(e)||await this.handleWebGPURenderer(e)||this.initializeWebGL(e)}handleThreeRenderer(e){return e.isWebGLRenderer&&!this.threeRendererPatched?(this.patchThreeRenderer(e),this.gl=e.getContext(),this.trackGPU&&this.initializeGPUTracking(),!0):!1}async handleWebGPURenderer(e){return e.isWebGPURenderer?(this.trackGPU&&(e.backend.trackTimestamp=!0,await e.hasFeatureAsync(`timestamp-query`)&&this.initializeWebGPUPanels()),this.info=e.info,!0):!1}initializeWebGPUPanels(){this.gpuPanel=this.addPanel(new e.Panel(`GPU`,`#ff0`,`#220`),2),this.gpuPanelCompute=this.addPanel(new e.Panel(`CPT`,`#e1e1e1`,`#212121`),3)}initializeWebGL(e){if(e instanceof WebGL2RenderingContext)this.gl=e;else if(e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas){if(this.gl=e.getContext(`webgl2`),!this.gl)return console.error(`Stats: Unable to obtain WebGL2 context.`),!1}else return console.error(`Stats: Invalid input type. Expected WebGL2RenderingContext, HTMLCanvasElement, or OffscreenCanvas.`),!1;return!0}initializeGPUTracking(){this.gl&&(this.ext=this.gl.getExtension(`EXT_disjoint_timer_query_webgl2`),this.ext&&(this.gpuPanel=this.addPanel(new e.Panel(`GPU`,`#ff0`,`#220`),2)))}begin(){this.isRunningCPUProfiling||this.beginProfiling(`cpu-started`),this.gl&&this.ext&&(this.activeQuery&&this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.activeQuery=this.gl.createQuery(),this.activeQuery&&this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,this.activeQuery))}end(){this.renderCount++,this.gl&&this.ext&&this.activeQuery&&(this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.gpuQueries.push({query:this.activeQuery}),this.activeQuery=null)}update(){this.info?this.processWebGPUTimestamps():this.processGpuQueries(),this.endProfiling(`cpu-started`,`cpu-finished`,`cpu-duration`),this.updateAverages(),this.resetCounters()}processWebGPUTimestamps(){this.totalGpuDuration=this.info.render.timestamp,this.totalGpuDurationCompute=this.info.compute.timestamp,this.addToAverage(this.totalGpuDurationCompute,this.averageGpuCompute)}updateAverages(){this.addToAverage(this.totalCpuDuration,this.averageCpu),this.addToAverage(this.totalGpuDuration,this.averageGpu)}resetCounters(){this.renderCount=0,this.totalCpuDuration===0&&this.beginProfiling(`cpu-started`),this.totalCpuDuration=0,this.totalFps=0,this.beginTime=this.endInternal()}resizePanel(e,t){e.canvas.style.position=`absolute`,this.minimal?e.canvas.style.display=`none`:(e.canvas.style.display=`block`,this.horizontal?(e.canvas.style.top=`0px`,e.canvas.style.left=t*e.WIDTH/e.PR+`px`):(e.canvas.style.left=`0px`,e.canvas.style.top=t*e.HEIGHT/e.PR+`px`))}addPanel(e,t){return e.canvas&&(this.dom.appendChild(e.canvas),this.resizePanel(e,t)),e}showPanel(e){for(let t=0;t<this.dom.children.length;t++){let n=this.dom.children[t];n.style.display=t===e?`block`:`none`}this.mode=e}processGpuQueries(){this.gl&&this.ext&&(this.totalGpuDuration=0,this.gpuQueries.forEach((e,t)=>{if(this.gl){let n=this.gl.getQueryParameter(e.query,this.gl.QUERY_RESULT_AVAILABLE),r=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT);if(n&&!r){let n=this.gl.getQueryParameter(e.query,this.gl.QUERY_RESULT)*1e-6;this.totalGpuDuration+=n,this.gl.deleteQuery(e.query),this.gpuQueries.splice(t,1)}}}))}endInternal(){this.frames++;let e=(performance||Date).now(),t=e-this.prevTime;if(e>=this.prevCpuTime+1e3/this.logsPerSecond){let n=Math.round(this.frames*1e3/t);this.addToAverage(n,this.averageFps),this.updatePanel(this.fpsPanel,this.averageFps,0),this.updatePanel(this.msPanel,this.averageCpu,this.precision),this.updatePanel(this.gpuPanel,this.averageGpu,this.precision),this.gpuPanelCompute&&this.updatePanel(this.gpuPanelCompute,this.averageGpuCompute),this.frames=0,this.prevCpuTime=e,this.prevTime=e}return e}addToAverage(e,t){t.logs.push(e),t.logs.length>this.samplesLog&&t.logs.shift(),t.graph.push(e),t.graph.length>this.samplesGraph&&t.graph.shift()}beginProfiling(e){window.performance&&(window.performance.mark(e),this.isRunningCPUProfiling=!0)}endProfiling(e,t,n){if(window.performance&&t&&this.isRunningCPUProfiling){window.performance.mark(t);let r=performance.measure(n,e,t);this.totalCpuDuration+=r.duration,this.isRunningCPUProfiling=!1}}updatePanel(e,t,n=2){if(t.logs.length>0){let r=0,i=.01;for(let e=0;e<t.logs.length;e++)r+=t.logs[e],t.logs[e]>i&&(i=t.logs[e]);let a=0,o=.01;for(let e=0;e<t.graph.length;e++)a+=t.graph[e],t.graph[e]>o&&(o=t.graph[e]);e&&e.update(r/Math.min(t.logs.length,this.samplesLog),a/Math.min(t.graph.length,this.samplesGraph),i,o,n)}}get domElement(){return this.dom}patchThreeRenderer(e){let t=e.render,n=this;e.render=function(e,r){n.begin(),t.call(this,e,r),n.end()},this.threeRendererPatched=!0}};wP.Panel=CP;var TP=wP,EP=AM(((e,t)=>{t.exports=`precision.highp.mediump.lowp.attribute.const.uniform.varying.break.continue.do.for.while.if.else.in.out.inout.float.int.uint.void.bool.true.false.discard.return.mat2.mat3.mat4.vec2.vec3.vec4.ivec2.ivec3.ive
4188c4.bvec2.bvec3.bvec4.sampler1D.sampler2D.sampler3D.samplerCube.sampler1DShadow.sampler2DShadow.struct.asm.class.union.enum.typedef.template.this.packed.goto.switch.default.inline.noinline.volatile.public.static.extern.external.interface.long.short.double.half.fixed.unsigned.input.output.hvec2.hvec3.hvec4.dvec2.dvec3.dvec4.fvec2.fvec3.fvec4.sampler2DRect.sampler3DRect.sampler2DRectShadow.sizeof.cast.namespace.using`.split(`.`)})),DP=AM(((e,t)=>{t.exports=`<<= >>= ++ -- << >> <= >= == != && || += -= *= /= %= &= ^^ ^= |= ( ) [ ] . ! ~ * / % + - < > & ^ | ? : = , ; { }`.split(` `)})),OP=AM(((e,t)=>{t.exports=`abs.acos.all.any.asin.atan.ceil.clamp.cos.cross.dFdx.dFdy.degrees.distance.dot.equal.exp.exp2.faceforward.floor.fract.gl_BackColor.gl_BackLightModelProduct.gl_BackLightProduct.gl_BackMaterial.gl_BackSecondaryColor.gl_ClipPlane.gl_ClipVertex.gl_Color.gl_DepthRange.gl_DepthRangeParameters.gl_EyePlaneQ.gl_EyePlaneR.gl_EyePlaneS.gl_EyePlaneT.gl_Fog.gl_FogCoord.gl_FogFragCoord.gl_FogParameters.gl_FragColor.gl_FragCoord.gl_FragData.gl_FragDepth.gl_FragDepthEXT.gl_FrontColor.gl_FrontFacing.gl_FrontLightModelProduct.gl_FrontLightProduct.gl_FrontMaterial.gl_FrontSecondaryColor.gl_LightModel.gl_LightModelParameters.gl_LightModelProducts.gl_LightProducts.gl_LightSource.gl_LightSourceParameters.gl_MaterialParameters.gl_MaxClipPlanes.gl_MaxCombinedTextureImageUnits.gl_MaxDrawBuffers.gl_MaxFragmentUniformComponents.gl_MaxLights.gl_MaxTextureCoords.gl_MaxTextureImageUnits.gl_MaxTextureUnits.gl_MaxVaryingFloats.gl_MaxVertexAttribs.gl_MaxVertexTextureImageUnits.gl_MaxVertexUniformComponents.gl_ModelViewMatrix.gl_ModelViewMatrixInverse.gl_ModelViewMatrixInverseTranspose.gl_ModelViewMatrixTranspose.gl_ModelViewProjectionMatrix.gl_ModelViewProjectionMatrixInverse.gl_ModelViewProjectionMatrixInverseTranspose.gl_ModelViewProjectionMatrixTranspose.gl_MultiTexCoord0.gl_MultiTexCoord1.gl_MultiTexCoord2.gl_MultiTexCoord3.gl_MultiTexCoord4.gl_MultiTexCoord5.gl_MultiTexCoord6.gl_MultiTexCoord7.gl_Normal.gl_NormalMatrix.gl_NormalScale.gl_ObjectPlaneQ.gl_ObjectPlaneR.gl_ObjectPlaneS.gl_ObjectPlaneT.gl_Point.gl_PointCoord.gl_PointParameters.gl_PointSize.gl_Position.gl_ProjectionMatrix.gl_ProjectionMatrixInverse.gl_ProjectionMatrixInverseTranspose.gl_ProjectionMatrixTranspose.gl_SecondaryColor.gl_TexCoord.gl_TextureEnvColor.gl_TextureMatrix.gl_TextureMatrixInverse.gl_TextureMatrixInverseTranspose.gl_TextureMatrixTranspose.gl_Vertex.greaterThan.greaterThanEqual.inversesqrt.length.lessThan.lessThanEqual.log.log2.matrixCompMult.max.min.mix.mod.normalize.not.notEqual.pow.radians.reflect.refract.sign.sin.smoothstep.sqrt.step.tan.texture2D.texture2DLod.texture2DProj.texture2DProjLod.textureCube.textureCubeLod.texture2DLodEXT.texture2DProjLodEXT.textureCubeLodEXT.texture2DGradEXT.texture2DProjGradEXT.textureCubeGradEXT`.split(`.`)})),kP=AM(((e,t)=>{t.exports=EP().slice().concat(`layout.centroid.smooth.case.mat2x2.mat2x3.mat2x4.mat3x2.mat3x3.mat3x4.mat4x2.mat4x3.mat4x4.uvec2.uvec3.uvec4.samplerCubeShadow.sampler2DArray.sampler2DArrayShadow.isampler2D.isampler3D.isamplerCube.isampler2DArray.usampler2D.usampler3D.usamplerCube.usampler2DArray.coherent.restrict.readonly.writeonly.resource.atomic_uint.noperspective.patch.sample.subroutine.common.partition.active.filter.image1D.image2D.image3D.imageCube.iimage1D.iimage2D.iimage3D.iimageCube.uimage1D.uimage2D.uimage3D.uimageCube.image1DArray.image2DArray.iimage1DArray.iimage2DArray.uimage1DArray.uimage2DArray.image1DShadow.image2DShadow.image1DArrayShadow.image2DArrayShadow.imageBuffer.iimageBuffer.uimageBuffer.sampler1DArray.sampler1DArrayShadow.isampler1D.isampler1DArray.usampler1D.usampler1DArray.isampler2DRect.usampler2DRect.samplerBuffer.isamplerBuffer.usamplerBuffer.sampler2DMS.isampler2DMS.usampler2DMS.sampler2DMSArray.isampler2DMSArray.usampler2DMSArray`.split(`.`))})),AP=AM(((e,t)=>{var n=OP();n=n.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),t.exports=n.concat(`gl_VertexID.gl_InstanceID.gl_Position.gl_PointSize.gl_FragCoord.gl_FrontFacing.gl_FragDepth.gl_PointCoord.gl_MaxVertexAttribs.gl_MaxVertexUniformVectors.gl_MaxVertexOutputVectors.gl_MaxFragmentInputVectors.gl_MaxVertexTextureImageUnits.gl_MaxCombinedTextureImageUnits.gl_MaxTextureImageUnits.gl_MaxFragmentUniformVectors.gl_MaxDrawBuffers.gl_MinProgramTexelOffset.gl_MaxProgramTexelOffset.gl_DepthRangeParameters.gl_DepthRange.trunc.round.roundEven.isnan.isinf.floatBitsToInt.floatBitsToUint.intBitsToFloat.uintBitsToFloat.packSnorm2x16.unpackSnorm2x16.packUnorm2x16.unpackUnorm2x16.packHalf2x16.unpackHalf2x16.outerProduct.transpose.determinant.inverse.texture.textureSize.textureProj.textureLod.textureOffset.texelFetch.texelFetchOffset.textureProjOffset.textureLodOffset.textureProjLod.textureProjLodOffset.textureGrad.textureGradOffset.textureProjGrad.textureProjGradOffset`.split(`.`))})),jP=AM(((e,t)=>{t.exports=S;var n=EP(),r=DP(),i=OP(),a=kP(),o=AP(),s=999,c=9999,l=0,u=1,d=2,f=3,p=4,m=5,h=6,g=7,_=8,v=9,y=10,b=11,x=[`block-comment`,`line-comment`,`preprocessor`,`operator`,`integer`,`float`,`ident`,`builtin`,`keyword`,`whitespace`,`eof`,`integer`];function S(e){var t=0,S=0,C=s,w,T,E=[],D=[],O=1,k=0,A=0,j=!1,M=!1,N=``,P;e||={};var ee=i,te=n;e.version===`300 es`&&(ee=o,te=a);for(var ne={},re={},t=0;t<ee.length;t++)ne[ee[t]]=!0;for(var t=0;t<te.length;t++)re[te[t]]=!0;return function(e){return D=[],e===null?L():I(e)};function F(e){e.length&&D.push({type:x[C],data:e,position:A,line:O,column:k})}function I(e){t=0,e.toString&&(e=e.toString()),N+=e.replace(/\r\n/g,`
4189`),P=N.length;for(var n;w=N[t],t<P;){switch(n=t,C){case l:t=ce();break;case u:t=se();break;case d:t=oe();break;case f:t=le();break;case p:t=fe();break;case b:t=de();break;case m:t=pe();break;case c:t=me();break;case v:t=ae();break;case s:t=ie()}if(n!==t)switch(N[n]){case`
4190`:k=0,++O;break;default:++k}}return S+=t,N=N.slice(t),D}function L(e){return E.length&&F(E.join(``)),C=y,F(`(eof)`),D}function ie(){return E=E.length?[]:E,T===`/`&&w===`*`?(A=S+t-1,C=l,T=w,t+1):T===`/`&&w===`/`?(A=S+t-1,C=u,T=w,t+1):w===`#`?(C=d,A=S+t,t):/\s/.test(w)?(C=v,A=S+t,t):(j=/\d/.test(w),M=/[^\w_]/.test(w),A=S+t,C=j?p:M?f:c,t)}function ae(){return/[^\s]/g.test(w)?(F(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function oe(){return(w===`\r`||w===`
4191`)&&T!==`\\`?(F(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function se(){return oe()}function ce(){return w===`/`&&T===`*`?(E.push(w),F(E.join(``)),C=s,t+1):(E.push(w),T=w,t+1)}function le(){if(T===`.`&&/\d/.test(w))return C=m,t;if(T===`/`&&w===`*`)return C=l,t;if(T===`/`&&w===`/`)return C=u,t;if(w===`.`&&E.length){for(;ue(E););return C=m,t}if(w===`;`||w===`)`||w===`(`){if(E.length)for(;ue(E););return F(w),C=s,t+1}var e=E.length===2&&w!==`=`;if(/[\w_\d\s]/.test(w)||e){for(;ue(E););return C=s,t}return E.push(w),T=w,t+1}function ue(e){var t=0,n,i;do{if(n=r.indexOf(e.slice(0,e.length+t).join(``)),i=r[n],n===-1){if(t--+e.length>0)continue;i=e.slice(0,1).join(``)}return F(i),A+=i.length,E=E.slice(i.length),E.length}while(1)}function de(){return/[^a-fA-F0-9]/.test(w)?(F(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function fe(){return w===`.`||/[eE]/.test(w)?(E.push(w),C=m,T=w,t+1):w===`x`&&E.length===1&&E[0]===`0`?(C=b,E.push(w),T=w,t+1):/[^\d]/.test(w)?(F(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function pe(){return w===`f`&&(E.push(w),T=w,t+=1),/[eE]/.test(w)||(w===`-`||w===`+`)&&/[eE]/.test(T)?(E.push(w),T=w,t+1):/[^\d]/.test(w)?(F(E.join(``)),C=s,t):(E.push(w),T=w,t+1)}function me(){if(/[^\d\w_]/.test(w)){var e=E.join(``);return C=re[e]?_:ne[e]?g:h,F(E.join(``)),C=s,t}return E.push(w),T=w,t+1}}})),MP=AM(((e,t)=>{var n=jP();t.exports=r;function r(e,t){var r=n(t),i=[];return i=i.concat(r(e)),i=i.concat(r(null)),i}})),NP=AM(((e,t)=>{t.exports=n;function n(e){for(var t=[],n=0;n<e.length;n++)e[n].type!==`eof`&&t.push(e[n].data);return t.join(``)}})),PP=AM(((e,t)=>{t.exports=n;function n(e){for(var t=null,n=null,a=0,o=0,s=0,c=0,l=0,u=[],d=0,f,p;d<e.length;d++)if(p=e[d],p.data===`{`){if(a&&a++||(f=h(d,r(`)`),r()),f<0)||(c=f,f=h(f,r(`(`),r(`)`)),f<0)||(l=f,f=h(f,i),f<0)||e[f].type!==`ident`||(n=e[f].data,f=h(f,i),f<0))continue;a=1,o=d,t=e[f].data,s=f;var m=h(f,i);switch(e[m]&&e[m].data){case`lowp`:case`highp`:case`mediump`:s=m}}else if(a&&p.data===`}`){if(--a)continue;u.push({name:n,type:t,body:[o+1,d],args:[l,c+1],outer:[s,d+1]})}for(d=0;d<e.length;d++)if(p=e[d],p.data===`;`){if(f=h(d,r(`)`),r()),f<0||(c=f,f=h(f,r(`(`),r(`)`)),f<0)||(l=f,f=h(f,i),f<0)||e[f].type!==`ident`||(n=e[f].data,f=h(f,i),f<0)||e[f].type===`operator`||e[f].data===`return`)continue;t=e[f].data,u.push({name:n,type:t,body:!1,args:[l,c+1],outer:[f,d+1]})}return u.sort(function(e,t){return e.outer[0]-t.outer[0]});function h(t,n,r){for(var i=t-1;i>=0;i--){if(n(e[i]))return i;if(r&&r(e[i]))return-1}return-1}}function r(e){return function(t){return t.type===`operator`&&(!e||t.data===e)}}function i(e){return e.type!==`whitespace`}}));MP(),NP(),PP();function FP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function IP(e){var t=FP(e,`string`);return typeof t==`symbol`?t:String(t)}function LP(e,t,n){return t=IP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var RP={position:`csm_Position`,positionRaw:`csm_PositionRaw`,pointSize:`csm_PointSize`,fragColor:`csm_FragColor`,diffuseColor:`csm_DiffuseColor`,normal:`csm_Normal`,roughness:`csm_Roughness`,metalness:`csm_Metalness`,emissive:`csm_Emissive`,ao:`csm_AO`,bump:`csm_Bump`,depthAlpha:`csm_DepthAlpha`},zP={},BP;LP(zP,`${RP.normal}`,{"#include <beginnormal_vertex>":`
4192    vec3 objectNormal = ${RP.normal};
4193    #ifdef USE_TANGENT
4194	    vec3 objectTangent = vec3( tangent.xyz );
4195    #endif
4196    `}),LP(zP,`${RP.position}`,{"#include <begin_vertex>":`
4197    vec3 transformed = ${RP.position};
4198  `}),LP(zP,`${RP.positionRaw}`,{"#include <begin_vertex>":`
4199    vec4 csm_internal_positionUnprojected = ${RP.positionRaw};
4200    mat4x4 csm_internal_unprojectMatrix = projectionMatrix * modelViewMatrix;
4201    #ifdef USE_INSTANCING
4202      csm_internal_unprojectMatrix = csm_internal_unprojectMatrix * instanceMatrix;
4203    #endif
4204    csm_internal_positionUnprojected = inverse(csm_internal_unprojectMatrix) * csm_internal_positionUnprojected;
4205    vec3 transformed = csm_internal_positionUnprojected.xyz;
4206  `}),LP(zP,`${RP.pointSize}`,{"gl_PointSize = size;":`
4207    gl_PointSize = ${RP.pointSize};
4208    `}),LP(zP,`${RP.diffuseColor}`,{"#include <color_fragment>":`
4209    #include <color_fragment>
4210    diffuseColor = ${RP.diffuseColor};
4211  `}),LP(zP,`${RP.fragColor}`,{"#include <dithering_fragment>":`
4212    #include <dithering_fragment>
4213    gl_FragColor  = ${RP.fragColor};
4214  `}),LP(zP,`${RP.emissive}`,{"vec3 totalEmissiveRadiance = emissive;":`
4215    vec3 totalEmissiveRadiance = ${RP.emissive};
4216    `}),LP(zP,`${RP.roughness}`,{"#include <roughnessmap_fragment>":`
4217    #include <roughnessmap_fragment>
4218    roughnessFactor = ${RP.roughness};
4219    `}),LP(zP,`${RP.metalness}`,{"#include <metalnessmap_fragment>":`
4220    #include <metalnessmap_fragment>
4221    metalnessFactor = ${RP.metalness};
4222    `}),LP(zP,`${RP.ao}`,{"#include <aomap_fragment>":`
4223    #include <aomap_fragment>
4224    reflectedLight.indirectDiffuse *= 1. - ${RP.ao};
4225    `}),LP(zP,`${RP.bump}`,{"#include <normal_fragment_maps>":`
4226    #include <normal_fragment_maps>
4227
4228    vec3 csm_internal_orthogonal = ${RP.bump} - (dot(${RP.bump}, normal) * normal);
4229    vec3 csm_internal_projectedbump = mat3(csm_internal_vModelViewMatrix) * csm_internal_orthogonal;
4230    normal = normalize(normal - csm_internal_projectedbump);
4231    `}),LP(zP,`${RP.depthAlpha}`,{"gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );":`
4232      gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity * ${RP.depthAlpha} );
4233    `,"gl_FragColor = packDepthToRGBA( fragCoordZ );":`
4234      gl_FragColor = packDepthToRGBA( fragCoordZ );
4235      gl_FragColor.a *= ${RP.depthAlpha};
4236    `}),BP={}
4236,LP(BP,`${RP.position}`,{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":`
4237    gl_Position = projectionMatrix * modelViewMatrix * vec4( ${RP.position}, 1.0 );
4238  `}),LP(BP,`${RP.positionRaw}`,{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":`
4239    gl_Position = ${RP.position};
4240  `}),LP(BP,`${RP.diffuseColor}`,{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":`
4241    gl_FragColor = ${RP.diffuseColor};
4242  `}),LP(BP,`${RP.fragColor}`,{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":`
4243    gl_FragColor = ${RP.fragColor};
4244  `});var VP={};LP(VP,`${RP.position}`,`*`),LP(VP,`${RP.positionRaw}`,`*`),LP(VP,`${RP.normal}`,`*`),LP(VP,`${RP.pointSize}`,[`PointsMaterial`]),LP(VP,`${RP.diffuseColor}`,`*`),LP(VP,`${RP.fragColor}`,`*`),LP(VP,`${RP.emissive}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`]),LP(VP,`${RP.roughness}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`]),LP(VP,`${RP.metalness}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`]),LP(VP,`${RP.ao}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`,`MeshBasicMaterial`,`MeshLambertMaterial`,`MeshPhongMaterial`,`MeshToonMaterial`]),LP(VP,`${RP.bump}`,[`MeshLambertMaterial`,`MeshMatcapMaterial`,`MeshNormalMaterial`,`MeshPhongMaterial`,`MeshPhysicalMaterial`,`MeshStandardMaterial`,`MeshToonMaterial`,`ShadowMaterial`]),LP(VP,`${RP.depthAlpha}`,`*`),new K,new G,new G,new K,new ea,Array.from({length:8},()=>new G),new G,new G,new G,new G,new G,new G,Object.freeze(new G(0,0,1)),(()=>{let e=new Fo;return e.matrixAutoUpdate=!1,e.matrixWorldAutoUpdate=!1,e})(),new q(`black`),new W(1,1),new G,new G,new G;var HP=e=>!!(e&&e.isPerspectiveCamera),UP=e=>!!(e&&e.isOrthographicCamera),WP=`min-polar-angle.max-polar-angle.min-azimuth-angle.max-azimuth-angle.distance.min-distance.max-distance.infinity-dolly.min-zoom.max-zoom.smooth-time.dragging-smooth-time.max-speed.azimuth-rotate-speed.polar-rotate-speed.dolly-speed.dolly-drag-inverted.truck-speed.dolly-to-cursor.drag-to-offset.vertical-drag-to-forward.boundary-friction.rest-threshold.collider-meshes.args.mouse-buttons.touches`.split(`.`),GP=(e,t)=>({left:xP.ACTION.ROTATE,middle:xP.ACTION.DOLLY,right:xP.ACTION.TRUCK,wheel:HP(e)?xP.ACTION.DOLLY:UP(e)?xP.ACTION.ZOOM:xP.ACTION.NONE,...t}),KP=(e,t)=>({one:xP.ACTION.TOUCH_ROTATE,two:HP(e)?xP.ACTION.TOUCH_DOLLY_TRUCK:UP(e)?xP.ACTION.TOUCH_ZOOM_TRUCK:xP.ACTION.NONE,three:xP.ACTION.TOUCH_TRUCK,...t}),qP=k({__name:`CameraControls`,props:{makeDefault:{type:Boolean,required:!1,default:!1},camera:{type:Object,required:!1},domElement:{type:null,required:!1},minPolarAngle:{type:Number,required:!1,default:0},maxPolarAngle:{type:Number,required:!1,default:Math.PI},minAzimuthAngle:{type:Number,required:!1,default:-1/0},maxAzimuthAngle:{type:Number,required:!1,default:1/0},distance:{type:Number,required:!1,default:()=>DT().camera.value.position.z},minDistance:{type:Number,required:!1,default:2**-52},maxDistance:{type:Number,required:!1,default:1/0},infinityDolly:{type:Boolean,required:!1,default:!1},minZoom:{type:Number,required:!1,default:.01},maxZoom:{type:Number,required:!1,default:1/0},smoothTime:{type:Number,required:!1,default:.25},draggingSmoothTime:{type:Number,required:!1,default:.125},maxSpeed:{type:Number,required:!1,default:1/0},azimuthRotateSpeed:{type:Number,required:!1,default:1},polarRotateSpeed:{type:Number,required:!1,default:1},dollySpeed:{type:Number,required:!1,default:1},dollyDragInverted:{type:Boolean,required:!1,default:!1},truckSpeed:{type:Number,required:!1,default:2},dollyToCursor:{type:Boolean,required:!1,default:!1},dragToOffset:{type:Boolean,required:!1,default:!1},verticalDragToForward:{type:Boolean,required:!1,default:!1},boundaryFriction:{type:Number,required:!1,default:0},restThreshold:{type:Number,required:!1,default:.01},colliderMeshes:{type:Array,required:!1,default:()=>[]},mouseButtons:{type:Object,required:!1,default:()=>GP(DT().camera.value)},touches:{type:Object,required:!1,default:()=>KP(DT().camera.value)}},emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,i=n,{makeDefault:a,minPolarAngle:o,maxPolarAngle:s,minAzimuthAngle:l,maxAzimuthAngle:u,distance:d,minDistance:f,maxDistance:m,infinityDolly:g,minZoom:_,maxZoom:v,smoothTime:y,draggingSmoothTime:x,maxSpeed:S,azimuthRotateSpeed:C,polarRotateSpeed:E,dollySpeed:D,dollyDragInverted:O,truckSpeed:k,dollyToCursor:A,dragToOffset:M,verticalDragToForward:N,boundaryFriction:P,restThreshold:ee,colliderMeshes:te}=h(r),ne={Box3:ea,MathUtils:{clamp:kr.clamp},Matrix4:K,Quaternion:Ar,Raycaster:Gf,Sphere:Fa,Spherical:Yf,Vector2:W,Vector3:G,Vector4:Yr};xP.install({THREE:ne});let{camera:re,renderer:F,extend:I,controls:ie,invalidate:oe}=DT();c(r,()=>{oe()});let se=T(()=>GP(r.camera||re.value,r.mouseButtons)),ce=T(()=>KP(r.camera||re.value,r.touches)),ue=L(null);I({CameraControls:xP}),le(ue,e=>{e.addEventListener(`update`,()=>{ue.value&&i(`change`,ue.value),oe()}),e.addEventListener(`controlend`,()=>ue.value&&i(`end`,ue.value)),e.addEventListener(`controlstart`,()=>ue.value&&i(`start`,ue.value)),a.value?ie.value=e:ie.value=null},{once:!0});let{onBeforeRender:de}=OT();return de(({delta:e})=>{ue.value?.enabled&&ue.value?.update(e)}),w(()=>{ue.value&&ue.value.disconnect()}),t({instance:ue}),(t,n)=>(e.camera||p(re))&&(e.domElement||p(F).domElement)?(j(),b(`TresCameraControls`,{key:0,ref_key:`controlsRef`,ref:ue,"min-polar-angle":p(o),"max-polar-angle":p(s),"min-azimuth-angle":p(l),"max-azimuth-angle":p(u),distance:p(d),"min-distance":p(f),"max-distance":p(m),"infinity-dolly":p(g),"min-zoom":p(_),"max-zoom":p(v),"smooth-time":p(y),"dragging-smooth-time":p(x),"max-speed":p(S),"azimuth-rotate-speed":p(C),"polar-rotate-speed":p(E),"dolly-speed":p(D),"dolly-drag-inverted":p(O),"truck-speed":p(k),"dolly-to-cursor":p(A),"drag-to-offset":p(M),"vertical-drag-to-forward":p(N),"boundary-friction":p(P),"rest-threshold":p(ee),"collider-meshes":p(te),args:[e.camera||p(re),e.domElement||p(F).domElement],"mouse-buttons":se.value,touches:ce.value},null,8,WP)):ae(`v-if`,!0)}}),JP={makeDefault:!1,autoRotate:!1,autoRotateSpeed:2,enableDamping:!0,dampingFactor:.05,enablePan:!0,keyPanSpeed:7,maxAzimuthAngle:1/0,minAzimuthAngle:-1/0,maxPolarAngle:Math.PI,minPolarAngle:0,minDistance:0,maxDistance:1/0,minZoom:0,maxZoom:1/0,enableZoom:!0,zoomSpeed:1,enableRotate:!0,rotateSpeed:1,target:()=>[0,0,0]};({...JP}),{...JP};
4244var YP=k({name:`Stats`,props:{showPanel:{type:Number,default:0}},setup(e,{expose:t}){let n=new SP.default;t({instance:n});let r=document.body;n.showPanel(e.showPanel||0),r?.appendChild(n.dom);let{onBeforeRender:i,onRender:a}=OT();i(()=>n.begin(),-1/0),a(()=>n.end(),1/0),w(()=>{r?.removeChild(n.dom)})}});k({name:`StatsGl`,props:[`logsPerSecond`,`samplesLog`,`samplesGraph`,`precision`,`horizontal`,`minimal`,`mode`],setup(e,{expose:t}){let n=new TP({logsPerSecond:e.logsPerSecond,samplesLog:e.samplesLog,samplesGraph:e.samplesGraph,precision:e.precision,horizontal:e.horizontal,minimal:e.minimal,mode:e.mode});t({instance:n});let r=document.body,i=n.domElement;r?.appendChild(i);let{renderer:a}=ET(),{onRender:o}=OT();n.init(a.instance),o(()=>n.update(),1/0),w(()=>{r?.removeChild(i)})}}),new q,k({name:`BakeShadows`,setup(){let{renderer:e}=DT();g(()=>{e instanceof u_&&(e.shadowMap.autoUpdate=!1,e.shadowMap.needsUpdate=!0)})}});var XP=class e extends Fo{static Geometry;isLensflare=!0;type=`Lensflare`;addElement(e){}dispose(){}constructor(){super(e.Geometry,new Co({opacity:0,transparent:!0})),this.frustumCulled=!1,this.renderOrder=1/0;let t=new G,n=new G,r=new sc(16,16),i=new sc(16,16),a=Ke,o=e.Geometry,s=new _u({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:`
4245
4246				precision highp float;
4247
4248				uniform vec3 screenPosition;
4249				uniform vec2 scale;
4250
4251				attribute vec3 position;
4252
4253				void main() {
4254
4255					gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );
4256
4257				}`,fragmentShader:`
4258
4259				precision highp float;
4260
4261				void main() {
4262
4263					gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 );
4264
4265				}`,depthTest:!0,depthWrite:!1,transparent:!1}),c=new _u({uniforms:{map:{value:r},scale:{value:null},screenPosition:{value:null}},vertexShader:`
4266
4267				precision highp float;
4268
4269				uniform vec3 screenPosition;
4270				uniform vec2 scale;
4271
4272				attribute vec3 position;
4273				attribute vec2 uv;
4274
4275				varying vec2 vUV;
4276
4277				void main() {
4278
4279					vUV = uv;
4280
4281					gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );
4282
4283				}`,fragmentShader:`
4284
4285				precision highp float;
4286
4287				uniform sampler2D map;
4288
4289				varying vec2 vUV;
4290
4291				void main() {
4292
4293					gl_FragColor = texture2D( map, vUV );
4294
4295				}`,depthTest:!1,depthWrite:!1,transparent:!1}),l=new Fo(o,s),u=[],d=ZP.Shader,f=new _u({name:d.name,uniforms:{map:{value:null},occlusionMap:{value:i},color:{value:new q(16777215)},scale:{value:new W},screenPosition:{value:new G}},vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:2,transparent:!0,depthWrite:!1}),p=new Fo(o,f);this.addElement=function(e){u.push(e)};let m=new W,h=new W,g=new $f,_=new Yr;this.onBeforeRender=function(e,d,v){e.getCurrentViewport(_);let y=e.getRenderTarget(),b=y===null?Ke:y.texture.type;a!==b&&(r.dispose(),i.dispose(),r.type=i.type=b,a=b);let x=_.w/_.z,S=_.z/2,C=_.w/2,w=16/_.w;if(m.set(w*x,w),g.min.set(_.x,_.y),g.max.set(_.x+(_.z-16),_.y+(_.w-16)),n.setFromMatrixPosition(this.matrixWorld),n.applyMatrix4(v.matrixWorldInverse),!(n.z>0)&&(t.copy(n).applyMatrix4(v.projectionMatrix),h.x=_.x+t.x*S+S-8,h.y=_.y+t.y*C+C-8,g.containsPoint(h))){e.copyFramebufferToTexture(r,h);let n=s.uniforms;n.scale.value=m,n.screenPosition.value=t,e.renderBufferDirect(v,null,o,s,l,null),e.copyFramebufferToTexture(i,h),n=c.uniforms,n.scale.value=m,n.screenPosition.value=t,e.renderBufferDirect(v,null,o,c,l,null);let a=-t.x*2,d=-t.y*2;for(let n=0,r=u.length;n<r;n++){let r=u[n],i=f.uniforms;i.color.value.copy(r.color),i.map.value=r.texture,i.screenPosition.value.x=t.x+a*r.distance,i.screenPosition.value.y=t.y+d*r.distance,w=r.size/_.w;let s=_.w/_.z;i.scale.value.set(w*s,w),f.uniformsNeedUpdate=!0,e.renderBufferDirect(v,null,o,f,p,null)}}},this.dispose=function(){s.dispose(),c.dispose(),f.dispose(),r.dispose(),i.dispose();for(let e=0,t=u.length;e<t;e++)u[e].texture.dispose()}}},ZP=class{texture;size;distance;color;static Shader;constructor(e,t=1,n=0,r=new q(16777215)){this.texture=e,this.size=t,this.distance=n,this.color=r}};ZP.Shader={name:`LensflareElementShader`,uniforms:{map:{value:null},occlusionMap:{value:null},color:{value:null},scale:{value:null},screenPosition:{value:null}},vertexShader:`
4296
4297		precision highp float;
4298
4299		uniform vec3 screenPosition;
4300		uniform vec2 scale;
4301
4302		uniform sampler2D occlusionMap;
4303
4304		attribute vec3 position;
4305		attribute vec2 uv;
4306
4307		varying vec2 vUV;
4308		varying float vVisibility;
4309
4310		void main() {
4311
4312			vUV = uv;
4313
4314			vec2 pos = position.xy;
4315
4316			vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );
4317			visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );
4318			visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );
4319			visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );
4320			visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );
4321			visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );
4322			visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );
4323			visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );
4324			visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );
4325
4326			vVisibility =        visibility.r / 9.0;
4327			vVisibility *= 1.0 - visibility.g / 9.0;
4328			vVisibility *=       visibility.b / 9.0;
4329
4330			gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );
4331
4332		}`,fragmentShader:`
4333
4334		precision highp float;
4335
4336		uniform sampler2D map;
4337		uniform vec3 color;
4338
4339		varying vec2 vUV;
4340		varying float vVisibility;
4341
4342		void main() {
4343
4344			vec4 texture = texture2D( map, vUV );
4345			texture.a *= vVisibility;
4346			gl_FragColor = texture;
4347			gl_FragColor.rgb *= color;
4348
4349		}`},XP.Geometry=(function(){let e=new Ua,t=new Wa(new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),5);return e.setIndex([0,1,2,0,2,3]),e.setAttribute(`position`,new Ka(t,3,0,!1)),e.setAttribute(`uv`,new Ka(t,2,3,!1)),e})(),kr.clamp,kr.lerp,k({name:`GlobalAudio`,props:[`src`,`loop`,`volume`,`playbackRate`,`playTrigger`,`stopTrigger`],async setup(e,{expose:t,emit:n}){let{camera:r,renderer:i}=ET(),a=new pf;r.activeCamera.value?.add(a);let o=new mf(a),s=new Xd;t({instance:o}),w(()=>{o&&o.disconnect()}),c(()=>[e.playbackRate],()=>o.setPlaybackRate(e.playbackRate??1),{immediate:!0}),c(()=>[e.volume],()=>o.setVolume(e.volume??.5),{immediate:!0}),c(()=>[e.loop],()=>o.setLoop(e.loop??!1),{immediate:!0}),c(()=>[e.src],async()=>{let t=await s.loadAsync(e.src);o.setBuffer(t)},{immediate:!0}),de(document.getElementById(e.playTrigger??``)||i.instance.domElement,`click`,()=>{o.isPlaying?o.pause():o.play(),n(`isPlaying`,o.isPlaying)});let l=document.getElementById(e.stopTrigger??``);return l&&de(l,`click`,()=>{o.stop(),n(`isPlaying`,o.isPlaying)}),null}}),new G(0,0,0),new G(0,0,0),new G(0,0,0),kN.ReflectorShader;var QP={sunset:`venice/venice_sunset_1k.hdr`,studio:`studio/poly_haven_studio_1k.hdr`,city:`city/canary_wharf_1k.hdr`,umbrellas:`outdoor/outdoor_umbrellas_1k.hdr`,night:`outdoor/satara_night_1k.hdr`,forest:`outood/mossy_forest_1k.hdr`,snow:`outdoor/snowy_forest_path_01_1k.hdr`,dawn:`kiara/kiara_1_dawn_1k.hdr`,hangar:`indoor/small_hangar_01_1k.hdr`,urban:`indoor/abandoned_games_room_02_1k.hdr`,modern:`city/modern_buildings_2_1k.hdr`,shangai:`city/shanghai_bund_1k.hdr`},$P=`https://raw.githubusercontent.com/Tresjs/assets/main/textures/hdr/`;function eF(e){return e instanceof di?e:Array.isArray(e)?new di(e[0],e[1],e[2]):typeof e==`number`?new di(e,e,e):e instanceof G||typeof e==`object`&&`x`in e&&`y`in e&&`z`in e?new di(e.x,e.y,e.z):null}function tF(e){e.traverse(e=>{e instanceof Fo&&e.material&&(e.material.needsUpdate=!0)})}async function nF(e,t){let{scene:n,invalidate:r}=DT(),{preset:i,blur:a,files:o=I([]),path:s=I(``),background:l,backgroundIntensity:u=I(1),environmentIntensity:d=I(1),backgroundRotation:f=I([0,0,0]),environmentRotation:m=I([0,0,0]),syncMaterials:g=I(!1)}=h(e);c(e,()=>{r()});let _=I(null),v=T(()=>Array.isArray(o.value)),y=new ld,b=new AN,x=async(e,t)=>new Promise((n,r)=>{v.value?(t&&y.setPath(t),y.load(e,e=>{e.mapping=301,n(e)},void 0,e=>r(e))):(t&&b.setPath(t),b.load(e[0],e=>{e.mapping=303,n(e)},void 0,e=>r(e)))});return c([o,s],async([e,t])=>{if(e&&e.length!==0&&!i?.value)try{_.value=await x(v.value?[...p(e)]:[p(e)],p(t))}catch(e){throw Error(`Failed to load environment map: ${e}`)}},{immediate:!0}),c(_,e=>{n.value&&e&&(n.value.environment=e)},{immediate:!0}),c([l,_],([e,r])=>{if(n.value){let i=t?.value?t.value.texture:r;i&&(n.value.background=e?i:null)}},{immediate:!0}),c(()=>a?.value,e=>{n.value&&e&&(n.value.backgroundBlurriness=e)},{immediate:!0}),c(()=>u?.value,e=>{n.value&&(n.value.backgroundIntensity=e??1)},{immediate:!0}),c(()=>d?.value,e=>{n.value&&(n.value.environmentIntensity=e??1)},{immediate:!0}),c(()=>f?.value,e=>{if(n.value){let t=eF(e);t&&(n.value.backgroundRotation=t)}},{immediate:!0}),c(()=>m?.value,e=>{if(n.value&&!g?.value){let t=eF(e);t&&(n.value.environmentRotation=t,tF(n.value))}},{immediate:!0}),c(()=>i?.value,async e=>{if(e&&e in QP){let t=$P,n=QP[e];try{b.setPath(t),_.value=await new Promise((e,t)=>{b.load(n,t=>{t.mapping=303,e(t)},void 0,e=>t(e))}),r()}catch(e){throw Error(`Failed to load environment map: ${e}`)}_.value&&(_.value.mapping=303),r()}else if(e&&!(e in QP))throw Error(`Preset must be one of: ${Object.keys(QP).join(`, `)}`)},{immediate:!0}),c([g,f],([e,t])=>{if(e&&n.value){let e=eF(t);e&&(n.value.environmentRotation=e,tF(n.value))}},{immediate:!0}),_}new q(16777215);var rF=Symbol(`eventBusKey`),iF=()=>{D(rF,Symbol(`eventBus`))},aF=()=>{let e=l(rF);if(!e)throw Error(`useEventBus is only available inside a ThreeDPreview`);return fe(e)},oF=Symbol(`settings`),sF=()=>l(oF),cF=e=>{D(oF,e)},lF=e=>{let t=e??sF();return{error:(...e)=>{t.value.logLevel>=FM.ERROR&&console.error(IM,...e)},log:(...e)=>{t.value.logLevel>=FM.LOG&&console.log(IM,...e)},warn:(...e)=>{t.value.logLevel>=FM.WARN&&console.warn(IM,...e)}}},uF=e=>(kr.radToDeg(e)%360+540)%360-180,dF=({azimuthAngle:e,polarAngle:t})=>{let n=uF(e),r=uF(t);return n>-10&&n<10&&r>80&&r<100},fF=({aspect:e,fov:t},{height:n,width:r},i)=>{let a=tN(Math.max(n,r/e)/2)/(1-i*2),o=tN(Math.sqrt(n**2+r**2)/2)+.1,s=rN(a,90-t/2);return{distance:s,maxDistance:s+(s-o),minDistance:o}},pF=(e,t)=>{let n=aF(),r=sF(),{log:i}=lF(),a=null,o=e=>{let a=!1,o=!1,s=null,c=null,l=null,u=null,d=()=>{s&&(!o||r.value.isTilting)&&(s.kill(),s=null)},f=()=>{c&&=(c.kill(),null)},p=()=>
4349{if(!a||!r.value.isTilting)return;d(),i(LM.LOG_TILT_CHANGE);let t=e.polarAngle,n=.15;s=CM.timeline({repeat:-1,repeatDelay:.5,yoyo:!0}),s.to(e,{duration:1.5,ease:`power1.inOut`,polarAngle:t+n}).to(e,{duration:1.5,ease:`power1.inOut`,polarAngle:t-n})},m=()=>{if(!dF(e))return;d(),i(LM.LOG_PRODUCT_OPTION_CHANGE),s=CM.timeline();let{azimuthAngle:t,polarAngle:n}=e;s.to(e,{azimuthAngle:t+35*kr.DEG2RAD,...r.value.animations.productChange,polarAngle:n-35*kr.DEG2RAD}).to(e,{azimuthAngle:t,duration:r.value.animations.productChange.duration,ease:`power2.inOut`,polarAngle:n})},h=(t=!0)=>{if(!a)return;let{distance:n,...i}=fF(e.camera,nN(r.value.dimension,r.value.frame),r.value.paddingFraction);t?(f(),c=CM.to(e,{distance:n,ease:`power1.out`})):e.distance=n,Object.assign(e,i)},g=()=>{a=!0,o=!0,h(!1);let t=e.distance;e.distance=t*1.5,r.value.isTilting?(e.distance=t,o=!1):(d(),l=setTimeout(()=>{l=null,s=CM.fromTo(e,{azimuthAngle:0,distance:e.distance},{azimuthAngle:-360*kr.DEG2RAD,distance:t,duration:r.value.animations.init.duration,ease:`back.out(1.7)`,onComplete:()=>{o=!1},paused:!0}),s.play(0)},750))},{start:_,stop:v}=ue(()=>{t(`inactive`)},()=>r.value.inactivityTimeout,{immediate:!1}),y=()=>{v(),d(),f(),t(`active`)},b=n.on(n=>{switch(n){case`materialChange`:h(),m(),t(`active`);break;case`init`:g(),_(),e.addEventListener(`controlstart`,y),r.value.isTilting&&(u=setTimeout(()=>{u=null,p()},1e3));break;case`sizeChange`:h(),t(`active`);break;case`tiltChange`:p(),t(`active`)}});return()=>{s&&=(s.kill(),null),f(),l!==null&&(clearTimeout(l),l=null),u!==null&&(clearTimeout(u),u=null),b(),e.removeEventListener(`controlstart`,y),v()}};c(e,e=>{e&&!a&&(a=o(e))},{immediate:!0}),O(()=>{a?.(),a=null})},mF={right:1},hF={three:xP.ACTION.TOUCH_DOLLY_ROTATE,two:xP.ACTION.TOUCH_DOLLY_ROTATE},gF=k({__name:`CameraControls`,emits:[`active`,`inactive`],setup(e,{emit:t}){let n=L();return pF(()=>n.value?.instance,t),(e,t)=>(j(),b(M,null,[t[0]||=_(`TresPerspectiveCamera`,{position:[0,0,11]},null,-1),a(p(qP),{ref_key:`cameraControlsRef`,ref:n,"make-default":``,"mouse-buttons":p(mF),touches:p(hF)},null,8,[`mouse-buttons`,`touches`])],64))}}),_F=e=>{let{error:t}=lF(),{invalidate:n,renderer:r}=DT(),{error:i,state:a}=lT(dd,e,{asyncOptions:{resetOnExecute:!1}}),o=L();return c(i,e=>{e&&t(LM.ERROR_LOADING_MOLDING_TEXTURE,e)}),c(a,(e,t)=>{if(!e)return;r instanceof u_&&(e.anisotropy=r.capabilities.getMaxAnisotropy()),e.flipY=!1,e.colorSpace=hn,e.wrapS=Fe,e.wrapT=Fe,e.minFilter=Ge,e.magFilter=Ve,e.generateMipmaps=!0,e.needsUpdate=!0,o.value?.dispose();let n=e.clone();n.needsUpdate=!0,o.value=n,t?.dispose()}),w(()=>{a.value?.dispose(),o.value?.dispose()}),{horizontalTexture:a,textureError:i,updateRepeat:(e,t,r)=>{if(!a.value||!o.value)return;let{height:i,width:s}=a.value.image,{repeatHorizontal:c,repeatVertical:l}=dN(e,t,r,s/i);a.value.repeat.set(c,1),o.value.repeat.set(l,1),n()},verticalTexture:o}},vF=(e,t)=>{let{error:n}=lF(),{invalidate:r}=DT(),i=L(),a=null,o=e=>{JM(e,t.keepTextures?.()??[])},s=0;return c(e,async()=>{let r=++s,c;try{({scene:c}=await uN.loadAsync(e()))}catch(e){n(t.loadErrorLog,e);return}if(r!==s){JM(c);return}cN(c),c.visible=!1,a=iN(c),a?sN(a.keys())&&(c.rotation.x=Math.PI/2):n(LM.ERROR_NO_SCALING_BONES),i.value&&o(i.value),i.value=c},{immediate:!0}),w(()=>{i.value&&o(i.value)}),{applySize:(e,t)=>{a&&oN(a,e,t),i.value&&(i.value.visible=!0),r()},scene:i}
4349},yF=[`object`],bF=k({__name:`FrameModel`,setup(e){let t=sF(),n=aF(),{error:r}=lF(),i=T(()=>t.value.frame),{horizontalTexture:a,textureError:o,updateRepeat:s,verticalTexture:l}=_F(T(()=>$M(t.value,i.value))),{applySize:u,scene:d}=vF(()=>ZM(t.value,i.value),{keepTextures:()=>[a.value??null,l.value??null],loadErrorLog:LM.ERROR_LOADING_FRAME_MODEL}),f=e=>{let t=!1;e.traverse(e=>{Ow(e)&&GM(e.material)&&(e.material.map=e.material.name===`Frame Vertical`?l.value??null:a.value??null,e.material.needsUpdate=!0,t=!0)}),t||r(LM.ERROR_NO_FRAME_MATERIAL)},m=()=>{let e=qM(i.value),{gapWidth:n=0,moldingWidth:r=0}=Te(i.value)??{};u(t.value.dimension,{offset:tN(e+n)}),s(t.value.dimension,e+n,r)},h=!1;return c([d,a,o],([e],[t])=>{e&&(a.value||o.value)&&(f(e),m(),h?e!==t&&n.emit(`materialChange`):(h=!0,n.emit(`sizeChange`)))}),c([()=>t.value.dimension.height,()=>t.value.dimension.width,()=>qM(t.value.frame)],([,,e],[,,t])=>{d.value&&(m(),e!==t&&n.emit(`sizeChange`))}),(e,t)=>p(d)?(j(),b(`primitive`,{key:0,object:p(d)},null,8,yF)):ae(`v-if`,!0)}}),xF=[`object`],SF=k({__name:`PassepartoutModel`,setup(e){let t=sF(),{error:n}=lF(),{invalidate:r}=DT(),{applySize:i,scene:a}=vF(()=>QM(t.value),{loadErrorLog:LM.ERROR_LOADING_PASSEPARTOUT_MODEL}),o=T(()=>{let e=t.value.frame?.matType;return e&&e!==Ee.NONE?De[e]:null}),s=e=>{let t=o.value;if(!t)return;let i=!1;e.traverse(e=>{Ow(e)&&KM(e.material)&&(e.material.color.set(t),i=!0)}),i||n(LM.ERROR_NO_PASSEPARTOUT_MATERIAL),r()},l=()=>{i(t.value.dimension,{offset:0,outerOffset:tN(qM(t.value.frame))})};return c(a,e=>{e&&(s(e),l())}),c([()=>t.value.dimension.height,()=>t.value.dimension.width,()=>qM(t.value.frame)],()=>{a.value&&l()}),c(o,()=>{a.value&&s(a.value)}),(e,t)=>p(a)?(j(),b(`primitive`,{key:0,object:p(a)},null,8,xF)):ae(`v-if`,!0)}}),CF=e=>{let{error:t,log:n}=lF(),{invalidate:r,renderer:i}=DT(),{error:a,state:o}=lT(dd,e,{asyncOptions:{resetOnExecute:!1}});return c(a,e=>{e&&t(LM.ERROR_LOADING_IMAGE_TEXTURE,e)}),c(o,(e,t)=>{e&&(i instanceof u_&&(e.anisotropy=i.capabilities.getMaxAnisotropy()),e.flipY=!1,e.minFilter=Ge,e.magFilter=Ve,e.generateMipmaps=!0,e.needsUpdate=!0,n(LM.SUCCESS_IMAGE_TEXTURE_LOADED),t?.dispose())}),w(()=>{o.value?.dispose()}),{texture:o,textureError:a,updateTextureSize:e=>{if(!o.value)return;let{offsetX:t,offsetY:n,repeatX:i,repeatY:a}=fN({height:o.value.image.height,width:o.value.image.width},e);o.value.repeat.set(i,a),o.value.offset.set(t,n),r()}}},wF=[`object`],TF=k({__name:`ProductModel`,emits:[`loaded`],setup(e,{emit:t}){let n=t,r=sF(),i=aF(),{error:a}=lF(),{invalidate:o,sizes:s}=DT(),{texture:l,textureError:u,updateTextureSize:d}=CF(T(()=>r.value.imageUrl)),{applySize:f,scene:m}=vF(()=>YM(r.value),{keepTextures:()=>[l.value],loadErrorLog:LM.ERROR_LOADING_MODEL}),h=()=>{f(r.value.dimension),d(r.value.dimension),o(),i.emit(`sizeChange`)},g=e=>{let t=!1;e.traverse(e=>{Ow(e)&&WM(e.material)&&(e.material.map=l.value,e.material.toneMapped=!1,e.material.needsUpdate=!0,t=!0)}),t||a(LM.ERROR_NO_IMAGE_MATERIAL)},_=!1;return c([m,l,u],([e],[t])=>{e&&(l.value||u.value)&&(g(e),h(),_?e!==t&&i.emit(`materialChange`):(_=!0,n(`loaded`),i.emit(`init`)))}),c([()=>r.value.dimension.height,()=>r.value.dimension.width],()=>{m.value&&h()}),c(()=>r.value.paddingFraction,()=>{m.value&&i.emit(`sizeChange`)}),ce(s.aspectRatio,()=>{m.value&&i.emit(`sizeChange`)},{debounce:250,maxWait:500}),c(()=>r.value.isTilting,()=>{m.value&&i.emit(`tiltChange`)}),(e,t)=>p(m)?(j(),b(`primitive`,{key:0,object:p(m)},null,8,wF)):ae(`v-if`,!0)}}),EF=k({__name:`EnvironmentLoader`,async setup(e){let t,n,r=sF(),{invalidate:i}=DT(),{log:a}=lF(),o=T(()=>PM[r.value.environmentFile]),s=E({background:T(()=>r.value.showBackground),backgroundRotation:o,environmentRotation:o,files:T(()=>XM(r.value))});return c(([t,n]=u(()=>nF(s,I(null))),t=await t,n(),t),e=>{e&&a(LM.SUCCESS_ENVIRONMENT_LOADED),i()}),(e,t)=>ae(` The environment is applied to the scene by the useEnvironment composable `)}}),DF=k({__name:`SceneEnvironment`,setup(e){let{error:t}=lF();return ee(e=>(t(LM.ERROR_LOADING_ENVIRONMENT,e),!1)),(e,t)=>(j(),F(EF))}}),OF=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})(k({__name:`ThreeDPreview`,props:{animations:{type:Object,required:!1},baseUrl:{type:String,required:!1},dimension:{type:Object,required:!0},environmentFile:{type:null,required:!1},frame:{type:Object,required:!1},framesBaseUrl:{type:String,required:!1},imageUrl:{type:String,required:!1},inactivityTimeout:{type:Number,required:!1},isTilting:{type:Boolean,required:!1},lighting:{type:Object,required:!1},logLevel:{type:null,required:!1},modelFile:{type:null,required:!0},paddingFraction:{type:Number,required:!1}
4349,showBackground:{type:Boolean,required:!1},showStats:{type:Boolean,required:!1}},emits:[`active`,`inactive`,`loaded`],setup(e){let t=e,n=T(()=>({...oe(t,RM),frame:t.frame??void 0}));cF(n),iF();let{error:r}=lF(n),i=T(()=>{let e=n.value.frame;return!!(e&&we(e.frameType))}),o=T(()=>i.value&&qM(n.value.frame)>0);return c(()=>n.value.frame?.frameType,e=>{e&&!we(e)&&r(LM.ERROR_UNSUPPORTED_FRAME_TYPE,e)},{immediate:!0}),(e,t)=>(j(),b(M,null,[ae(` alpha + clear-alpha keep the canvas transparent: tres v5 defaults to an
4350       opaque context and explicitly applies clearColor #000000 with clearAlpha 1 `),a(p(cE),{"tone-mapping":p(4),"output-color-space":p(gn),class:`three-d-canvas`,"tone-mapping-exposure":2,"render-mode":`on-demand`,alpha:``,"clear-alpha":0},{default:P(()=>[a(gF,{onInactive:t[0]||=t=>e.$emit(`inactive`),onActive:t[1]||=t=>e.$emit(`active`)}),a(TF,{onLoaded:t[2]||=t=>e.$emit(`loaded`)}),i.value?(j(),F(bF,{key:0})):ae(`v-if`,!0),o.value?(j(),F(SF,{key:1})):ae(`v-if`,!0),(j(),F(A,null,{default:P(()=>[a(DF)]),_:1})),n.value.showStats?(j(),F(p(YP),{key:2})):ae(`v-if`,!0)]),_:1},8,[`tone-mapping`,`output-color-space`])],2112))}}),[[`__scopeId`,`data-v-d180529d`]]),kF={[se.LEINWAND]:{options:{"leinwand-keilrahmen-25mm":{context:{"optionTypes[]":`leinwand-keilrahmen-25mm`},model:z[`leinwand-keilrahmen-25mm`],translationKey:`option.leinwand-keilrahmen-25mm`},"leinwand-keilrahmen-38mm":{context:{"optionTypes[]":`leinwand-keilrahmen-38mm`},model:z[`leinwand-keilrahmen-38mm`],translationKey:`option.leinwand-keilrahmen-38mm`}},dimension:{width:800,height:600}},[se.POSTER]:{options:{"poster-materialausfuehrung-standard":{context:{"optionTypes[]":`poster-materialausfuehrung-standard`},model:z[`poster-laminierung-keine`],translationKey:`option.poster-laminierung-keine`},"poster-laminierung-matt":{context:{"optionTypes[]":`poster-laminierung-matt`},model:z[`poster-laminierung-matt`],translationKey:`option.poster-laminierung-matt`},"poster-laminierung-glaenzend":{context:{"optionTypes[]":`poster-laminierung-glaenzend`},model:z[`poster-laminierung-glaenzend`],translationKey:`option.poster-laminierung-glaenzend`}},dimension:{width:800,height:600}},[se.ACRYLGLAS]:{options:{"acrylglas-druckverfahren-fineart":{context:{"optionTypes[]":`acrylglas-druckverfahren-fineart`},model:z[`acrylglas-druckverfahren-fineart`],translationKey:`option.acrylglas-druckverfahren-fineart`},"acrylglas-druckverfahren-direktdruck":{context:{"optionTypes[]":`acrylglas-druckverfahren-direktdruck`},model:z[`acrylglas-druckverfahren-direktdruck`],translationKey:`option.acrylglas-druckverfahren-direktdruck`}},dimension:{width:600,height:450},hideOptionSwitch:!0},[se.ALUDIBOND]:{options:{"aludibond-druckverfahren-direktdruck":{context:{"optionTypes[]":`aludibond-druckverfahren-direktdruck`},model:z[`product-aludibond-druckverfahren-direktdruck`],translationKey:`option.aludibond-druckverfahren-direktdruck`},"aludibond-druckverfahren-fineart-matt":{context:{"optionTypes[]":`aludibond-druckverfahren-fineart-matt`},model:z[`product-aludibond-druckverfahren-fineart-matt`],translationKey:`option.aludibond-druckverfahren-fineart-matt`},"aludibond-druckverfahren-fineart-glaenzend":{context:{"optionTypes[]":`aludibond-druckverfahren-fineart-glaenzend`},model:z[`product-aludibond-druckverfahren-fineart-glaenzend`],translationKey:`option.aludibond-druckverfahren-fineart-glaenzend`},"aludibond-druckverfahren-fineart-hahnemuehle":{context:{"optionTypes[]":`aludibond-druckverfahren-fineart-hahnemuehle`},model:z[`product-aludibond-druckverfahren-fineart-hahnemuehle`],translationKey:`option.aludibond-druckverfahren-fineart-hahnemuehle`},"aludibond-materialausfuehrung-brushed":{context:{"optionTypes[]":`aludibond-materialausfuehrung-brushed`},model:z[`product-aludibond-materialausfuehrung-brushed`],translationKey:`option.aludibond-materialausfuehrung-brushed`}},dimension:{width:600,height:450}}},AF=(e,{suffix:t,isPortrait:n})=>`3d/preview-image/${e}-${n?`portrait`:`landscape`}${t||``}`;export{wN as a,CN as i,AF as n,we as o,OF as r,kF as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.