@widelab-development/pirxey-webflow-dev 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/prx-site.js CHANGED
@@ -1,8 +1,8 @@
1
- (()=>{function gi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Dh(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var Mn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Qr={duration:.5,overwrite:!1,delay:0},Kl,$e,ye,Nn=1e8,me=1/Nn,kl=Math.PI*2,bm=kl/4,Em=0,Ch=Math.sqrt,wm=Math.cos,Tm=Math.sin,Ue=function(t){return typeof t=="string"},Te=function(t){return typeof t=="function"},xi=function(t){return typeof t=="number"},qa=function(t){return typeof t>"u"},li=function(t){return typeof t=="object"},yn=function(t){return t!==!1},Ql=function(){return typeof window<"u"},Oa=function(t){return Te(t)||Ue(t)},Rh=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ke=Array.isArray,Vl=/(?:-?\.?\d|\.)+/gi,jl=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,_r=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ll=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,tc=/[+-]=-?[.\d]+/,Ph=/[^,'"\[\]\s]+/gi,Am=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,be,ai,Hl,ec,Dn={},Va={},Ih,Lh=function(t){return(Va=gr(t,Dn))&&Qe},Ya=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},Ks=function(t,e){return!e&&console.warn(t)},Fh=function(t,e){return t&&(Dn[t]=e)&&Va&&(Va[t]=e)||Dn},Qs=function(){return 0},Dm={suppressEvents:!0,isStart:!0,kill:!1},Ba={suppressEvents:!0,kill:!1},Cm={suppressEvents:!0},nc={},zi=[],Gl={},Uh,xn={},Fl={},Mh=30,za=[],ic="",rc=function(t){var e=t[0],n,i;if(li(e)||Te(e)||(t=[t]),!(n=(e._gsap||{}).harness)){for(i=za.length;i--&&!za[i].targetTest(e););n=za[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new oc(t[i],n)))||t.splice(i,1);return t},ki=function(t){return t._gsap||rc(On(t))[0]._gsap},sc=function(t,e,n){return(n=t[e])&&Te(n)?t[e]():qa(n)&&t.getAttribute&&t.getAttribute(e)||n},on=function(t,e){return(t=t.split(",")).forEach(e)||t},Ae=function(t){return Math.round(t*1e5)/1e5||0},ke=function(t){return Math.round(t*1e7)/1e7||0},xr=function(t,e){var n=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),n==="+"?t+i:n==="-"?t-i:n==="*"?t*i:t/i},Rm=function(t,e){for(var n=e.length,i=0;t.indexOf(e[i])<0&&++i<n;);return i<n},Ha=function(){var t=zi.length,e=zi.slice(0),n,i;for(Gl={},zi.length=0,n=0;n<t;n++)i=e[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},Nh=function(t,e,n,i){zi.length&&!$e&&Ha(),t.render(e,n,i||$e&&e<0&&(t._initted||t._startAt)),zi.length&&!$e&&Ha()},Oh=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Ph).length<2?e:Ue(t)?t.trim():t},Bh=function(t){return t},Bn=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Pm=function(t){return function(e,n){for(var i in n)i in e||i==="duration"&&t||i==="ease"||(e[i]=n[i])}},gr=function(t,e){for(var n in e)t[n]=e[n];return t},Sh=function r(t,e){for(var n in e)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=li(e[n])?r(t[n]||(t[n]={}),e[n]):e[n]);return t},Ga=function(t,e){var n={},i;for(i in t)i in e||(n[i]=t[i]);return n},Zs=function(t){var e=t.parent||be,n=t.keyframes?Pm(Ke(t.keyframes)):Bn;if(yn(t.inherit))for(;e;)n(t,e.vars.defaults),e=e.parent||e._dp;return t},Im=function(t,e){for(var n=t.length,i=n===e.length;i&&n--&&t[n]===e[n];);return n<0},zh=function(t,e,n,i,s){n===void 0&&(n="_first"),i===void 0&&(i="_last");var a=t[i],o;if(s)for(o=e[s];a&&a[s]>o;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[i]=e,e._prev=a,e.parent=e._dp=t,e},Za=function(t,e,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var s=e._prev,a=e._next;s?s._next=a:t[n]===e&&(t[n]=a),a?a._prev=s:t[i]===e&&(t[i]=s),e._next=e._prev=e.parent=null},Vi=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},dr=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},Lm=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Wl=function(t,e,n,i){return t._startAt&&($e?t._startAt.revert(Ba):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},Fm=function r(t){return!t||t._ts&&r(t.parent)},bh=function(t){return t._repeat?jr(t._tTime,t=t.duration()+t._rDelay)*t:0},jr=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},Wa=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Ja=function(t){return t._end=ke(t._start+(t._tDur/Math.abs(t._ts||t._rts||me)||0))},$a=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=ke(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ja(t),n._dirty||dr(n,t)),t},kh=function(t,e){var n;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(n=Wa(t.rawTime(),e),(!e._dur||ea(0,e.totalDuration(),n)-e._tTime>me)&&e.render(n,!0)),dr(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(n=t;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-me}},oi=function(t,e,n,i){return e.parent&&Vi(e),e._start=ke((xi(n)?n:n||t!==be?Un(t,n,e):t._time)+e._delay),e._end=ke(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),zh(t,e,"_first","_last",t._sort?"_start":0),Xl(e)||(t._recent=e),i||kh(t,e),t._ts<0&&$a(t,t._tTime),t},Vh=function(t,e){return(Dn.ScrollTrigger||Ya("scrollTrigger",e))&&Dn.ScrollTrigger.create(e,t)},Hh=function(t,e,n,i,s){if(uc(t,e,s),!t._initted)return 1;if(!n&&t._pt&&!$e&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Uh!==vn.frame)return zi.push(t),t._lazy=[s,i],1},Um=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},Xl=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},Nm=function(t,e,n,i){var s=t.ratio,a=e<0||!e&&(!t._start&&Um(t)&&!(!t._initted&&Xl(t))||(t._ts<0||t._dp._ts<0)&&!Xl(t))?0:1,o=t._rDelay,l=0,c,u,f;if(o&&t._repeat&&(l=ea(0,t._tDur,e),u=jr(l,o),t._yoyo&&u&1&&(a=1-a),u!==jr(t._tTime,o)&&(s=1-a,t.vars.repeatRefresh&&t._initted&&t.invalidate())),a!==s||$e||i||t._zTime===me||!e&&t._zTime){if(!t._initted&&Hh(t,e,i,n,l))return;for(f=t._zTime,t._zTime=e||(n?me:0),n||(n=e&&!f),t.ratio=a,t._from&&(a=1-a),t._time=0,t._tTime=l,c=t._pt;c;)c.r(a,c.d),c=c._next;e<0&&Wl(t,e,n,!0),t._onUpdate&&!n&&An(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&An(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===a&&(a&&Vi(t,1),!n&&!$e&&(An(t,a?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},Om=function(t,e,n){var i;if(n>e)for(i=t._first;i&&i._start<=n;){if(i.data==="isPause"&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=n;){if(i.data==="isPause"&&i._start<e)return i;i=i._prev}},ts=function(t,e,n,i){var s=t._repeat,a=ke(e)||0,o=t._tTime/t._tDur;return o&&!i&&(t._time*=a/t._dur),t._dur=a,t._tDur=s?s<0?1e10:ke(a*(s+1)+t._rDelay*s):a,o>0&&!i&&$a(t,t._tTime=t._tDur*o),t.parent&&Ja(t),n||dr(t.parent,t),t},Eh=function(t){return t instanceof Xe?dr(t):ts(t,t._dur)},Bm={_start:0,endTime:Qs,totalDuration:Qs},Un=function r(t,e,n){var i=t.labels,s=t._recent||Bm,a=t.duration()>=Nn?s.endTime(!1):t._dur,o,l,c;return Ue(e)&&(isNaN(e)||e in i)?(l=e.charAt(0),c=e.substr(-1)==="%",o=e.indexOf("="),l==="<"||l===">"?(o>=0&&(e=e.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(e.substr(1))||0)*(c?(o<0?s:n).totalDuration()/100:1)):o<0?(e in i||(i[e]=a),i[e]):(l=parseFloat(e.charAt(o-1)+e.substr(o+1)),c&&n&&(l=l/100*(Ke(n)?n[0]:n).totalDuration()),o>1?r(t,e.substr(0,o-1),n)+l:a+l)):e==null?a:+e},Js=function(t,e,n){var i=xi(e[1]),s=(i?2:1)+(t<2?0:1),a=e[s],o,l;if(i&&(a.duration=e[1]),a.parent=n,t){for(o=a,l=n;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=yn(l.vars.inherit)&&l.parent;a.immediateRender=yn(o.immediateRender),t<2?a.runBackwards=1:a.startAt=e[s-1]}return new Ce(e[0],a,e[s+1])},Hi=function(t,e){return t||t===0?e(t):e},ea=function(t,e,n){return n<t?t:n>e?e:n},qe=function(t,e){return!Ue(t)||!(e=Am.exec(t))?"":e[1]},zm=function(t,e,n){return Hi(n,function(i){return ea(t,e,i)})},ql=[].slice,Gh=function(t,e){return t&&li(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&li(t[0]))&&!t.nodeType&&t!==ai},km=function(t,e,n){return n===void 0&&(n=[]),t.forEach(function(i){var s;return Ue(i)&&!e||Gh(i,1)?(s=n).push.apply(s,On(i)):n.push(i)})||n},On=function(t,e,n){return ye&&!e&&ye.selector?ye.selector(t):Ue(t)&&!n&&(Hl||!es())?ql.call((e||ec).querySelectorAll(t),0):Ke(t)?km(t,n):Gh(t)?ql.call(t,0):t?[t]:[]},Yl=function(t){return t=On(t)[0]||Ks("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return On(e,n.querySelectorAll?n:n===t?Ks("Invalid scope")||ec.createElement("div"):t)}},Wh=function(t){return t.sort(function(){return .5-Math.random()})},Xh=function(t){if(Te(t))return t;var e=li(t)?t:{each:t},n=pr(e.ease),i=e.from||0,s=parseFloat(e.base)||0,a={},o=i>0&&i<1,l=isNaN(i)||o,c=e.axis,u=i,f=i;return Ue(i)?u=f={center:.5,edges:.5,end:1}[i]||0:!o&&l&&(u=i[0],f=i[1]),function(h,d,_){var g=(_||e).length,p=a[g],m,S,v,M,D,T,w,P,y;if(!p){if(y=e.grid==="auto"?0:(e.grid||[1,Nn])[1],!y){for(w=-Nn;w<(w=_[y++].getBoundingClientRect().left)&&y<g;);y<g&&y--}for(p=a[g]=[],m=l?Math.min(y,g)*u-.5:i%y,S=y===Nn?0:l?g*f/y-.5:i/y|0,w=0,P=Nn,T=0;T<g;T++)v=T%y-m,M=S-(T/y|0),p[T]=D=c?Math.abs(c==="y"?M:v):Ch(v*v+M*M),D>w&&(w=D),D<P&&(P=D);i==="random"&&Wh(p),p.max=w-P,p.min=P,p.v=g=(parseFloat(e.amount)||parseFloat(e.each)*(y>g?g-1:c?c==="y"?g/y:y:Math.max(y,g/y))||0)*(i==="edges"?-1:1),p.b=g<0?s-g:s,p.u=qe(e.amount||e.each)||0,n=n&&g<0?tf(n):n}return g=(p[h]-p.min)/p.max||0,ke(p.b+(n?n(g):g)*p.v)+p.u}},Zl=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var i=ke(Math.round(parseFloat(n)/t)*t*e);return(i-i%1)/e+(xi(n)?0:qe(n))}},qh=function(t,e){var n=Ke(t),i,s;return!n&&li(t)&&(i=n=t.radius||Nn,t.values?(t=On(t.values),(s=!xi(t[0]))&&(i*=i)):t=Zl(t.increment)),Hi(e,n?Te(t)?function(a){return s=t(a),Math.abs(s-a)<=i?s:a}:function(a){for(var o=parseFloat(s?a.x:a),l=parseFloat(s?a.y:0),c=Nn,u=0,f=t.length,h,d;f--;)s?(h=t[f].x-o,d=t[f].y-l,h=h*h+d*d):h=Math.abs(t[f]-o),h<c&&(c=h,u=f);return u=!i||c<=i?t[u]:a,s||u===a||xi(a)?u:u+qe(a)}:Zl(t))},Yh=function(t,e,n,i){return Hi(Ke(t)?!e:n===!0?!!(n=0):!i,function(){return Ke(t)?t[~~(Math.random()*t.length)]:(n=n||1e-5)&&(i=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((t-n/2+Math.random()*(e-t+n*.99))/n)*n*i)/i})},Vm=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){return e.reduce(function(s,a){return a(s)},i)}},Hm=function(t,e){return function(n){return t(parseFloat(n))+(e||qe(n))}},Gm=function(t,e,n){return Jh(t,e,0,1,n)},Zh=function(t,e,n){return Hi(n,function(i){return t[~~e(i)]})},Wm=function r(t,e,n){var i=e-t;return Ke(t)?Zh(t,r(0,t.length),e):Hi(n,function(s){return(i+(s-t)%i)%i+t})},Xm=function r(t,e,n){var i=e-t,s=i*2;return Ke(t)?Zh(t,r(0,t.length-1),e):Hi(n,function(a){return a=(s+(a-t)%s)%s||0,t+(a>i?s-a:a)})},ns=function(t){for(var e=0,n="",i,s,a,o;~(i=t.indexOf("random(",e));)a=t.indexOf(")",i),o=t.charAt(i+7)==="[",s=t.substr(i+7,a-i-7).match(o?Ph:Vl),n+=t.substr(e,i-e)+Yh(o?s:+s[0],o?0:+s[1],+s[2]||1e-5),e=a+1;return n+t.substr(e,t.length-e)},Jh=function(t,e,n,i,s){var a=e-t,o=i-n;return Hi(s,function(l){return n+((l-t)/a*o||0)})},qm=function r(t,e,n,i){var s=isNaN(t+e)?0:function(d){return(1-d)*t+d*e};if(!s){var a=Ue(t),o={},l,c,u,f,h;if(n===!0&&(i=1)&&(n=null),a)t={p:t},e={p:e};else if(Ke(t)&&!Ke(e)){for(u=[],f=t.length,h=f-2,c=1;c<f;c++)u.push(r(t[c-1],t[c]));f--,s=function(_){_*=f;var g=Math.min(h,~~_);return u[g](_-g)},n=e}else i||(t=gr(Ke(t)?[]:{},t));if(!u){for(l in e)lc.call(o,t,l,"get",e[l]);s=function(_){return dc(_,o)||(a?t.p:t)}}}return Hi(n,s)},wh=function(t,e,n){var i=t.labels,s=Nn,a,o,l;for(a in i)o=i[a]-e,o<0==!!n&&o&&s>(o=Math.abs(o))&&(l=a,s=o);return l},An=function(t,e,n){var i=t.vars,s=i[e],a=ye,o=t._ctx,l,c,u;if(s)return l=i[e+"Params"],c=i.callbackScope||t,n&&zi.length&&Ha(),o&&(ye=o),u=l?s.apply(c,l):s.call(c),ye=a,u},qs=function(t){return Vi(t),t.scrollTrigger&&t.scrollTrigger.kill(!!$e),t.progress()<1&&An(t,"onInterrupt"),t},Kr,$h=[],Kh=function(t){if(t)if(t=!t.name&&t.default||t,Ql()||t.headless){var e=t.name,n=Te(t),i=e&&!n&&t.init?function(){this._props=[]}:t,s={init:Qs,render:dc,add:lc,kill:lg,modifier:og,rawVars:0},a={targetTest:0,get:0,getSetter:Ka,aliases:{},register:0};if(es(),t!==i){if(xn[e])return;Bn(i,Bn(Ga(t,s),a)),gr(i.prototype,gr(s,Ga(t,a))),xn[i.prop=e]=i,t.targetTest&&(za.push(i),nc[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Fh(e,i),t.register&&t.register(Qe,i,ln)}else $h.push(t)},fe=255,Ys={aqua:[0,fe,fe],lime:[0,fe,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,fe],navy:[0,0,128],white:[fe,fe,fe],olive:[128,128,0],yellow:[fe,fe,0],orange:[fe,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[fe,0,0],pink:[fe,192,203],cyan:[0,fe,fe],transparent:[fe,fe,fe,0]},Ul=function(t,e,n){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(n-e)*t*6:t<.5?n:t*3<2?e+(n-e)*(2/3-t)*6:e)*fe+.5|0},Qh=function(t,e,n){var i=t?xi(t)?[t>>16,t>>8&fe,t&fe]:0:Ys.black,s,a,o,l,c,u,f,h,d,_;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Ys[t])i=Ys[t];else if(t.charAt(0)==="#"){if(t.length<6&&(s=t.charAt(1),a=t.charAt(2),o=t.charAt(3),t="#"+s+s+a+a+o+o+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return i=parseInt(t.substr(1,6),16),[i>>16,i>>8&fe,i&fe,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&fe,t&fe]}else if(t.substr(0,3)==="hsl"){if(i=_=t.match(Vl),!e)l=+i[0]%360/360,c=+i[1]/100,u=+i[2]/100,a=u<=.5?u*(c+1):u+c-u*c,s=u*2-a,i.length>3&&(i[3]*=1),i[0]=Ul(l+1/3,s,a),i[1]=Ul(l,s,a),i[2]=Ul(l-1/3,s,a);else if(~t.indexOf("="))return i=t.match(jl),n&&i.length<4&&(i[3]=1),i}else i=t.match(Vl)||Ys.transparent;i=i.map(Number)}return e&&!_&&(s=i[0]/fe,a=i[1]/fe,o=i[2]/fe,f=Math.max(s,a,o),h=Math.min(s,a,o),u=(f+h)/2,f===h?l=c=0:(d=f-h,c=u>.5?d/(2-f-h):d/(f+h),l=f===s?(a-o)/d+(a<o?6:0):f===a?(o-s)/d+2:(s-a)/d+4,l*=60),i[0]=~~(l+.5),i[1]=~~(c*100+.5),i[2]=~~(u*100+.5)),n&&i.length<4&&(i[3]=1),i},jh=function(t){var e=[],n=[],i=-1;return t.split(_i).forEach(function(s){var a=s.match(_r)||[];e.push.apply(e,a),n.push(i+=a.length+1)}),e.c=n,e},Th=function(t,e,n){var i="",s=(t+i).match(_i),a=e?"hsla(":"rgba(",o=0,l,c,u,f;if(!s)return t;if(s=s.map(function(h){return(h=Qh(h,e,1))&&a+(e?h[0]+","+h[1]+"%,"+h[2]+"%,"+h[3]:h.join(","))+")"}),n&&(u=jh(t),l=n.c,l.join(i)!==u.c.join(i)))for(c=t.replace(_i,"1").split(_r),f=c.length-1;o<f;o++)i+=c[o]+(~l.indexOf(o)?s.shift()||a+"0,0,0,0)":(u.length?u:s.length?s:n).shift());if(!c)for(c=t.split(_i),f=c.length-1;o<f;o++)i+=c[o]+s[o];return i+c[f]},_i=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Ys)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),Ym=/hsl[a]?\(/,ac=function(t){var e=t.join(" "),n;if(_i.lastIndex=0,_i.test(e))return n=Ym.test(e),t[1]=Th(t[1],n),t[0]=Th(t[0],n,jh(t[1])),!0},js,vn=function(){var r=Date.now,t=500,e=33,n=r(),i=n,s=1e3/240,a=s,o=[],l,c,u,f,h,d,_=function g(p){var m=r()-i,S=p===!0,v,M,D,T;if((m>t||m<0)&&(n+=m-e),i+=m,D=i-n,v=D-a,(v>0||S)&&(T=++f.frame,h=D-f.time*1e3,f.time=D=D/1e3,a+=v+(v>=s?4:s-v),M=1),S||(l=c(g)),M)for(d=0;d<o.length;d++)o[d](D,h,T,p)};return f={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(p){return h/(1e3/(p||60))},wake:function(){Ih&&(!Hl&&Ql()&&(ai=Hl=window,ec=ai.document||{},Dn.gsap=Qe,(ai.gsapVersions||(ai.gsapVersions=[])).push(Qe.version),Lh(Va||ai.GreenSockGlobals||!ai.gsap&&ai||{}),$h.forEach(Kh)),u=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&f.sleep(),c=u||function(p){return setTimeout(p,a-f.time*1e3+1|0)},js=1,_(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(l),js=0,c=Qs},lagSmoothing:function(p,m){t=p||1/0,e=Math.min(m||33,t)},fps:function(p){s=1e3/(p||240),a=f.time*1e3+s},add:function(p,m,S){var v=m?function(M,D,T,w){p(M,D,T,w),f.remove(v)}:p;return f.remove(p),o[S?"unshift":"push"](v),es(),v},remove:function(p,m){~(m=o.indexOf(p))&&o.splice(m,1)&&d>=m&&d--},_listeners:o},f}(),es=function(){return!js&&vn.wake()},ee={},Zm=/^[\d.\-M][\d.\-,\s]/,Jm=/["']/g,$m=function(t){for(var e={},n=t.substr(1,t.length-3).split(":"),i=n[0],s=1,a=n.length,o,l,c;s<a;s++)l=n[s],o=s!==a-1?l.lastIndexOf(","):l.length,c=l.substr(0,o),e[i]=isNaN(c)?c.replace(Jm,"").trim():+c,i=l.substr(o+1).trim();return e},Km=function(t){var e=t.indexOf("(")+1,n=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<n?t.indexOf(")",n+1):n)},Qm=function(t){var e=(t+"").split("("),n=ee[e[0]];return n&&e.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[$m(e[1])]:Km(t).split(",").map(Oh)):ee._CE&&Zm.test(t)?ee._CE("",t):n},tf=function(t){return function(e){return 1-t(1-e)}},ef=function r(t,e){for(var n=t._first,i;n;)n instanceof Xe?r(n,e):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==e&&(n.timeline?r(n.timeline,e):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=e)),n=n._next},pr=function(t,e){return t&&(Te(t)?t:ee[t]||Qm(t))||e},vr=function(t,e,n,i){n===void 0&&(n=function(l){return 1-e(1-l)}),i===void 0&&(i=function(l){return l<.5?e(l*2)/2:1-e((1-l)*2)/2});var s={easeIn:e,easeOut:n,easeInOut:i},a;return on(t,function(o){ee[o]=Dn[o]=s,ee[a=o.toLowerCase()]=n;for(var l in s)ee[a+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=ee[o+"."+l]=s[l]}),s},nf=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},Nl=function r(t,e,n){var i=e>=1?e:1,s=(n||(t?.3:.45))/(e<1?e:1),a=s/kl*(Math.asin(1/i)||0),o=function(u){return u===1?1:i*Math.pow(2,-10*u)*Tm((u-a)*s)+1},l=t==="out"?o:t==="in"?function(c){return 1-o(1-c)}:nf(o);return s=kl/s,l.config=function(c,u){return r(t,c,u)},l},Ol=function r(t,e){e===void 0&&(e=1.70158);var n=function(a){return a?--a*a*((e+1)*a+e)+1:0},i=t==="out"?n:t==="in"?function(s){return 1-n(1-s)}:nf(n);return i.config=function(s){return r(t,s)},i};on("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;vr(r+",Power"+(e-1),t?function(n){return Math.pow(n,e)}:function(n){return n},function(n){return 1-Math.pow(1-n,e)},function(n){return n<.5?Math.pow(n*2,e)/2:1-Math.pow((1-n)*2,e)/2})});ee.Linear.easeNone=ee.none=ee.Linear.easeIn;vr("Elastic",Nl("in"),Nl("out"),Nl());(function(r,t){var e=1/t,n=2*e,i=2.5*e,s=function(o){return o<e?r*o*o:o<n?r*Math.pow(o-1.5/t,2)+.75:o<i?r*(o-=2.25/t)*o+.9375:r*Math.pow(o-2.625/t,2)+.984375};vr("Bounce",function(a){return 1-s(1-a)},s)})(7.5625,2.75);vr("Expo",function(r){return r?Math.pow(2,10*(r-1)):0});vr("Circ",function(r){return-(Ch(1-r*r)-1)});vr("Sine",function(r){return r===1?1:-wm(r*bm)+1});vr("Back",Ol("in"),Ol("out"),Ol());ee.SteppedEase=ee.steps=Dn.SteppedEase={config:function(t,e){t===void 0&&(t=1);var n=1/t,i=t+(e?0:1),s=e?1:0,a=1-me;return function(o){return((i*ea(0,a,o)|0)+s)*n}}};Qr.ease=ee["quad.out"];on("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return ic+=r+","+r+"Params,"});var oc=function(t,e){this.id=Em++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:sc,this.set=e?e.getSetter:Ka},ta=function(){function r(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,ts(this,+e.duration,1,1),this.data=e.data,ye&&(this._ctx=ye,ye.data.push(this)),js||vn.wake()}var t=r.prototype;return t.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},t.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},t.totalDuration=function(n){return arguments.length?(this._dirty=0,ts(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,i){if(es(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for($a(this,n),!s._dp||s.parent||kh(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&oi(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===me||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Nh(this,n,i)),this},t.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+bh(this))%(this._dur+this._rDelay)||(n?this._dur:0),i):this._time},t.totalProgress=function(n,i){return arguments.length?this.totalTime(this.totalDuration()*n,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(n,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+bh(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(n,i){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*s,i):this._repeat?jr(this._tTime,s)+1:1},t.timeScale=function(n,i){if(!arguments.length)return this._rts===-me?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?Wa(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-me?0:this._rts,this.totalTime(ea(-Math.abs(this._delay),this._tDur,s),i!==!1),Ja(this),Lm(this)},t.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(es(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==me&&(this._tTime-=me)))),this):this._ps},t.startTime=function(n){if(arguments.length){this._start=n;var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&oi(i,this,n-this._delay),this}return this._start},t.endTime=function(n){return this._start+(yn(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(n){var i=this.parent||this._dp;return i?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Wa(i.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=Cm);var i=$e;return $e=n,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),$e=i,this},t.globalTime=function(n){for(var i=this,s=arguments.length?n:i.rawTime();i;)s=i._start+s/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(n):s},t.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,Eh(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,Eh(this),i?this.time(i):this}return this._rDelay},t.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},t.seek=function(n,i){return this.totalTime(Un(this,n),yn(i))},t.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,yn(i))},t.play=function(n,i){return n!=null&&this.seek(n,i),this.reversed(!1).paused(!1)},t.reverse=function(n,i){return n!=null&&this.seek(n||this.totalDuration(),i),this.reversed(!0).paused(!1)},t.pause=function(n,i){return n!=null&&this.seek(n,i),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-me:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-me,this},t.isActive=function(){var n=this.parent||this._dp,i=this._start,s;return!!(!n||this._ts&&this._initted&&n.isActive()&&(s=n.rawTime(!0))>=i&&s<this.endTime(!0)-me)},t.eventCallback=function(n,i,s){var a=this.vars;return arguments.length>1?(i?(a[n]=i,s&&(a[n+"Params"]=s),n==="onUpdate"&&(this._onUpdate=i)):delete a[n],this):a[n]},t.then=function(n){var i=this;return new Promise(function(s){var a=Te(n)?n:Bh,o=function(){var c=i.then;i.then=null,Te(a)&&(a=a(i))&&(a.then||a===i)&&(i.then=c),s(a),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?o():i._prom=o})},t.kill=function(){qs(this)},r}();Bn(ta.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:-me,_prom:0,_ps:!1,_rts:1});var Xe=function(r){Dh(t,r);function t(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=yn(n.sortChildren),be&&oi(n.parent||be,gi(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&Vh(gi(s),n.scrollTrigger),s}var e=t.prototype;return e.to=function(i,s,a){return Js(0,arguments,this),this},e.from=function(i,s,a){return Js(1,arguments,this),this},e.fromTo=function(i,s,a,o){return Js(2,arguments,this),this},e.set=function(i,s,a){return s.duration=0,s.parent=this,Zs(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Ce(i,s,Un(this,a),1),this},e.call=function(i,s,a){return oi(this,Ce.delayedCall(0,i,s),a)},e.staggerTo=function(i,s,a,o,l,c,u){return a.duration=s,a.stagger=a.stagger||o,a.onComplete=c,a.onCompleteParams=u,a.parent=this,new Ce(i,a,Un(this,l)),this},e.staggerFrom=function(i,s,a,o,l,c,u){return a.runBackwards=1,Zs(a).immediateRender=yn(a.immediateRender),this.staggerTo(i,s,a,o,l,c,u)},e.staggerFromTo=function(i,s,a,o,l,c,u,f){return o.startAt=a,Zs(o).immediateRender=yn(o.immediateRender),this.staggerTo(i,s,o,l,c,u,f)},e.render=function(i,s,a){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,u=i<=0?0:ke(i),f=this._zTime<0!=i<0&&(this._initted||!c),h,d,_,g,p,m,S,v,M,D,T,w;if(this!==be&&u>l&&i>=0&&(u=l),u!==this._tTime||a||f){if(o!==this._time&&c&&(u+=this._time-o,i+=this._time-o),h=u,M=this._start,v=this._ts,m=!v,f&&(c||(o=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(T=this._yoyo,p=c+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(p*100+i,s,a);if(h=ke(u%p),u===l?(g=this._repeat,h=c):(g=~~(u/p),g&&g===u/p&&(h=c,g--),h>c&&(h=c)),D=jr(this._tTime,p),!o&&this._tTime&&D!==g&&this._tTime-D*p-this._dur<=0&&(D=g),T&&g&1&&(h=c-h,w=1),g!==D&&!this._lock){var P=T&&D&1,y=P===(T&&g&1);if(g<D&&(P=!P),o=P?0:u%c?c:u,this._lock=1,this.render(o||(w?0:ke(g*p)),s,!c)._lock=0,this._tTime=u,!s&&this.parent&&An(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,y&&(this._lock=2,o=P?c:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;ef(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(S=Om(this,ke(o),ke(h)),S&&(u-=h-(h=S._start))),this._tTime=u,this._time=h,this._act=!v,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,o=0),!o&&h&&!s&&!g&&(An(this,"onStart"),this._tTime!==u))return this;if(h>=o&&i>=0)for(d=this._first;d;){if(_=d._next,(d._act||h>=d._start)&&d._ts&&S!==d){if(d.parent!==this)return this.render(i,s,a);if(d.render(d._ts>0?(h-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(h-d._start)*d._ts,s,a),h!==this._time||!this._ts&&!m){S=0,_&&(u+=this._zTime=-me);break}}d=_}else{d=this._last;for(var x=i<0?i:h;d;){if(_=d._prev,(d._act||x<=d._end)&&d._ts&&S!==d){if(d.parent!==this)return this.render(i,s,a);if(d.render(d._ts>0?(x-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(x-d._start)*d._ts,s,a||$e&&(d._initted||d._startAt)),h!==this._time||!this._ts&&!m){S=0,_&&(u+=this._zTime=x?-me:me);break}}d=_}}if(S&&!s&&(this.pause(),S.render(h>=o?0:-me)._zTime=h>=o?1:-1,this._ts))return this._start=M,Ja(this),this.render(i,s,a);this._onUpdate&&!s&&An(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&o)&&(M===this._start||Math.abs(v)!==Math.abs(this._ts))&&(this._lock||((i||!c)&&(u===l&&this._ts>0||!u&&this._ts<0)&&Vi(this,1),!s&&!(i<0&&!o)&&(u||o||!l)&&(An(this,u===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(i,s){var a=this;if(xi(s)||(s=Un(this,s,i)),!(i instanceof ta)){if(Ke(i))return i.forEach(function(o){return a.add(o,s)}),this;if(Ue(i))return this.addLabel(i,s);if(Te(i))i=Ce.delayedCall(0,i);else return this}return this!==i?oi(this,i,s):this},e.getChildren=function(i,s,a,o){i===void 0&&(i=!0),s===void 0&&(s=!0),a===void 0&&(a=!0),o===void 0&&(o=-Nn);for(var l=[],c=this._first;c;)c._start>=o&&(c instanceof Ce?s&&l.push(c):(a&&l.push(c),i&&l.push.apply(l,c.getChildren(!0,s,a)))),c=c._next;return l},e.getById=function(i){for(var s=this.getChildren(1,1,1),a=s.length;a--;)if(s[a].vars.id===i)return s[a]},e.remove=function(i){return Ue(i)?this.removeLabel(i):Te(i)?this.killTweensOf(i):(Za(this,i),i===this._recent&&(this._recent=this._last),dr(this))},e.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ke(vn.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),r.prototype.totalTime.call(this,i,s),this._forcing=0,this):this._tTime},e.addLabel=function(i,s){return this.labels[i]=Un(this,s),this},e.removeLabel=function(i){return delete this.labels[i],this},e.addPause=function(i,s,a){var o=Ce.delayedCall(0,s||Qs,a);return o.data="isPause",this._hasPause=1,oi(this,o,Un(this,i))},e.removePause=function(i){var s=this._first;for(i=Un(this,i);s;)s._start===i&&s.data==="isPause"&&Vi(s),s=s._next},e.killTweensOf=function(i,s,a){for(var o=this.getTweensOf(i,a),l=o.length;l--;)Bi!==o[l]&&o[l].kill(i,s);return this},e.getTweensOf=function(i,s){for(var a=[],o=On(i),l=this._first,c=xi(s),u;l;)l instanceof Ce?Rm(l._targets,o)&&(c?(!Bi||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&a.push(l):(u=l.getTweensOf(o,s)).length&&a.push.apply(a,u),l=l._next;return a},e.tweenTo=function(i,s){s=s||{};var a=this,o=Un(a,i),l=s,c=l.startAt,u=l.onStart,f=l.onStartParams,h=l.immediateRender,d,_=Ce.to(a,Bn({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:s.duration||Math.abs((o-(c&&"time"in c?c.time:a._time))/a.timeScale())||me,onStart:function(){if(a.pause(),!d){var p=s.duration||Math.abs((o-(c&&"time"in c?c.time:a._time))/a.timeScale());_._dur!==p&&ts(_,p,0,1).render(_._time,!0,!0),d=1}u&&u.apply(_,f||[])}},s));return h?_.render(0):_},e.tweenFromTo=function(i,s,a){return this.tweenTo(s,Bn({startAt:{time:Un(this,i)}},a))},e.recent=function(){return this._recent},e.nextLabel=function(i){return i===void 0&&(i=this._time),wh(this,Un(this,i))},e.previousLabel=function(i){return i===void 0&&(i=this._time),wh(this,Un(this,i),1)},e.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+me)},e.shiftChildren=function(i,s,a){a===void 0&&(a=0);for(var o=this._first,l=this.labels,c;o;)o._start>=a&&(o._start+=i,o._end+=i),o=o._next;if(s)for(c in l)l[c]>=a&&(l[c]+=i);return dr(this)},e.invalidate=function(i){var s=this._first;for(this._lock=0;s;)s.invalidate(i),s=s._next;return r.prototype.invalidate.call(this,i)},e.clear=function(i){i===void 0&&(i=!0);for(var s=this._first,a;s;)a=s._next,this.remove(s),s=a;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),dr(this)},e.totalDuration=function(i){var s=0,a=this,o=a._last,l=Nn,c,u,f;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-i:i));if(a._dirty){for(f=a.parent;o;)c=o._prev,o._dirty&&o.totalDuration(),u=o._start,u>l&&a._sort&&o._ts&&!a._lock?(a._lock=1,oi(a,o,u-o._delay,1)._lock=0):l=u,u<0&&o._ts&&(s-=u,(!f&&!a._dp||f&&f.smoothChildTiming)&&(a._start+=u/a._ts,a._time-=u,a._tTime-=u),a.shiftChildren(-u,!1,-1/0),l=0),o._end>s&&o._ts&&(s=o._end),o=c;ts(a,a===be&&a._time>s?a._time:s,1,1),a._dirty=0}return a._tDur},t.updateRoot=function(i){if(be._ts&&(Nh(be,Wa(i,be)),Uh=vn.frame),vn.frame>=Mh){Mh+=Mn.autoSleep||120;var s=be._first;if((!s||!s._ts)&&Mn.autoSleep&&vn._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||vn.sleep()}}},t}(ta);Bn(Xe.prototype,{_lock:0,_hasPause:0,_forcing:0});var jm=function(t,e,n,i,s,a,o){var l=new ln(this._pt,t,e,0,1,fc,null,s),c=0,u=0,f,h,d,_,g,p,m,S;for(l.b=n,l.e=i,n+="",i+="",(m=~i.indexOf("random("))&&(i=ns(i)),a&&(S=[n,i],a(S,t,e),n=S[0],i=S[1]),h=n.match(Ll)||[];f=Ll.exec(i);)_=f[0],g=i.substring(c,f.index),d?d=(d+1)%5:g.substr(-5)==="rgba("&&(d=1),_!==h[u++]&&(p=parseFloat(h[u-1])||0,l._pt={_next:l._pt,p:g||u===1?g:",",s:p,c:_.charAt(1)==="="?xr(p,_)-p:parseFloat(_)-p,m:d&&d<4?Math.round:0},c=Ll.lastIndex);return l.c=c<i.length?i.substring(c,i.length):"",l.fp=o,(tc.test(i)||m)&&(l.e=0),this._pt=l,l},lc=function(t,e,n,i,s,a,o,l,c,u){Te(i)&&(i=i(s||0,t,a));var f=t[e],h=n!=="get"?n:Te(f)?c?t[e.indexOf("set")||!Te(t["get"+e.substr(3)])?e:"get"+e.substr(3)](c):t[e]():f,d=Te(f)?c?rg:af:hc,_;if(Ue(i)&&(~i.indexOf("random(")&&(i=ns(i)),i.charAt(1)==="="&&(_=xr(h,i)+(qe(h)||0),(_||_===0)&&(i=_))),!u||h!==i||Jl)return!isNaN(h*i)&&i!==""?(_=new ln(this._pt,t,e,+h||0,i-(h||0),typeof f=="boolean"?ag:of,0,d),c&&(_.fp=c),o&&_.modifier(o,this,t),this._pt=_):(!f&&!(e in t)&&Ya(e,i),jm.call(this,t,e,h,i,d,l||Mn.stringFilter,c))},tg=function(t,e,n,i,s){if(Te(t)&&(t=$s(t,s,e,n,i)),!li(t)||t.style&&t.nodeType||Ke(t)||Rh(t))return Ue(t)?$s(t,s,e,n,i):t;var a={},o;for(o in t)a[o]=$s(t[o],s,e,n,i);return a},cc=function(t,e,n,i,s,a){var o,l,c,u;if(xn[t]&&(o=new xn[t]).init(s,o.rawVars?e[t]:tg(e[t],i,s,a,n),n,i,a)!==!1&&(n._pt=l=new ln(n._pt,s,t,0,1,o.render,o,0,o.priority),n!==Kr))for(c=n._ptLookup[n._targets.indexOf(s)],u=o._props.length;u--;)c[o._props[u]]=l;return o},Bi,Jl,uc=function r(t,e,n){var i=t.vars,s=i.ease,a=i.startAt,o=i.immediateRender,l=i.lazy,c=i.onUpdate,u=i.runBackwards,f=i.yoyoEase,h=i.keyframes,d=i.autoRevert,_=t._dur,g=t._startAt,p=t._targets,m=t.parent,S=m&&m.data==="nested"?m.vars.targets:p,v=t._overwrite==="auto"&&!Kl,M=t.timeline,D,T,w,P,y,x,F,I,R,B,G,Z,J;if(M&&(!h||!s)&&(s="none"),t._ease=pr(s,Qr.ease),t._yEase=f?tf(pr(f===!0?s:f,Qr.ease)):0,f&&t._yoyo&&!t._repeat&&(f=t._yEase,t._yEase=t._ease,t._ease=f),t._from=!M&&!!i.runBackwards,!M||h&&!i.stagger){if(I=p[0]?ki(p[0]).harness:0,Z=I&&i[I.prop],D=Ga(i,nc),g&&(g._zTime<0&&g.progress(1),e<0&&u&&o&&!d?g.render(-1,!0):g.revert(u&&_?Ba:Dm),g._lazy=0),a){if(Vi(t._startAt=Ce.set(p,Bn({data:"isStart",overwrite:!1,parent:m,immediateRender:!0,lazy:!g&&yn(l),startAt:null,delay:0,onUpdate:c&&function(){return An(t,"onUpdate")},stagger:0},a))),t._startAt._dp=0,t._startAt._sat=t,e<0&&($e||!o&&!d)&&t._startAt.revert(Ba),o&&_&&e<=0&&n<=0){e&&(t._zTime=e);return}}else if(u&&_&&!g){if(e&&(o=!1),w=Bn({overwrite:!1,data:"isFromStart",lazy:o&&!g&&yn(l),immediateRender:o,stagger:0,parent:m},D),Z&&(w[I.prop]=Z),Vi(t._startAt=Ce.set(p,w)),t._startAt._dp=0,t._startAt._sat=t,e<0&&($e?t._startAt.revert(Ba):t._startAt.render(-1,!0)),t._zTime=e,!o)r(t._startAt,me,me);else if(!e)return}for(t._pt=t._ptCache=0,l=_&&yn(l)||l&&!_,T=0;T<p.length;T++){if(y=p[T],F=y._gsap||rc(p)[T]._gsap,t._ptLookup[T]=B={},Gl[F.id]&&zi.length&&Ha(),G=S===p?T:S.indexOf(y),I&&(R=new I).init(y,Z||D,t,G,S)!==!1&&(t._pt=P=new ln(t._pt,y,R.name,0,1,R.render,R,0,R.priority),R._props.forEach(function(N){B[N]=P}),R.priority&&(x=1)),!I||Z)for(w in D)xn[w]&&(R=cc(w,D,t,G,y,S))?R.priority&&(x=1):B[w]=P=lc.call(t,y,w,"get",D[w],G,S,0,i.stringFilter);t._op&&t._op[T]&&t.kill(y,t._op[T]),v&&t._pt&&(Bi=t,be.killTweensOf(y,B,t.globalTime(e)),J=!t.parent,Bi=0),t._pt&&l&&(Gl[F.id]=1)}x&&pc(t),t._onInit&&t._onInit(t)}t._onUpdate=c,t._initted=(!t._op||t._pt)&&!J,h&&e<=0&&M.render(Nn,!0,!0)},eg=function(t,e,n,i,s,a,o,l){var c=(t._pt&&t._ptCache||(t._ptCache={}))[e],u,f,h,d;if(!c)for(c=t._ptCache[e]=[],h=t._ptLookup,d=t._targets.length;d--;){if(u=h[d][e],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return Jl=1,t.vars[e]="+=0",uc(t,o),Jl=0,l?Ks(e+" not eligible for reset"):1;c.push(u)}for(d=c.length;d--;)f=c[d],u=f._pt||f,u.s=(i||i===0)&&!s?i:u.s+(i||0)+a*u.c,u.c=n-u.s,f.e&&(f.e=Ae(n)+qe(f.e)),f.b&&(f.b=u.s+qe(f.b))},ng=function(t,e){var n=t[0]?ki(t[0]).harness:0,i=n&&n.aliases,s,a,o,l;if(!i)return e;s=gr({},e);for(a in i)if(a in s)for(l=i[a].split(","),o=l.length;o--;)s[l[o]]=s[a];return s},ig=function(t,e,n,i){var s=e.ease||i||"power1.inOut",a,o;if(Ke(e))o=n[t]||(n[t]=[]),e.forEach(function(l,c){return o.push({t:c/(e.length-1)*100,v:l,e:s})});else for(a in e)o=n[a]||(n[a]=[]),a==="ease"||o.push({t:parseFloat(t),v:e[a],e:s})},$s=function(t,e,n,i,s){return Te(t)?t.call(e,n,i,s):Ue(t)&&~t.indexOf("random(")?ns(t):t},rf=ic+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",sf={};on(rf+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return sf[r]=1});var Ce=function(r){Dh(t,r);function t(n,i,s,a){var o;typeof i=="number"&&(s.duration=i,i=s,s=null),o=r.call(this,a?i:Zs(i))||this;var l=o.vars,c=l.duration,u=l.delay,f=l.immediateRender,h=l.stagger,d=l.overwrite,_=l.keyframes,g=l.defaults,p=l.scrollTrigger,m=l.yoyoEase,S=i.parent||be,v=(Ke(n)||Rh(n)?xi(n[0]):"length"in i)?[n]:On(n),M,D,T,w,P,y,x,F;if(o._targets=v.length?rc(v):Ks("GSAP target "+n+" not found. https://gsap.com",!Mn.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=d,_||h||Oa(c)||Oa(u)){if(i=o.vars,M=o.timeline=new Xe({data:"nested",defaults:g||{},targets:S&&S.data==="nested"?S.vars.targets:v}),M.kill(),M.parent=M._dp=gi(o),M._start=0,h||Oa(c)||Oa(u)){if(w=v.length,x=h&&Xh(h),li(h))for(P in h)~rf.indexOf(P)&&(F||(F={}),F[P]=h[P]);for(D=0;D<w;D++)T=Ga(i,sf),T.stagger=0,m&&(T.yoyoEase=m),F&&gr(T,F),y=v[D],T.duration=+$s(c,gi(o),D,y,v),T.delay=(+$s(u,gi(o),D,y,v)||0)-o._delay,!h&&w===1&&T.delay&&(o._delay=u=T.delay,o._start+=u,T.delay=0),M.to(y,T,x?x(D,y,v):0),M._ease=ee.none;M.duration()?c=u=0:o.timeline=0}else if(_){Zs(Bn(M.vars.defaults,{ease:"none"})),M._ease=pr(_.ease||i.ease||"none");var I=0,R,B,G;if(Ke(_))_.forEach(function(Z){return M.to(v,Z,">")}),M.duration();else{T={};for(P in _)P==="ease"||P==="easeEach"||ig(P,_[P],T,_.easeEach);for(P in T)for(R=T[P].sort(function(Z,J){return Z.t-J.t}),I=0,D=0;D<R.length;D++)B=R[D],G={ease:B.e,duration:(B.t-(D?R[D-1].t:0))/100*c},G[P]=B.v,M.to(v,G,I),I+=G.duration;M.duration()<c&&M.to({},{duration:c-M.duration()})}}c||o.duration(c=M.duration())}else o.timeline=0;return d===!0&&!Kl&&(Bi=gi(o),be.killTweensOf(v),Bi=0),oi(S,gi(o),s),i.reversed&&o.reverse(),i.paused&&o.paused(!0),(f||!c&&!_&&o._start===ke(S._time)&&yn(f)&&Fm(gi(o))&&S.data!=="nested")&&(o._tTime=-me,o.render(Math.max(0,-u)||0)),p&&Vh(gi(o),p),o}var e=t.prototype;return e.render=function(i,s,a){var o=this._time,l=this._tDur,c=this._dur,u=i<0,f=i>l-me&&!u?l:i<me?0:i,h,d,_,g,p,m,S,v,M;if(!c)Nm(this,i,s,a);else if(f!==this._tTime||!i||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(h=f,v=this.timeline,this._repeat){if(g=c+this._rDelay,this._repeat<-1&&u)return this.totalTime(g*100+i,s,a);if(h=ke(f%g),f===l?(_=this._repeat,h=c):(_=~~(f/g),_&&_===ke(f/g)&&(h=c,_--),h>c&&(h=c)),m=this._yoyo&&_&1,m&&(M=this._yEase,h=c-h),p=jr(this._tTime,g),h===o&&!a&&this._initted&&_===p)return this._tTime=f,this;_!==p&&(v&&this._yEase&&ef(v,m),this.vars.repeatRefresh&&!m&&!this._lock&&this._time!==g&&this._initted&&(this._lock=a=1,this.render(ke(g*_),!0).invalidate()._lock=0))}if(!this._initted){if(Hh(this,u?i:h,a,s,f))return this._tTime=0,this;if(o!==this._time&&!(a&&this.vars.repeatRefresh&&_!==p))return this;if(c!==this._dur)return this.render(i,s,a)}if(this._tTime=f,this._time=h,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=S=(M||this._ease)(h/c),this._from&&(this.ratio=S=1-S),h&&!o&&!s&&!_&&(An(this,"onStart"),this._tTime!==f))return this;for(d=this._pt;d;)d.r(S,d.d),d=d._next;v&&v.render(i<0?i:v._dur*v._ease(h/this._dur),s,a)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(u&&Wl(this,i,s,a),An(this,"onUpdate")),this._repeat&&_!==p&&this.vars.onRepeat&&!s&&this.parent&&An(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(u&&!this._onUpdate&&Wl(this,i,!0,!0),(i||!c)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&Vi(this,1),!s&&!(u&&!o)&&(f||o||m)&&(An(this,f===l?"onComplete":"onReverseComplete",!0),this._prom&&!(f<l&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),r.prototype.invalidate.call(this,i)},e.resetTo=function(i,s,a,o,l){js||vn.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||uc(this,c),u=this._ease(c/this._dur),eg(this,i,s,a,o,u,c,l)?this.resetTo(i,s,a,o,1):($a(this,0),this.parent||zh(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(i,s){if(s===void 0&&(s="all"),!i&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?qs(this):this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(i,s,Bi&&Bi.vars.overwrite!==!0)._first||qs(this),this.parent&&a!==this.timeline.totalDuration()&&ts(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,l=i?On(i):o,c=this._ptLookup,u=this._pt,f,h,d,_,g,p,m;if((!s||s==="all")&&Im(o,l))return s==="all"&&(this._pt=0),qs(this);for(f=this._op=this._op||[],s!=="all"&&(Ue(s)&&(g={},on(s,function(S){return g[S]=1}),s=g),s=ng(o,s)),m=o.length;m--;)if(~l.indexOf(o[m])){h=c[m],s==="all"?(f[m]=s,_=h,d={}):(d=f[m]=f[m]||{},_=s);for(g in _)p=h&&h[g],p&&((!("kill"in p.d)||p.d.kill(g)===!0)&&Za(this,p,"_pt"),delete h[g]),d!=="all"&&(d[g]=1)}return this._initted&&!this._pt&&u&&qs(this),this},t.to=function(i,s){return new t(i,s,arguments[2])},t.from=function(i,s){return Js(1,arguments)},t.delayedCall=function(i,s,a,o){return new t(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:s,onReverseComplete:s,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},t.fromTo=function(i,s,a){return Js(2,arguments)},t.set=function(i,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new t(i,s)},t.killTweensOf=function(i,s,a){return be.killTweensOf(i,s,a)},t}(ta);Bn(Ce.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});on("staggerTo,staggerFrom,staggerFromTo",function(r){Ce[r]=function(){var t=new Xe,e=ql.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var hc=function(t,e,n){return t[e]=n},af=function(t,e,n){return t[e](n)},rg=function(t,e,n,i){return t[e](i.fp,n)},sg=function(t,e,n){return t.setAttribute(e,n)},Ka=function(t,e){return Te(t[e])?af:qa(t[e])&&t.setAttribute?sg:hc},of=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},ag=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},fc=function(t,e){var n=e._pt,i="";if(!t&&e.b)i=e.b;else if(t===1&&e.e)i=e.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*t):Math.round((n.s+n.c*t)*1e4)/1e4)+i,n=n._next;i+=e.c}e.set(e.t,e.p,i,e)},dc=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},og=function(t,e,n,i){for(var s=this._pt,a;s;)a=s._next,s.p===i&&s.modifier(t,e,n),s=a},lg=function(t){for(var e=this._pt,n,i;e;)i=e._next,e.p===t&&!e.op||e.op===t?Za(this,e,"_pt"):e.dep||(n=1),e=i;return!n},cg=function(t,e,n,i){i.mSet(t,e,i.m.call(i.tween,n,i.mt),i)},pc=function(t){for(var e=t._pt,n,i,s,a;e;){for(n=e._next,i=s;i&&i.pr>e.pr;)i=i._next;(e._prev=i?i._prev:a)?e._prev._next=e:s=e,(e._next=i)?i._prev=e:a=e,e=n}t._pt=s},ln=function(){function r(e,n,i,s,a,o,l,c,u){this.t=n,this.s=s,this.c=a,this.p=i,this.r=o||of,this.d=l||this,this.set=c||hc,this.pr=u||0,this._next=e,e&&(e._prev=this)}var t=r.prototype;return t.modifier=function(n,i,s){this.mSet=this.mSet||this.set,this.set=cg,this.m=n,this.mt=s,this.tween=i},r}();on(ic+"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(r){return nc[r]=1});Dn.TweenMax=Dn.TweenLite=Ce;Dn.TimelineLite=Dn.TimelineMax=Xe;be=new Xe({sortChildren:!1,defaults:Qr,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Mn.stringFilter=ac;var mr=[],ka={},ug=[],Ah=0,hg=0,Bl=function(t){return(ka[t]||ug).map(function(e){return e()})},$l=function(){var t=Date.now(),e=[];t-Ah>2&&(Bl("matchMediaInit"),mr.forEach(function(n){var i=n.queries,s=n.conditions,a,o,l,c;for(o in i)a=ai.matchMedia(i[o]).matches,a&&(l=1),a!==s[o]&&(s[o]=a,c=1);c&&(n.revert(),l&&e.push(n))}),Bl("matchMediaRevert"),e.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),Ah=t,Bl("matchMedia"))},lf=function(){function r(e,n){this.selector=n&&Yl(n),this.data=[],this._r=[],this.isReverted=!1,this.id=hg++,e&&this.add(e)}var t=r.prototype;return t.add=function(n,i,s){Te(n)&&(s=i,i=n,n=Te);var a=this,o=function(){var c=ye,u=a.selector,f;return c&&c!==a&&c.data.push(a),s&&(a.selector=Yl(s)),ye=a,f=i.apply(a,arguments),Te(f)&&a._r.push(f),ye=c,a.selector=u,a.isReverted=!1,f};return a.last=o,n===Te?o(a,function(l){return a.add(null,l)}):n?a[n]=o:o},t.ignore=function(n){var i=ye;ye=null,n(this),ye=i},t.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof Ce&&!(i.parent&&i.parent.data==="nested")&&n.push(i)}),n},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(n,i){var s=this;if(n?function(){for(var o=s.getTweens(),l=s.data.length,c;l--;)c=s.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}));for(o.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,f){return f.g-u.g||-1/0}).forEach(function(u){return u.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof Xe?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof Ce)&&c.revert&&c.revert(n);s._r.forEach(function(u){return u(n,s)}),s.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),i)for(var a=mr.length;a--;)mr[a].id===this.id&&mr.splice(a,1)},t.revert=function(n){this.kill(n||{})},r}(),fg=function(){function r(e){this.contexts=[],this.scope=e,ye&&ye.data.push(this)}var t=r.prototype;return t.add=function(n,i,s){li(n)||(n={matches:n});var a=new lf(0,s||this.scope),o=a.conditions={},l,c,u;ye&&!a.selector&&(a.selector=ye.selector),this.contexts.push(a),i=a.add("onMatch",i),a.queries=n;for(c in n)c==="all"?u=1:(l=ai.matchMedia(n[c]),l&&(mr.indexOf(a)<0&&mr.push(a),(o[c]=l.matches)&&(u=1),l.addListener?l.addListener($l):l.addEventListener("change",$l)));return u&&i(a,function(f){return a.add(null,f)}),this},t.revert=function(n){this.kill(n||{})},t.kill=function(n){this.contexts.forEach(function(i){return i.kill(n,!0)})},r}(),Xa={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(i){return Kh(i)})},timeline:function(t){return new Xe(t)},getTweensOf:function(t,e){return be.getTweensOf(t,e)},getProperty:function(t,e,n,i){Ue(t)&&(t=On(t)[0]);var s=ki(t||{}).get,a=n?Bh:Oh;return n==="native"&&(n=""),t&&(e?a((xn[e]&&xn[e].get||s)(t,e,n,i)):function(o,l,c){return a((xn[o]&&xn[o].get||s)(t,o,l,c))})},quickSetter:function(t,e,n){if(t=On(t),t.length>1){var i=t.map(function(u){return Qe.quickSetter(u,e,n)}),s=i.length;return function(u){for(var f=s;f--;)i[f](u)}}t=t[0]||{};var a=xn[e],o=ki(t),l=o.harness&&(o.harness.aliases||{})[e]||e,c=a?function(u){var f=new a;Kr._pt=0,f.init(t,n?u+n:u,Kr,0,[t]),f.render(1,f),Kr._pt&&dc(1,Kr)}:o.set(t,l);return a?c:function(u){return c(t,l,n?u+n:u,o,1)}},quickTo:function(t,e,n){var i,s=Qe.to(t,gr((i={},i[e]="+=0.1",i.paused=!0,i),n||{})),a=function(l,c,u){return s.resetTo(e,l,c,u)};return a.tween=s,a},isTweening:function(t){return be.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=pr(t.ease,Qr.ease)),Sh(Qr,t||{})},config:function(t){return Sh(Mn,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,i=t.plugins,s=t.defaults,a=t.extendTimeline;(i||"").split(",").forEach(function(o){return o&&!xn[o]&&!Dn[o]&&Ks(e+" effect requires "+o+" plugin.")}),Fl[e]=function(o,l,c){return n(On(o),Bn(l||{},s),c)},a&&(Xe.prototype[e]=function(o,l,c){return this.add(Fl[e](o,li(l)?l:(c=l)&&{},this),c)})},registerEase:function(t,e){ee[t]=pr(e)},parseEase:function(t,e){return arguments.length?pr(t,e):ee},getById:function(t){return be.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var n=new Xe(t),i,s;for(n.smoothChildTiming=yn(t.smoothChildTiming),be.remove(n),n._dp=0,n._time=n._tTime=be._time,i=be._first;i;)s=i._next,(e||!(!i._dur&&i instanceof Ce&&i.vars.onComplete===i._targets[0]))&&oi(n,i,i._start-i._delay),i=s;return oi(be,n,0),n},context:function(t,e){return t?new lf(t,e):ye},matchMedia:function(t){return new fg(t)},matchMediaRefresh:function(){return mr.forEach(function(t){var e=t.conditions,n,i;for(i in e)e[i]&&(e[i]=!1,n=1);n&&t.revert()})||$l()},addEventListener:function(t,e){var n=ka[t]||(ka[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=ka[t],i=n&&n.indexOf(e);i>=0&&n.splice(i,1)},utils:{wrap:Wm,wrapYoyo:Xm,distribute:Xh,random:Yh,snap:qh,normalize:Gm,getUnit:qe,clamp:zm,splitColor:Qh,toArray:On,selector:Yl,mapRange:Jh,pipe:Vm,unitize:Hm,interpolate:qm,shuffle:Wh},install:Lh,effects:Fl,ticker:vn,updateRoot:Xe.updateRoot,plugins:xn,globalTimeline:be,core:{PropTween:ln,globals:Fh,Tween:Ce,Timeline:Xe,Animation:ta,getCache:ki,_removeLinkedListItem:Za,reverting:function(){return $e},context:function(t){return t&&ye&&(ye.data.push(t),t._ctx=ye),ye},suppressOverwrites:function(t){return Kl=t}}};on("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return Xa[r]=Ce[r]});vn.add(Xe.updateRoot);Kr=Xa.to({},{duration:0});var dg=function(t,e){for(var n=t._pt;n&&n.p!==e&&n.op!==e&&n.fp!==e;)n=n._next;return n},pg=function(t,e){var n=t._targets,i,s,a;for(i in e)for(s=n.length;s--;)a=t._ptLookup[s][i],a&&(a=a.d)&&(a._pt&&(a=dg(a,i)),a&&a.modifier&&a.modifier(e[i],t,n[s],i))},zl=function(t,e){return{name:t,rawVars:1,init:function(i,s,a){a._onInit=function(o){var l,c;if(Ue(s)&&(l={},on(s,function(u){return l[u]=1}),s=l),e){l={};for(c in s)l[c]=e(s[c]);s=l}pg(o,s)}}}},Qe=Xa.registerPlugin({name:"attr",init:function(t,e,n,i,s){var a,o,l;this.tween=n;for(a in e)l=t.getAttribute(a)||"",o=this.add(t,"setAttribute",(l||0)+"",e[a],i,s,0,0,a),o.op=a,o.b=l,this._props.push(a)},render:function(t,e){for(var n=e._pt;n;)$e?n.set(n.t,n.p,n.b,n):n.r(t,n.d),n=n._next}},{name:"endArray",init:function(t,e){for(var n=e.length;n--;)this.add(t,n,t[n]||0,e[n],0,0,0,0,0,1)}},zl("roundProps",Zl),zl("modifiers"),zl("snap",qh))||Xa;Ce.version=Xe.version=Qe.version="3.12.5";Ih=1;Ql()&&es();var mg=ee.Power0,gg=ee.Power1,_g=ee.Power2,xg=ee.Power3,vg=ee.Power4,yg=ee.Linear,Mg=ee.Quad,Sg=ee.Cubic,bg=ee.Quart,Eg=ee.Quint,wg=ee.Strong,Tg=ee.Elastic,Ag=ee.Back,Dg=ee.SteppedEase,Cg=ee.Bounce,Rg=ee.Sine,Pg=ee.Expo,Ig=ee.Circ;var cf,Gi,rs,Mc,br,Lg,uf,Sc,Fg=function(){return typeof window<"u"},yi={},Sr=180/Math.PI,ss=Math.PI/180,is=Math.atan2,hf=1e8,bc=/([A-Z])/g,Ug=/(left|right|width|margin|padding|x)/i,Ng=/[\s,\(]\S/,ci={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_c=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},Og=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},Bg=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},zg=function(t,e){var n=e.s+e.c*t;e.set(e.t,e.p,~~(n+(n<0?-.5:.5))+e.u,e)},xf=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},vf=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},kg=function(t,e,n){return t.style[e]=n},Vg=function(t,e,n){return t.style.setProperty(e,n)},Hg=function(t,e,n){return t._gsap[e]=n},Gg=function(t,e,n){return t._gsap.scaleX=t._gsap.scaleY=n},Wg=function(t,e,n,i,s){var a=t._gsap;a.scaleX=a.scaleY=n,a.renderTransform(s,a)},Xg=function(t,e,n,i,s){var a=t._gsap;a[e]=n,a.renderTransform(s,a)},Ee="transform",Sn=Ee+"Origin",qg=function r(t,e){var n=this,i=this.target,s=i.style,a=i._gsap;if(t in yi&&s){if(this.tfm=this.tfm||{},t!=="transform")t=ci[t]||t,~t.indexOf(",")?t.split(",").forEach(function(o){return n.tfm[o]=vi(i,o)}):this.tfm[t]=a.x?a[t]:vi(i,t),t===Sn&&(this.tfm.zOrigin=a.zOrigin);else return ci.transform.split(",").forEach(function(o){return r.call(n,o,e)});if(this.props.indexOf(Ee)>=0)return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Sn,e,"")),t=Ee}(s||e)&&this.props.push(t,e,s[t])},yf=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},Yg=function(){var t=this.props,e=this.target,n=e.style,i=e._gsap,s,a;for(s=0;s<t.length;s+=3)t[s+1]?e[t[s]]=t[s+2]:t[s+2]?n[t[s]]=t[s+2]:n.removeProperty(t[s].substr(0,2)==="--"?t[s]:t[s].replace(bc,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)i[a]=this.tfm[a];i.svg&&(i.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),s=Sc(),(!s||!s.isStart)&&!n[Ee]&&(yf(n),i.zOrigin&&n[Sn]&&(n[Sn]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},Mf=function(t,e){var n={target:t,props:[],revert:Yg,save:qg};return t._gsap||Qe.core.getCache(t),e&&e.split(",").forEach(function(i){return n.save(i)}),n},Sf,xc=function(t,e){var n=Gi.createElementNS?Gi.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Gi.createElement(t);return n&&n.style?n:Gi.createElement(t)},ui=function r(t,e,n){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(bc,"-$1").toLowerCase())||i.getPropertyValue(e)||!n&&r(t,as(e)||e,1)||""},ff="O,Moz,ms,Ms,Webkit".split(","),as=function(t,e,n){var i=e||br,s=i.style,a=5;if(t in s&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);a--&&!(ff[a]+t in s););return a<0?null:(a===3?"ms":a>=0?ff[a]:"")+t},vc=function(){Fg()&&window.document&&(cf=window,Gi=cf.document,rs=Gi.documentElement,br=xc("div")||{style:{}},Lg=xc("div"),Ee=as(Ee),Sn=Ee+"Origin",br.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Sf=!!as("perspective"),Sc=Qe.core.reverting,Mc=1)},mc=function r(t){var e=xc("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,a;if(rs.appendChild(e),e.appendChild(this),this.style.display="block",t)try{a=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(a=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),rs.removeChild(e),this.style.cssText=s,a},df=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},bf=function(t){var e;try{e=t.getBBox()}catch{e=mc.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===mc||(e=mc.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+df(t,["x","cx","x1"])||0,y:+df(t,["y","cy","y1"])||0,width:0,height:0}:e},Ef=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&bf(t))},Er=function(t,e){if(e){var n=t.style,i;e in yi&&e!==Sn&&(e=Ee),n.removeProperty?(i=e.substr(0,2),(i==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),n.removeProperty(i==="--"?e:e.replace(bc,"-$1").toLowerCase())):n.removeAttribute(e)}},Wi=function(t,e,n,i,s,a){var o=new ln(t._pt,e,n,0,1,a?vf:xf);return t._pt=o,o.b=i,o.e=s,t._props.push(n),o},pf={deg:1,rad:1,turn:1},Zg={grid:1,flex:1},Xi=function r(t,e,n,i){var s=parseFloat(n)||0,a=(n+"").trim().substr((s+"").length)||"px",o=br.style,l=Ug.test(e),c=t.tagName.toLowerCase()==="svg",u=(c?"client":"offset")+(l?"Width":"Height"),f=100,h=i==="px",d=i==="%",_,g,p,m;if(i===a||!s||pf[i]||pf[a])return s;if(a!=="px"&&!h&&(s=r(t,e,n,"px")),m=t.getCTM&&Ef(t),(d||a==="%")&&(yi[e]||~e.indexOf("adius")))return _=m?t.getBBox()[l?"width":"height"]:t[u],Ae(d?s/_*f:s/100*_);if(o[l?"width":"height"]=f+(h?a:i),g=~e.indexOf("adius")||i==="em"&&t.appendChild&&!c?t:t.parentNode,m&&(g=(t.ownerSVGElement||{}).parentNode),(!g||g===Gi||!g.appendChild)&&(g=Gi.body),p=g._gsap,p&&d&&p.width&&l&&p.time===vn.time&&!p.uncache)return Ae(s/p.width*f);if(d&&(e==="height"||e==="width")){var S=t.style[e];t.style[e]=f+i,_=t[u],S?t.style[e]=S:Er(t,e)}else(d||a==="%")&&!Zg[ui(g,"display")]&&(o.position=ui(t,"position")),g===t&&(o.position="static"),g.appendChild(br),_=br[u],g.removeChild(br),o.position="absolute";return l&&d&&(p=ki(g),p.time=vn.time,p.width=g[u]),Ae(h?_*s/f:_&&s?f/_*s:0)},vi=function(t,e,n,i){var s;return Mc||vc(),e in ci&&e!=="transform"&&(e=ci[e],~e.indexOf(",")&&(e=e.split(",")[0])),yi[e]&&e!=="transform"?(s=ra(t,i),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:ja(ui(t,Sn))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=Qa[e]&&Qa[e](t,e,n)||ui(t,e)||sc(t,e)||(e==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?Xi(t,e,s,n)+n:s},Jg=function(t,e,n,i){if(!n||n==="none"){var s=as(e,t,1),a=s&&ui(t,s,1);a&&a!==n?(e=s,n=a):e==="borderColor"&&(n=ui(t,"borderTopColor"))}var o=new ln(this._pt,t.style,e,0,1,fc),l=0,c=0,u,f,h,d,_,g,p,m,S,v,M,D;if(o.b=n,o.e=i,n+="",i+="",i==="auto"&&(g=t.style[e],t.style[e]=i,i=ui(t,e)||i,g?t.style[e]=g:Er(t,e)),u=[n,i],ac(u),n=u[0],i=u[1],h=n.match(_r)||[],D=i.match(_r)||[],D.length){for(;f=_r.exec(i);)p=f[0],S=i.substring(l,f.index),_?_=(_+1)%5:(S.substr(-5)==="rgba("||S.substr(-5)==="hsla(")&&(_=1),p!==(g=h[c++]||"")&&(d=parseFloat(g)||0,M=g.substr((d+"").length),p.charAt(1)==="="&&(p=xr(d,p)+M),m=parseFloat(p),v=p.substr((m+"").length),l=_r.lastIndex-v.length,v||(v=v||Mn.units[e]||M,l===i.length&&(i+=v,o.e+=v)),M!==v&&(d=Xi(t,e,g,v)||0),o._pt={_next:o._pt,p:S||c===1?S:",",s:d,c:m-d,m:_&&_<4||e==="zIndex"?Math.round:0});o.c=l<i.length?i.substring(l,i.length):""}else o.r=e==="display"&&i==="none"?vf:xf;return tc.test(i)&&(o.e=0),this._pt=o,o},mf={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},$g=function(t){var e=t.split(" "),n=e[0],i=e[1]||"50%";return(n==="top"||n==="bottom"||i==="left"||i==="right")&&(t=n,n=i,i=t),e[0]=mf[n]||n,e[1]=mf[i]||i,e.join(" ")},Kg=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var n=e.t,i=n.style,s=e.u,a=n._gsap,o,l,c;if(s==="all"||s===!0)i.cssText="",l=1;else for(s=s.split(","),c=s.length;--c>-1;)o=s[c],yi[o]&&(l=1,o=o==="transformOrigin"?Sn:Ee),Er(n,o);l&&(Er(n,Ee),a&&(a.svg&&n.removeAttribute("transform"),ra(n,1),a.uncache=1,yf(i)))}},Qa={clearProps:function(t,e,n,i,s){if(s.data!=="isFromStart"){var a=t._pt=new ln(t._pt,e,n,0,0,Kg);return a.u=i,a.pr=-10,a.tween=s,t._props.push(n),1}}},ia=[1,0,0,1,0,0],wf={},Tf=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},gf=function(t){var e=ui(t,Ee);return Tf(e)?ia:e.substr(7).match(jl).map(Ae)},Ec=function(t,e){var n=t._gsap||ki(t),i=t.style,s=gf(t),a,o,l,c;return n.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?ia:s):(s===ia&&!t.offsetParent&&t!==rs&&!n.svg&&(l=i.display,i.display="block",a=t.parentNode,(!a||!t.offsetParent)&&(c=1,o=t.nextElementSibling,rs.appendChild(t)),s=gf(t),l?i.display=l:Er(t,"display"),c&&(o?a.insertBefore(t,o):a?a.appendChild(t):rs.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},yc=function(t,e,n,i,s,a){var o=t._gsap,l=s||Ec(t,!0),c=o.xOrigin||0,u=o.yOrigin||0,f=o.xOffset||0,h=o.yOffset||0,d=l[0],_=l[1],g=l[2],p=l[3],m=l[4],S=l[5],v=e.split(" "),M=parseFloat(v[0])||0,D=parseFloat(v[1])||0,T,w,P,y;n?l!==ia&&(w=d*p-_*g)&&(P=M*(p/w)+D*(-g/w)+(g*S-p*m)/w,y=M*(-_/w)+D*(d/w)-(d*S-_*m)/w,M=P,D=y):(T=bf(t),M=T.x+(~v[0].indexOf("%")?M/100*T.width:M),D=T.y+(~(v[1]||v[0]).indexOf("%")?D/100*T.height:D)),i||i!==!1&&o.smooth?(m=M-c,S=D-u,o.xOffset=f+(m*d+S*g)-m,o.yOffset=h+(m*_+S*p)-S):o.xOffset=o.yOffset=0,o.xOrigin=M,o.yOrigin=D,o.smooth=!!i,o.origin=e,o.originIsAbsolute=!!n,t.style[Sn]="0px 0px",a&&(Wi(a,o,"xOrigin",c,M),Wi(a,o,"yOrigin",u,D),Wi(a,o,"xOffset",f,o.xOffset),Wi(a,o,"yOffset",h,o.yOffset)),t.setAttribute("data-svg-origin",M+" "+D)},ra=function(t,e){var n=t._gsap||new oc(t);if("x"in n&&!e&&!n.uncache)return n;var i=t.style,s=n.scaleX<0,a="px",o="deg",l=getComputedStyle(t),c=ui(t,Sn)||"0",u,f,h,d,_,g,p,m,S,v,M,D,T,w,P,y,x,F,I,R,B,G,Z,J,N,Q,A,at,bt,Zt,X,tt;return u=f=h=g=p=m=S=v=M=0,d=_=1,n.svg=!!(t.getCTM&&Ef(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Ee]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Ee]!=="none"?l[Ee]:"")),i.scale=i.rotate=i.translate="none"),w=Ec(t,n.svg),n.svg&&(n.uncache?(N=t.getBBox(),c=n.xOrigin-N.x+"px "+(n.yOrigin-N.y)+"px",J=""):J=!e&&t.getAttribute("data-svg-origin"),yc(t,J||c,!!J||n.originIsAbsolute,n.smooth!==!1,w)),D=n.xOrigin||0,T=n.yOrigin||0,w!==ia&&(F=w[0],I=w[1],R=w[2],B=w[3],u=G=w[4],f=Z=w[5],w.length===6?(d=Math.sqrt(F*F+I*I),_=Math.sqrt(B*B+R*R),g=F||I?is(I,F)*Sr:0,S=R||B?is(R,B)*Sr+g:0,S&&(_*=Math.abs(Math.cos(S*ss))),n.svg&&(u-=D-(D*F+T*R),f-=T-(D*I+T*B))):(tt=w[6],Zt=w[7],A=w[8],at=w[9],bt=w[10],X=w[11],u=w[12],f=w[13],h=w[14],P=is(tt,bt),p=P*Sr,P&&(y=Math.cos(-P),x=Math.sin(-P),J=G*y+A*x,N=Z*y+at*x,Q=tt*y+bt*x,A=G*-x+A*y,at=Z*-x+at*y,bt=tt*-x+bt*y,X=Zt*-x+X*y,G=J,Z=N,tt=Q),P=is(-R,bt),m=P*Sr,P&&(y=Math.cos(-P),x=Math.sin(-P),J=F*y-A*x,N=I*y-at*x,Q=R*y-bt*x,X=B*x+X*y,F=J,I=N,R=Q),P=is(I,F),g=P*Sr,P&&(y=Math.cos(P),x=Math.sin(P),J=F*y+I*x,N=G*y+Z*x,I=I*y-F*x,Z=Z*y-G*x,F=J,G=N),p&&Math.abs(p)+Math.abs(g)>359.9&&(p=g=0,m=180-m),d=Ae(Math.sqrt(F*F+I*I+R*R)),_=Ae(Math.sqrt(Z*Z+tt*tt)),P=is(G,Z),S=Math.abs(P)>2e-4?P*Sr:0,M=X?1/(X<0?-X:X):0),n.svg&&(J=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Tf(ui(t,Ee)),J&&t.setAttribute("transform",J))),Math.abs(S)>90&&Math.abs(S)<270&&(s?(d*=-1,S+=g<=0?180:-180,g+=g<=0?180:-180):(_*=-1,S+=S<=0?180:-180)),e=e||n.uncache,n.x=u-((n.xPercent=u&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-u)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+a,n.y=f-((n.yPercent=f&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+a,n.z=h+a,n.scaleX=Ae(d),n.scaleY=Ae(_),n.rotation=Ae(g)+o,n.rotationX=Ae(p)+o,n.rotationY=Ae(m)+o,n.skewX=S+o,n.skewY=v+o,n.transformPerspective=M+a,(n.zOrigin=parseFloat(c.split(" ")[2])||!e&&n.zOrigin||0)&&(i[Sn]=ja(c)),n.xOffset=n.yOffset=0,n.force3D=Mn.force3D,n.renderTransform=n.svg?jg:Sf?Af:Qg,n.uncache=0,n},ja=function(t){return(t=t.split(" "))[0]+" "+t[1]},gc=function(t,e,n){var i=qe(e);return Ae(parseFloat(e)+parseFloat(Xi(t,"x",n+"px",i)))+i},Qg=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Af(t,e)},yr="0deg",na="0px",Mr=") ",Af=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,a=n.x,o=n.y,l=n.z,c=n.rotation,u=n.rotationY,f=n.rotationX,h=n.skewX,d=n.skewY,_=n.scaleX,g=n.scaleY,p=n.transformPerspective,m=n.force3D,S=n.target,v=n.zOrigin,M="",D=m==="auto"&&t&&t!==1||m===!0;if(v&&(f!==yr||u!==yr)){var T=parseFloat(u)*ss,w=Math.sin(T),P=Math.cos(T),y;T=parseFloat(f)*ss,y=Math.cos(T),a=gc(S,a,w*y*-v),o=gc(S,o,-Math.sin(T)*-v),l=gc(S,l,P*y*-v+v)}p!==na&&(M+="perspective("+p+Mr),(i||s)&&(M+="translate("+i+"%, "+s+"%) "),(D||a!==na||o!==na||l!==na)&&(M+=l!==na||D?"translate3d("+a+", "+o+", "+l+") ":"translate("+a+", "+o+Mr),c!==yr&&(M+="rotate("+c+Mr),u!==yr&&(M+="rotateY("+u+Mr),f!==yr&&(M+="rotateX("+f+Mr),(h!==yr||d!==yr)&&(M+="skew("+h+", "+d+Mr),(_!==1||g!==1)&&(M+="scale("+_+", "+g+Mr),S.style[Ee]=M||"translate(0, 0)"},jg=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,a=n.x,o=n.y,l=n.rotation,c=n.skewX,u=n.skewY,f=n.scaleX,h=n.scaleY,d=n.target,_=n.xOrigin,g=n.yOrigin,p=n.xOffset,m=n.yOffset,S=n.forceCSS,v=parseFloat(a),M=parseFloat(o),D,T,w,P,y;l=parseFloat(l),c=parseFloat(c),u=parseFloat(u),u&&(u=parseFloat(u),c+=u,l+=u),l||c?(l*=ss,c*=ss,D=Math.cos(l)*f,T=Math.sin(l)*f,w=Math.sin(l-c)*-h,P=Math.cos(l-c)*h,c&&(u*=ss,y=Math.tan(c-u),y=Math.sqrt(1+y*y),w*=y,P*=y,u&&(y=Math.tan(u),y=Math.sqrt(1+y*y),D*=y,T*=y)),D=Ae(D),T=Ae(T),w=Ae(w),P=Ae(P)):(D=f,P=h,T=w=0),(v&&!~(a+"").indexOf("px")||M&&!~(o+"").indexOf("px"))&&(v=Xi(d,"x",a,"px"),M=Xi(d,"y",o,"px")),(_||g||p||m)&&(v=Ae(v+_-(_*D+g*w)+p),M=Ae(M+g-(_*T+g*P)+m)),(i||s)&&(y=d.getBBox(),v=Ae(v+i/100*y.width),M=Ae(M+s/100*y.height)),y="matrix("+D+","+T+","+w+","+P+","+v+","+M+")",d.setAttribute("transform",y),S&&(d.style[Ee]=y)},t_=function(t,e,n,i,s){var a=360,o=Ue(s),l=parseFloat(s)*(o&&~s.indexOf("rad")?Sr:1),c=l-i,u=i+c+"deg",f,h;return o&&(f=s.split("_")[1],f==="short"&&(c%=a,c!==c%(a/2)&&(c+=c<0?a:-a)),f==="cw"&&c<0?c=(c+a*hf)%a-~~(c/a)*a:f==="ccw"&&c>0&&(c=(c-a*hf)%a-~~(c/a)*a)),t._pt=h=new ln(t._pt,e,n,i,c,Og),h.e=u,h.u="deg",t._props.push(n),h},_f=function(t,e){for(var n in e)t[n]=e[n];return t},e_=function(t,e,n){var i=_f({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",a=n.style,o,l,c,u,f,h,d,_;i.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),a[Ee]=e,o=ra(n,1),Er(n,Ee),n.setAttribute("transform",c)):(c=getComputedStyle(n)[Ee],a[Ee]=e,o=ra(n,1),a[Ee]=c);for(l in yi)c=i[l],u=o[l],c!==u&&s.indexOf(l)<0&&(d=qe(c),_=qe(u),f=d!==_?Xi(n,l,c,_):parseFloat(c),h=parseFloat(u),t._pt=new ln(t._pt,o,l,f,h-f,_c),t._pt.u=_||0,t._props.push(l));_f(o,i)};on("padding,margin,Width,Radius",function(r,t){var e="Top",n="Right",i="Bottom",s="Left",a=(t<3?[e,n,i,s]:[e+s,e+n,i+n,i+s]).map(function(o){return t<2?r+o:"border"+o+r});Qa[t>1?"border"+r:r]=function(o,l,c,u,f){var h,d;if(arguments.length<4)return h=a.map(function(_){return vi(o,_,c)}),d=h.join(" "),d.split(h[0]).length===5?h[0]:d;h=(u+"").split(" "),d={},a.forEach(function(_,g){return d[_]=h[g]=h[g]||h[(g-1)/2|0]}),o.init(l,d,f)}});var wc={name:"css",register:vc,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,i,s){var a=this._props,o=t.style,l=n.vars.startAt,c,u,f,h,d,_,g,p,m,S,v,M,D,T,w,P;Mc||vc(),this.styles=this.styles||Mf(t),P=this.styles.props,this.tween=n;for(g in e)if(g!=="autoRound"&&(u=e[g],!(xn[g]&&cc(g,e,n,i,t,s)))){if(d=typeof u,_=Qa[g],d==="function"&&(u=u.call(n,i,t,s),d=typeof u),d==="string"&&~u.indexOf("random(")&&(u=ns(u)),_)_(this,t,g,u,n)&&(w=1);else if(g.substr(0,2)==="--")c=(getComputedStyle(t).getPropertyValue(g)+"").trim(),u+="",_i.lastIndex=0,_i.test(c)||(p=qe(c),m=qe(u)),m?p!==m&&(c=Xi(t,g,c,m)+m):p&&(u+=p),this.add(o,"setProperty",c,u,i,s,0,0,g),a.push(g),P.push(g,0,o[g]);else if(d!=="undefined"){if(l&&g in l?(c=typeof l[g]=="function"?l[g].call(n,i,t,s):l[g],Ue(c)&&~c.indexOf("random(")&&(c=ns(c)),qe(c+"")||c==="auto"||(c+=Mn.units[g]||qe(vi(t,g))||""),(c+"").charAt(1)==="="&&(c=vi(t,g))):c=vi(t,g),h=parseFloat(c),S=d==="string"&&u.charAt(1)==="="&&u.substr(0,2),S&&(u=u.substr(2)),f=parseFloat(u),g in ci&&(g==="autoAlpha"&&(h===1&&vi(t,"visibility")==="hidden"&&f&&(h=0),P.push("visibility",0,o.visibility),Wi(this,o,"visibility",h?"inherit":"hidden",f?"inherit":"hidden",!f)),g!=="scale"&&g!=="transform"&&(g=ci[g],~g.indexOf(",")&&(g=g.split(",")[0]))),v=g in yi,v){if(this.styles.save(g),M||(D=t._gsap,D.renderTransform&&!e.parseTransform||ra(t,e.parseTransform),T=e.smoothOrigin!==!1&&D.smooth,M=this._pt=new ln(this._pt,o,Ee,0,1,D.renderTransform,D,0,-1),M.dep=1),g==="scale")this._pt=new ln(this._pt,D,"scaleY",D.scaleY,(S?xr(D.scaleY,S+f):f)-D.scaleY||0,_c),this._pt.u=0,a.push("scaleY",g),g+="X";else if(g==="transformOrigin"){P.push(Sn,0,o[Sn]),u=$g(u),D.svg?yc(t,u,0,T,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==D.zOrigin&&Wi(this,D,"zOrigin",D.zOrigin,m),Wi(this,o,g,ja(c),ja(u)));continue}else if(g==="svgOrigin"){yc(t,u,1,T,0,this);continue}else if(g in wf){t_(this,D,g,h,S?xr(h,S+u):u);continue}else if(g==="smoothOrigin"){Wi(this,D,"smooth",D.smooth,u);continue}else if(g==="force3D"){D[g]=u;continue}else if(g==="transform"){e_(this,u,t);continue}}else g in o||(g=as(g)||g);if(v||(f||f===0)&&(h||h===0)&&!Ng.test(u)&&g in o)p=(c+"").substr((h+"").length),f||(f=0),m=qe(u)||(g in Mn.units?Mn.units[g]:p),p!==m&&(h=Xi(t,g,c,m)),this._pt=new ln(this._pt,v?D:o,g,h,(S?xr(h,S+f):f)-h,!v&&(m==="px"||g==="zIndex")&&e.autoRound!==!1?zg:_c),this._pt.u=m||0,p!==m&&m!=="%"&&(this._pt.b=c,this._pt.r=Bg);else if(g in o)Jg.call(this,t,g,c,S?S+u:u);else if(g in t)this.add(t,g,c||t[g],S?S+u:u,i,s);else if(g!=="parseTransform"){Ya(g,u);continue}v||(g in o?P.push(g,0,o[g]):P.push(g,1,c||t[g])),a.push(g)}}w&&pc(this)},render:function(t,e){if(e.tween._time||!Sc())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:vi,aliases:ci,getSetter:function(t,e,n){var i=ci[e];return i&&i.indexOf(",")<0&&(e=i),e in yi&&e!==Sn&&(t._gsap.x||vi(t,"x"))?n&&uf===n?e==="scale"?Gg:Hg:(uf=n||{})&&(e==="scale"?Wg:Xg):t.style&&!qa(t.style[e])?kg:~e.indexOf("-")?Vg:Ka(t,e)},core:{_removeProperty:Er,_getMatrix:Ec}};Qe.utils.checkPrefix=as;Qe.core.getStyleSaver=Mf;(function(r,t,e,n){var i=on(r+","+t+","+e,function(s){yi[s]=1});on(t,function(s){Mn.units[s]="deg",wf[s]=1}),ci[i[13]]=r+","+t,on(n,function(s){var a=s.split(":");ci[a[1]]=i[a[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");on("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Mn.units[r]="px"});Qe.registerPlugin(wc);var bn=Qe.registerPlugin(wc)||Qe,qS=bn.core.Tween;var Df=()=>{document.querySelectorAll(".client-list_wrapper").forEach(r=>{let t=r.querySelector(".client-list_wrap");if(!t)return;let e=Array.from(t.children),n=t.scrollWidth;e.forEach(i=>{let s=i.cloneNode(!0);s.style.width=`${i.offsetWidth}px`,t.appendChild(s)}),t.style.width=`${n*2}px`,bn.fromTo(t,{x:0},{x:-n,duration:60,ease:"linear",repeat:-1,force3D:!0})})};var Cf=()=>{let r=document.querySelectorAll("[data-contact-popup-toggler]"),t=document.querySelector("[data-contact-popup]");var e=0;if(!r||!t)return;let n=t.querySelector("[data-contact-popup-close]");if(!n)return;let i=t.querySelector(".contact-popup_box");if(!i)return;let s=(a,o)=>{let l=document.createElement("script"),c=document.getElementsByTagName("script")[0];l.async=1,l.onload=l.onreadystatechange=(u,f)=>{(f||!l.readyState||/loaded|complete/.test(l.readyState))&&(l.onload=l.onreadystatechange=null,l=void 0,f||o&&o())},l.src=a,c.parentNode.insertBefore(l,c)};r.forEach(a=>{a.addEventListener("click",o=>{o.preventDefault,e?(t.classList.add("-open"),document.body.classList.add("-popup-open")):s("https://embed.typeform.com/next/embed.js",()=>{e=1,t.classList.add("-open"),document.body.classList.add("-popup-open")})})}),n.addEventListener("click",a=>{a.preventDefault,t.classList.remove("-open"),document.body.classList.remove("-popup-open")}),t.addEventListener("click",a=>{i.contains(a.target)||(t.classList.remove("-open"),document.body.classList.remove("-popup-open"))}),new URL(document.location).searchParams.has("invicible")&&setTimeout(()=>{s("https://embed.typeform.com/next/embed.js",()=>{e=1,setTimeout(()=>{t.classList.add("-open"),document.body.classList.add("-popup-open")},200)})},2e3)};var Rf=()=>{let r=document.querySelector(".is-section-loader");if(!r)return;let t=r.querySelector(".loader_line"),e=r.querySelector(".loader_value");!t||!e||bn.to(t,{width:"100%",duration:1.5,onUpdate:function(){let n=Math.round(this.progress()*100);e.innerHTML=`${n}%`},onComplete:function(){bn.to(r,{y:"-100dvh",duration:.75})}},"<")};function Pf(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function n_(r,t,e){return t&&Pf(r.prototype,t),e&&Pf(r,e),r}var Ye,no,i_,Cn,qi,Yi,ls,Lf,wr,aa,Ff,Mi,Jn,Uf,Nf=function(){return Ye||typeof window<"u"&&(Ye=window.gsap)&&Ye.registerPlugin&&Ye},Of=1,os=[],$t=[],$n=[],oa=Date.now,Tc=function(t,e){return e},r_=function(){var t=aa.core,e=t.bridge||{},n=t._scrollers,i=t._proxies;n.push.apply(n,$t),i.push.apply(i,$n),$t=n,$n=i,Tc=function(a,o){return e[a](o)}},bi=function(t,e){return~$n.indexOf(t)&&$n[$n.indexOf(t)+1][e]},la=function(t){return!!~Ff.indexOf(t)},un=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:i!==!1,capture:!!s})},cn=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},to="scrollLeft",eo="scrollTop",Ac=function(){return Mi&&Mi.isPressed||$t.cache++},io=function(t,e){var n=function i(s){if(s||s===0){Of&&(Cn.history.scrollRestoration="manual");var a=Mi&&Mi.isPressed;s=i.v=Math.round(s)||(Mi&&Mi.iOS?1:0),t(s),i.cacheID=$t.cache,a&&Tc("ss",s)}else(e||$t.cache!==i.cacheID||Tc("ref"))&&(i.cacheID=$t.cache,i.v=t());return i.v+i.offset};return n.offset=0,t&&n},je={s:to,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:io(function(r){return arguments.length?Cn.scrollTo(r,Ie.sc()):Cn.pageXOffset||qi[to]||Yi[to]||ls[to]||0})},Ie={s:eo,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:je,sc:io(function(r){return arguments.length?Cn.scrollTo(je.sc(),r):Cn.pageYOffset||qi[eo]||Yi[eo]||ls[eo]||0})},hn=function(t,e){return(e&&e._ctx&&e._ctx.selector||Ye.utils.toArray)(t)[0]||(typeof t=="string"&&Ye.config().nullTargetWarn!==!1?console.warn("Element not found:",t):null)},Si=function(t,e){var n=e.s,i=e.sc;la(t)&&(t=qi.scrollingElement||Yi);var s=$t.indexOf(t),a=i===Ie.sc?1:2;!~s&&(s=$t.push(t)-1),$t[s+a]||un(t,"scroll",Ac);var o=$t[s+a],l=o||($t[s+a]=io(bi(t,n),!0)||(la(t)?i:io(function(c){return arguments.length?t[n]=c:t[n]})));return l.target=t,o||(l.smooth=Ye.getProperty(t,"scrollBehavior")==="smooth"),l},ro=function(t,e,n){var i=t,s=t,a=oa(),o=a,l=e||50,c=Math.max(500,l*3),u=function(_,g){var p=oa();g||p-a>l?(s=i,i=_,o=a,a=p):n?i+=_:i=s+(_-s)/(p-o)*(a-o)},f=function(){s=i=n?0:i,o=a=0},h=function(_){var g=o,p=s,m=oa();return(_||_===0)&&_!==i&&u(_),a===o||m-o>c?0:(i+(n?p:-p))/((n?m:a)-g)*1e3};return{update:u,reset:f,getVelocity:h}},sa=function(t,e){return e&&!t._gsapAllow&&t.preventDefault(),t.changedTouches?t.changedTouches[0]:t},If=function(t){var e=Math.max.apply(Math,t),n=Math.min.apply(Math,t);return Math.abs(e)>=Math.abs(n)?e:n},Bf=function(){aa=Ye.core.globals().ScrollTrigger,aa&&aa.core&&r_()},zf=function(t){return Ye=t||Nf(),!no&&Ye&&typeof document<"u"&&document.body&&(Cn=window,qi=document,Yi=qi.documentElement,ls=qi.body,Ff=[Cn,qi,Yi,ls],i_=Ye.utils.clamp,Uf=Ye.core.context||function(){},wr="onpointerenter"in ls?"pointer":"mouse",Lf=De.isTouch=Cn.matchMedia&&Cn.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in Cn||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,Jn=De.eventTypes=("ontouchstart"in Yi?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in Yi?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return Of=0},500),Bf(),no=1),no};je.op=Ie;$t.cache=0;var De=function(){function r(e){this.init(e)}var t=r.prototype;return t.init=function(n){no||zf(Ye)||console.warn("Please gsap.registerPlugin(Observer)"),aa||Bf();var i=n.tolerance,s=n.dragMinimum,a=n.type,o=n.target,l=n.lineHeight,c=n.debounce,u=n.preventDefault,f=n.onStop,h=n.onStopDelay,d=n.ignore,_=n.wheelSpeed,g=n.event,p=n.onDragStart,m=n.onDragEnd,S=n.onDrag,v=n.onPress,M=n.onRelease,D=n.onRight,T=n.onLeft,w=n.onUp,P=n.onDown,y=n.onChangeX,x=n.onChangeY,F=n.onChange,I=n.onToggleX,R=n.onToggleY,B=n.onHover,G=n.onHoverEnd,Z=n.onMove,J=n.ignoreCheck,N=n.isNormalizer,Q=n.onGestureStart,A=n.onGestureEnd,at=n.onWheel,bt=n.onEnable,Zt=n.onDisable,X=n.onClick,tt=n.scrollSpeed,ft=n.capture,nt=n.allowClicks,It=n.lockAxis,Rt=n.onLockAxis;this.target=o=hn(o)||Yi,this.vars=n,d&&(d=Ye.utils.toArray(d)),i=i||1e-9,s=s||0,_=_||1,tt=tt||1,a=a||"wheel,touch,pointer",c=c!==!1,l||(l=parseFloat(Cn.getComputedStyle(ls).lineHeight)||22);var O,Gt,St,Et,_t,Ft,Pt,z=this,jt=0,C=0,b=n.passive||!u,W=Si(o,je),K=Si(o,Ie),j=W(),et=K(),mt=~a.indexOf("touch")&&!~a.indexOf("pointer")&&Jn[0]==="pointerdown",lt=la(o),it=o.ownerDocument||qi,Lt=[0,0,0],rt=[0,0,0],Mt=0,Yt=function(){return Mt=oa()},gt=function(vt,ie){return(z.event=vt)&&d&&~d.indexOf(vt.target)||ie&&mt&&vt.pointerType!=="touch"||J&&J(vt,ie)},xt=function(){z._vx.reset(),z._vy.reset(),Gt.pause(),f&&f(z)},Ut=function(){var vt=z.deltaX=If(Lt),ie=z.deltaY=If(rt),ut=Math.abs(vt)>=i,kt=Math.abs(ie)>=i;F&&(ut||kt)&&F(z,vt,ie,Lt,rt),ut&&(D&&z.deltaX>0&&D(z),T&&z.deltaX<0&&T(z),y&&y(z),I&&z.deltaX<0!=jt<0&&I(z),jt=z.deltaX,Lt[0]=Lt[1]=Lt[2]=0),kt&&(P&&z.deltaY>0&&P(z),w&&z.deltaY<0&&w(z),x&&x(z),R&&z.deltaY<0!=C<0&&R(z),C=z.deltaY,rt[0]=rt[1]=rt[2]=0),(Et||St)&&(Z&&Z(z),St&&(S(z),St=!1),Et=!1),Ft&&!(Ft=!1)&&Rt&&Rt(z),_t&&(at(z),_t=!1),O=0},Ht=function(vt,ie,ut){Lt[ut]+=vt,rt[ut]+=ie,z._vx.update(vt),z._vy.update(ie),c?O||(O=requestAnimationFrame(Ut)):Ut()},ue=function(vt,ie){It&&!Pt&&(z.axis=Pt=Math.abs(vt)>Math.abs(ie)?"x":"y",Ft=!0),Pt!=="y"&&(Lt[2]+=vt,z._vx.update(vt,!0)),Pt!=="x"&&(rt[2]+=ie,z._vy.update(ie,!0)),c?O||(O=requestAnimationFrame(Ut)):Ut()},Nt=function(vt){if(!gt(vt,1)){vt=sa(vt,u);var ie=vt.clientX,ut=vt.clientY,kt=ie-z.x,At=ut-z.y,zt=z.isDragging;z.x=ie,z.y=ut,(zt||Math.abs(z.startX-ie)>=s||Math.abs(z.startY-ut)>=s)&&(S&&(St=!0),zt||(z.isDragging=!0),ue(kt,At),zt||p&&p(z))}},L=z.onPress=function(Ct){gt(Ct,1)||Ct&&Ct.button||(z.axis=Pt=null,Gt.pause(),z.isPressed=!0,Ct=sa(Ct),jt=C=0,z.startX=z.x=Ct.clientX,z.startY=z.y=Ct.clientY,z._vx.reset(),z._vy.reset(),un(N?o:it,Jn[1],Nt,b,!0),z.deltaX=z.deltaY=0,v&&v(z))},Y=z.onRelease=function(Ct){if(!gt(Ct,1)){cn(N?o:it,Jn[1],Nt,!0);var vt=!isNaN(z.y-z.startY),ie=z.isDragging,ut=ie&&(Math.abs(z.x-z.startX)>3||Math.abs(z.y-z.startY)>3),kt=sa(Ct);!ut&&vt&&(z._vx.reset(),z._vy.reset(),u&&nt&&Ye.delayedCall(.08,function(){if(oa()-Mt>300&&!Ct.defaultPrevented){if(Ct.target.click)Ct.target.click();else if(it.createEvent){var At=it.createEvent("MouseEvents");At.initMouseEvent("click",!0,!0,Cn,1,kt.screenX,kt.screenY,kt.clientX,kt.clientY,!1,!1,!1,!1,0,null),Ct.target.dispatchEvent(At)}}})),z.isDragging=z.isGesturing=z.isPressed=!1,f&&ie&&!N&&Gt.restart(!0),m&&ie&&m(z),M&&M(z,ut)}},$=function(vt){return vt.touches&&vt.touches.length>1&&(z.isGesturing=!0)&&Q(vt,z.isDragging)},ot=function(){return(z.isGesturing=!1)||A(z)},ct=function(vt){if(!gt(vt)){var ie=W(),ut=K();Ht((ie-j)*tt,(ut-et)*tt,1),j=ie,et=ut,f&&Gt.restart(!0)}},Vt=function(vt){if(!gt(vt)){vt=sa(vt,u),at&&(_t=!0);var ie=(vt.deltaMode===1?l:vt.deltaMode===2?Cn.innerHeight:1)*_;Ht(vt.deltaX*ie,vt.deltaY*ie,0),f&&!N&&Gt.restart(!0)}},se=function(vt){if(!gt(vt)){var ie=vt.clientX,ut=vt.clientY,kt=ie-z.x,At=ut-z.y;z.x=ie,z.y=ut,Et=!0,f&&Gt.restart(!0),(kt||At)&&ue(kt,At)}},ce=function(vt){z.event=vt,B(z)},de=function(vt){z.event=vt,G(z)},te=function(vt){return gt(vt)||sa(vt,u)&&X(z)};Gt=z._dc=Ye.delayedCall(h||.25,xt).pause(),z.deltaX=z.deltaY=0,z._vx=ro(0,50,!0),z._vy=ro(0,50,!0),z.scrollX=W,z.scrollY=K,z.isDragging=z.isGesturing=z.isPressed=!1,Uf(this),z.enable=function(Ct){return z.isEnabled||(un(lt?it:o,"scroll",Ac),a.indexOf("scroll")>=0&&un(lt?it:o,"scroll",ct,b,ft),a.indexOf("wheel")>=0&&un(o,"wheel",Vt,b,ft),(a.indexOf("touch")>=0&&Lf||a.indexOf("pointer")>=0)&&(un(o,Jn[0],L,b,ft),un(it,Jn[2],Y),un(it,Jn[3],Y),nt&&un(o,"click",Yt,!0,!0),X&&un(o,"click",te),Q&&un(it,"gesturestart",$),A&&un(it,"gestureend",ot),B&&un(o,wr+"enter",ce),G&&un(o,wr+"leave",de),Z&&un(o,wr+"move",se)),z.isEnabled=!0,Ct&&Ct.type&&L(Ct),bt&&bt(z)),z},z.disable=function(){z.isEnabled&&(os.filter(function(Ct){return Ct!==z&&la(Ct.target)}).length||cn(lt?it:o,"scroll",Ac),z.isPressed&&(z._vx.reset(),z._vy.reset(),cn(N?o:it,Jn[1],Nt,!0)),cn(lt?it:o,"scroll",ct,ft),cn(o,"wheel",Vt,ft),cn(o,Jn[0],L,ft),cn(it,Jn[2],Y),cn(it,Jn[3],Y),cn(o,"click",Yt,!0),cn(o,"click",te),cn(it,"gesturestart",$),cn(it,"gestureend",ot),cn(o,wr+"enter",ce),cn(o,wr+"leave",de),cn(o,wr+"move",se),z.isEnabled=z.isPressed=z.isDragging=!1,Zt&&Zt(z))},z.kill=z.revert=function(){z.disable();var Ct=os.indexOf(z);Ct>=0&&os.splice(Ct,1),Mi===z&&(Mi=0)},os.push(z),N&&la(o)&&(Mi=z),z.enable(g)},n_(r,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),r}();De.version="3.12.5";De.create=function(r){return new De(r)};De.register=zf;De.getAll=function(){return os.slice()};De.getById=function(r){return os.filter(function(t){return t.vars.id===r})[0]};Nf()&&Ye.registerPlugin(De);var yt,hs,ne,we,Kn,ge,id,Mo,Ma,ma,ua,so,tn,wo,Uc,dn,kf,Vf,fs,rd,Dc,sd,fn,Nc,ad,od,Zi,Oc,Hc,ds,Gc,So,Bc,Cc,ao=1,en=Date.now,Rc=en(),Vn=0,ha=0,Hf=function(t,e,n){var i=Pn(t)&&(t.substr(0,6)==="clamp("||t.indexOf("max")>-1);return n["_"+e+"Clamp"]=i,i?t.substr(6,t.length-7):t},Gf=function(t,e){return e&&(!Pn(t)||t.substr(0,6)!=="clamp(")?"clamp("+t+")":t},s_=function r(){return ha&&requestAnimationFrame(r)},Wf=function(){return wo=1},Xf=function(){return wo=0},hi=function(t){return t},fa=function(t){return Math.round(t*1e5)/1e5||0},ld=function(){return typeof window<"u"},cd=function(){return yt||ld()&&(yt=window.gsap)&&yt.registerPlugin&&yt},Pr=function(t){return!!~id.indexOf(t)},ud=function(t){return(t==="Height"?Gc:ne["inner"+t])||Kn["client"+t]||ge["client"+t]},hd=function(t){return bi(t,"getBoundingClientRect")||(Pr(t)?function(){return yo.width=ne.innerWidth,yo.height=Gc,yo}:function(){return Ei(t)})},a_=function(t,e,n){var i=n.d,s=n.d2,a=n.a;return(a=bi(t,"getBoundingClientRect"))?function(){return a()[i]}:function(){return(e?ud(s):t["client"+s])||0}},o_=function(t,e){return!e||~$n.indexOf(t)?hd(t):function(){return yo}},fi=function(t,e){var n=e.s,i=e.d2,s=e.d,a=e.a;return Math.max(0,(n="scroll"+i)&&(a=bi(t,n))?a()-hd(t)()[s]:Pr(t)?(Kn[n]||ge[n])-ud(i):t[n]-t["offset"+i])},oo=function(t,e){for(var n=0;n<fs.length;n+=3)(!e||~e.indexOf(fs[n+1]))&&t(fs[n],fs[n+1],fs[n+2])},Pn=function(t){return typeof t=="string"},mn=function(t){return typeof t=="function"},da=function(t){return typeof t=="number"},Tr=function(t){return typeof t=="object"},ca=function(t,e,n){return t&&t.progress(e?0:1)&&n&&t.pause()},Pc=function(t,e){if(t.enabled){var n=t._ctx?t._ctx.add(function(){return e(t)}):e(t);n&&n.totalTime&&(t.callbackAnimation=n)}},cs=Math.abs,fd="left",dd="top",Wc="right",Xc="bottom",Dr="width",Cr="height",ga="Right",_a="Left",xa="Top",va="Bottom",Le="padding",zn="margin",ms="Width",qc="Height",Ne="px",kn=function(t){return ne.getComputedStyle(t)},l_=function(t){var e=kn(t).position;t.style.position=e==="absolute"||e==="fixed"?e:"relative"},qf=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Ei=function(t,e){var n=e&&kn(t)[Uc]!=="matrix(1, 0, 0, 1, 0, 0)"&&yt.to(t,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),i=t.getBoundingClientRect();return n&&n.progress(0).kill(),i},bo=function(t,e){var n=e.d2;return t["offset"+n]||t["client"+n]||0},pd=function(t){var e=[],n=t.labels,i=t.duration(),s;for(s in n)e.push(n[s]/i);return e},c_=function(t){return function(e){return yt.utils.snap(pd(t),e)}},Yc=function(t){var e=yt.utils.snap(t),n=Array.isArray(t)&&t.slice(0).sort(function(i,s){return i-s});return n?function(i,s,a){a===void 0&&(a=.001);var o;if(!s)return e(i);if(s>0){for(i-=a,o=0;o<n.length;o++)if(n[o]>=i)return n[o];return n[o-1]}else for(o=n.length,i+=a;o--;)if(n[o]<=i)return n[o];return n[0]}:function(i,s,a){a===void 0&&(a=.001);var o=e(i);return!s||Math.abs(o-i)<a||o-i<0==s<0?o:e(s<0?i-t:i+t)}},u_=function(t){return function(e,n){return Yc(pd(t))(e,n.direction)}},lo=function(t,e,n,i){return n.split(",").forEach(function(s){return t(e,s,i)})},He=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:!i,capture:!!s})},Ve=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},co=function(t,e,n){n=n&&n.wheelHandler,n&&(t(e,"wheel",n),t(e,"touchmove",n))},Yf={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},uo={toggleActions:"play",anticipatePin:0},Eo={top:0,left:0,center:.5,bottom:1,right:1},go=function(t,e){if(Pn(t)){var n=t.indexOf("="),i=~n?+(t.charAt(n-1)+1)*parseFloat(t.substr(n+1)):0;~n&&(t.indexOf("%")>n&&(i*=e/100),t=t.substr(0,n-1)),t=i+(t in Eo?Eo[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t},ho=function(t,e,n,i,s,a,o,l){var c=s.startColor,u=s.endColor,f=s.fontSize,h=s.indent,d=s.fontWeight,_=we.createElement("div"),g=Pr(n)||bi(n,"pinType")==="fixed",p=t.indexOf("scroller")!==-1,m=g?ge:n,S=t.indexOf("start")!==-1,v=S?c:u,M="border-color:"+v+";font-size:"+f+";color:"+v+";font-weight:"+d+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return M+="position:"+((p||l)&&g?"fixed;":"absolute;"),(p||l||!g)&&(M+=(i===Ie?Wc:Xc)+":"+(a+parseFloat(h))+"px;"),o&&(M+="box-sizing:border-box;text-align:left;width:"+o.offsetWidth+"px;"),_._isStart=S,_.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),_.style.cssText=M,_.innerText=e||e===0?t+"-"+e:t,m.children[0]?m.insertBefore(_,m.children[0]):m.appendChild(_),_._offset=_["offset"+i.op.d2],_o(_,0,i,S),_},_o=function(t,e,n,i){var s={display:"block"},a=n[i?"os2":"p2"],o=n[i?"p2":"os2"];t._isFlipped=i,s[n.a+"Percent"]=i?-100:0,s[n.a]=i?"1px":0,s["border"+a+ms]=1,s["border"+o+ms]=0,s[n.p]=e+"px",yt.set(t,s)},Kt=[],zc={},Sa,Zf=function(){return en()-Vn>34&&(Sa||(Sa=requestAnimationFrame(wi)))},us=function(){(!fn||!fn.isPressed||fn.startX>ge.clientWidth)&&($t.cache++,fn?Sa||(Sa=requestAnimationFrame(wi)):wi(),Vn||Lr("scrollStart"),Vn=en())},Ic=function(){od=ne.innerWidth,ad=ne.innerHeight},pa=function(){$t.cache++,!tn&&!sd&&!we.fullscreenElement&&!we.webkitFullscreenElement&&(!Nc||od!==ne.innerWidth||Math.abs(ne.innerHeight-ad)>ne.innerHeight*.25)&&Mo.restart(!0)},Ir={},h_=[],md=function r(){return Ve(Qt,"scrollEnd",r)||Ar(!0)},Lr=function(t){return Ir[t]&&Ir[t].map(function(e){return e()})||h_},Rn=[],gd=function(t){for(var e=0;e<Rn.length;e+=5)(!t||Rn[e+4]&&Rn[e+4].query===t)&&(Rn[e].style.cssText=Rn[e+1],Rn[e].getBBox&&Rn[e].setAttribute("transform",Rn[e+2]||""),Rn[e+3].uncache=1)},Zc=function(t,e){var n;for(dn=0;dn<Kt.length;dn++)n=Kt[dn],n&&(!e||n._ctx===e)&&(t?n.kill(1):n.revert(!0,!0));So=!0,e&&gd(e),e||Lr("revert")},_d=function(t,e){$t.cache++,(e||!pn)&&$t.forEach(function(n){return mn(n)&&n.cacheID++&&(n.rec=0)}),Pn(t)&&(ne.history.scrollRestoration=Hc=t)},pn,Rr=0,Jf,f_=function(){if(Jf!==Rr){var t=Jf=Rr;requestAnimationFrame(function(){return t===Rr&&Ar(!0)})}},xd=function(){ge.appendChild(ds),Gc=!fn&&ds.offsetHeight||ne.innerHeight,ge.removeChild(ds)},$f=function(t){return Ma(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(e){return e.style.display=t?"none":"block"})},Ar=function(t,e){if(Vn&&!t&&!So){He(Qt,"scrollEnd",md);return}xd(),pn=Qt.isRefreshing=!0,$t.forEach(function(i){return mn(i)&&++i.cacheID&&(i.rec=i())});var n=Lr("refreshInit");rd&&Qt.sort(),e||Zc(),$t.forEach(function(i){mn(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),Kt.slice(0).forEach(function(i){return i.refresh()}),So=!1,Kt.forEach(function(i){if(i._subPinOffset&&i.pin){var s=i.vars.horizontal?"offsetWidth":"offsetHeight",a=i.pin[s];i.revert(!0,1),i.adjustPinSpacing(i.pin[s]-a),i.refresh()}}),Bc=1,$f(!0),Kt.forEach(function(i){var s=fi(i.scroller,i._dir),a=i.vars.end==="max"||i._endClamp&&i.end>s,o=i._startClamp&&i.start>=s;(a||o)&&i.setPositions(o?s-1:i.start,a?Math.max(o?s:i.start+1,s):i.end,!0)}),$f(!1),Bc=0,n.forEach(function(i){return i&&i.render&&i.render(-1)}),$t.forEach(function(i){mn(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),_d(Hc,1),Mo.pause(),Rr++,pn=2,wi(2),Kt.forEach(function(i){return mn(i.vars.onRefresh)&&i.vars.onRefresh(i)}),pn=Qt.isRefreshing=!1,Lr("refresh")},kc=0,xo=1,ya,wi=function(t){if(t===2||!pn&&!So){Qt.isUpdating=!0,ya&&ya.update(0);var e=Kt.length,n=en(),i=n-Rc>=50,s=e&&Kt[0].scroll();if(xo=kc>s?-1:1,pn||(kc=s),i&&(Vn&&!wo&&n-Vn>200&&(Vn=0,Lr("scrollEnd")),ua=Rc,Rc=n),xo<0){for(dn=e;dn-- >0;)Kt[dn]&&Kt[dn].update(0,i);xo=1}else for(dn=0;dn<e;dn++)Kt[dn]&&Kt[dn].update(0,i);Qt.isUpdating=!1}Sa=0},Vc=[fd,dd,Xc,Wc,zn+va,zn+ga,zn+xa,zn+_a,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],vo=Vc.concat([Dr,Cr,"boxSizing","max"+ms,"max"+qc,"position",zn,Le,Le+xa,Le+ga,Le+va,Le+_a]),d_=function(t,e,n){ps(n);var i=t._gsap;if(i.spacerIsNative)ps(i.spacerState);else if(t._gsap.swappedIn){var s=e.parentNode;s&&(s.insertBefore(t,e),s.removeChild(e))}t._gsap.swappedIn=!1},Lc=function(t,e,n,i){if(!t._gsap.swappedIn){for(var s=Vc.length,a=e.style,o=t.style,l;s--;)l=Vc[s],a[l]=n[l];a.position=n.position==="absolute"?"absolute":"relative",n.display==="inline"&&(a.display="inline-block"),o[Xc]=o[Wc]="auto",a.flexBasis=n.flexBasis||"auto",a.overflow="visible",a.boxSizing="border-box",a[Dr]=bo(t,je)+Ne,a[Cr]=bo(t,Ie)+Ne,a[Le]=o[zn]=o[dd]=o[fd]="0",ps(i),o[Dr]=o["max"+ms]=n[Dr],o[Cr]=o["max"+qc]=n[Cr],o[Le]=n[Le],t.parentNode!==e&&(t.parentNode.insertBefore(e,t),e.appendChild(t)),t._gsap.swappedIn=!0}},p_=/([A-Z])/g,ps=function(t){if(t){var e=t.t.style,n=t.length,i=0,s,a;for((t.t._gsap||yt.core.getCache(t.t)).uncache=1;i<n;i+=2)a=t[i+1],s=t[i],a?e[s]=a:e[s]&&e.removeProperty(s.replace(p_,"-$1").toLowerCase())}},fo=function(t){for(var e=vo.length,n=t.style,i=[],s=0;s<e;s++)i.push(vo[s],n[vo[s]]);return i.t=t,i},m_=function(t,e,n){for(var i=[],s=t.length,a=n?8:0,o;a<s;a+=2)o=t[a],i.push(o,o in e?e[o]:t[a+1]);return i.t=t.t,i},yo={left:0,top:0},Kf=function(t,e,n,i,s,a,o,l,c,u,f,h,d,_){mn(t)&&(t=t(l)),Pn(t)&&t.substr(0,3)==="max"&&(t=h+(t.charAt(4)==="="?go("0"+t.substr(3),n):0));var g=d?d.time():0,p,m,S;if(d&&d.seek(0),isNaN(t)||(t=+t),da(t))d&&(t=yt.utils.mapRange(d.scrollTrigger.start,d.scrollTrigger.end,0,h,t)),o&&_o(o,n,i,!0);else{mn(e)&&(e=e(l));var v=(t||"0").split(" "),M,D,T,w;S=hn(e,l)||ge,M=Ei(S)||{},(!M||!M.left&&!M.top)&&kn(S).display==="none"&&(w=S.style.display,S.style.display="block",M=Ei(S),w?S.style.display=w:S.style.removeProperty("display")),D=go(v[0],M[i.d]),T=go(v[1]||"0",n),t=M[i.p]-c[i.p]-u+D+s-T,o&&_o(o,T,i,n-T<20||o._isStart&&T>20),n-=n-T}if(_&&(l[_]=t||-.001,t<0&&(t=0)),a){var P=t+n,y=a._isStart;p="scroll"+i.d2,_o(a,P,i,y&&P>20||!y&&(f?Math.max(ge[p],Kn[p]):a.parentNode[p])<=P+1),f&&(c=Ei(o),f&&(a.style[i.op.p]=c[i.op.p]-i.op.m-a._offset+Ne))}return d&&S&&(p=Ei(S),d.seek(h),m=Ei(S),d._caScrollDist=p[i.p]-m[i.p],t=t/d._caScrollDist*h),d&&d.seek(g),d?t:Math.round(t)},g_=/(webkit|moz|length|cssText|inset)/i,Qf=function(t,e,n,i){if(t.parentNode!==e){var s=t.style,a,o;if(e===ge){t._stOrig=s.cssText,o=kn(t);for(a in o)!+a&&!g_.test(a)&&o[a]&&typeof s[a]=="string"&&a!=="0"&&(s[a]=o[a]);s.top=n,s.left=i}else s.cssText=t._stOrig;yt.core.getCache(t).uncache=1,e.appendChild(t)}},vd=function(t,e,n){var i=e,s=i;return function(a){var o=Math.round(t());return o!==i&&o!==s&&Math.abs(o-i)>3&&Math.abs(o-s)>3&&(a=o,n&&n()),s=i,i=a,a}},po=function(t,e,n){var i={};i[e.p]="+="+n,yt.set(t,i)},jf=function(t,e){var n=Si(t,e),i="_scroll"+e.p2,s=function a(o,l,c,u,f){var h=a.tween,d=l.onComplete,_={};c=c||n();var g=vd(n,c,function(){h.kill(),a.tween=0});return f=u&&f||0,u=u||o-c,h&&h.kill(),l[i]=o,l.inherit=!1,l.modifiers=_,_[i]=function(){return g(c+u*h.ratio+f*h.ratio*h.ratio)},l.onUpdate=function(){$t.cache++,a.tween&&wi()},l.onComplete=function(){a.tween=0,d&&d.call(h)},h=a.tween=yt.to(t,l),h};return t[i]=n,n.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},He(t,"wheel",n.wheelHandler),Qt.isTouch&&He(t,"touchmove",n.wheelHandler),s},Qt=function(){function r(e,n){hs||r.register(yt)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),Oc(this),this.init(e,n)}var t=r.prototype;return t.init=function(n,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!ha){this.update=this.refresh=this.kill=hi;return}n=qf(Pn(n)||da(n)||n.nodeType?{trigger:n}:n,uo);var s=n,a=s.onUpdate,o=s.toggleClass,l=s.id,c=s.onToggle,u=s.onRefresh,f=s.scrub,h=s.trigger,d=s.pin,_=s.pinSpacing,g=s.invalidateOnRefresh,p=s.anticipatePin,m=s.onScrubComplete,S=s.onSnapComplete,v=s.once,M=s.snap,D=s.pinReparent,T=s.pinSpacer,w=s.containerAnimation,P=s.fastScrollEnd,y=s.preventOverlaps,x=n.horizontal||n.containerAnimation&&n.horizontal!==!1?je:Ie,F=!f&&f!==0,I=hn(n.scroller||ne),R=yt.core.getCache(I),B=Pr(I),G=("pinType"in n?n.pinType:bi(I,"pinType")||B&&"fixed")==="fixed",Z=[n.onEnter,n.onLeave,n.onEnterBack,n.onLeaveBack],J=F&&n.toggleActions.split(" "),N="markers"in n?n.markers:uo.markers,Q=B?0:parseFloat(kn(I)["border"+x.p2+ms])||0,A=this,at=n.onRefreshInit&&function(){return n.onRefreshInit(A)},bt=a_(I,B,x),Zt=o_(I,B),X=0,tt=0,ft=0,nt=Si(I,x),It,Rt,O,Gt,St,Et,_t,Ft,Pt,z,jt,C,b,W,K,j,et,mt,lt,it,Lt,rt,Mt,Yt,gt,xt,Ut,Ht,ue,Nt,L,Y,$,ot,ct,Vt,se,ce,de;if(A._startClamp=A._endClamp=!1,A._dir=x,p*=45,A.scroller=I,A.scroll=w?w.time.bind(w):nt,Gt=nt(),A.vars=n,i=i||n.animation,"refreshPriority"in n&&(rd=1,n.refreshPriority===-9999&&(ya=A)),R.tweenScroll=R.tweenScroll||{top:jf(I,Ie),left:jf(I,je)},A.tweenTo=It=R.tweenScroll[x.p],A.scrubDuration=function(ut){$=da(ut)&&ut,$?Y?Y.duration(ut):Y=yt.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:$,paused:!0,onComplete:function(){return m&&m(A)}}):(Y&&Y.progress(1).kill(),Y=0)},i&&(i.vars.lazy=!1,i._initted&&!A.isReverted||i.vars.immediateRender!==!1&&n.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),A.animation=i.pause(),i.scrollTrigger=A,A.scrubDuration(f),Nt=0,l||(l=i.vars.id)),M&&((!Tr(M)||M.push)&&(M={snapTo:M}),"scrollBehavior"in ge.style&&yt.set(B?[ge,Kn]:I,{scrollBehavior:"auto"}),$t.forEach(function(ut){return mn(ut)&&ut.target===(B?we.scrollingElement||Kn:I)&&(ut.smooth=!1)}),O=mn(M.snapTo)?M.snapTo:M.snapTo==="labels"?c_(i):M.snapTo==="labelsDirectional"?u_(i):M.directional!==!1?function(ut,kt){return Yc(M.snapTo)(ut,en()-tt<500?0:kt.direction)}:yt.utils.snap(M.snapTo),ot=M.duration||{min:.1,max:2},ot=Tr(ot)?ma(ot.min,ot.max):ma(ot,ot),ct=yt.delayedCall(M.delay||$/2||.1,function(){var ut=nt(),kt=en()-tt<500,At=It.tween;if((kt||Math.abs(A.getVelocity())<10)&&!At&&!wo&&X!==ut){var zt=(ut-Et)/W,Se=i&&!F?i.totalProgress():zt,Jt=kt?0:(Se-L)/(en()-ua)*1e3||0,xe=yt.utils.clamp(-zt,1-zt,cs(Jt/2)*Jt/.185),ze=zt+(M.inertia===!1?0:xe),ve,pe,E=M,U=E.onStart,k=E.onInterrupt,V=E.onComplete;if(ve=O(ze,A),da(ve)||(ve=ze),pe=Math.round(Et+ve*W),ut<=_t&&ut>=Et&&pe!==ut){if(At&&!At._initted&&At.data<=cs(pe-ut))return;M.inertia===!1&&(xe=ve-zt),It(pe,{duration:ot(cs(Math.max(cs(ze-Se),cs(ve-Se))*.185/Jt/.05||0)),ease:M.ease||"power3",data:cs(pe-ut),onInterrupt:function(){return ct.restart(!0)&&k&&k(A)},onComplete:function(){A.update(),X=nt(),i&&(Y?Y.resetTo("totalProgress",ve,i._tTime/i._tDur):i.progress(ve)),Nt=L=i&&!F?i.totalProgress():A.progress,S&&S(A),V&&V(A)}},ut,xe*W,pe-ut-xe*W),U&&U(A,It.tween)}}else A.isActive&&X!==ut&&ct.restart(!0)}).pause()),l&&(zc[l]=A),h=A.trigger=hn(h||d!==!0&&d),de=h&&h._gsap&&h._gsap.stRevert,de&&(de=de(A)),d=d===!0?h:hn(d),Pn(o)&&(o={targets:h,className:o}),d&&(_===!1||_===zn||(_=!_&&d.parentNode&&d.parentNode.style&&kn(d.parentNode).display==="flex"?!1:Le),A.pin=d,Rt=yt.core.getCache(d),Rt.spacer?K=Rt.pinState:(T&&(T=hn(T),T&&!T.nodeType&&(T=T.current||T.nativeElement),Rt.spacerIsNative=!!T,T&&(Rt.spacerState=fo(T))),Rt.spacer=mt=T||we.createElement("div"),mt.classList.add("pin-spacer"),l&&mt.classList.add("pin-spacer-"+l),Rt.pinState=K=fo(d)),n.force3D!==!1&&yt.set(d,{force3D:!0}),A.spacer=mt=Rt.spacer,ue=kn(d),Yt=ue[_+x.os2],it=yt.getProperty(d),Lt=yt.quickSetter(d,x.a,Ne),Lc(d,mt,ue),et=fo(d)),N){C=Tr(N)?qf(N,Yf):Yf,z=ho("scroller-start",l,I,x,C,0),jt=ho("scroller-end",l,I,x,C,0,z),lt=z["offset"+x.op.d2];var te=hn(bi(I,"content")||I);Ft=this.markerStart=ho("start",l,te,x,C,lt,0,w),Pt=this.markerEnd=ho("end",l,te,x,C,lt,0,w),w&&(ce=yt.quickSetter([Ft,Pt],x.a,Ne)),!G&&!($n.length&&bi(I,"fixedMarkers")===!0)&&(l_(B?ge:I),yt.set([z,jt],{force3D:!0}),xt=yt.quickSetter(z,x.a,Ne),Ht=yt.quickSetter(jt,x.a,Ne))}if(w){var Ct=w.vars.onUpdate,vt=w.vars.onUpdateParams;w.eventCallback("onUpdate",function(){A.update(0,0,1),Ct&&Ct.apply(w,vt||[])})}if(A.previous=function(){return Kt[Kt.indexOf(A)-1]},A.next=function(){return Kt[Kt.indexOf(A)+1]},A.revert=function(ut,kt){if(!kt)return A.kill(!0);var At=ut!==!1||!A.enabled,zt=tn;At!==A.isReverted&&(At&&(Vt=Math.max(nt(),A.scroll.rec||0),ft=A.progress,se=i&&i.progress()),Ft&&[Ft,Pt,z,jt].forEach(function(Se){return Se.style.display=At?"none":"block"}),At&&(tn=A,A.update(At)),d&&(!D||!A.isActive)&&(At?d_(d,mt,K):Lc(d,mt,kn(d),gt)),At||A.update(At),tn=zt,A.isReverted=At)},A.refresh=function(ut,kt,At,zt){if(!((tn||!A.enabled)&&!kt)){if(d&&ut&&Vn){He(r,"scrollEnd",md);return}!pn&&at&&at(A),tn=A,It.tween&&!At&&(It.tween.kill(),It.tween=0),Y&&Y.pause(),g&&i&&i.revert({kill:!1}).invalidate(),A.isReverted||A.revert(!0,!0),A._subPinOffset=!1;var Se=bt(),Jt=Zt(),xe=w?w.duration():fi(I,x),ze=W<=.01,ve=0,pe=zt||0,E=Tr(At)?At.end:n.end,U=n.endTrigger||h,k=Tr(At)?At.start:n.start||(n.start===0||!h?0:d?"0 0":"0 100%"),V=A.pinnedContainer=n.pinnedContainer&&hn(n.pinnedContainer,A),H=h&&Math.max(0,Kt.indexOf(A))||0,st=H,ht,pt,Dt,Bt,Tt,wt,oe,Pe,Ze,an,Wt,Ot,si;for(N&&Tr(At)&&(Ot=yt.getProperty(z,x.p),si=yt.getProperty(jt,x.p));st--;)wt=Kt[st],wt.end||wt.refresh(0,1)||(tn=A),oe=wt.pin,oe&&(oe===h||oe===d||oe===V)&&!wt.isReverted&&(an||(an=[]),an.unshift(wt),wt.revert(!0,!0)),wt!==Kt[st]&&(H--,st--);for(mn(k)&&(k=k(A)),k=Hf(k,"start",A),Et=Kf(k,h,Se,x,nt(),Ft,z,A,Jt,Q,G,xe,w,A._startClamp&&"_startClamp")||(d?-.001:0),mn(E)&&(E=E(A)),Pn(E)&&!E.indexOf("+=")&&(~E.indexOf(" ")?E=(Pn(k)?k.split(" ")[0]:"")+E:(ve=go(E.substr(2),Se),E=Pn(k)?k:(w?yt.utils.mapRange(0,w.duration(),w.scrollTrigger.start,w.scrollTrigger.end,Et):Et)+ve,U=h)),E=Hf(E,"end",A),_t=Math.max(Et,Kf(E||(U?"100% 0":xe),U,Se,x,nt()+ve,Pt,jt,A,Jt,Q,G,xe,w,A._endClamp&&"_endClamp"))||-.001,ve=0,st=H;st--;)wt=Kt[st],oe=wt.pin,oe&&wt.start-wt._pinPush<=Et&&!w&&wt.end>0&&(ht=wt.end-(A._startClamp?Math.max(0,wt.start):wt.start),(oe===h&&wt.start-wt._pinPush<Et||oe===V)&&isNaN(k)&&(ve+=ht*(1-wt.progress)),oe===d&&(pe+=ht));if(Et+=ve,_t+=ve,A._startClamp&&(A._startClamp+=ve),A._endClamp&&!pn&&(A._endClamp=_t||-.001,_t=Math.min(_t,fi(I,x))),W=_t-Et||(Et-=.01)&&.001,ze&&(ft=yt.utils.clamp(0,1,yt.utils.normalize(Et,_t,Vt))),A._pinPush=pe,Ft&&ve&&(ht={},ht[x.a]="+="+ve,V&&(ht[x.p]="-="+nt()),yt.set([Ft,Pt],ht)),d&&!(Bc&&A.end>=fi(I,x)))ht=kn(d),Bt=x===Ie,Dt=nt(),rt=parseFloat(it(x.a))+pe,!xe&&_t>1&&(Wt=(B?we.scrollingElement||Kn:I).style,Wt={style:Wt,value:Wt["overflow"+x.a.toUpperCase()]},B&&kn(ge)["overflow"+x.a.toUpperCase()]!=="scroll"&&(Wt.style["overflow"+x.a.toUpperCase()]="scroll")),Lc(d,mt,ht),et=fo(d),pt=Ei(d,!0),Pe=G&&Si(I,Bt?je:Ie)(),_?(gt=[_+x.os2,W+pe+Ne],gt.t=mt,st=_===Le?bo(d,x)+W+pe:0,st&&(gt.push(x.d,st+Ne),mt.style.flexBasis!=="auto"&&(mt.style.flexBasis=st+Ne)),ps(gt),V&&Kt.forEach(function(le){le.pin===V&&le.vars.pinSpacing!==!1&&(le._subPinOffset=!0)}),G&&nt(Vt)):(st=bo(d,x),st&&mt.style.flexBasis!=="auto"&&(mt.style.flexBasis=st+Ne)),G&&(Tt={top:pt.top+(Bt?Dt-Et:Pe)+Ne,left:pt.left+(Bt?Pe:Dt-Et)+Ne,boxSizing:"border-box",position:"fixed"},Tt[Dr]=Tt["max"+ms]=Math.ceil(pt.width)+Ne,Tt[Cr]=Tt["max"+qc]=Math.ceil(pt.height)+Ne,Tt[zn]=Tt[zn+xa]=Tt[zn+ga]=Tt[zn+va]=Tt[zn+_a]="0",Tt[Le]=ht[Le],Tt[Le+xa]=ht[Le+xa],Tt[Le+ga]=ht[Le+ga],Tt[Le+va]=ht[Le+va],Tt[Le+_a]=ht[Le+_a],j=m_(K,Tt,D),pn&&nt(0)),i?(Ze=i._initted,Dc(1),i.render(i.duration(),!0,!0),Mt=it(x.a)-rt+W+pe,Ut=Math.abs(W-Mt)>1,G&&Ut&&j.splice(j.length-2,2),i.render(0,!0,!0),Ze||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),Dc(0)):Mt=W,Wt&&(Wt.value?Wt.style["overflow"+x.a.toUpperCase()]=Wt.value:Wt.style.removeProperty("overflow-"+x.a));else if(h&&nt()&&!w)for(pt=h.parentNode;pt&&pt!==ge;)pt._pinOffset&&(Et-=pt._pinOffset,_t-=pt._pinOffset),pt=pt.parentNode;an&&an.forEach(function(le){return le.revert(!1,!0)}),A.start=Et,A.end=_t,Gt=St=pn?Vt:nt(),!w&&!pn&&(Gt<Vt&&nt(Vt),A.scroll.rec=0),A.revert(!1,!0),tt=en(),ct&&(X=-1,ct.restart(!0)),tn=0,i&&F&&(i._initted||se)&&i.progress()!==se&&i.progress(se||0,!0).render(i.time(),!0,!0),(ze||ft!==A.progress||w||g)&&(i&&!F&&i.totalProgress(w&&Et<-.001&&!ft?yt.utils.normalize(Et,_t,0):ft,!0),A.progress=ze||(Gt-Et)/W===ft?0:ft),d&&_&&(mt._pinOffset=Math.round(A.progress*Mt)),Y&&Y.invalidate(),isNaN(Ot)||(Ot-=yt.getProperty(z,x.p),si-=yt.getProperty(jt,x.p),po(z,x,Ot),po(Ft,x,Ot-(zt||0)),po(jt,x,si),po(Pt,x,si-(zt||0))),ze&&!pn&&A.update(),u&&!pn&&!b&&(b=!0,u(A),b=!1)}},A.getVelocity=function(){return(nt()-St)/(en()-ua)*1e3||0},A.endAnimation=function(){ca(A.callbackAnimation),i&&(Y?Y.progress(1):i.paused()?F||ca(i,A.direction<0,1):ca(i,i.reversed()))},A.labelToScroll=function(ut){return i&&i.labels&&(Et||A.refresh()||Et)+i.labels[ut]/i.duration()*W||0},A.getTrailing=function(ut){var kt=Kt.indexOf(A),At=A.direction>0?Kt.slice(0,kt).reverse():Kt.slice(kt+1);return(Pn(ut)?At.filter(function(zt){return zt.vars.preventOverlaps===ut}):At).filter(function(zt){return A.direction>0?zt.end<=Et:zt.start>=_t})},A.update=function(ut,kt,At){if(!(w&&!At&&!ut)){var zt=pn===!0?Vt:A.scroll(),Se=ut?0:(zt-Et)/W,Jt=Se<0?0:Se>1?1:Se||0,xe=A.progress,ze,ve,pe,E,U,k,V,H;if(kt&&(St=Gt,Gt=w?nt():zt,M&&(L=Nt,Nt=i&&!F?i.totalProgress():Jt)),p&&d&&!tn&&!ao&&Vn&&(!Jt&&Et<zt+(zt-St)/(en()-ua)*p?Jt=1e-4:Jt===1&&_t>zt+(zt-St)/(en()-ua)*p&&(Jt=.9999)),Jt!==xe&&A.enabled){if(ze=A.isActive=!!Jt&&Jt<1,ve=!!xe&&xe<1,k=ze!==ve,U=k||!!Jt!=!!xe,A.direction=Jt>xe?1:-1,A.progress=Jt,U&&!tn&&(pe=Jt&&!xe?0:Jt===1?1:xe===1?2:3,F&&(E=!k&&J[pe+1]!=="none"&&J[pe+1]||J[pe],H=i&&(E==="complete"||E==="reset"||E in i))),y&&(k||H)&&(H||f||!i)&&(mn(y)?y(A):A.getTrailing(y).forEach(function(Dt){return Dt.endAnimation()})),F||(Y&&!tn&&!ao?(Y._dp._time-Y._start!==Y._time&&Y.render(Y._dp._time-Y._start),Y.resetTo?Y.resetTo("totalProgress",Jt,i._tTime/i._tDur):(Y.vars.totalProgress=Jt,Y.invalidate().restart())):i&&i.totalProgress(Jt,!!(tn&&(tt||ut)))),d){if(ut&&_&&(mt.style[_+x.os2]=Yt),!G)Lt(fa(rt+Mt*Jt));else if(U){if(V=!ut&&Jt>xe&&_t+1>zt&&zt+1>=fi(I,x),D)if(!ut&&(ze||V)){var st=Ei(d,!0),ht=zt-Et;Qf(d,ge,st.top+(x===Ie?ht:0)+Ne,st.left+(x===Ie?0:ht)+Ne)}else Qf(d,mt);ps(ze||V?j:et),Ut&&Jt<1&&ze||Lt(rt+(Jt===1&&!V?Mt:0))}}M&&!It.tween&&!tn&&!ao&&ct.restart(!0),o&&(k||v&&Jt&&(Jt<1||!Cc))&&Ma(o.targets).forEach(function(Dt){return Dt.classList[ze||v?"add":"remove"](o.className)}),a&&!F&&!ut&&a(A),U&&!tn?(F&&(H&&(E==="complete"?i.pause().totalProgress(1):E==="reset"?i.restart(!0).pause():E==="restart"?i.restart(!0):i[E]()),a&&a(A)),(k||!Cc)&&(c&&k&&Pc(A,c),Z[pe]&&Pc(A,Z[pe]),v&&(Jt===1?A.kill(!1,1):Z[pe]=0),k||(pe=Jt===1?1:3,Z[pe]&&Pc(A,Z[pe]))),P&&!ze&&Math.abs(A.getVelocity())>(da(P)?P:2500)&&(ca(A.callbackAnimation),Y?Y.progress(1):ca(i,E==="reverse"?1:!Jt,1))):F&&a&&!tn&&a(A)}if(Ht){var pt=w?zt/w.duration()*(w._caScrollDist||0):zt;xt(pt+(z._isFlipped?1:0)),Ht(pt)}ce&&ce(-zt/w.duration()*(w._caScrollDist||0))}},A.enable=function(ut,kt){A.enabled||(A.enabled=!0,He(I,"resize",pa),B||He(I,"scroll",us),at&&He(r,"refreshInit",at),ut!==!1&&(A.progress=ft=0,Gt=St=X=nt()),kt!==!1&&A.refresh())},A.getTween=function(ut){return ut&&It?It.tween:Y},A.setPositions=function(ut,kt,At,zt){if(w){var Se=w.scrollTrigger,Jt=w.duration(),xe=Se.end-Se.start;ut=Se.start+xe*ut/Jt,kt=Se.start+xe*kt/Jt}A.refresh(!1,!1,{start:Gf(ut,At&&!!A._startClamp),end:Gf(kt,At&&!!A._endClamp)},zt),A.update()},A.adjustPinSpacing=function(ut){if(gt&&ut){var kt=gt.indexOf(x.d)+1;gt[kt]=parseFloat(gt[kt])+ut+Ne,gt[1]=parseFloat(gt[1])+ut+Ne,ps(gt)}},A.disable=function(ut,kt){if(A.enabled&&(ut!==!1&&A.revert(!0,!0),A.enabled=A.isActive=!1,kt||Y&&Y.pause(),Vt=0,Rt&&(Rt.uncache=1),at&&Ve(r,"refreshInit",at),ct&&(ct.pause(),It.tween&&It.tween.kill()&&(It.tween=0)),!B)){for(var At=Kt.length;At--;)if(Kt[At].scroller===I&&Kt[At]!==A)return;Ve(I,"resize",pa),B||Ve(I,"scroll",us)}},A.kill=function(ut,kt){A.disable(ut,kt),Y&&!kt&&Y.kill(),l&&delete zc[l];var At=Kt.indexOf(A);At>=0&&Kt.splice(At,1),At===dn&&xo>0&&dn--,At=0,Kt.forEach(function(zt){return zt.scroller===A.scroller&&(At=1)}),At||pn||(A.scroll.rec=0),i&&(i.scrollTrigger=null,ut&&i.revert({kill:!1}),kt||i.kill()),Ft&&[Ft,Pt,z,jt].forEach(function(zt){return zt.parentNode&&zt.parentNode.removeChild(zt)}),ya===A&&(ya=0),d&&(Rt&&(Rt.uncache=1),At=0,Kt.forEach(function(zt){return zt.pin===d&&At++}),At||(Rt.spacer=0)),n.onKill&&n.onKill(A)},Kt.push(A),A.enable(!1,!1),de&&de(A),i&&i.add&&!W){var ie=A.update;A.update=function(){A.update=ie,Et||_t||A.refresh()},yt.delayedCall(.01,A.update),W=.01,Et=_t=0}else A.refresh();d&&f_()},r.register=function(n){return hs||(yt=n||cd(),ld()&&window.document&&r.enable(),hs=ha),hs},r.defaults=function(n){if(n)for(var i in n)uo[i]=n[i];return uo},r.disable=function(n,i){ha=0,Kt.forEach(function(a){return a[i?"kill":"disable"](n)}),Ve(ne,"wheel",us),Ve(we,"scroll",us),clearInterval(so),Ve(we,"touchcancel",hi),Ve(ge,"touchstart",hi),lo(Ve,we,"pointerdown,touchstart,mousedown",Wf),lo(Ve,we,"pointerup,touchend,mouseup",Xf),Mo.kill(),oo(Ve);for(var s=0;s<$t.length;s+=3)co(Ve,$t[s],$t[s+1]),co(Ve,$t[s],$t[s+2])},r.enable=function(){if(ne=window,we=document,Kn=we.documentElement,ge=we.body,yt&&(Ma=yt.utils.toArray,ma=yt.utils.clamp,Oc=yt.core.context||hi,Dc=yt.core.suppressOverwrites||hi,Hc=ne.history.scrollRestoration||"auto",kc=ne.pageYOffset,yt.core.globals("ScrollTrigger",r),ge)){ha=1,ds=document.createElement("div"),ds.style.height="100vh",ds.style.position="absolute",xd(),s_(),De.register(yt),r.isTouch=De.isTouch,Zi=De.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),Nc=De.isTouch===1,He(ne,"wheel",us),id=[ne,we,Kn,ge],yt.matchMedia?(r.matchMedia=function(l){var c=yt.matchMedia(),u;for(u in l)c.add(u,l[u]);return c},yt.addEventListener("matchMediaInit",function(){return Zc()}),yt.addEventListener("matchMediaRevert",function(){return gd()}),yt.addEventListener("matchMedia",function(){Ar(0,1),Lr("matchMedia")}),yt.matchMedia("(orientation: portrait)",function(){return Ic(),Ic})):console.warn("Requires GSAP 3.11.0 or later"),Ic(),He(we,"scroll",us);var n=ge.style,i=n.borderTopStyle,s=yt.core.Animation.prototype,a,o;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle="solid",a=Ei(ge),Ie.m=Math.round(a.top+Ie.sc())||0,je.m=Math.round(a.left+je.sc())||0,i?n.borderTopStyle=i:n.removeProperty("border-top-style"),so=setInterval(Zf,250),yt.delayedCall(.5,function(){return ao=0}),He(we,"touchcancel",hi),He(ge,"touchstart",hi),lo(He,we,"pointerdown,touchstart,mousedown",Wf),lo(He,we,"pointerup,touchend,mouseup",Xf),Uc=yt.utils.checkPrefix("transform"),vo.push(Uc),hs=en(),Mo=yt.delayedCall(.2,Ar).pause(),fs=[we,"visibilitychange",function(){var l=ne.innerWidth,c=ne.innerHeight;we.hidden?(kf=l,Vf=c):(kf!==l||Vf!==c)&&pa()},we,"DOMContentLoaded",Ar,ne,"load",Ar,ne,"resize",pa],oo(He),Kt.forEach(function(l){return l.enable(0,1)}),o=0;o<$t.length;o+=3)co(Ve,$t[o],$t[o+1]),co(Ve,$t[o],$t[o+2])}},r.config=function(n){"limitCallbacks"in n&&(Cc=!!n.limitCallbacks);var i=n.syncInterval;i&&clearInterval(so)||(so=i)&&setInterval(Zf,i),"ignoreMobileResize"in n&&(Nc=r.isTouch===1&&n.ignoreMobileResize),"autoRefreshEvents"in n&&(oo(Ve)||oo(He,n.autoRefreshEvents||"none"),sd=(n.autoRefreshEvents+"").indexOf("resize")===-1)},r.scrollerProxy=function(n,i){var s=hn(n),a=$t.indexOf(s),o=Pr(s);~a&&$t.splice(a,o?6:2),i&&(o?$n.unshift(ne,i,ge,i,Kn,i):$n.unshift(s,i))},r.clearMatchMedia=function(n){Kt.forEach(function(i){return i._ctx&&i._ctx.query===n&&i._ctx.kill(!0,!0)})},r.isInViewport=function(n,i,s){var a=(Pn(n)?hn(n):n).getBoundingClientRect(),o=a[s?Dr:Cr]*i||0;return s?a.right-o>0&&a.left+o<ne.innerWidth:a.bottom-o>0&&a.top+o<ne.innerHeight},r.positionInViewport=function(n,i,s){Pn(n)&&(n=hn(n));var a=n.getBoundingClientRect(),o=a[s?Dr:Cr],l=i==null?o/2:i in Eo?Eo[i]*o:~i.indexOf("%")?parseFloat(i)*o/100:parseFloat(i)||0;return s?(a.left+l)/ne.innerWidth:(a.top+l)/ne.innerHeight},r.killAll=function(n){if(Kt.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),n!==!0){var i=Ir.killAll||[];Ir={},i.forEach(function(s){return s()})}},r}();Qt.version="3.12.5";Qt.saveStyles=function(r){return r?Ma(r).forEach(function(t){if(t&&t.style){var e=Rn.indexOf(t);e>=0&&Rn.splice(e,5),Rn.push(t,t.style.cssText,t.getBBox&&t.getAttribute("transform"),yt.core.getCache(t),Oc())}}):Rn};Qt.revert=function(r,t){return Zc(!r,t)};Qt.create=function(r,t){return new Qt(r,t)};Qt.refresh=function(r){return r?pa():(hs||Qt.register())&&Ar(!0)};Qt.update=function(r){return++$t.cache&&wi(r===!0?2:0)};Qt.clearScrollMemory=_d;Qt.maxScroll=function(r,t){return fi(r,t?je:Ie)};Qt.getScrollFunc=function(r,t){return Si(hn(r),t?je:Ie)};Qt.getById=function(r){return zc[r]};Qt.getAll=function(){return Kt.filter(function(r){return r.vars.id!=="ScrollSmoother"})};Qt.isScrolling=function(){return!!Vn};Qt.snapDirectional=Yc;Qt.addEventListener=function(r,t){var e=Ir[r]||(Ir[r]=[]);~e.indexOf(t)||e.push(t)};Qt.removeEventListener=function(r,t){var e=Ir[r],n=e&&e.indexOf(t);n>=0&&e.splice(n,1)};Qt.batch=function(r,t){var e=[],n={},i=t.interval||.016,s=t.batchMax||1e9,a=function(c,u){var f=[],h=[],d=yt.delayedCall(i,function(){u(f,h),f=[],h=[]}).pause();return function(_){f.length||d.restart(!0),f.push(_.trigger),h.push(_),s<=f.length&&d.progress(1)}},o;for(o in t)n[o]=o.substr(0,2)==="on"&&mn(t[o])&&o!=="onRefreshInit"?a(o,t[o]):t[o];return mn(s)&&(s=s(),He(Qt,"refresh",function(){return s=t.batchMax()})),Ma(r).forEach(function(l){var c={};for(o in n)c[o]=n[o];c.trigger=l,e.push(Qt.create(c))}),e};var td=function(t,e,n,i){return e>i?t(i):e<0&&t(0),n>i?(i-e)/(n-e):n<0?e/(e-n):1},Fc=function r(t,e){e===!0?t.style.removeProperty("touch-action"):t.style.touchAction=e===!0?"auto":e?"pan-"+e+(De.isTouch?" pinch-zoom":""):"none",t===Kn&&r(ge,e)},mo={auto:1,scroll:1},__=function(t){var e=t.event,n=t.target,i=t.axis,s=(e.changedTouches?e.changedTouches[0]:e).target,a=s._gsap||yt.core.getCache(s),o=en(),l;if(!a._isScrollT||o-a._isScrollT>2e3){for(;s&&s!==ge&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(mo[(l=kn(s)).overflowY]||mo[l.overflowX]));)s=s.parentNode;a._isScroll=s&&s!==n&&!Pr(s)&&(mo[(l=kn(s)).overflowY]||mo[l.overflowX]),a._isScrollT=o}(a._isScroll||i==="x")&&(e.stopPropagation(),e._gsapAllow=!0)},yd=function(t,e,n,i){return De.create({target:t,capture:!0,debounce:!1,lockAxis:!0,type:e,onWheel:i=i&&__,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&He(we,De.eventTypes[0],nd,!1,!0)},onDisable:function(){return Ve(we,De.eventTypes[0],nd,!0)}})},x_=/(input|label|select|textarea)/i,ed,nd=function(t){var e=x_.test(t.target.tagName);(e||ed)&&(t._gsapAllow=!0,ed=e)},v_=function(t){Tr(t)||(t={}),t.preventDefault=t.isNormalizer=t.allowClicks=!0,t.type||(t.type="wheel,touch"),t.debounce=!!t.debounce,t.id=t.id||"normalizer";var e=t,n=e.normalizeScrollX,i=e.momentum,s=e.allowNestedScroll,a=e.onRelease,o,l,c=hn(t.target)||Kn,u=yt.core.globals().ScrollSmoother,f=u&&u.get(),h=Zi&&(t.content&&hn(t.content)||f&&t.content!==!1&&!f.smooth()&&f.content()),d=Si(c,Ie),_=Si(c,je),g=1,p=(De.isTouch&&ne.visualViewport?ne.visualViewport.scale*ne.visualViewport.width:ne.outerWidth)/ne.innerWidth,m=0,S=mn(i)?function(){return i(o)}:function(){return i||2.8},v,M,D=yd(c,t.type,!0,s),T=function(){return M=!1},w=hi,P=hi,y=function(){l=fi(c,Ie),P=ma(Zi?1:0,l),n&&(w=ma(0,fi(c,je))),v=Rr},x=function(){h._gsap.y=fa(parseFloat(h._gsap.y)+d.offset)+"px",h.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(h._gsap.y)+", 0, 1)",d.offset=d.cacheID=0},F=function(){if(M){requestAnimationFrame(T);var N=fa(o.deltaY/2),Q=P(d.v-N);if(h&&Q!==d.v+d.offset){d.offset=Q-d.v;var A=fa((parseFloat(h&&h._gsap.y)||0)-d.offset);h.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+A+", 0, 1)",h._gsap.y=A+"px",d.cacheID=$t.cache,wi()}return!0}d.offset&&x(),M=!0},I,R,B,G,Z=function(){y(),I.isActive()&&I.vars.scrollY>l&&(d()>l?I.progress(1)&&d(l):I.resetTo("scrollY",l))};return h&&yt.set(h,{y:"+=0"}),t.ignoreCheck=function(J){return Zi&&J.type==="touchmove"&&F(J)||g>1.05&&J.type!=="touchstart"||o.isGesturing||J.touches&&J.touches.length>1},t.onPress=function(){M=!1;var J=g;g=fa((ne.visualViewport&&ne.visualViewport.scale||1)/p),I.pause(),J!==g&&Fc(c,g>1.01?!0:n?!1:"x"),R=_(),B=d(),y(),v=Rr},t.onRelease=t.onGestureStart=function(J,N){if(d.offset&&x(),!N)G.restart(!0);else{$t.cache++;var Q=S(),A,at;n&&(A=_(),at=A+Q*.05*-J.velocityX/.227,Q*=td(_,A,at,fi(c,je)),I.vars.scrollX=w(at)),A=d(),at=A+Q*.05*-J.velocityY/.227,Q*=td(d,A,at,fi(c,Ie)),I.vars.scrollY=P(at),I.invalidate().duration(Q).play(.01),(Zi&&I.vars.scrollY>=l||A>=l-1)&&yt.to({},{onUpdate:Z,duration:Q})}a&&a(J)},t.onWheel=function(){I._ts&&I.pause(),en()-m>1e3&&(v=0,m=en())},t.onChange=function(J,N,Q,A,at){if(Rr!==v&&y(),N&&n&&_(w(A[2]===N?R+(J.startX-J.x):_()+N-A[1])),Q){d.offset&&x();var bt=at[2]===Q,Zt=bt?B+J.startY-J.y:d()+Q-at[1],X=P(Zt);bt&&Zt!==X&&(B+=X-Zt),d(X)}(Q||N)&&wi()},t.onEnable=function(){Fc(c,n?!1:"x"),Qt.addEventListener("refresh",Z),He(ne,"resize",Z),d.smooth&&(d.target.style.scrollBehavior="auto",d.smooth=_.smooth=!1),D.enable()},t.onDisable=function(){Fc(c,!0),Ve(ne,"resize",Z),Qt.removeEventListener("refresh",Z),D.kill()},t.lockAxis=t.lockAxis!==!1,o=new De(t),o.iOS=Zi,Zi&&!d()&&d(1),Zi&&yt.ticker.add(hi),G=o._dc,I=yt.to(o,{ease:"power4",paused:!0,inherit:!1,scrollX:n?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:vd(d,d(),function(){return I.pause()})},onUpdate:wi,onComplete:G.vars.onComplete}),o};Qt.sort=function(r){return Kt.sort(r||function(t,e){return(t.vars.refreshPriority||0)*-1e6+t.start-(e.start+(e.vars.refreshPriority||0)*-1e6)})};Qt.observe=function(r){return new De(r)};Qt.normalizeScroll=function(r){if(typeof r>"u")return fn;if(r===!0&&fn)return fn.enable();if(r===!1){fn&&fn.kill(),fn=r;return}var t=r instanceof De?r:v_(r);return fn&&fn.target===t.target&&fn.kill(),Pr(t.target)&&(fn=t),t};Qt.core={_getVelocityProp:ro,_inputObserver:yd,_scrollers:$t,_proxies:$n,bridge:{ss:function(){Vn||Lr("scrollStart"),Vn=en()},ref:function(){return tn}}};cd()&&yt.registerPlugin(Qt);bn.registerPlugin(Qt);var Md=()=>{[{wrapperSelector:".prx-steps-wrap",itemSelector:".prx-step-box, .prx-step-divider"},{wrapperSelector:".prx-trust_grid",itemSelector:".prx-trust-box"},{wrapperSelector:".prx-areas_wrapper",itemSelector:".prx-areas_item"},{wrapperSelector:".prx-mastery_techonologies-wrapper",itemSelector:".mastery_technologies_image"}].forEach(({wrapperSelector:t,itemSelector:e})=>{let n=document.querySelector(t);if(!n)return;let i=n.querySelectorAll(e);i.length&&(bn.set(i,{opacity:0,y:48}),bn.timeline({scrollTrigger:{trigger:n,start:"top bottom-=12%",toggleActions:"play none none reverse"}}).to(i,{opacity:1,y:0,duration:.7,ease:"power2.out",stagger:.22}))})};var y_=/(?:^\s+|\s+$)/g,M_=/([\uD800-\uDBFF][\uDC00-\uDFFF](?:[\u200D\uFE0F][\uD800-\uDBFF][\uDC00-\uDFFF]){2,}|\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\uDD3E\uDDD6-\uDDDF])\u200D[\u2640\u2642]\uFE0F|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F\u200D[\u2640\u2642]|(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642])\uFE0F|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC69\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708]))\uFE0F|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83D\uDC69\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]))|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\u200D(?:(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F)/;function To(r){var t=r.nodeType,e="";if(t===1||t===9||t===11){if(typeof r.textContent=="string")return r.textContent;for(r=r.firstChild;r;r=r.nextSibling)e+=To(r)}else if(t===3||t===4)return r.nodeValue;return e}function Qn(r,t,e,n){if(r+="",e&&(r=r.trim?r.trim():r.replace(y_,"")),t&&t!=="")return r.replace(/>/g,"&gt;").replace(/</g,"&lt;").split(t);for(var i=[],s=r.length,a=0,o,l;a<s;a++)l=r.charAt(a),(l.charCodeAt(0)>=55296&&l.charCodeAt(0)<=56319||r.charCodeAt(a+1)>=65024&&r.charCodeAt(a+1)<=65039)&&(o=((r.substr(a,12).split(M_)||[])[1]||"").length||2,l=r.substr(a,o),i.emoji=1,a+=o-1),i.push(l===">"?"&gt;":l==="<"?"&lt;":n&&l===" "&&(r.charAt(a-1)===" "||r.charAt(a+1)===" ")?"&nbsp;":l);return i}var Ao=function(){function r(e){this.chars=Qn(e),this.sets=[],this.length=50;for(var n=0;n<20;n++)this.sets[n]=bd(80,this.chars)}var t=r.prototype;return t.grow=function(n){for(var i=0;i<20;i++)this.sets[i]+=bd(n-this.length,this.chars);this.length=n},r}(),Fr,Td,Ad=function(){return Fr||typeof window<"u"&&(Fr=window.gsap)&&Fr.registerPlugin&&Fr},S_=1,Sd=/\s+/g,bd=function(t,e){for(var n=e.length,i="";--t>-1;)i+=e[~~(Math.random()*n)];return i},Jc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Ed=Jc.toLowerCase(),b_={upperCase:new Ao(Jc),lowerCase:new Ao(Ed),upperAndLowerCase:new Ao(Jc+Ed)},wd=function(){Td=Fr=Ad()},ba={version:"3.12.5",name:"scrambleText",register:function(t,e,n){Fr=t,wd()},init:function(t,e,n,i,s){if(Td||wd(),this.prop="innerHTML"in t?"innerHTML":"textContent"in t?"textContent":0,!!this.prop){this.target=t,typeof e!="object"&&(e={text:e});var a=e.text||e.value||"",o=e.trim!==!1,l=this,c,u,f,h;return l.delimiter=c=e.delimiter||"",l.original=Qn(To(t).replace(Sd," ").split("&nbsp;").join(""),c,o),(a==="{original}"||a===!0||a==null)&&(a=l.original.join(c)),l.text=Qn((a||"").replace(Sd," "),c,o),l.hasClass=!!(e.newClass||e.oldClass),l.newClass=e.newClass,l.oldClass=e.oldClass,h=c==="",l.textHasEmoji=h&&!!l.text.emoji,l.charsHaveEmoji=!!e.chars&&!!Qn(e.chars).emoji,l.length=h?l.original.length:l.original.join(c).length,l.lengthDif=(h?l.text.length:l.text.join(c).length)-l.length,l.fillChar=e.fillChar||e.chars&&~e.chars.indexOf(" ")?"&nbsp;":"",l.charSet=f=b_[e.chars||"upperCase"]||new Ao(e.chars),l.speed=.05/(e.speed||1),l.prevScrambleTime=0,l.setIndex=Math.random()*20|0,u=l.length+Math.max(l.lengthDif,0),u>f.length&&f.grow(u),l.chars=f.sets[l.setIndex],l.revealDelay=e.revealDelay||0,l.tweenLength=e.tweenLength!==!1,l.tween=n,l.rightToLeft=!!e.rightToLeft,l._props.push("scrambleText","text"),S_}},render:function(t,e){var n=e.target,i=e.prop,s=e.text,a=e.delimiter,o=e.tween,l=e.prevScrambleTime,c=e.revealDelay,u=e.setIndex,f=e.chars,h=e.charSet,d=e.length,_=e.textHasEmoji,g=e.charsHaveEmoji,p=e.lengthDif,m=e.tweenLength,S=e.oldClass,v=e.newClass,M=e.rightToLeft,D=e.fillChar,T=e.speed,w=e.original,P=e.hasClass,y=s.length,x=o._time,F=x-l,I,R,B,G,Z,J,N,Q,A,at,bt;c&&(o._from&&(x=o._dur-x),t=x===0?0:x<c?1e-6:x===o._dur?1:o._ease((x-c)/(o._dur-c))),t<0?t=0:t>1&&(t=1),M&&(t=1-t),I=~~(t*y+.5),t?((F>T||F<-T)&&(e.setIndex=u=(u+(Math.random()*19|0))%20,e.chars=h.sets[u],e.prevScrambleTime+=F),G=f):G=w.join(a),bt=o._from?t:1-t,at=d+(m?o._from?bt*bt*bt:1-bt*bt*bt:1)*p,M?t===1&&(o._from||o.data==="isFromStart")?(B="",G=w.join(a)):(N=s.slice(I).join(a),g?B=Qn(G).slice(0,at-(_?Qn(N):N).length+.5|0).join(""):B=G.substr(0,at-(_?Qn(N):N).length+.5|0),G=N):(B=s.slice(0,I).join(a),R=(_?Qn(B):B).length,g?G=Qn(G).slice(R,at+.5|0).join(""):G=G.substr(R,at-R+.5|0)),P?(Q=M?S:v,A=M?v:S,Z=Q&&I!==0,J=A&&I!==y,N=(Z?"<span class='"+Q+"'>":"")+B+(Z?"</span>":"")+(J?"<span class='"+A+"'>":"")+a+G+(J?"</span>":"")):N=B+a+G,n[i]=D==="&nbsp;"&&~N.indexOf(" ")?N.split(" ").join("&nbsp;&nbsp;"):N}};ba.emojiSafeSplit=Qn;ba.getText=To;Ad()&&Fr.registerPlugin(ba);bn.registerPlugin(ba);var Dd=()=>{document.querySelectorAll("[data-scramble-link]").forEach(t=>{let e=t.querySelector("[data-scramble-text]");if(!e)return;let n=e.textContent;t.addEventListener("mouseenter",()=>{bn.matchMedia().add("(min-width: 768px)",()=>{bn.to(e,{duration:1,scrambleText:{text:n,chars:"10"}})})})})};var dh="164";var E_=0,Cd=1,w_=2;var em=1,ph=2,Pi=3,or=0,Tn=1,Li=2,rr=0,sr=1,Rd=2,Pd=3,Id=4,T_=5,Hr=100,A_=101,D_=102,C_=103,R_=104,P_=200,I_=201,L_=202,F_=203,Ru=204,Pu=205,U_=206,N_=207,O_=208,B_=209,z_=210,k_=211,V_=212,H_=213,G_=214,W_=0,X_=1,q_=2,jo=3,Y_=4,Z_=5,J_=6,$_=7,nm=0,K_=1,Q_=2,ar=0,j_=1,t0=2,e0=3,n0=4,i0=5,r0=6,s0=7;var im=300,Bs=301,zs=302,Iu=303,Lu=304,Tl=306,Fu=1e3,Wr=1001,Uu=1002,Wn=1003,a0=1004;var Do=1005;var ni=1006,$c=1007;var Xr=1008;var lr=1009,o0=1010,l0=1011,rm=1012,sm=1013,ks=1014,nr=1015,Al=1016,am=1017,om=1018,Ua=1020,c0=35902,u0=1021,h0=1022,pi=1023,f0=1024,d0=1025,Us=1026,Pa=1027,p0=1028,lm=1029,m0=1030,cm=1031,um=1033,Kc=33776,Qc=33777,jc=33778,tu=33779,Ld=35840,Fd=35841,Ud=35842,Nd=35843,Od=36196,Bd=37492,zd=37496,kd=37808,Vd=37809,Hd=37810,Gd=37811,Wd=37812,Xd=37813,qd=37814,Yd=37815,Zd=37816,Jd=37817,$d=37818,Kd=37819,Qd=37820,jd=37821,eu=36492,tp=36494,ep=36495,g0=36283,np=36284,ip=36285,rp=36286;var tl=2300,el=2301,nu=2302,sp=2400,ap=2401,op=2402;var _0=3200,x0=3201,v0=0,y0=1,er="",Gn="srgb",hr="srgb-linear",mh="display-p3",Dl="display-p3-linear",nl="linear",_e="srgb",il="rec709",rl="p3";var gs=7680;var lp=519,M0=512,S0=513,b0=514,hm=515,E0=516,w0=517,T0=518,A0=519,cp=35044;var up="300 es",Fi=2e3,sl=2001,cr=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,t);t.target=null}}},nn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var iu=Math.PI/180,Nu=180/Math.PI;function Na(){let r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(nn[r&255]+nn[r>>8&255]+nn[r>>16&255]+nn[r>>24&255]+"-"+nn[t&255]+nn[t>>8&255]+"-"+nn[t>>16&15|64]+nn[t>>24&255]+"-"+nn[e&63|128]+nn[e>>8&255]+"-"+nn[e>>16&255]+nn[e>>24&255]+nn[n&255]+nn[n>>8&255]+nn[n>>16&255]+nn[n>>24&255]).toLowerCase()}function wn(r,t,e){return Math.max(t,Math.min(e,r))}function D0(r,t){return(r%t+t)%t}function ru(r,t,e){return(1-e)*r+e*t}function Ea(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function En(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var ae=class r{constructor(t=0,e=0){r.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(wn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*n-a*i+t.x,this.y=s*i+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},qt=class r{constructor(t,e,n,i,s,a,o,l,c){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,a,o,l,c)}set(t,e,n,i,s,a,o,l,c){let u=this.elements;return u[0]=t,u[1]=i,u[2]=o,u[3]=e,u[4]=s,u[5]=l,u[6]=n,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],u=n[4],f=n[7],h=n[2],d=n[5],_=n[8],g=i[0],p=i[3],m=i[6],S=i[1],v=i[4],M=i[7],D=i[2],T=i[5],w=i[8];return s[0]=a*g+o*S+l*D,s[3]=a*p+o*v+l*T,s[6]=a*m+o*M+l*w,s[1]=c*g+u*S+f*D,s[4]=c*p+u*v+f*T,s[7]=c*m+u*M+f*w,s[2]=h*g+d*S+_*D,s[5]=h*p+d*v+_*T,s[8]=h*m+d*M+_*w,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],u=t[8];return e*a*u-e*o*c-n*s*u+n*o*l+i*s*c-i*a*l}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],u=t[8],f=u*a-o*c,h=o*l-u*s,d=c*s-a*l,_=e*f+n*h+i*d;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/_;return t[0]=f*g,t[1]=(i*c-u*n)*g,t[2]=(o*n-i*a)*g,t[3]=h*g,t[4]=(u*e-i*l)*g,t[5]=(i*s-o*e)*g,t[6]=d*g,t[7]=(n*l-c*e)*g,t[8]=(a*e-n*s)*g,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,s,a,o){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+t,-i*c,i*l,-i*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(su.makeScale(t,e)),this}rotate(t){return this.premultiply(su.makeRotation(-t)),this}translate(t,e){return this.premultiply(su.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},su=new qt;function fm(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function al(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function C0(){let r=al("canvas");return r.style.display="block",r}var hp={};function R0(r){r in hp||(hp[r]=!0,console.warn(r))}var fp=new qt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),dp=new qt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Co={[hr]:{transfer:nl,primaries:il,toReference:r=>r,fromReference:r=>r},[Gn]:{transfer:_e,primaries:il,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Dl]:{transfer:nl,primaries:rl,toReference:r=>r.applyMatrix3(dp),fromReference:r=>r.applyMatrix3(fp)},[mh]:{transfer:_e,primaries:rl,toReference:r=>r.convertSRGBToLinear().applyMatrix3(dp),fromReference:r=>r.applyMatrix3(fp).convertLinearToSRGB()}},P0=new Set([hr,Dl]),he={enabled:!0,_workingColorSpace:hr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!P0.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,t,e){if(this.enabled===!1||t===e||!t||!e)return r;let n=Co[t].toReference,i=Co[e].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,t){return this.convert(r,this._workingColorSpace,t)},toWorkingColorSpace:function(r,t){return this.convert(r,t,this._workingColorSpace)},getPrimaries:function(r){return Co[r].primaries},getTransfer:function(r){return r===er?nl:Co[r].transfer}};function Ns(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function au(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var _s,Ou=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{_s===void 0&&(_s=al("canvas")),_s.width=t.width,_s.height=t.height;let n=_s.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=_s}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=al("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=Ns(s[a]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(Ns(e[n]/255)*255):e[n]=Ns(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},I0=0,ol=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:I0++}),this.uuid=Na(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?s.push(ou(i[a].image)):s.push(ou(i[a]))}else s=ou(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function ou(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Ou.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var L0=0,Yn=class r extends cr{constructor(t=r.DEFAULT_IMAGE,e=r.DEFAULT_MAPPING,n=Wr,i=Wr,s=ni,a=Xr,o=pi,l=lr,c=r.DEFAULT_ANISOTROPY,u=er){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:L0++}),this.uuid=Na(),this.name="",this.source=new ol(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new ae(0,0),this.repeat=new ae(1,1),this.center=new ae(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new qt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,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),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==im)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Fu:t.x=t.x-Math.floor(t.x);break;case Wr:t.x=t.x<0?0:1;break;case Uu:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Fu:t.y=t.y-Math.floor(t.y);break;case Wr:t.y=t.y<0?0:1;break;case Uu:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};Yn.DEFAULT_IMAGE=null;Yn.DEFAULT_MAPPING=im;Yn.DEFAULT_ANISOTROPY=1;var We=class r{constructor(t=0,e=0,n=0,i=1){r.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,s,l=t.elements,c=l[0],u=l[4],f=l[8],h=l[1],d=l[5],_=l[9],g=l[2],p=l[6],m=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-g)<.01&&Math.abs(_-p)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+g)<.1&&Math.abs(_+p)<.1&&Math.abs(c+d+m-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let v=(c+1)/2,M=(d+1)/2,D=(m+1)/2,T=(u+h)/4,w=(f+g)/4,P=(_+p)/4;return v>M&&v>D?v<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(v),i=T/n,s=w/n):M>D?M<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(M),n=T/i,s=P/i):D<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(D),n=w/s,i=P/s),this.set(n,i,s,e),this}let S=Math.sqrt((p-_)*(p-_)+(f-g)*(f-g)+(h-u)*(h-u));return Math.abs(S)<.001&&(S=1),this.x=(p-_)/S,this.y=(f-g)/S,this.z=(h-u)/S,this.w=Math.acos((c+d+m-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Bu=class extends cr{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new We(0,0,t,e),this.scissorTest=!1,this.viewport=new We(0,0,t,e);let i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ni,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let s=new Yn(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];let a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let n=0,i=t.textures.length;n<i;n++)this.textures[n]=t.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new ol(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},Ui=class extends Bu{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},ll=class extends Yn{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=Wn,this.minFilter=Wn,this.wrapR=Wr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var zu=class extends Yn{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=Wn,this.minFilter=Wn,this.wrapR=Wr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var ur=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,s,a,o){let l=n[i+0],c=n[i+1],u=n[i+2],f=n[i+3],h=s[a+0],d=s[a+1],_=s[a+2],g=s[a+3];if(o===0){t[e+0]=l,t[e+1]=c,t[e+2]=u,t[e+3]=f;return}if(o===1){t[e+0]=h,t[e+1]=d,t[e+2]=_,t[e+3]=g;return}if(f!==g||l!==h||c!==d||u!==_){let p=1-o,m=l*h+c*d+u*_+f*g,S=m>=0?1:-1,v=1-m*m;if(v>Number.EPSILON){let D=Math.sqrt(v),T=Math.atan2(D,m*S);p=Math.sin(p*T)/D,o=Math.sin(o*T)/D}let M=o*S;if(l=l*p+h*M,c=c*p+d*M,u=u*p+_*M,f=f*p+g*M,p===1-o){let D=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=D,c*=D,u*=D,f*=D}}t[e]=l,t[e+1]=c,t[e+2]=u,t[e+3]=f}static multiplyQuaternionsFlat(t,e,n,i,s,a){let o=n[i],l=n[i+1],c=n[i+2],u=n[i+3],f=s[a],h=s[a+1],d=s[a+2],_=s[a+3];return t[e]=o*_+u*f+l*d-c*h,t[e+1]=l*_+u*h+c*f-o*d,t[e+2]=c*_+u*d+o*h-l*f,t[e+3]=u*_-o*f-l*h-c*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,i=t._y,s=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(n/2),u=o(i/2),f=o(s/2),h=l(n/2),d=l(i/2),_=l(s/2);switch(a){case"XYZ":this._x=h*u*f+c*d*_,this._y=c*d*f-h*u*_,this._z=c*u*_+h*d*f,this._w=c*u*f-h*d*_;break;case"YXZ":this._x=h*u*f+c*d*_,this._y=c*d*f-h*u*_,this._z=c*u*_-h*d*f,this._w=c*u*f+h*d*_;break;case"ZXY":this._x=h*u*f-c*d*_,this._y=c*d*f+h*u*_,this._z=c*u*_+h*d*f,this._w=c*u*f-h*d*_;break;case"ZYX":this._x=h*u*f-c*d*_,this._y=c*d*f+h*u*_,this._z=c*u*_-h*d*f,this._w=c*u*f+h*d*_;break;case"YZX":this._x=h*u*f+c*d*_,this._y=c*d*f+h*u*_,this._z=c*u*_-h*d*f,this._w=c*u*f-h*d*_;break;case"XZY":this._x=h*u*f-c*d*_,this._y=c*d*f-h*u*_,this._z=c*u*_+h*d*f,this._w=c*u*f+h*d*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],a=e[1],o=e[5],l=e[9],c=e[2],u=e[6],f=e[10],h=n+o+f;if(h>0){let d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(u-l)*d,this._y=(s-c)*d,this._z=(a-i)*d}else if(n>o&&n>f){let d=2*Math.sqrt(1+n-o-f);this._w=(u-l)/d,this._x=.25*d,this._y=(i+a)/d,this._z=(s+c)/d}else if(o>f){let d=2*Math.sqrt(1+o-n-f);this._w=(s-c)/d,this._x=(i+a)/d,this._y=.25*d,this._z=(l+u)/d}else{let d=2*Math.sqrt(1+f-n-o);this._w=(a-i)/d,this._x=(s+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(wn(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,i=t._y,s=t._z,a=t._w,o=e._x,l=e._y,c=e._z,u=e._w;return this._x=n*u+a*o+i*c-s*l,this._y=i*u+a*l+s*o-n*c,this._z=s*u+a*c+n*l-i*o,this._w=a*u-n*o-i*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,a=this._w,o=a*t._w+n*t._x+i*t._y+s*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=i,this._z=s,this;let l=1-o*o;if(l<=Number.EPSILON){let d=1-e;return this._w=d*a+e*this._w,this._x=d*n+e*this._x,this._y=d*i+e*this._y,this._z=d*s+e*this._z,this.normalize(),this}let c=Math.sqrt(l),u=Math.atan2(c,o),f=Math.sin((1-e)*u)/c,h=Math.sin(e*u)/c;return this._w=a*f+this._w*h,this._x=n*f+this._x*h,this._y=i*f+this._y*h,this._z=s*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},q=class r{constructor(t=0,e=0,n=0){r.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(pp.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(pp.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,a=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*i-o*n),u=2*(o*e-s*i),f=2*(s*n-a*e);return this.x=e+l*c+a*f-o*u,this.y=n+l*u+o*c-s*f,this.z=i+l*f+s*u-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,a=e.x,o=e.y,l=e.z;return this.x=i*l-s*o,this.y=s*a-n*l,this.z=n*o-i*a,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return lu.copy(this).projectOnVector(t),this.sub(lu)}reflect(t){return this.sub(lu.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(wn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},lu=new q,pp=new ur,qr=class{constructor(t=new q(1/0,1/0,1/0),e=new q(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(jn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(jn.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=jn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let n=t.geometry;if(n!==void 0){let s=n.getAttribute("position");if(e===!0&&s!==void 0&&t.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)t.isMesh===!0?t.getVertexPosition(a,jn):jn.fromBufferAttribute(s,a),jn.applyMatrix4(t.matrixWorld),this.expandByPoint(jn);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Ro.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Ro.copy(n.boundingBox)),Ro.applyMatrix4(t.matrixWorld),this.union(Ro)}let i=t.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,jn),jn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(wa),Po.subVectors(this.max,wa),xs.subVectors(t.a,wa),vs.subVectors(t.b,wa),ys.subVectors(t.c,wa),Ji.subVectors(vs,xs),$i.subVectors(ys,vs),Ur.subVectors(xs,ys);let e=[0,-Ji.z,Ji.y,0,-$i.z,$i.y,0,-Ur.z,Ur.y,Ji.z,0,-Ji.x,$i.z,0,-$i.x,Ur.z,0,-Ur.x,-Ji.y,Ji.x,0,-$i.y,$i.x,0,-Ur.y,Ur.x,0];return!cu(e,xs,vs,ys,Po)||(e=[1,0,0,0,1,0,0,0,1],!cu(e,xs,vs,ys,Po))?!1:(Io.crossVectors(Ji,$i),e=[Io.x,Io.y,Io.z],cu(e,xs,vs,ys,Po))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,jn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(jn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Ti[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ti[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ti[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ti[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ti[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ti[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ti[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ti[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ti),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},Ti=[new q,new q,new q,new q,new q,new q,new q,new q],jn=new q,Ro=new qr,xs=new q,vs=new q,ys=new q,Ji=new q,$i=new q,Ur=new q,wa=new q,Po=new q,Io=new q,Nr=new q;function cu(r,t,e,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){Nr.fromArray(r,s);let o=i.x*Math.abs(Nr.x)+i.y*Math.abs(Nr.y)+i.z*Math.abs(Nr.z),l=t.dot(Nr),c=e.dot(Nr),u=n.dot(Nr);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}var F0=new qr,Ta=new q,uu=new q,Vs=class{constructor(t=new q,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):F0.setFromPoints(t).getCenter(n);let i=0;for(let s=0,a=t.length;s<a;s++)i=Math.max(i,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Ta.subVectors(t,this.center);let e=Ta.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(Ta,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(uu.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Ta.copy(t.center).add(uu)),this.expandByPoint(Ta.copy(t.center).sub(uu))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},Ai=new q,hu=new q,Lo=new q,Ki=new q,fu=new q,Fo=new q,du=new q,cl=class{constructor(t=new q,e=new q(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Ai)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=Ai.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Ai.copy(this.origin).addScaledVector(this.direction,e),Ai.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){hu.copy(t).add(e).multiplyScalar(.5),Lo.copy(e).sub(t).normalize(),Ki.copy(this.origin).sub(hu);let s=t.distanceTo(e)*.5,a=-this.direction.dot(Lo),o=Ki.dot(this.direction),l=-Ki.dot(Lo),c=Ki.lengthSq(),u=Math.abs(1-a*a),f,h,d,_;if(u>0)if(f=a*l-o,h=a*o-l,_=s*u,f>=0)if(h>=-_)if(h<=_){let g=1/u;f*=g,h*=g,d=f*(f+a*h+2*o)+h*(a*f+h+2*l)+c}else h=s,f=Math.max(0,-(a*h+o)),d=-f*f+h*(h+2*l)+c;else h=-s,f=Math.max(0,-(a*h+o)),d=-f*f+h*(h+2*l)+c;else h<=-_?(f=Math.max(0,-(-a*s+o)),h=f>0?-s:Math.min(Math.max(-s,-l),s),d=-f*f+h*(h+2*l)+c):h<=_?(f=0,h=Math.min(Math.max(-s,-l),s),d=h*(h+2*l)+c):(f=Math.max(0,-(a*s+o)),h=f>0?s:Math.min(Math.max(-s,-l),s),d=-f*f+h*(h+2*l)+c);else h=a>0?-s:s,f=Math.max(0,-(a*h+o)),d=-f*f+h*(h+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(hu).addScaledVector(Lo,h),d}intersectSphere(t,e){Ai.subVectors(t.center,this.origin);let n=Ai.dot(this.direction),i=Ai.dot(Ai)-n*n,s=t.radius*t.radius;if(i>s)return null;let a=Math.sqrt(s-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,s,a,o,l,c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,i=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,i=(t.min.x-h.x)*c),u>=0?(s=(t.min.y-h.y)*u,a=(t.max.y-h.y)*u):(s=(t.max.y-h.y)*u,a=(t.min.y-h.y)*u),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a<i||isNaN(i))&&(i=a),f>=0?(o=(t.min.z-h.z)*f,l=(t.max.z-h.z)*f):(o=(t.max.z-h.z)*f,l=(t.min.z-h.z)*f),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,Ai)!==null}intersectTriangle(t,e,n,i,s){fu.subVectors(e,t),Fo.subVectors(n,t),du.crossVectors(fu,Fo);let a=this.direction.dot(du),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ki.subVectors(this.origin,t);let l=o*this.direction.dot(Fo.crossVectors(Ki,Fo));if(l<0)return null;let c=o*this.direction.dot(fu.cross(Ki));if(c<0||l+c>a)return null;let u=-o*Ki.dot(du);return u<0?null:this.at(u/a,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Re=class r{constructor(t,e,n,i,s,a,o,l,c,u,f,h,d,_,g,p){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,a,o,l,c,u,f,h,d,_,g,p)}set(t,e,n,i,s,a,o,l,c,u,f,h,d,_,g,p){let m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=i,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=u,m[10]=f,m[14]=h,m[3]=d,m[7]=_,m[11]=g,m[15]=p,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 r().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/Ms.setFromMatrixColumn(t,0).length(),s=1/Ms.setFromMatrixColumn(t,1).length(),a=1/Ms.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){let h=a*u,d=a*f,_=o*u,g=o*f;e[0]=l*u,e[4]=-l*f,e[8]=c,e[1]=d+_*c,e[5]=h-g*c,e[9]=-o*l,e[2]=g-h*c,e[6]=_+d*c,e[10]=a*l}else if(t.order==="YXZ"){let h=l*u,d=l*f,_=c*u,g=c*f;e[0]=h+g*o,e[4]=_*o-d,e[8]=a*c,e[1]=a*f,e[5]=a*u,e[9]=-o,e[2]=d*o-_,e[6]=g+h*o,e[10]=a*l}else if(t.order==="ZXY"){let h=l*u,d=l*f,_=c*u,g=c*f;e[0]=h-g*o,e[4]=-a*f,e[8]=_+d*o,e[1]=d+_*o,e[5]=a*u,e[9]=g-h*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){let h=a*u,d=a*f,_=o*u,g=o*f;e[0]=l*u,e[4]=_*c-d,e[8]=h*c+g,e[1]=l*f,e[5]=g*c+h,e[9]=d*c-_,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){let h=a*l,d=a*c,_=o*l,g=o*c;e[0]=l*u,e[4]=g-h*f,e[8]=_*f+d,e[1]=f,e[5]=a*u,e[9]=-o*u,e[2]=-c*u,e[6]=d*f+_,e[10]=h-g*f}else if(t.order==="XZY"){let h=a*l,d=a*c,_=o*l,g=o*c;e[0]=l*u,e[4]=-f,e[8]=c*u,e[1]=h*f+g,e[5]=a*u,e[9]=d*f-_,e[2]=_*f-d,e[6]=o*u,e[10]=g*f+h}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(U0,t,N0)}lookAt(t,e,n){let i=this.elements;return In.subVectors(t,e),In.lengthSq()===0&&(In.z=1),In.normalize(),Qi.crossVectors(n,In),Qi.lengthSq()===0&&(Math.abs(n.z)===1?In.x+=1e-4:In.z+=1e-4,In.normalize(),Qi.crossVectors(n,In)),Qi.normalize(),Uo.crossVectors(In,Qi),i[0]=Qi.x,i[4]=Uo.x,i[8]=In.x,i[1]=Qi.y,i[5]=Uo.y,i[9]=In.y,i[2]=Qi.z,i[6]=Uo.z,i[10]=In.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],u=n[1],f=n[5],h=n[9],d=n[13],_=n[2],g=n[6],p=n[10],m=n[14],S=n[3],v=n[7],M=n[11],D=n[15],T=i[0],w=i[4],P=i[8],y=i[12],x=i[1],F=i[5],I=i[9],R=i[13],B=i[2],G=i[6],Z=i[10],J=i[14],N=i[3],Q=i[7],A=i[11],at=i[15];return s[0]=a*T+o*x+l*B+c*N,s[4]=a*w+o*F+l*G+c*Q,s[8]=a*P+o*I+l*Z+c*A,s[12]=a*y+o*R+l*J+c*at,s[1]=u*T+f*x+h*B+d*N,s[5]=u*w+f*F+h*G+d*Q,s[9]=u*P+f*I+h*Z+d*A,s[13]=u*y+f*R+h*J+d*at,s[2]=_*T+g*x+p*B+m*N,s[6]=_*w+g*F+p*G+m*Q,s[10]=_*P+g*I+p*Z+m*A,s[14]=_*y+g*R+p*J+m*at,s[3]=S*T+v*x+M*B+D*N,s[7]=S*w+v*F+M*G+D*Q,s[11]=S*P+v*I+M*Z+D*A,s[15]=S*y+v*R+M*J+D*at,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],a=t[1],o=t[5],l=t[9],c=t[13],u=t[2],f=t[6],h=t[10],d=t[14],_=t[3],g=t[7],p=t[11],m=t[15];return _*(+s*l*f-i*c*f-s*o*h+n*c*h+i*o*d-n*l*d)+g*(+e*l*d-e*c*h+s*a*h-i*a*d+i*c*u-s*l*u)+p*(+e*c*f-e*o*d-s*a*f+n*a*d+s*o*u-n*c*u)+m*(-i*o*u-e*l*f+e*o*h+i*a*f-n*a*h+n*l*u)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],u=t[8],f=t[9],h=t[10],d=t[11],_=t[12],g=t[13],p=t[14],m=t[15],S=f*p*c-g*h*c+g*l*d-o*p*d-f*l*m+o*h*m,v=_*h*c-u*p*c-_*l*d+a*p*d+u*l*m-a*h*m,M=u*g*c-_*f*c+_*o*d-a*g*d-u*o*m+a*f*m,D=_*f*l-u*g*l-_*o*h+a*g*h+u*o*p-a*f*p,T=e*S+n*v+i*M+s*D;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/T;return t[0]=S*w,t[1]=(g*h*s-f*p*s-g*i*d+n*p*d+f*i*m-n*h*m)*w,t[2]=(o*p*s-g*l*s+g*i*c-n*p*c-o*i*m+n*l*m)*w,t[3]=(f*l*s-o*h*s-f*i*c+n*h*c+o*i*d-n*l*d)*w,t[4]=v*w,t[5]=(u*p*s-_*h*s+_*i*d-e*p*d-u*i*m+e*h*m)*w,t[6]=(_*l*s-a*p*s-_*i*c+e*p*c+a*i*m-e*l*m)*w,t[7]=(a*h*s-u*l*s+u*i*c-e*h*c-a*i*d+e*l*d)*w,t[8]=M*w,t[9]=(_*f*s-u*g*s-_*n*d+e*g*d+u*n*m-e*f*m)*w,t[10]=(a*g*s-_*o*s+_*n*c-e*g*c-a*n*m+e*o*m)*w,t[11]=(u*o*s-a*f*s-u*n*c+e*f*c+a*n*d-e*o*d)*w,t[12]=D*w,t[13]=(u*g*i-_*f*i+_*n*h-e*g*h-u*n*p+e*f*p)*w,t[14]=(_*o*i-a*g*i-_*n*l+e*g*l+a*n*p-e*o*p)*w,t[15]=(a*f*i-u*o*i+u*n*l-e*f*l-a*n*h+e*o*h)*w,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,a=t.x,o=t.y,l=t.z,c=s*a,u=s*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,u*o+n,u*l-i*a,0,c*l-i*o,u*l+i*a,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,a){return this.set(1,n,s,0,t,1,a,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,a=e._y,o=e._z,l=e._w,c=s+s,u=a+a,f=o+o,h=s*c,d=s*u,_=s*f,g=a*u,p=a*f,m=o*f,S=l*c,v=l*u,M=l*f,D=n.x,T=n.y,w=n.z;return i[0]=(1-(g+m))*D,i[1]=(d+M)*D,i[2]=(_-v)*D,i[3]=0,i[4]=(d-M)*T,i[5]=(1-(h+m))*T,i[6]=(p+S)*T,i[7]=0,i[8]=(_+v)*w,i[9]=(p-S)*w,i[10]=(1-(h+g))*w,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=Ms.set(i[0],i[1],i[2]).length(),a=Ms.set(i[4],i[5],i[6]).length(),o=Ms.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],ti.copy(this);let c=1/s,u=1/a,f=1/o;return ti.elements[0]*=c,ti.elements[1]*=c,ti.elements[2]*=c,ti.elements[4]*=u,ti.elements[5]*=u,ti.elements[6]*=u,ti.elements[8]*=f,ti.elements[9]*=f,ti.elements[10]*=f,e.setFromRotationMatrix(ti),n.x=s,n.y=a,n.z=o,this}makePerspective(t,e,n,i,s,a,o=Fi){let l=this.elements,c=2*s/(e-t),u=2*s/(n-i),f=(e+t)/(e-t),h=(n+i)/(n-i),d,_;if(o===Fi)d=-(a+s)/(a-s),_=-2*a*s/(a-s);else if(o===sl)d=-a/(a-s),_=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,a,o=Fi){let l=this.elements,c=1/(e-t),u=1/(n-i),f=1/(a-s),h=(e+t)*c,d=(n+i)*u,_,g;if(o===Fi)_=(a+s)*f,g=-2*f;else if(o===sl)_=s*f,g=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=g,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},Ms=new q,ti=new Re,U0=new q(0,0,0),N0=new q(1,1,1),Qi=new q,Uo=new q,In=new q,mp=new Re,gp=new ur,Ni=class r{constructor(t=0,e=0,n=0,i=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let i=t.elements,s=i[0],a=i[4],o=i[8],l=i[1],c=i[5],u=i[9],f=i[2],h=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(wn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-wn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(wn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-wn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(wn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-wn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return mp.makeRotationFromQuaternion(t),this.setFromRotationMatrix(mp,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return gp.setFromEuler(this),this.setFromQuaternion(gp,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Ni.DEFAULT_ORDER="XYZ";var ul=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},O0=0,_p=new q,Ss=new ur,Di=new Re,No=new q,Aa=new q,B0=new q,z0=new ur,xp=new q(1,0,0),vp=new q(0,1,0),yp=new q(0,0,1),Mp={type:"added"},k0={type:"removed"},bs={type:"childadded",child:null},pu={type:"childremoved",child:null},sn=class r extends cr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:O0++}),this.uuid=Na(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new q,e=new Ni,n=new ur,i=new q(1,1,1);function s(){n.setFromEuler(e,!1)}function a(){e.setFromQuaternion(n,void 0,!1)}e._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Re},normalMatrix:{value:new qt}}),this.matrix=new Re,this.matrixWorld=new Re,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ul,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Ss.setFromAxisAngle(t,e),this.quaternion.multiply(Ss),this}rotateOnWorldAxis(t,e){return Ss.setFromAxisAngle(t,e),this.quaternion.premultiply(Ss),this}rotateX(t){return this.rotateOnAxis(xp,t)}rotateY(t){return this.rotateOnAxis(vp,t)}rotateZ(t){return this.rotateOnAxis(yp,t)}translateOnAxis(t,e){return _p.copy(t).applyQuaternion(this.quaternion),this.position.add(_p.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(xp,t)}translateY(t){return this.translateOnAxis(vp,t)}translateZ(t){return this.translateOnAxis(yp,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Di.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?No.copy(t):No.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),Aa.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Di.lookAt(Aa,No,this.up):Di.lookAt(No,Aa,this.up),this.quaternion.setFromRotationMatrix(Di),i&&(Di.extractRotation(i.matrixWorld),Ss.setFromRotationMatrix(Di),this.quaternion.premultiply(Ss.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(Mp),bs.child=t,this.dispatchEvent(bs),bs.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(k0),pu.child=t,this.dispatchEvent(pu),pu.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Di.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Di.multiply(t.parent.matrixWorld)),t.applyMatrix4(Di),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Mp),bs.child=t,this.dispatchEvent(bs),bs.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){let a=this.children[n].getObjectByProperty(t,e);if(a!==void 0)return a}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);let i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Aa,t,B0),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Aa,z0,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let n=0,i=e.length;n<i;n++){let s=e[n];(s.matrixWorldAutoUpdate===!0||t===!0)&&s.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let i=this.children;for(let s=0,a=i.length;s<a;s++){let o=i[s];o.matrixWorldAutoUpdate===!0&&o.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){let l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){let f=l[c];s(t.shapes,f)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(t.materials,this.material[l]));i.material=o}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){let l=this.animations[o];i.animations.push(s(t.animations,l))}}if(e){let o=a(t.geometries),l=a(t.materials),c=a(t.textures),u=a(t.images),f=a(t.shapes),h=a(t.skeletons),d=a(t.animations),_=a(t.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),f.length>0&&(n.shapes=f),h.length>0&&(n.skeletons=h),d.length>0&&(n.animations=d),_.length>0&&(n.nodes=_)}return n.object=i,n;function a(o){let l=[];for(let c in o){let u=o[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){let i=t.children[n];this.add(i.clone())}return this}};sn.DEFAULT_UP=new q(0,1,0);sn.DEFAULT_MATRIX_AUTO_UPDATE=!0;sn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var ei=new q,Ci=new q,mu=new q,Ri=new q,Es=new q,ws=new q,Sp=new q,gu=new q,_u=new q,xu=new q,Ls=class r{constructor(t=new q,e=new q,n=new q){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),ei.subVectors(t,e),i.cross(ei);let s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){ei.subVectors(i,e),Ci.subVectors(n,e),mu.subVectors(t,e);let a=ei.dot(ei),o=ei.dot(Ci),l=ei.dot(mu),c=Ci.dot(Ci),u=Ci.dot(mu),f=a*c-o*o;if(f===0)return s.set(0,0,0),null;let h=1/f,d=(c*l-o*u)*h,_=(a*u-o*l)*h;return s.set(1-d-_,_,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Ri)===null?!1:Ri.x>=0&&Ri.y>=0&&Ri.x+Ri.y<=1}static getInterpolation(t,e,n,i,s,a,o,l){return this.getBarycoord(t,e,n,i,Ri)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Ri.x),l.addScaledVector(a,Ri.y),l.addScaledVector(o,Ri.z),l)}static isFrontFacing(t,e,n,i){return ei.subVectors(n,e),Ci.subVectors(t,e),ei.cross(Ci).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return ei.subVectors(this.c,this.b),Ci.subVectors(this.a,this.b),ei.cross(Ci).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return r.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return r.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,s){return r.getInterpolation(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return r.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return r.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,i=this.b,s=this.c,a,o;Es.subVectors(i,n),ws.subVectors(s,n),gu.subVectors(t,n);let l=Es.dot(gu),c=ws.dot(gu);if(l<=0&&c<=0)return e.copy(n);_u.subVectors(t,i);let u=Es.dot(_u),f=ws.dot(_u);if(u>=0&&f<=u)return e.copy(i);let h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return a=l/(l-u),e.copy(n).addScaledVector(Es,a);xu.subVectors(t,s);let d=Es.dot(xu),_=ws.dot(xu);if(_>=0&&d<=_)return e.copy(s);let g=d*c-l*_;if(g<=0&&c>=0&&_<=0)return o=c/(c-_),e.copy(n).addScaledVector(ws,o);let p=u*_-d*f;if(p<=0&&f-u>=0&&d-_>=0)return Sp.subVectors(s,i),o=(f-u)/(f-u+(d-_)),e.copy(i).addScaledVector(Sp,o);let m=1/(p+g+h);return a=g*m,o=h*m,e.copy(n).addScaledVector(Es,a).addScaledVector(ws,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},dm={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},ji={h:0,s:0,l:0},Oo={h:0,s:0,l:0};function vu(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}var re=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Gn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,he.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=he.workingColorSpace){return this.r=t,this.g=e,this.b=n,he.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=he.workingColorSpace){if(t=D0(t,1),e=wn(e,0,1),n=wn(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,a=2*n-s;this.r=vu(a,s,t+1/3),this.g=vu(a,s,t),this.b=vu(a,s,t-1/3)}return he.toWorkingColorSpace(this,i),this}setStyle(t,e=Gn){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let s,a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Gn){let n=dm[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Ns(t.r),this.g=Ns(t.g),this.b=Ns(t.b),this}copyLinearToSRGB(t){return this.r=au(t.r),this.g=au(t.g),this.b=au(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Gn){return he.fromWorkingColorSpace(rn.copy(this),t),Math.round(wn(rn.r*255,0,255))*65536+Math.round(wn(rn.g*255,0,255))*256+Math.round(wn(rn.b*255,0,255))}getHexString(t=Gn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=he.workingColorSpace){he.fromWorkingColorSpace(rn.copy(this),e);let n=rn.r,i=rn.g,s=rn.b,a=Math.max(n,i,s),o=Math.min(n,i,s),l,c,u=(o+a)/2;if(o===a)l=0,c=0;else{let f=a-o;switch(c=u<=.5?f/(a+o):f/(2-a-o),a){case n:l=(i-s)/f+(i<s?6:0);break;case i:l=(s-n)/f+2;break;case s:l=(n-i)/f+4;break}l/=6}return t.h=l,t.s=c,t.l=u,t}getRGB(t,e=he.workingColorSpace){return he.fromWorkingColorSpace(rn.copy(this),e),t.r=rn.r,t.g=rn.g,t.b=rn.b,t}getStyle(t=Gn){he.fromWorkingColorSpace(rn.copy(this),t);let e=rn.r,n=rn.g,i=rn.b;return t!==Gn?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){return this.getHSL(ji),this.setHSL(ji.h+t,ji.s+e,ji.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(ji),t.getHSL(Oo);let n=ru(ji.h,Oo.h,e),i=ru(ji.s,Oo.s,e),s=ru(ji.l,Oo.l,e);return this.setHSL(n,i,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,i=this.b,s=t.elements;return this.r=s[0]*e+s[3]*n+s[6]*i,this.g=s[1]*e+s[4]*n+s[7]*i,this.b=s[2]*e+s[5]*n+s[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},rn=new re;re.NAMES=dm;var V0=0,Yr=class extends cr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:V0++}),this.uuid=Na(),this.name="",this.type="Material",this.blending=sr,this.side=or,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Ru,this.blendDst=Pu,this.blendEquation=Hr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new re(0,0,0),this.blendAlpha=0,this.depthFunc=jo,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=lp,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=gs,this.stencilZFail=gs,this.stencilZPass=gs,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let i=this[e];if(i===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.6,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(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),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(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).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(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).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(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).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!==sr&&(n.blending=this.blending),this.side!==or&&(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!==Ru&&(n.blendSrc=this.blendSrc),this.blendDst!==Pu&&(n.blendDst=this.blendDst),this.blendEquation!==Hr&&(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!==jo&&(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!==lp&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==gs&&(n.stencilFail=this.stencilFail),this.stencilZFail!==gs&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==gs&&(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.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 i(s){let a=[];for(let o in s){let l=s[o];delete l.metadata,a.push(l)}return a}if(e){let s=i(t.textures),a=i(t.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let i=e.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},hl=class extends Yr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new re(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 Ni,this.combine=nm,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var Fe=new q,Bo=new ae,Xn=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=cp,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=nr,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return R0("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)Bo.fromBufferAttribute(this,e),Bo.applyMatrix3(t),this.setXY(e,Bo.x,Bo.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Fe.fromBufferAttribute(this,e),Fe.applyMatrix3(t),this.setXYZ(e,Fe.x,Fe.y,Fe.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Fe.fromBufferAttribute(this,e),Fe.applyMatrix4(t),this.setXYZ(e,Fe.x,Fe.y,Fe.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Fe.fromBufferAttribute(this,e),Fe.applyNormalMatrix(t),this.setXYZ(e,Fe.x,Fe.y,Fe.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Fe.fromBufferAttribute(this,e),Fe.transformDirection(t),this.setXYZ(e,Fe.x,Fe.y,Fe.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Ea(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=En(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ea(e,this.array)),e}setX(t,e){return this.normalized&&(e=En(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ea(e,this.array)),e}setY(t,e){return this.normalized&&(e=En(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ea(e,this.array)),e}setZ(t,e){return this.normalized&&(e=En(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ea(e,this.array)),e}setW(t,e){return this.normalized&&(e=En(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=En(e,this.array),n=En(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=En(e,this.array),n=En(n,this.array),i=En(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,s){return t*=this.itemSize,this.normalized&&(e=En(e,this.array),n=En(n,this.array),i=En(i,this.array),s=En(s,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==cp&&(t.usage=this.usage),t}};var fl=class extends Xn{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var dl=class extends Xn{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var qn=class extends Xn{constructor(t,e,n){super(new Float32Array(t),e,n)}},H0=0,Hn=new Re,yu=new sn,Ts=new q,Ln=new qr,Da=new qr,Ge=new q,mi=class r extends cr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:H0++}),this.uuid=Na(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(fm(t)?dl:fl)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new qt().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Hn.makeRotationFromQuaternion(t),this.applyMatrix4(Hn),this}rotateX(t){return Hn.makeRotationX(t),this.applyMatrix4(Hn),this}rotateY(t){return Hn.makeRotationY(t),this.applyMatrix4(Hn),this}rotateZ(t){return Hn.makeRotationZ(t),this.applyMatrix4(Hn),this}translate(t,e,n){return Hn.makeTranslation(t,e,n),this.applyMatrix4(Hn),this}scale(t,e,n){return Hn.makeScale(t,e,n),this.applyMatrix4(Hn),this}lookAt(t){return yu.lookAt(t),yu.updateMatrix(),this.applyMatrix4(yu.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ts).negate(),this.translate(Ts.x,Ts.y,Ts.z),this}setFromPoints(t){let e=[];for(let n=0,i=t.length;n<i;n++){let s=t[n];e.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new qn(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new qr);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new q(-1/0,-1/0,-1/0),new q(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){let s=e[n];Ln.setFromBufferAttribute(s),this.morphTargetsRelative?(Ge.addVectors(this.boundingBox.min,Ln.min),this.boundingBox.expandByPoint(Ge),Ge.addVectors(this.boundingBox.max,Ln.max),this.boundingBox.expandByPoint(Ge)):(this.boundingBox.expandByPoint(Ln.min),this.boundingBox.expandByPoint(Ln.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.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 Vs);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new q,1/0);return}if(t){let n=this.boundingSphere.center;if(Ln.setFromBufferAttribute(t),e)for(let s=0,a=e.length;s<a;s++){let o=e[s];Da.setFromBufferAttribute(o),this.morphTargetsRelative?(Ge.addVectors(Ln.min,Da.min),Ln.expandByPoint(Ge),Ge.addVectors(Ln.max,Da.max),Ln.expandByPoint(Ge)):(Ln.expandByPoint(Da.min),Ln.expandByPoint(Da.max))}Ln.getCenter(n);let i=0;for(let s=0,a=t.count;s<a;s++)Ge.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(Ge));if(e)for(let s=0,a=e.length;s<a;s++){let o=e[s],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)Ge.fromBufferAttribute(o,c),l&&(Ts.fromBufferAttribute(t,c),Ge.add(Ts)),i=Math.max(i,n.distanceToSquared(Ge))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=e.position,i=e.normal,s=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Xn(new Float32Array(4*n.count),4));let a=this.getAttribute("tangent"),o=[],l=[];for(let P=0;P<n.count;P++)o[P]=new q,l[P]=new q;let c=new q,u=new q,f=new q,h=new ae,d=new ae,_=new ae,g=new q,p=new q;function m(P,y,x){c.fromBufferAttribute(n,P),u.fromBufferAttribute(n,y),f.fromBufferAttribute(n,x),h.fromBufferAttribute(s,P),d.fromBufferAttribute(s,y),_.fromBufferAttribute(s,x),u.sub(c),f.sub(c),d.sub(h),_.sub(h);let F=1/(d.x*_.y-_.x*d.y);isFinite(F)&&(g.copy(u).multiplyScalar(_.y).addScaledVector(f,-d.y).multiplyScalar(F),p.copy(f).multiplyScalar(d.x).addScaledVector(u,-_.x).multiplyScalar(F),o[P].add(g),o[y].add(g),o[x].add(g),l[P].add(p),l[y].add(p),l[x].add(p))}let S=this.groups;S.length===0&&(S=[{start:0,count:t.count}]);for(let P=0,y=S.length;P<y;++P){let x=S[P],F=x.start,I=x.count;for(let R=F,B=F+I;R<B;R+=3)m(t.getX(R+0),t.getX(R+1),t.getX(R+2))}let v=new q,M=new q,D=new q,T=new q;function w(P){D.fromBufferAttribute(i,P),T.copy(D);let y=o[P];v.copy(y),v.sub(D.multiplyScalar(D.dot(y))).normalize(),M.crossVectors(T,y);let F=M.dot(l[P])<0?-1:1;a.setXYZW(P,v.x,v.y,v.z,F)}for(let P=0,y=S.length;P<y;++P){let x=S[P],F=x.start,I=x.count;for(let R=F,B=F+I;R<B;R+=3)w(t.getX(R+0)),w(t.getX(R+1)),w(t.getX(R+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Xn(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let h=0,d=n.count;h<d;h++)n.setXYZ(h,0,0,0);let i=new q,s=new q,a=new q,o=new q,l=new q,c=new q,u=new q,f=new q;if(t)for(let h=0,d=t.count;h<d;h+=3){let _=t.getX(h+0),g=t.getX(h+1),p=t.getX(h+2);i.fromBufferAttribute(e,_),s.fromBufferAttribute(e,g),a.fromBufferAttribute(e,p),u.subVectors(a,s),f.subVectors(i,s),u.cross(f),o.fromBufferAttribute(n,_),l.fromBufferAttribute(n,g),c.fromBufferAttribute(n,p),o.add(u),l.add(u),c.add(u),n.setXYZ(_,o.x,o.y,o.z),n.setXYZ(g,l.x,l.y,l.z),n.setXYZ(p,c.x,c.y,c.z)}else for(let h=0,d=e.count;h<d;h+=3)i.fromBufferAttribute(e,h+0),s.fromBufferAttribute(e,h+1),a.fromBufferAttribute(e,h+2),u.subVectors(a,s),f.subVectors(i,s),u.cross(f),n.setXYZ(h+0,u.x,u.y,u.z),n.setXYZ(h+1,u.x,u.y,u.z),n.setXYZ(h+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Ge.fromBufferAttribute(t,e),Ge.normalize(),t.setXYZ(e,Ge.x,Ge.y,Ge.z)}toNonIndexed(){function t(o,l){let c=o.array,u=o.itemSize,f=o.normalized,h=new c.constructor(l.length*u),d=0,_=0;for(let g=0,p=l.length;g<p;g++){o.isInterleavedBufferAttribute?d=l[g]*o.data.stride+o.offset:d=l[g]*u;for(let m=0;m<u;m++)h[_++]=c[d++]}return new Xn(h,u,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new r,n=this.index.array,i=this.attributes;for(let o in i){let l=i[o],c=t(l,n);e.setAttribute(o,c)}let s=this.morphAttributes;for(let o in s){let l=[],c=s[o];for(let u=0,f=c.length;u<f;u++){let h=c[u],d=t(h,n);l.push(d)}e.morphAttributes[o]=l}e.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let o=0,l=a.length;o<l;o++){let c=a[o];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let l in n){let c=n[l];t.data.attributes[l]=c.toJSON(t.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let f=0,h=c.length;f<h;f++){let d=c[f];u.push(d.toJSON(t.data))}u.length>0&&(i[l]=u,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let i=t.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(e))}let s=t.morphAttributes;for(let c in s){let u=[],f=s[c];for(let h=0,d=f.length;h<d;h++)u.push(f[h].clone(e));this.morphAttributes[c]=u}this.morphTargetsRelative=t.morphTargetsRelative;let a=t.groups;for(let c=0,u=a.length;c<u;c++){let f=a[c];this.addGroup(f.start,f.count,f.materialIndex)}let o=t.boundingBox;o!==null&&(this.boundingBox=o.clone());let l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},bp=new Re,Or=new cl,zo=new Vs,Ep=new q,As=new q,Ds=new q,Cs=new q,Mu=new q,ko=new q,Vo=new ae,Ho=new ae,Go=new ae,wp=new q,Tp=new q,Ap=new q,Wo=new q,Xo=new q,ii=class extends sn{constructor(t=new mi,e=new hl){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){let o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(t,e){let n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(i,t);let o=this.morphTargetInfluences;if(s&&o){ko.set(0,0,0);for(let l=0,c=s.length;l<c;l++){let u=o[l],f=s[l];u!==0&&(Mu.fromBufferAttribute(f,t),a?ko.addScaledVector(Mu,u):ko.addScaledVector(Mu.sub(e),u))}e.add(ko)}return e}raycast(t,e){let n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),zo.copy(n.boundingSphere),zo.applyMatrix4(s),Or.copy(t.ray).recast(t.near),!(zo.containsPoint(Or.origin)===!1&&(Or.intersectSphere(zo,Ep)===null||Or.origin.distanceToSquared(Ep)>(t.far-t.near)**2))&&(bp.copy(s).invert(),Or.copy(t.ray).applyMatrix4(bp),!(n.boundingBox!==null&&Or.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Or)))}_computeIntersections(t,e,n){let i,s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,f=s.attributes.normal,h=s.groups,d=s.drawRange;if(o!==null)if(Array.isArray(a))for(let _=0,g=h.length;_<g;_++){let p=h[_],m=a[p.materialIndex],S=Math.max(p.start,d.start),v=Math.min(o.count,Math.min(p.start+p.count,d.start+d.count));for(let M=S,D=v;M<D;M+=3){let T=o.getX(M),w=o.getX(M+1),P=o.getX(M+2);i=qo(this,m,t,n,c,u,f,T,w,P),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=p.materialIndex,e.push(i))}}else{let _=Math.max(0,d.start),g=Math.min(o.count,d.start+d.count);for(let p=_,m=g;p<m;p+=3){let S=o.getX(p),v=o.getX(p+1),M=o.getX(p+2);i=qo(this,a,t,n,c,u,f,S,v,M),i&&(i.faceIndex=Math.floor(p/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let _=0,g=h.length;_<g;_++){let p=h[_],m=a[p.materialIndex],S=Math.max(p.start,d.start),v=Math.min(l.count,Math.min(p.start+p.count,d.start+d.count));for(let M=S,D=v;M<D;M+=3){let T=M,w=M+1,P=M+2;i=qo(this,m,t,n,c,u,f,T,w,P),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=p.materialIndex,e.push(i))}}else{let _=Math.max(0,d.start),g=Math.min(l.count,d.start+d.count);for(let p=_,m=g;p<m;p+=3){let S=p,v=p+1,M=p+2;i=qo(this,a,t,n,c,u,f,S,v,M),i&&(i.faceIndex=Math.floor(p/3),e.push(i))}}}};function G0(r,t,e,n,i,s,a,o){let l;if(t.side===Tn?l=n.intersectTriangle(a,s,i,!0,o):l=n.intersectTriangle(i,s,a,t.side===or,o),l===null)return null;Xo.copy(o),Xo.applyMatrix4(r.matrixWorld);let c=e.ray.origin.distanceTo(Xo);return c<e.near||c>e.far?null:{distance:c,point:Xo.clone(),object:r}}function qo(r,t,e,n,i,s,a,o,l,c){r.getVertexPosition(o,As),r.getVertexPosition(l,Ds),r.getVertexPosition(c,Cs);let u=G0(r,t,e,n,As,Ds,Cs,Wo);if(u){i&&(Vo.fromBufferAttribute(i,o),Ho.fromBufferAttribute(i,l),Go.fromBufferAttribute(i,c),u.uv=Ls.getInterpolation(Wo,As,Ds,Cs,Vo,Ho,Go,new ae)),s&&(Vo.fromBufferAttribute(s,o),Ho.fromBufferAttribute(s,l),Go.fromBufferAttribute(s,c),u.uv1=Ls.getInterpolation(Wo,As,Ds,Cs,Vo,Ho,Go,new ae)),a&&(wp.fromBufferAttribute(a,o),Tp.fromBufferAttribute(a,l),Ap.fromBufferAttribute(a,c),u.normal=Ls.getInterpolation(Wo,As,Ds,Cs,wp,Tp,Ap,new q),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));let f={a:o,b:l,c,normal:new q,materialIndex:0};Ls.getNormal(As,Ds,Cs,f.normal),u.face=f}return u}var Ia=class r extends mi{constructor(t=1,e=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};let o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);let l=[],c=[],u=[],f=[],h=0,d=0;_("z","y","x",-1,-1,n,e,t,a,s,0),_("z","y","x",1,-1,n,e,-t,a,s,1),_("x","z","y",1,1,t,n,e,i,a,2),_("x","z","y",1,-1,t,n,-e,i,a,3),_("x","y","z",1,-1,t,e,n,i,s,4),_("x","y","z",-1,-1,t,e,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new qn(c,3)),this.setAttribute("normal",new qn(u,3)),this.setAttribute("uv",new qn(f,2));function _(g,p,m,S,v,M,D,T,w,P,y){let x=M/w,F=D/P,I=M/2,R=D/2,B=T/2,G=w+1,Z=P+1,J=0,N=0,Q=new q;for(let A=0;A<Z;A++){let at=A*F-R;for(let bt=0;bt<G;bt++){let Zt=bt*x-I;Q[g]=Zt*S,Q[p]=at*v,Q[m]=B,c.push(Q.x,Q.y,Q.z),Q[g]=0,Q[p]=0,Q[m]=T>0?1:-1,u.push(Q.x,Q.y,Q.z),f.push(bt/w),f.push(1-A/P),J+=1}}for(let A=0;A<P;A++)for(let at=0;at<w;at++){let bt=h+at+G*A,Zt=h+at+G*(A+1),X=h+(at+1)+G*(A+1),tt=h+(at+1)+G*A;l.push(bt,Zt,tt),l.push(Zt,X,tt),N+=6}o.addGroup(d,N,y),d+=N,h+=J}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function Hs(r){let t={};for(let e in r){t[e]={};for(let n in r[e]){let i=r[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function gn(r){let t={};for(let e=0;e<r.length;e++){let n=Hs(r[e]);for(let i in n)t[i]=n[i]}return t}function W0(r){let t=[];for(let e=0;e<r.length;e++)t.push(r[e].clone());return t}function pm(r){let t=r.getRenderTarget();return t===null?r.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:he.workingColorSpace}var X0={clone:Hs,merge:gn},q0=`void main() {
1
+ (()=>{var Rh=()=>{let r=()=>{requestAnimationFrame(()=>{document.querySelectorAll(".client-list_wrapper").forEach(t=>{let e=t.querySelector(".client-list_wrap");if(!e)return;let n=Array.from(e.children),i=e.scrollWidth;i&&(n.forEach(s=>{let o=s.cloneNode(!0);o.style.width=`${s.offsetWidth}px`,e.appendChild(o)}),e.style.width=`${i*2}px`)})})};document.readyState==="complete"?r():window.addEventListener("load",r,{once:!0})};var Ph=()=>{let r=document.querySelectorAll("[data-contact-popup-toggler]"),t=document.querySelector("[data-contact-popup]");var e=0;if(!r||!t)return;let n=t.querySelector("[data-contact-popup-close]");if(!n)return;let i=t.querySelector(".contact-popup_box");if(!i)return;let s=(o,a)=>{let l=document.createElement("script"),c=document.getElementsByTagName("script")[0];l.async=1,l.onload=l.onreadystatechange=(u,h)=>{(h||!l.readyState||/loaded|complete/.test(l.readyState))&&(l.onload=l.onreadystatechange=null,l=void 0,h||a&&a())},l.src=o,c.parentNode.insertBefore(l,c)};r.forEach(o=>{o.addEventListener("click",a=>{a.preventDefault,e?(t.classList.add("-open"),document.body.classList.add("-popup-open")):s("https://embed.typeform.com/next/embed.js",()=>{e=1,t.classList.add("-open"),document.body.classList.add("-popup-open")})})}),n.addEventListener("click",o=>{o.preventDefault,t.classList.remove("-open"),document.body.classList.remove("-popup-open")}),t.addEventListener("click",o=>{i.contains(o.target)||(t.classList.remove("-open"),document.body.classList.remove("-popup-open"))}),new URL(document.location).searchParams.has("invicible")&&setTimeout(()=>{s("https://embed.typeform.com/next/embed.js",()=>{e=1,setTimeout(()=>{t.classList.add("-open"),document.body.classList.add("-popup-open")},200)})},2e3)};function _i(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function zh(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var Sn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},jr={duration:.5,overwrite:!1,delay:0},nc,Ke,Me,Un=1e8,ge=1/Un,Xl=Math.PI*2,Wm=Xl/4,Xm=0,kh=Math.sqrt,qm=Math.cos,Ym=Math.sin,Ue=function(t){return typeof t=="string"},Ae=function(t){return typeof t=="function"},vi=function(t){return typeof t=="number"},Qo=function(t){return typeof t>"u"},li=function(t){return typeof t=="object"},Mn=function(t){return t!==!1},ic=function(){return typeof window<"u"},Go=function(t){return Ae(t)||Ue(t)},Vh=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Qe=Array.isArray,ql=/(?:-?\.?\d|\.)+/gi,rc=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,xr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Bl=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,sc=/[+-]=-?[.\d]+/,Hh=/[^,'"\[\]\s]+/gi,Zm=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,we,oi,Yl,oc,Dn={},Yo={},Gh,Wh=function(t){return(Yo=_r(t,Dn))&&je},jo=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},eo=function(t,e){return!e&&console.warn(t)},Xh=function(t,e){return t&&(Dn[t]=e)&&Yo&&(Yo[t]=e)||Dn},no=function(){return 0},Jm={suppressEvents:!0,isStart:!0,kill:!1},Wo={suppressEvents:!0,kill:!1},$m={suppressEvents:!0},ac={},ki=[],Zl={},qh,vn={},zl={},Ih=30,Xo=[],lc="",cc=function(t){var e=t[0],n,i;if(li(e)||Ae(e)||(t=[t]),!(n=(e._gsap||{}).harness)){for(i=Xo.length;i--&&!Xo[i].targetTest(e););n=Xo[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new fc(t[i],n)))||t.splice(i,1);return t},Vi=function(t){return t._gsap||cc(On(t))[0]._gsap},uc=function(t,e,n){return(n=t[e])&&Ae(n)?t[e]():Qo(n)&&t.getAttribute&&t.getAttribute(e)||n},ln=function(t,e){return(t=t.split(",")).forEach(e)||t},De=function(t){return Math.round(t*1e5)/1e5||0},Ve=function(t){return Math.round(t*1e7)/1e7||0},vr=function(t,e){var n=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),n==="+"?t+i:n==="-"?t-i:n==="*"?t*i:t/i},Km=function(t,e){for(var n=e.length,i=0;t.indexOf(e[i])<0&&++i<n;);return i<n},Zo=function(){var t=ki.length,e=ki.slice(0),n,i;for(Zl={},ki.length=0,n=0;n<t;n++)i=e[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},Yh=function(t,e,n,i){ki.length&&!Ke&&Zo(),t.render(e,n,i||Ke&&e<0&&(t._initted||t._startAt)),ki.length&&!Ke&&Zo()},Zh=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Hh).length<2?e:Ue(t)?t.trim():t},Jh=function(t){return t},Bn=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Qm=function(t){return function(e,n){for(var i in n)i in e||i==="duration"&&t||i==="ease"||(e[i]=n[i])}},_r=function(t,e){for(var n in e)t[n]=e[n];return t},Lh=function r(t,e){for(var n in e)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=li(e[n])?r(t[n]||(t[n]={}),e[n]):e[n]);return t},Jo=function(t,e){var n={},i;for(i in t)i in e||(n[i]=t[i]);return n},Qs=function(t){var e=t.parent||we,n=t.keyframes?Qm(Qe(t.keyframes)):Bn;if(Mn(t.inherit))for(;e;)n(t,e.vars.defaults),e=e.parent||e._dp;return t},jm=function(t,e){for(var n=t.length,i=n===e.length;i&&n--&&t[n]===e[n];);return n<0},$h=function(t,e,n,i,s){n===void 0&&(n="_first"),i===void 0&&(i="_last");var o=t[i],a;if(s)for(a=e[s];o&&o[s]>a;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[i]=e,e._prev=o,e.parent=e._dp=t,e},ta=function(t,e,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var s=e._prev,o=e._next;s?s._next=o:t[n]===e&&(t[n]=o),o?o._prev=s:t[i]===e&&(t[i]=s),e._next=e._prev=e.parent=null},Hi=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},pr=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},tg=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Jl=function(t,e,n,i){return t._startAt&&(Ke?t._startAt.revert(Wo):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},eg=function r(t){return!t||t._ts&&r(t.parent)},Fh=function(t){return t._repeat?ts(t._tTime,t=t.duration()+t._rDelay)*t:0},ts=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},$o=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},ea=function(t){return t._end=Ve(t._start+(t._tDur/Math.abs(t._ts||t._rts||ge)||0))},na=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=Ve(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),ea(t),n._dirty||pr(n,t)),t},Kh=function(t,e){var n;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(n=$o(t.rawTime(),e),(!e._dur||so(0,e.totalDuration(),n)-e._tTime>ge)&&e.render(n,!0)),pr(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(n=t;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-ge}},ai=function(t,e,n,i){return e.parent&&Hi(e),e._start=Ve((vi(n)?n:n||t!==we?Nn(t,n,e):t._time)+e._delay),e._end=Ve(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),$h(t,e,"_first","_last",t._sort?"_start":0),$l(e)||(t._recent=e),i||Kh(t,e),t._ts<0&&na(t,t._tTime),t},Qh=function(t,e){return(Dn.ScrollTrigger||jo("scrollTrigger",e))&&Dn.ScrollTrigger.create(e,t)},jh=function(t,e,n,i,s){if(mc(t,e,s),!t._initted)return 1;if(!n&&t._pt&&!Ke&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&qh!==yn.frame)return ki.push(t),t._lazy=[s,i],1},ng=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},$l=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},ig=function(t,e,n,i){var s=t.ratio,o=e<0||!e&&(!t._start&&ng(t)&&!(!t._initted&&$l(t))||(t._ts<0||t._dp._ts<0)&&!$l(t))?0:1,a=t._rDelay,l=0,c,u,h;if(a&&t._repeat&&(l=so(0,t._tDur,e),u=ts(l,a),t._yoyo&&u&1&&(o=1-o),u!==ts(t._tTime,a)&&(s=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==s||Ke||i||t._zTime===ge||!e&&t._zTime){if(!t._initted&&jh(t,e,i,n,l))return;for(h=t._zTime,t._zTime=e||(n?ge:0),n||(n=e&&!h),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=l,c=t._pt;c;)c.r(o,c.d),c=c._next;e<0&&Jl(t,e,n,!0),t._onUpdate&&!n&&An(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&An(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&Hi(t,1),!n&&!Ke&&(An(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},rg=function(t,e,n){var i;if(n>e)for(i=t._first;i&&i._start<=n;){if(i.data==="isPause"&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=n;){if(i.data==="isPause"&&i._start<e)return i;i=i._prev}},es=function(t,e,n,i){var s=t._repeat,o=Ve(e)||0,a=t._tTime/t._tDur;return a&&!i&&(t._time*=o/t._dur),t._dur=o,t._tDur=s?s<0?1e10:Ve(o*(s+1)+t._rDelay*s):o,a>0&&!i&&na(t,t._tTime=t._tDur*a),t.parent&&ea(t),n||pr(t.parent,t),t},Nh=function(t){return t instanceof qe?pr(t):es(t,t._dur)},sg={_start:0,endTime:no,totalDuration:no},Nn=function r(t,e,n){var i=t.labels,s=t._recent||sg,o=t.duration()>=Un?s.endTime(!1):t._dur,a,l,c;return Ue(e)&&(isNaN(e)||e in i)?(l=e.charAt(0),c=e.substr(-1)==="%",a=e.indexOf("="),l==="<"||l===">"?(a>=0&&(e=e.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(e.substr(1))||0)*(c?(a<0?s:n).totalDuration()/100:1)):a<0?(e in i||(i[e]=o),i[e]):(l=parseFloat(e.charAt(a-1)+e.substr(a+1)),c&&n&&(l=l/100*(Qe(n)?n[0]:n).totalDuration()),a>1?r(t,e.substr(0,a-1),n)+l:o+l)):e==null?o:+e},js=function(t,e,n){var i=vi(e[1]),s=(i?2:1)+(t<2?0:1),o=e[s],a,l;if(i&&(o.duration=e[1]),o.parent=n,t){for(a=o,l=n;l&&!("immediateRender"in a);)a=l.vars.defaults||{},l=Mn(l.vars.inherit)&&l.parent;o.immediateRender=Mn(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[s-1]}return new Re(e[0],o,e[s+1])},Gi=function(t,e){return t||t===0?e(t):e},so=function(t,e,n){return n<t?t:n>e?e:n},Ye=function(t,e){return!Ue(t)||!(e=Zm.exec(t))?"":e[1]},og=function(t,e,n){return Gi(n,function(i){return so(t,e,i)})},Kl=[].slice,tf=function(t,e){return t&&li(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&li(t[0]))&&!t.nodeType&&t!==oi},ag=function(t,e,n){return n===void 0&&(n=[]),t.forEach(function(i){var s;return Ue(i)&&!e||tf(i,1)?(s=n).push.apply(s,On(i)):n.push(i)})||n},On=function(t,e,n){return Me&&!e&&Me.selector?Me.selector(t):Ue(t)&&!n&&(Yl||!ns())?Kl.call((e||oc).querySelectorAll(t),0):Qe(t)?ag(t,n):tf(t)?Kl.call(t,0):t?[t]:[]},Ql=function(t){return t=On(t)[0]||eo("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return On(e,n.querySelectorAll?n:n===t?eo("Invalid scope")||oc.createElement("div"):t)}},ef=function(t){return t.sort(function(){return .5-Math.random()})},nf=function(t){if(Ae(t))return t;var e=li(t)?t:{each:t},n=mr(e.ease),i=e.from||0,s=parseFloat(e.base)||0,o={},a=i>0&&i<1,l=isNaN(i)||a,c=e.axis,u=i,h=i;return Ue(i)?u=h={center:.5,edges:.5,end:1}[i]||0:!a&&l&&(u=i[0],h=i[1]),function(f,d,_){var g=(_||e).length,p=o[g],m,S,v,M,D,T,E,R,y;if(!p){if(y=e.grid==="auto"?0:(e.grid||[1,Un])[1],!y){for(E=-Un;E<(E=_[y++].getBoundingClientRect().left)&&y<g;);y<g&&y--}for(p=o[g]=[],m=l?Math.min(y,g)*u-.5:i%y,S=y===Un?0:l?g*h/y-.5:i/y|0,E=0,R=Un,T=0;T<g;T++)v=T%y-m,M=S-(T/y|0),p[T]=D=c?Math.abs(c==="y"?M:v):kh(v*v+M*M),D>E&&(E=D),D<R&&(R=D);i==="random"&&ef(p),p.max=E-R,p.min=R,p.v=g=(parseFloat(e.amount)||parseFloat(e.each)*(y>g?g-1:c?c==="y"?g/y:y:Math.max(y,g/y))||0)*(i==="edges"?-1:1),p.b=g<0?s-g:s,p.u=Ye(e.amount||e.each)||0,n=n&&g<0?ff(n):n}return g=(p[f]-p.min)/p.max||0,Ve(p.b+(n?n(g):g)*p.v)+p.u}},jl=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var i=Ve(Math.round(parseFloat(n)/t)*t*e);return(i-i%1)/e+(vi(n)?0:Ye(n))}},rf=function(t,e){var n=Qe(t),i,s;return!n&&li(t)&&(i=n=t.radius||Un,t.values?(t=On(t.values),(s=!vi(t[0]))&&(i*=i)):t=jl(t.increment)),Gi(e,n?Ae(t)?function(o){return s=t(o),Math.abs(s-o)<=i?s:o}:function(o){for(var a=parseFloat(s?o.x:o),l=parseFloat(s?o.y:0),c=Un,u=0,h=t.length,f,d;h--;)s?(f=t[h].x-a,d=t[h].y-l,f=f*f+d*d):f=Math.abs(t[h]-a),f<c&&(c=f,u=h);return u=!i||c<=i?t[u]:o,s||u===o||vi(o)?u:u+Ye(o)}:jl(t))},sf=function(t,e,n,i){return Gi(Qe(t)?!e:n===!0?!!(n=0):!i,function(){return Qe(t)?t[~~(Math.random()*t.length)]:(n=n||1e-5)&&(i=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((t-n/2+Math.random()*(e-t+n*.99))/n)*n*i)/i})},lg=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){return e.reduce(function(s,o){return o(s)},i)}},cg=function(t,e){return function(n){return t(parseFloat(n))+(e||Ye(n))}},ug=function(t,e,n){return af(t,e,0,1,n)},of=function(t,e,n){return Gi(n,function(i){return t[~~e(i)]})},hg=function r(t,e,n){var i=e-t;return Qe(t)?of(t,r(0,t.length),e):Gi(n,function(s){return(i+(s-t)%i)%i+t})},fg=function r(t,e,n){var i=e-t,s=i*2;return Qe(t)?of(t,r(0,t.length-1),e):Gi(n,function(o){return o=(s+(o-t)%s)%s||0,t+(o>i?s-o:o)})},is=function(t){for(var e=0,n="",i,s,o,a;~(i=t.indexOf("random(",e));)o=t.indexOf(")",i),a=t.charAt(i+7)==="[",s=t.substr(i+7,o-i-7).match(a?Hh:ql),n+=t.substr(e,i-e)+sf(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),e=o+1;return n+t.substr(e,t.length-e)},af=function(t,e,n,i,s){var o=e-t,a=i-n;return Gi(s,function(l){return n+((l-t)/o*a||0)})},dg=function r(t,e,n,i){var s=isNaN(t+e)?0:function(d){return(1-d)*t+d*e};if(!s){var o=Ue(t),a={},l,c,u,h,f;if(n===!0&&(i=1)&&(n=null),o)t={p:t},e={p:e};else if(Qe(t)&&!Qe(e)){for(u=[],h=t.length,f=h-2,c=1;c<h;c++)u.push(r(t[c-1],t[c]));h--,s=function(_){_*=h;var g=Math.min(f,~~_);return u[g](_-g)},n=e}else i||(t=_r(Qe(t)?[]:{},t));if(!u){for(l in e)dc.call(a,t,l,"get",e[l]);s=function(_){return xc(_,a)||(o?t.p:t)}}}return Gi(n,s)},Uh=function(t,e,n){var i=t.labels,s=Un,o,a,l;for(o in i)a=i[o]-e,a<0==!!n&&a&&s>(a=Math.abs(a))&&(l=o,s=a);return l},An=function(t,e,n){var i=t.vars,s=i[e],o=Me,a=t._ctx,l,c,u;if(s)return l=i[e+"Params"],c=i.callbackScope||t,n&&ki.length&&Zo(),a&&(Me=a),u=l?s.apply(c,l):s.call(c),Me=o,u},$s=function(t){return Hi(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Ke),t.progress()<1&&An(t,"onInterrupt"),t},Qr,lf=[],cf=function(t){if(t)if(t=!t.name&&t.default||t,ic()||t.headless){var e=t.name,n=Ae(t),i=e&&!n&&t.init?function(){this._props=[]}:t,s={init:no,render:xc,add:dc,kill:Cg,modifier:Dg,rawVars:0},o={targetTest:0,get:0,getSetter:ia,aliases:{},register:0};if(ns(),t!==i){if(vn[e])return;Bn(i,Bn(Jo(t,s),o)),_r(i.prototype,_r(s,Jo(t,o))),vn[i.prop=e]=i,t.targetTest&&(Xo.push(i),ac[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Xh(e,i),t.register&&t.register(je,i,cn)}else lf.push(t)},de=255,Ks={aqua:[0,de,de],lime:[0,de,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,de],navy:[0,0,128],white:[de,de,de],olive:[128,128,0],yellow:[de,de,0],orange:[de,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[de,0,0],pink:[de,192,203],cyan:[0,de,de],transparent:[de,de,de,0]},kl=function(t,e,n){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(n-e)*t*6:t<.5?n:t*3<2?e+(n-e)*(2/3-t)*6:e)*de+.5|0},uf=function(t,e,n){var i=t?vi(t)?[t>>16,t>>8&de,t&de]:0:Ks.black,s,o,a,l,c,u,h,f,d,_;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Ks[t])i=Ks[t];else if(t.charAt(0)==="#"){if(t.length<6&&(s=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+s+s+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return i=parseInt(t.substr(1,6),16),[i>>16,i>>8&de,i&de,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&de,t&de]}else if(t.substr(0,3)==="hsl"){if(i=_=t.match(ql),!e)l=+i[0]%360/360,c=+i[1]/100,u=+i[2]/100,o=u<=.5?u*(c+1):u+c-u*c,s=u*2-o,i.length>3&&(i[3]*=1),i[0]=kl(l+1/3,s,o),i[1]=kl(l,s,o),i[2]=kl(l-1/3,s,o);else if(~t.indexOf("="))return i=t.match(rc),n&&i.length<4&&(i[3]=1),i}else i=t.match(ql)||Ks.transparent;i=i.map(Number)}return e&&!_&&(s=i[0]/de,o=i[1]/de,a=i[2]/de,h=Math.max(s,o,a),f=Math.min(s,o,a),u=(h+f)/2,h===f?l=c=0:(d=h-f,c=u>.5?d/(2-h-f):d/(h+f),l=h===s?(o-a)/d+(o<a?6:0):h===o?(a-s)/d+2:(s-o)/d+4,l*=60),i[0]=~~(l+.5),i[1]=~~(c*100+.5),i[2]=~~(u*100+.5)),n&&i.length<4&&(i[3]=1),i},hf=function(t){var e=[],n=[],i=-1;return t.split(xi).forEach(function(s){var o=s.match(xr)||[];e.push.apply(e,o),n.push(i+=o.length+1)}),e.c=n,e},Oh=function(t,e,n){var i="",s=(t+i).match(xi),o=e?"hsla(":"rgba(",a=0,l,c,u,h;if(!s)return t;if(s=s.map(function(f){return(f=uf(f,e,1))&&o+(e?f[0]+","+f[1]+"%,"+f[2]+"%,"+f[3]:f.join(","))+")"}),n&&(u=hf(t),l=n.c,l.join(i)!==u.c.join(i)))for(c=t.replace(xi,"1").split(xr),h=c.length-1;a<h;a++)i+=c[a]+(~l.indexOf(a)?s.shift()||o+"0,0,0,0)":(u.length?u:s.length?s:n).shift());if(!c)for(c=t.split(xi),h=c.length-1;a<h;a++)i+=c[a]+s[a];return i+c[h]},xi=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Ks)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),pg=/hsl[a]?\(/,hc=function(t){var e=t.join(" "),n;if(xi.lastIndex=0,xi.test(e))return n=pg.test(e),t[1]=Oh(t[1],n),t[0]=Oh(t[0],n,hf(t[1])),!0},io,yn=function(){var r=Date.now,t=500,e=33,n=r(),i=n,s=1e3/240,o=s,a=[],l,c,u,h,f,d,_=function g(p){var m=r()-i,S=p===!0,v,M,D,T;if((m>t||m<0)&&(n+=m-e),i+=m,D=i-n,v=D-o,(v>0||S)&&(T=++h.frame,f=D-h.time*1e3,h.time=D=D/1e3,o+=v+(v>=s?4:s-v),M=1),S||(l=c(g)),M)for(d=0;d<a.length;d++)a[d](D,f,T,p)};return h={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(p){return f/(1e3/(p||60))},wake:function(){Gh&&(!Yl&&ic()&&(oi=Yl=window,oc=oi.document||{},Dn.gsap=je,(oi.gsapVersions||(oi.gsapVersions=[])).push(je.version),Wh(Yo||oi.GreenSockGlobals||!oi.gsap&&oi||{}),lf.forEach(cf)),u=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&h.sleep(),c=u||function(p){return setTimeout(p,o-h.time*1e3+1|0)},io=1,_(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(l),io=0,c=no},lagSmoothing:function(p,m){t=p||1/0,e=Math.min(m||33,t)},fps:function(p){s=1e3/(p||240),o=h.time*1e3+s},add:function(p,m,S){var v=m?function(M,D,T,E){p(M,D,T,E),h.remove(v)}:p;return h.remove(p),a[S?"unshift":"push"](v),ns(),v},remove:function(p,m){~(m=a.indexOf(p))&&a.splice(m,1)&&d>=m&&d--},_listeners:a},h}(),ns=function(){return!io&&yn.wake()},ee={},mg=/^[\d.\-M][\d.\-,\s]/,gg=/["']/g,_g=function(t){for(var e={},n=t.substr(1,t.length-3).split(":"),i=n[0],s=1,o=n.length,a,l,c;s<o;s++)l=n[s],a=s!==o-1?l.lastIndexOf(","):l.length,c=l.substr(0,a),e[i]=isNaN(c)?c.replace(gg,"").trim():+c,i=l.substr(a+1).trim();return e},xg=function(t){var e=t.indexOf("(")+1,n=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<n?t.indexOf(")",n+1):n)},vg=function(t){var e=(t+"").split("("),n=ee[e[0]];return n&&e.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[_g(e[1])]:xg(t).split(",").map(Zh)):ee._CE&&mg.test(t)?ee._CE("",t):n},ff=function(t){return function(e){return 1-t(1-e)}},df=function r(t,e){for(var n=t._first,i;n;)n instanceof qe?r(n,e):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==e&&(n.timeline?r(n.timeline,e):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=e)),n=n._next},mr=function(t,e){return t&&(Ae(t)?t:ee[t]||vg(t))||e},yr=function(t,e,n,i){n===void 0&&(n=function(l){return 1-e(1-l)}),i===void 0&&(i=function(l){return l<.5?e(l*2)/2:1-e((1-l)*2)/2});var s={easeIn:e,easeOut:n,easeInOut:i},o;return ln(t,function(a){ee[a]=Dn[a]=s,ee[o=a.toLowerCase()]=n;for(var l in s)ee[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=ee[a+"."+l]=s[l]}),s},pf=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},Vl=function r(t,e,n){var i=e>=1?e:1,s=(n||(t?.3:.45))/(e<1?e:1),o=s/Xl*(Math.asin(1/i)||0),a=function(u){return u===1?1:i*Math.pow(2,-10*u)*Ym((u-o)*s)+1},l=t==="out"?a:t==="in"?function(c){return 1-a(1-c)}:pf(a);return s=Xl/s,l.config=function(c,u){return r(t,c,u)},l},Hl=function r(t,e){e===void 0&&(e=1.70158);var n=function(o){return o?--o*o*((e+1)*o+e)+1:0},i=t==="out"?n:t==="in"?function(s){return 1-n(1-s)}:pf(n);return i.config=function(s){return r(t,s)},i};ln("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;yr(r+",Power"+(e-1),t?function(n){return Math.pow(n,e)}:function(n){return n},function(n){return 1-Math.pow(1-n,e)},function(n){return n<.5?Math.pow(n*2,e)/2:1-Math.pow((1-n)*2,e)/2})});ee.Linear.easeNone=ee.none=ee.Linear.easeIn;yr("Elastic",Vl("in"),Vl("out"),Vl());(function(r,t){var e=1/t,n=2*e,i=2.5*e,s=function(a){return a<e?r*a*a:a<n?r*Math.pow(a-1.5/t,2)+.75:a<i?r*(a-=2.25/t)*a+.9375:r*Math.pow(a-2.625/t,2)+.984375};yr("Bounce",function(o){return 1-s(1-o)},s)})(7.5625,2.75);yr("Expo",function(r){return r?Math.pow(2,10*(r-1)):0});yr("Circ",function(r){return-(kh(1-r*r)-1)});yr("Sine",function(r){return r===1?1:-qm(r*Wm)+1});yr("Back",Hl("in"),Hl("out"),Hl());ee.SteppedEase=ee.steps=Dn.SteppedEase={config:function(t,e){t===void 0&&(t=1);var n=1/t,i=t+(e?0:1),s=e?1:0,o=1-ge;return function(a){return((i*so(0,o,a)|0)+s)*n}}};jr.ease=ee["quad.out"];ln("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return lc+=r+","+r+"Params,"});var fc=function(t,e){this.id=Xm++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:uc,this.set=e?e.getSetter:ia},ro=function(){function r(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,es(this,+e.duration,1,1),this.data=e.data,Me&&(this._ctx=Me,Me.data.push(this)),io||yn.wake()}var t=r.prototype;return t.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},t.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},t.totalDuration=function(n){return arguments.length?(this._dirty=0,es(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,i){if(ns(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(na(this,n),!s._dp||s.parent||Kh(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&ai(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===ge||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Yh(this,n,i)),this},t.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+Fh(this))%(this._dur+this._rDelay)||(n?this._dur:0),i):this._time},t.totalProgress=function(n,i){return arguments.length?this.totalTime(this.totalDuration()*n,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(n,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+Fh(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(n,i){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*s,i):this._repeat?ts(this._tTime,s)+1:1},t.timeScale=function(n,i){if(!arguments.length)return this._rts===-ge?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?$o(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-ge?0:this._rts,this.totalTime(so(-Math.abs(this._delay),this._tDur,s),i!==!1),ea(this),tg(this)},t.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(ns(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==ge&&(this._tTime-=ge)))),this):this._ps},t.startTime=function(n){if(arguments.length){this._start=n;var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&ai(i,this,n-this._delay),this}return this._start},t.endTime=function(n){return this._start+(Mn(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(n){var i=this.parent||this._dp;return i?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?$o(i.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=$m);var i=Ke;return Ke=n,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),Ke=i,this},t.globalTime=function(n){for(var i=this,s=arguments.length?n:i.rawTime();i;)s=i._start+s/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(n):s},t.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,Nh(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,Nh(this),i?this.time(i):this}return this._rDelay},t.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},t.seek=function(n,i){return this.totalTime(Nn(this,n),Mn(i))},t.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,Mn(i))},t.play=function(n,i){return n!=null&&this.seek(n,i),this.reversed(!1).paused(!1)},t.reverse=function(n,i){return n!=null&&this.seek(n||this.totalDuration(),i),this.reversed(!0).paused(!1)},t.pause=function(n,i){return n!=null&&this.seek(n,i),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-ge:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-ge,this},t.isActive=function(){var n=this.parent||this._dp,i=this._start,s;return!!(!n||this._ts&&this._initted&&n.isActive()&&(s=n.rawTime(!0))>=i&&s<this.endTime(!0)-ge)},t.eventCallback=function(n,i,s){var o=this.vars;return arguments.length>1?(i?(o[n]=i,s&&(o[n+"Params"]=s),n==="onUpdate"&&(this._onUpdate=i)):delete o[n],this):o[n]},t.then=function(n){var i=this;return new Promise(function(s){var o=Ae(n)?n:Jh,a=function(){var c=i.then;i.then=null,Ae(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=c),s(o),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?a():i._prom=a})},t.kill=function(){$s(this)},r}();Bn(ro.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:-ge,_prom:0,_ps:!1,_rts:1});var qe=function(r){zh(t,r);function t(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=Mn(n.sortChildren),we&&ai(n.parent||we,_i(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&Qh(_i(s),n.scrollTrigger),s}var e=t.prototype;return e.to=function(i,s,o){return js(0,arguments,this),this},e.from=function(i,s,o){return js(1,arguments,this),this},e.fromTo=function(i,s,o,a){return js(2,arguments,this),this},e.set=function(i,s,o){return s.duration=0,s.parent=this,Qs(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Re(i,s,Nn(this,o),1),this},e.call=function(i,s,o){return ai(this,Re.delayedCall(0,i,s),o)},e.staggerTo=function(i,s,o,a,l,c,u){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=c,o.onCompleteParams=u,o.parent=this,new Re(i,o,Nn(this,l)),this},e.staggerFrom=function(i,s,o,a,l,c,u){return o.runBackwards=1,Qs(o).immediateRender=Mn(o.immediateRender),this.staggerTo(i,s,o,a,l,c,u)},e.staggerFromTo=function(i,s,o,a,l,c,u,h){return a.startAt=o,Qs(a).immediateRender=Mn(a.immediateRender),this.staggerTo(i,s,a,l,c,u,h)},e.render=function(i,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,u=i<=0?0:Ve(i),h=this._zTime<0!=i<0&&(this._initted||!c),f,d,_,g,p,m,S,v,M,D,T,E;if(this!==we&&u>l&&i>=0&&(u=l),u!==this._tTime||o||h){if(a!==this._time&&c&&(u+=this._time-a,i+=this._time-a),f=u,M=this._start,v=this._ts,m=!v,h&&(c||(a=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(T=this._yoyo,p=c+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(p*100+i,s,o);if(f=Ve(u%p),u===l?(g=this._repeat,f=c):(g=~~(u/p),g&&g===u/p&&(f=c,g--),f>c&&(f=c)),D=ts(this._tTime,p),!a&&this._tTime&&D!==g&&this._tTime-D*p-this._dur<=0&&(D=g),T&&g&1&&(f=c-f,E=1),g!==D&&!this._lock){var R=T&&D&1,y=R===(T&&g&1);if(g<D&&(R=!R),a=R?0:u%c?c:u,this._lock=1,this.render(a||(E?0:Ve(g*p)),s,!c)._lock=0,this._tTime=u,!s&&this.parent&&An(this,"onRepeat"),this.vars.repeatRefresh&&!E&&(this.invalidate()._lock=1),a&&a!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,y&&(this._lock=2,a=R?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!E&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;df(this,E)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(S=rg(this,Ve(a),Ve(f)),S&&(u-=f-(f=S._start))),this._tTime=u,this._time=f,this._act=!v,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,a=0),!a&&f&&!s&&!g&&(An(this,"onStart"),this._tTime!==u))return this;if(f>=a&&i>=0)for(d=this._first;d;){if(_=d._next,(d._act||f>=d._start)&&d._ts&&S!==d){if(d.parent!==this)return this.render(i,s,o);if(d.render(d._ts>0?(f-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(f-d._start)*d._ts,s,o),f!==this._time||!this._ts&&!m){S=0,_&&(u+=this._zTime=-ge);break}}d=_}else{d=this._last;for(var x=i<0?i:f;d;){if(_=d._prev,(d._act||x<=d._end)&&d._ts&&S!==d){if(d.parent!==this)return this.render(i,s,o);if(d.render(d._ts>0?(x-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(x-d._start)*d._ts,s,o||Ke&&(d._initted||d._startAt)),f!==this._time||!this._ts&&!m){S=0,_&&(u+=this._zTime=x?-ge:ge);break}}d=_}}if(S&&!s&&(this.pause(),S.render(f>=a?0:-ge)._zTime=f>=a?1:-1,this._ts))return this._start=M,ea(this),this.render(i,s,o);this._onUpdate&&!s&&An(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&a)&&(M===this._start||Math.abs(v)!==Math.abs(this._ts))&&(this._lock||((i||!c)&&(u===l&&this._ts>0||!u&&this._ts<0)&&Hi(this,1),!s&&!(i<0&&!a)&&(u||a||!l)&&(An(this,u===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(i,s){var o=this;if(vi(s)||(s=Nn(this,s,i)),!(i instanceof ro)){if(Qe(i))return i.forEach(function(a){return o.add(a,s)}),this;if(Ue(i))return this.addLabel(i,s);if(Ae(i))i=Re.delayedCall(0,i);else return this}return this!==i?ai(this,i,s):this},e.getChildren=function(i,s,o,a){i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=!0),a===void 0&&(a=-Un);for(var l=[],c=this._first;c;)c._start>=a&&(c instanceof Re?s&&l.push(c):(o&&l.push(c),i&&l.push.apply(l,c.getChildren(!0,s,o)))),c=c._next;return l},e.getById=function(i){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===i)return s[o]},e.remove=function(i){return Ue(i)?this.removeLabel(i):Ae(i)?this.killTweensOf(i):(ta(this,i),i===this._recent&&(this._recent=this._last),pr(this))},e.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ve(yn.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),r.prototype.totalTime.call(this,i,s),this._forcing=0,this):this._tTime},e.addLabel=function(i,s){return this.labels[i]=Nn(this,s),this},e.removeLabel=function(i){return delete this.labels[i],this},e.addPause=function(i,s,o){var a=Re.delayedCall(0,s||no,o);return a.data="isPause",this._hasPause=1,ai(this,a,Nn(this,i))},e.removePause=function(i){var s=this._first;for(i=Nn(this,i);s;)s._start===i&&s.data==="isPause"&&Hi(s),s=s._next},e.killTweensOf=function(i,s,o){for(var a=this.getTweensOf(i,o),l=a.length;l--;)zi!==a[l]&&a[l].kill(i,s);return this},e.getTweensOf=function(i,s){for(var o=[],a=On(i),l=this._first,c=vi(s),u;l;)l instanceof Re?Km(l._targets,a)&&(c?(!zi||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&o.push(l):(u=l.getTweensOf(a,s)).length&&o.push.apply(o,u),l=l._next;return o},e.tweenTo=function(i,s){s=s||{};var o=this,a=Nn(o,i),l=s,c=l.startAt,u=l.onStart,h=l.onStartParams,f=l.immediateRender,d,_=Re.to(o,Bn({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale())||ge,onStart:function(){if(o.pause(),!d){var p=s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());_._dur!==p&&es(_,p,0,1).render(_._time,!0,!0),d=1}u&&u.apply(_,h||[])}},s));return f?_.render(0):_},e.tweenFromTo=function(i,s,o){return this.tweenTo(s,Bn({startAt:{time:Nn(this,i)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(i){return i===void 0&&(i=this._time),Uh(this,Nn(this,i))},e.previousLabel=function(i){return i===void 0&&(i=this._time),Uh(this,Nn(this,i),1)},e.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+ge)},e.shiftChildren=function(i,s,o){o===void 0&&(o=0);for(var a=this._first,l=this.labels,c;a;)a._start>=o&&(a._start+=i,a._end+=i),a=a._next;if(s)for(c in l)l[c]>=o&&(l[c]+=i);return pr(this)},e.invalidate=function(i){var s=this._first;for(this._lock=0;s;)s.invalidate(i),s=s._next;return r.prototype.invalidate.call(this,i)},e.clear=function(i){i===void 0&&(i=!0);for(var s=this._first,o;s;)o=s._next,this.remove(s),s=o;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),pr(this)},e.totalDuration=function(i){var s=0,o=this,a=o._last,l=Un,c,u,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));if(o._dirty){for(h=o.parent;a;)c=a._prev,a._dirty&&a.totalDuration(),u=a._start,u>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,ai(o,a,u-a._delay,1)._lock=0):l=u,u<0&&a._ts&&(s-=u,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=u/o._ts,o._time-=u,o._tTime-=u),o.shiftChildren(-u,!1,-1/0),l=0),a._end>s&&a._ts&&(s=a._end),a=c;es(o,o===we&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(i){if(we._ts&&(Yh(we,$o(i,we)),qh=yn.frame),yn.frame>=Ih){Ih+=Sn.autoSleep||120;var s=we._first;if((!s||!s._ts)&&Sn.autoSleep&&yn._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||yn.sleep()}}},t}(ro);Bn(qe.prototype,{_lock:0,_hasPause:0,_forcing:0});var yg=function(t,e,n,i,s,o,a){var l=new cn(this._pt,t,e,0,1,_c,null,s),c=0,u=0,h,f,d,_,g,p,m,S;for(l.b=n,l.e=i,n+="",i+="",(m=~i.indexOf("random("))&&(i=is(i)),o&&(S=[n,i],o(S,t,e),n=S[0],i=S[1]),f=n.match(Bl)||[];h=Bl.exec(i);)_=h[0],g=i.substring(c,h.index),d?d=(d+1)%5:g.substr(-5)==="rgba("&&(d=1),_!==f[u++]&&(p=parseFloat(f[u-1])||0,l._pt={_next:l._pt,p:g||u===1?g:",",s:p,c:_.charAt(1)==="="?vr(p,_)-p:parseFloat(_)-p,m:d&&d<4?Math.round:0},c=Bl.lastIndex);return l.c=c<i.length?i.substring(c,i.length):"",l.fp=a,(sc.test(i)||m)&&(l.e=0),this._pt=l,l},dc=function(t,e,n,i,s,o,a,l,c,u){Ae(i)&&(i=i(s||0,t,o));var h=t[e],f=n!=="get"?n:Ae(h)?c?t[e.indexOf("set")||!Ae(t["get"+e.substr(3)])?e:"get"+e.substr(3)](c):t[e]():h,d=Ae(h)?c?Eg:_f:gc,_;if(Ue(i)&&(~i.indexOf("random(")&&(i=is(i)),i.charAt(1)==="="&&(_=vr(f,i)+(Ye(f)||0),(_||_===0)&&(i=_))),!u||f!==i||tc)return!isNaN(f*i)&&i!==""?(_=new cn(this._pt,t,e,+f||0,i-(f||0),typeof h=="boolean"?Ag:xf,0,d),c&&(_.fp=c),a&&_.modifier(a,this,t),this._pt=_):(!h&&!(e in t)&&jo(e,i),yg.call(this,t,e,f,i,d,l||Sn.stringFilter,c))},Mg=function(t,e,n,i,s){if(Ae(t)&&(t=to(t,s,e,n,i)),!li(t)||t.style&&t.nodeType||Qe(t)||Vh(t))return Ue(t)?to(t,s,e,n,i):t;var o={},a;for(a in t)o[a]=to(t[a],s,e,n,i);return o},pc=function(t,e,n,i,s,o){var a,l,c,u;if(vn[t]&&(a=new vn[t]).init(s,a.rawVars?e[t]:Mg(e[t],i,s,o,n),n,i,o)!==!1&&(n._pt=l=new cn(n._pt,s,t,0,1,a.render,a,0,a.priority),n!==Qr))for(c=n._ptLookup[n._targets.indexOf(s)],u=a._props.length;u--;)c[a._props[u]]=l;return a},zi,tc,mc=function r(t,e,n){var i=t.vars,s=i.ease,o=i.startAt,a=i.immediateRender,l=i.lazy,c=i.onUpdate,u=i.runBackwards,h=i.yoyoEase,f=i.keyframes,d=i.autoRevert,_=t._dur,g=t._startAt,p=t._targets,m=t.parent,S=m&&m.data==="nested"?m.vars.targets:p,v=t._overwrite==="auto"&&!nc,M=t.timeline,D,T,E,R,y,x,L,F,P,B,X,G,J;if(M&&(!f||!s)&&(s="none"),t._ease=mr(s,jr.ease),t._yEase=h?ff(mr(h===!0?s:h,jr.ease)):0,h&&t._yoyo&&!t._repeat&&(h=t._yEase,t._yEase=t._ease,t._ease=h),t._from=!M&&!!i.runBackwards,!M||f&&!i.stagger){if(F=p[0]?Vi(p[0]).harness:0,G=F&&i[F.prop],D=Jo(i,ac),g&&(g._zTime<0&&g.progress(1),e<0&&u&&a&&!d?g.render(-1,!0):g.revert(u&&_?Wo:Jm),g._lazy=0),o){if(Hi(t._startAt=Re.set(p,Bn({data:"isStart",overwrite:!1,parent:m,immediateRender:!0,lazy:!g&&Mn(l),startAt:null,delay:0,onUpdate:c&&function(){return An(t,"onUpdate")},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(Ke||!a&&!d)&&t._startAt.revert(Wo),a&&_&&e<=0&&n<=0){e&&(t._zTime=e);return}}else if(u&&_&&!g){if(e&&(a=!1),E=Bn({overwrite:!1,data:"isFromStart",lazy:a&&!g&&Mn(l),immediateRender:a,stagger:0,parent:m},D),G&&(E[F.prop]=G),Hi(t._startAt=Re.set(p,E)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(Ke?t._startAt.revert(Wo):t._startAt.render(-1,!0)),t._zTime=e,!a)r(t._startAt,ge,ge);else if(!e)return}for(t._pt=t._ptCache=0,l=_&&Mn(l)||l&&!_,T=0;T<p.length;T++){if(y=p[T],L=y._gsap||cc(p)[T]._gsap,t._ptLookup[T]=B={},Zl[L.id]&&ki.length&&Zo(),X=S===p?T:S.indexOf(y),F&&(P=new F).init(y,G||D,t,X,S)!==!1&&(t._pt=R=new cn(t._pt,y,P.name,0,1,P.render,P,0,P.priority),P._props.forEach(function(U){B[U]=R}),P.priority&&(x=1)),!F||G)for(E in D)vn[E]&&(P=pc(E,D,t,X,y,S))?P.priority&&(x=1):B[E]=R=dc.call(t,y,E,"get",D[E],X,S,0,i.stringFilter);t._op&&t._op[T]&&t.kill(y,t._op[T]),v&&t._pt&&(zi=t,we.killTweensOf(y,B,t.globalTime(e)),J=!t.parent,zi=0),t._pt&&l&&(Zl[L.id]=1)}x&&vc(t),t._onInit&&t._onInit(t)}t._onUpdate=c,t._initted=(!t._op||t._pt)&&!J,f&&e<=0&&M.render(Un,!0,!0)},Sg=function(t,e,n,i,s,o,a,l){var c=(t._pt&&t._ptCache||(t._ptCache={}))[e],u,h,f,d;if(!c)for(c=t._ptCache[e]=[],f=t._ptLookup,d=t._targets.length;d--;){if(u=f[d][e],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return tc=1,t.vars[e]="+=0",mc(t,a),tc=0,l?eo(e+" not eligible for reset"):1;c.push(u)}for(d=c.length;d--;)h=c[d],u=h._pt||h,u.s=(i||i===0)&&!s?i:u.s+(i||0)+o*u.c,u.c=n-u.s,h.e&&(h.e=De(n)+Ye(h.e)),h.b&&(h.b=u.s+Ye(h.b))},bg=function(t,e){var n=t[0]?Vi(t[0]).harness:0,i=n&&n.aliases,s,o,a,l;if(!i)return e;s=_r({},e);for(o in i)if(o in s)for(l=i[o].split(","),a=l.length;a--;)s[l[a]]=s[o];return s},wg=function(t,e,n,i){var s=e.ease||i||"power1.inOut",o,a;if(Qe(e))a=n[t]||(n[t]=[]),e.forEach(function(l,c){return a.push({t:c/(e.length-1)*100,v:l,e:s})});else for(o in e)a=n[o]||(n[o]=[]),o==="ease"||a.push({t:parseFloat(t),v:e[o],e:s})},to=function(t,e,n,i,s){return Ae(t)?t.call(e,n,i,s):Ue(t)&&~t.indexOf("random(")?is(t):t},mf=lc+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",gf={};ln(mf+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return gf[r]=1});var Re=function(r){zh(t,r);function t(n,i,s,o){var a;typeof i=="number"&&(s.duration=i,i=s,s=null),a=r.call(this,o?i:Qs(i))||this;var l=a.vars,c=l.duration,u=l.delay,h=l.immediateRender,f=l.stagger,d=l.overwrite,_=l.keyframes,g=l.defaults,p=l.scrollTrigger,m=l.yoyoEase,S=i.parent||we,v=(Qe(n)||Vh(n)?vi(n[0]):"length"in i)?[n]:On(n),M,D,T,E,R,y,x,L;if(a._targets=v.length?cc(v):eo("GSAP target "+n+" not found. https://gsap.com",!Sn.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=d,_||f||Go(c)||Go(u)){if(i=a.vars,M=a.timeline=new qe({data:"nested",defaults:g||{},targets:S&&S.data==="nested"?S.vars.targets:v}),M.kill(),M.parent=M._dp=_i(a),M._start=0,f||Go(c)||Go(u)){if(E=v.length,x=f&&nf(f),li(f))for(R in f)~mf.indexOf(R)&&(L||(L={}),L[R]=f[R]);for(D=0;D<E;D++)T=Jo(i,gf),T.stagger=0,m&&(T.yoyoEase=m),L&&_r(T,L),y=v[D],T.duration=+to(c,_i(a),D,y,v),T.delay=(+to(u,_i(a),D,y,v)||0)-a._delay,!f&&E===1&&T.delay&&(a._delay=u=T.delay,a._start+=u,T.delay=0),M.to(y,T,x?x(D,y,v):0),M._ease=ee.none;M.duration()?c=u=0:a.timeline=0}else if(_){Qs(Bn(M.vars.defaults,{ease:"none"})),M._ease=mr(_.ease||i.ease||"none");var F=0,P,B,X;if(Qe(_))_.forEach(function(G){return M.to(v,G,">")}),M.duration();else{T={};for(R in _)R==="ease"||R==="easeEach"||wg(R,_[R],T,_.easeEach);for(R in T)for(P=T[R].sort(function(G,J){return G.t-J.t}),F=0,D=0;D<P.length;D++)B=P[D],X={ease:B.e,duration:(B.t-(D?P[D-1].t:0))/100*c},X[R]=B.v,M.to(v,X,F),F+=X.duration;M.duration()<c&&M.to({},{duration:c-M.duration()})}}c||a.duration(c=M.duration())}else a.timeline=0;return d===!0&&!nc&&(zi=_i(a),we.killTweensOf(v),zi=0),ai(S,_i(a),s),i.reversed&&a.reverse(),i.paused&&a.paused(!0),(h||!c&&!_&&a._start===Ve(S._time)&&Mn(h)&&eg(_i(a))&&S.data!=="nested")&&(a._tTime=-ge,a.render(Math.max(0,-u)||0)),p&&Qh(_i(a),p),a}var e=t.prototype;return e.render=function(i,s,o){var a=this._time,l=this._tDur,c=this._dur,u=i<0,h=i>l-ge&&!u?l:i<ge?0:i,f,d,_,g,p,m,S,v,M;if(!c)ig(this,i,s,o);else if(h!==this._tTime||!i||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(f=h,v=this.timeline,this._repeat){if(g=c+this._rDelay,this._repeat<-1&&u)return this.totalTime(g*100+i,s,o);if(f=Ve(h%g),h===l?(_=this._repeat,f=c):(_=~~(h/g),_&&_===Ve(h/g)&&(f=c,_--),f>c&&(f=c)),m=this._yoyo&&_&1,m&&(M=this._yEase,f=c-f),p=ts(this._tTime,g),f===a&&!o&&this._initted&&_===p)return this._tTime=h,this;_!==p&&(v&&this._yEase&&df(v,m),this.vars.repeatRefresh&&!m&&!this._lock&&this._time!==g&&this._initted&&(this._lock=o=1,this.render(Ve(g*_),!0).invalidate()._lock=0))}if(!this._initted){if(jh(this,u?i:f,o,s,h))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&_!==p))return this;if(c!==this._dur)return this.render(i,s,o)}if(this._tTime=h,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=S=(M||this._ease)(f/c),this._from&&(this.ratio=S=1-S),f&&!a&&!s&&!_&&(An(this,"onStart"),this._tTime!==h))return this;for(d=this._pt;d;)d.r(S,d.d),d=d._next;v&&v.render(i<0?i:v._dur*v._ease(f/this._dur),s,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(u&&Jl(this,i,s,o),An(this,"onUpdate")),this._repeat&&_!==p&&this.vars.onRepeat&&!s&&this.parent&&An(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&Jl(this,i,!0,!0),(i||!c)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Hi(this,1),!s&&!(u&&!a)&&(h||a||m)&&(An(this,h===l?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),r.prototype.invalidate.call(this,i)},e.resetTo=function(i,s,o,a,l){io||yn.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||mc(this,c),u=this._ease(c/this._dur),Sg(this,i,s,o,a,u,c,l)?this.resetTo(i,s,o,a,1):(na(this,0),this.parent||$h(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(i,s){if(s===void 0&&(s="all"),!i&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?$s(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,s,zi&&zi.vars.overwrite!==!0)._first||$s(this),this.parent&&o!==this.timeline.totalDuration()&&es(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=i?On(i):a,c=this._ptLookup,u=this._pt,h,f,d,_,g,p,m;if((!s||s==="all")&&jm(a,l))return s==="all"&&(this._pt=0),$s(this);for(h=this._op=this._op||[],s!=="all"&&(Ue(s)&&(g={},ln(s,function(S){return g[S]=1}),s=g),s=bg(a,s)),m=a.length;m--;)if(~l.indexOf(a[m])){f=c[m],s==="all"?(h[m]=s,_=f,d={}):(d=h[m]=h[m]||{},_=s);for(g in _)p=f&&f[g],p&&((!("kill"in p.d)||p.d.kill(g)===!0)&&ta(this,p,"_pt"),delete f[g]),d!=="all"&&(d[g]=1)}return this._initted&&!this._pt&&u&&$s(this),this},t.to=function(i,s){return new t(i,s,arguments[2])},t.from=function(i,s){return js(1,arguments)},t.delayedCall=function(i,s,o,a){return new t(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(i,s,o){return js(2,arguments)},t.set=function(i,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new t(i,s)},t.killTweensOf=function(i,s,o){return we.killTweensOf(i,s,o)},t}(ro);Bn(Re.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ln("staggerTo,staggerFrom,staggerFromTo",function(r){Re[r]=function(){var t=new qe,e=Kl.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var gc=function(t,e,n){return t[e]=n},_f=function(t,e,n){return t[e](n)},Eg=function(t,e,n,i){return t[e](i.fp,n)},Tg=function(t,e,n){return t.setAttribute(e,n)},ia=function(t,e){return Ae(t[e])?_f:Qo(t[e])&&t.setAttribute?Tg:gc},xf=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},Ag=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},_c=function(t,e){var n=e._pt,i="";if(!t&&e.b)i=e.b;else if(t===1&&e.e)i=e.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*t):Math.round((n.s+n.c*t)*1e4)/1e4)+i,n=n._next;i+=e.c}e.set(e.t,e.p,i,e)},xc=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},Dg=function(t,e,n,i){for(var s=this._pt,o;s;)o=s._next,s.p===i&&s.modifier(t,e,n),s=o},Cg=function(t){for(var e=this._pt,n,i;e;)i=e._next,e.p===t&&!e.op||e.op===t?ta(this,e,"_pt"):e.dep||(n=1),e=i;return!n},Rg=function(t,e,n,i){i.mSet(t,e,i.m.call(i.tween,n,i.mt),i)},vc=function(t){for(var e=t._pt,n,i,s,o;e;){for(n=e._next,i=s;i&&i.pr>e.pr;)i=i._next;(e._prev=i?i._prev:o)?e._prev._next=e:s=e,(e._next=i)?i._prev=e:o=e,e=n}t._pt=s},cn=function(){function r(e,n,i,s,o,a,l,c,u){this.t=n,this.s=s,this.c=o,this.p=i,this.r=a||xf,this.d=l||this,this.set=c||gc,this.pr=u||0,this._next=e,e&&(e._prev=this)}var t=r.prototype;return t.modifier=function(n,i,s){this.mSet=this.mSet||this.set,this.set=Rg,this.m=n,this.mt=s,this.tween=i},r}();ln(lc+"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(r){return ac[r]=1});Dn.TweenMax=Dn.TweenLite=Re;Dn.TimelineLite=Dn.TimelineMax=qe;we=new qe({sortChildren:!1,defaults:jr,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Sn.stringFilter=hc;var gr=[],qo={},Pg=[],Bh=0,Ig=0,Gl=function(t){return(qo[t]||Pg).map(function(e){return e()})},ec=function(){var t=Date.now(),e=[];t-Bh>2&&(Gl("matchMediaInit"),gr.forEach(function(n){var i=n.queries,s=n.conditions,o,a,l,c;for(a in i)o=oi.matchMedia(i[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,c=1);c&&(n.revert(),l&&e.push(n))}),Gl("matchMediaRevert"),e.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),Bh=t,Gl("matchMedia"))},vf=function(){function r(e,n){this.selector=n&&Ql(n),this.data=[],this._r=[],this.isReverted=!1,this.id=Ig++,e&&this.add(e)}var t=r.prototype;return t.add=function(n,i,s){Ae(n)&&(s=i,i=n,n=Ae);var o=this,a=function(){var c=Me,u=o.selector,h;return c&&c!==o&&c.data.push(o),s&&(o.selector=Ql(s)),Me=o,h=i.apply(o,arguments),Ae(h)&&o._r.push(h),Me=c,o.selector=u,o.isReverted=!1,h};return o.last=a,n===Ae?a(o,function(l){return o.add(null,l)}):n?o[n]=a:a},t.ignore=function(n){var i=Me;Me=null,n(this),Me=i},t.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof Re&&!(i.parent&&i.parent.data==="nested")&&n.push(i)}),n},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(n,i){var s=this;if(n?function(){for(var a=s.getTweens(),l=s.data.length,c;l--;)c=s.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}));for(a.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,h){return h.g-u.g||-1/0}).forEach(function(u){return u.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof qe?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof Re)&&c.revert&&c.revert(n);s._r.forEach(function(u){return u(n,s)}),s.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),i)for(var o=gr.length;o--;)gr[o].id===this.id&&gr.splice(o,1)},t.revert=function(n){this.kill(n||{})},r}(),Lg=function(){function r(e){this.contexts=[],this.scope=e,Me&&Me.data.push(this)}var t=r.prototype;return t.add=function(n,i,s){li(n)||(n={matches:n});var o=new vf(0,s||this.scope),a=o.conditions={},l,c,u;Me&&!o.selector&&(o.selector=Me.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=n;for(c in n)c==="all"?u=1:(l=oi.matchMedia(n[c]),l&&(gr.indexOf(o)<0&&gr.push(o),(a[c]=l.matches)&&(u=1),l.addListener?l.addListener(ec):l.addEventListener("change",ec)));return u&&i(o,function(h){return o.add(null,h)}),this},t.revert=function(n){this.kill(n||{})},t.kill=function(n){this.contexts.forEach(function(i){return i.kill(n,!0)})},r}(),Ko={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(i){return cf(i)})},timeline:function(t){return new qe(t)},getTweensOf:function(t,e){return we.getTweensOf(t,e)},getProperty:function(t,e,n,i){Ue(t)&&(t=On(t)[0]);var s=Vi(t||{}).get,o=n?Jh:Zh;return n==="native"&&(n=""),t&&(e?o((vn[e]&&vn[e].get||s)(t,e,n,i)):function(a,l,c){return o((vn[a]&&vn[a].get||s)(t,a,l,c))})},quickSetter:function(t,e,n){if(t=On(t),t.length>1){var i=t.map(function(u){return je.quickSetter(u,e,n)}),s=i.length;return function(u){for(var h=s;h--;)i[h](u)}}t=t[0]||{};var o=vn[e],a=Vi(t),l=a.harness&&(a.harness.aliases||{})[e]||e,c=o?function(u){var h=new o;Qr._pt=0,h.init(t,n?u+n:u,Qr,0,[t]),h.render(1,h),Qr._pt&&xc(1,Qr)}:a.set(t,l);return o?c:function(u){return c(t,l,n?u+n:u,a,1)}},quickTo:function(t,e,n){var i,s=je.to(t,_r((i={},i[e]="+=0.1",i.paused=!0,i),n||{})),o=function(l,c,u){return s.resetTo(e,l,c,u)};return o.tween=s,o},isTweening:function(t){return we.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=mr(t.ease,jr.ease)),Lh(jr,t||{})},config:function(t){return Lh(Sn,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,i=t.plugins,s=t.defaults,o=t.extendTimeline;(i||"").split(",").forEach(function(a){return a&&!vn[a]&&!Dn[a]&&eo(e+" effect requires "+a+" plugin.")}),zl[e]=function(a,l,c){return n(On(a),Bn(l||{},s),c)},o&&(qe.prototype[e]=function(a,l,c){return this.add(zl[e](a,li(l)?l:(c=l)&&{},this),c)})},registerEase:function(t,e){ee[t]=mr(e)},parseEase:function(t,e){return arguments.length?mr(t,e):ee},getById:function(t){return we.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var n=new qe(t),i,s;for(n.smoothChildTiming=Mn(t.smoothChildTiming),we.remove(n),n._dp=0,n._time=n._tTime=we._time,i=we._first;i;)s=i._next,(e||!(!i._dur&&i instanceof Re&&i.vars.onComplete===i._targets[0]))&&ai(n,i,i._start-i._delay),i=s;return ai(we,n,0),n},context:function(t,e){return t?new vf(t,e):Me},matchMedia:function(t){return new Lg(t)},matchMediaRefresh:function(){return gr.forEach(function(t){var e=t.conditions,n,i;for(i in e)e[i]&&(e[i]=!1,n=1);n&&t.revert()})||ec()},addEventListener:function(t,e){var n=qo[t]||(qo[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=qo[t],i=n&&n.indexOf(e);i>=0&&n.splice(i,1)},utils:{wrap:hg,wrapYoyo:fg,distribute:nf,random:sf,snap:rf,normalize:ug,getUnit:Ye,clamp:og,splitColor:uf,toArray:On,selector:Ql,mapRange:af,pipe:lg,unitize:cg,interpolate:dg,shuffle:ef},install:Wh,effects:zl,ticker:yn,updateRoot:qe.updateRoot,plugins:vn,globalTimeline:we,core:{PropTween:cn,globals:Xh,Tween:Re,Timeline:qe,Animation:ro,getCache:Vi,_removeLinkedListItem:ta,reverting:function(){return Ke},context:function(t){return t&&Me&&(Me.data.push(t),t._ctx=Me),Me},suppressOverwrites:function(t){return nc=t}}};ln("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return Ko[r]=Re[r]});yn.add(qe.updateRoot);Qr=Ko.to({},{duration:0});var Fg=function(t,e){for(var n=t._pt;n&&n.p!==e&&n.op!==e&&n.fp!==e;)n=n._next;return n},Ng=function(t,e){var n=t._targets,i,s,o;for(i in e)for(s=n.length;s--;)o=t._ptLookup[s][i],o&&(o=o.d)&&(o._pt&&(o=Fg(o,i)),o&&o.modifier&&o.modifier(e[i],t,n[s],i))},Wl=function(t,e){return{name:t,rawVars:1,init:function(i,s,o){o._onInit=function(a){var l,c;if(Ue(s)&&(l={},ln(s,function(u){return l[u]=1}),s=l),e){l={};for(c in s)l[c]=e(s[c]);s=l}Ng(a,s)}}}},je=Ko.registerPlugin({name:"attr",init:function(t,e,n,i,s){var o,a,l;this.tween=n;for(o in e)l=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(l||0)+"",e[o],i,s,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(t,e){for(var n=e._pt;n;)Ke?n.set(n.t,n.p,n.b,n):n.r(t,n.d),n=n._next}},{name:"endArray",init:function(t,e){for(var n=e.length;n--;)this.add(t,n,t[n]||0,e[n],0,0,0,0,0,1)}},Wl("roundProps",jl),Wl("modifiers"),Wl("snap",rf))||Ko;Re.version=qe.version=je.version="3.12.5";Gh=1;ic()&&ns();var Ug=ee.Power0,Og=ee.Power1,Bg=ee.Power2,zg=ee.Power3,kg=ee.Power4,Vg=ee.Linear,Hg=ee.Quad,Gg=ee.Cubic,Wg=ee.Quart,Xg=ee.Quint,qg=ee.Strong,Yg=ee.Elastic,Zg=ee.Back,Jg=ee.SteppedEase,$g=ee.Bounce,Kg=ee.Sine,Qg=ee.Expo,jg=ee.Circ;var yf,Wi,ss,Tc,wr,t_,Mf,Ac,e_=function(){return typeof window<"u"},Mi={},br=180/Math.PI,os=Math.PI/180,rs=Math.atan2,Sf=1e8,Dc=/([A-Z])/g,n_=/(left|right|width|margin|padding|x)/i,i_=/[\s,\(]\S/,ci={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Sc=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},r_=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},s_=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},o_=function(t,e){var n=e.s+e.c*t;e.set(e.t,e.p,~~(n+(n<0?-.5:.5))+e.u,e)},Cf=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Rf=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},a_=function(t,e,n){return t.style[e]=n},l_=function(t,e,n){return t.style.setProperty(e,n)},c_=function(t,e,n){return t._gsap[e]=n},u_=function(t,e,n){return t._gsap.scaleX=t._gsap.scaleY=n},h_=function(t,e,n,i,s){var o=t._gsap;o.scaleX=o.scaleY=n,o.renderTransform(s,o)},f_=function(t,e,n,i,s){var o=t._gsap;o[e]=n,o.renderTransform(s,o)},Ee="transform",bn=Ee+"Origin",d_=function r(t,e){var n=this,i=this.target,s=i.style,o=i._gsap;if(t in Mi&&s){if(this.tfm=this.tfm||{},t!=="transform")t=ci[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return n.tfm[a]=yi(i,a)}):this.tfm[t]=o.x?o[t]:yi(i,t),t===bn&&(this.tfm.zOrigin=o.zOrigin);else return ci.transform.split(",").forEach(function(a){return r.call(n,a,e)});if(this.props.indexOf(Ee)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(bn,e,"")),t=Ee}(s||e)&&this.props.push(t,e,s[t])},Pf=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},p_=function(){var t=this.props,e=this.target,n=e.style,i=e._gsap,s,o;for(s=0;s<t.length;s+=3)t[s+1]?e[t[s]]=t[s+2]:t[s+2]?n[t[s]]=t[s+2]:n.removeProperty(t[s].substr(0,2)==="--"?t[s]:t[s].replace(Dc,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)i[o]=this.tfm[o];i.svg&&(i.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),s=Ac(),(!s||!s.isStart)&&!n[Ee]&&(Pf(n),i.zOrigin&&n[bn]&&(n[bn]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},If=function(t,e){var n={target:t,props:[],revert:p_,save:d_};return t._gsap||je.core.getCache(t),e&&e.split(",").forEach(function(i){return n.save(i)}),n},Lf,bc=function(t,e){var n=Wi.createElementNS?Wi.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Wi.createElement(t);return n&&n.style?n:Wi.createElement(t)},ui=function r(t,e,n){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(Dc,"-$1").toLowerCase())||i.getPropertyValue(e)||!n&&r(t,as(e)||e,1)||""},bf="O,Moz,ms,Ms,Webkit".split(","),as=function(t,e,n){var i=e||wr,s=i.style,o=5;if(t in s&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(bf[o]+t in s););return o<0?null:(o===3?"ms":o>=0?bf[o]:"")+t},wc=function(){e_()&&window.document&&(yf=window,Wi=yf.document,ss=Wi.documentElement,wr=bc("div")||{style:{}},t_=bc("div"),Ee=as(Ee),bn=Ee+"Origin",wr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Lf=!!as("perspective"),Ac=je.core.reverting,Tc=1)},yc=function r(t){var e=bc("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(ss.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),ss.removeChild(e),this.style.cssText=s,o},wf=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},Ff=function(t){var e;try{e=t.getBBox()}catch{e=yc.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===yc||(e=yc.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+wf(t,["x","cx","x1"])||0,y:+wf(t,["y","cy","y1"])||0,width:0,height:0}:e},Nf=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&Ff(t))},Er=function(t,e){if(e){var n=t.style,i;e in Mi&&e!==bn&&(e=Ee),n.removeProperty?(i=e.substr(0,2),(i==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),n.removeProperty(i==="--"?e:e.replace(Dc,"-$1").toLowerCase())):n.removeAttribute(e)}},Xi=function(t,e,n,i,s,o){var a=new cn(t._pt,e,n,0,1,o?Rf:Cf);return t._pt=a,a.b=i,a.e=s,t._props.push(n),a},Ef={deg:1,rad:1,turn:1},m_={grid:1,flex:1},qi=function r(t,e,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",a=wr.style,l=n_.test(e),c=t.tagName.toLowerCase()==="svg",u=(c?"client":"offset")+(l?"Width":"Height"),h=100,f=i==="px",d=i==="%",_,g,p,m;if(i===o||!s||Ef[i]||Ef[o])return s;if(o!=="px"&&!f&&(s=r(t,e,n,"px")),m=t.getCTM&&Nf(t),(d||o==="%")&&(Mi[e]||~e.indexOf("adius")))return _=m?t.getBBox()[l?"width":"height"]:t[u],De(d?s/_*h:s/100*_);if(a[l?"width":"height"]=h+(f?o:i),g=~e.indexOf("adius")||i==="em"&&t.appendChild&&!c?t:t.parentNode,m&&(g=(t.ownerSVGElement||{}).parentNode),(!g||g===Wi||!g.appendChild)&&(g=Wi.body),p=g._gsap,p&&d&&p.width&&l&&p.time===yn.time&&!p.uncache)return De(s/p.width*h);if(d&&(e==="height"||e==="width")){var S=t.style[e];t.style[e]=h+i,_=t[u],S?t.style[e]=S:Er(t,e)}else(d||o==="%")&&!m_[ui(g,"display")]&&(a.position=ui(t,"position")),g===t&&(a.position="static"),g.appendChild(wr),_=wr[u],g.removeChild(wr),a.position="absolute";return l&&d&&(p=Vi(g),p.time=yn.time,p.width=g[u]),De(f?_*s/h:_&&s?h/_*s:0)},yi=function(t,e,n,i){var s;return Tc||wc(),e in ci&&e!=="transform"&&(e=ci[e],~e.indexOf(",")&&(e=e.split(",")[0])),Mi[e]&&e!=="transform"?(s=lo(t,i),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:sa(ui(t,bn))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=ra[e]&&ra[e](t,e,n)||ui(t,e)||uc(t,e)||(e==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?qi(t,e,s,n)+n:s},g_=function(t,e,n,i){if(!n||n==="none"){var s=as(e,t,1),o=s&&ui(t,s,1);o&&o!==n?(e=s,n=o):e==="borderColor"&&(n=ui(t,"borderTopColor"))}var a=new cn(this._pt,t.style,e,0,1,_c),l=0,c=0,u,h,f,d,_,g,p,m,S,v,M,D;if(a.b=n,a.e=i,n+="",i+="",i==="auto"&&(g=t.style[e],t.style[e]=i,i=ui(t,e)||i,g?t.style[e]=g:Er(t,e)),u=[n,i],hc(u),n=u[0],i=u[1],f=n.match(xr)||[],D=i.match(xr)||[],D.length){for(;h=xr.exec(i);)p=h[0],S=i.substring(l,h.index),_?_=(_+1)%5:(S.substr(-5)==="rgba("||S.substr(-5)==="hsla(")&&(_=1),p!==(g=f[c++]||"")&&(d=parseFloat(g)||0,M=g.substr((d+"").length),p.charAt(1)==="="&&(p=vr(d,p)+M),m=parseFloat(p),v=p.substr((m+"").length),l=xr.lastIndex-v.length,v||(v=v||Sn.units[e]||M,l===i.length&&(i+=v,a.e+=v)),M!==v&&(d=qi(t,e,g,v)||0),a._pt={_next:a._pt,p:S||c===1?S:",",s:d,c:m-d,m:_&&_<4||e==="zIndex"?Math.round:0});a.c=l<i.length?i.substring(l,i.length):""}else a.r=e==="display"&&i==="none"?Rf:Cf;return sc.test(i)&&(a.e=0),this._pt=a,a},Tf={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},__=function(t){var e=t.split(" "),n=e[0],i=e[1]||"50%";return(n==="top"||n==="bottom"||i==="left"||i==="right")&&(t=n,n=i,i=t),e[0]=Tf[n]||n,e[1]=Tf[i]||i,e.join(" ")},x_=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var n=e.t,i=n.style,s=e.u,o=n._gsap,a,l,c;if(s==="all"||s===!0)i.cssText="",l=1;else for(s=s.split(","),c=s.length;--c>-1;)a=s[c],Mi[a]&&(l=1,a=a==="transformOrigin"?bn:Ee),Er(n,a);l&&(Er(n,Ee),o&&(o.svg&&n.removeAttribute("transform"),lo(n,1),o.uncache=1,Pf(i)))}},ra={clearProps:function(t,e,n,i,s){if(s.data!=="isFromStart"){var o=t._pt=new cn(t._pt,e,n,0,0,x_);return o.u=i,o.pr=-10,o.tween=s,t._props.push(n),1}}},ao=[1,0,0,1,0,0],Uf={},Of=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Af=function(t){var e=ui(t,Ee);return Of(e)?ao:e.substr(7).match(rc).map(De)},Cc=function(t,e){var n=t._gsap||Vi(t),i=t.style,s=Af(t),o,a,l,c;return n.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?ao:s):(s===ao&&!t.offsetParent&&t!==ss&&!n.svg&&(l=i.display,i.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(c=1,a=t.nextElementSibling,ss.appendChild(t)),s=Af(t),l?i.display=l:Er(t,"display"),c&&(a?o.insertBefore(t,a):o?o.appendChild(t):ss.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Ec=function(t,e,n,i,s,o){var a=t._gsap,l=s||Cc(t,!0),c=a.xOrigin||0,u=a.yOrigin||0,h=a.xOffset||0,f=a.yOffset||0,d=l[0],_=l[1],g=l[2],p=l[3],m=l[4],S=l[5],v=e.split(" "),M=parseFloat(v[0])||0,D=parseFloat(v[1])||0,T,E,R,y;n?l!==ao&&(E=d*p-_*g)&&(R=M*(p/E)+D*(-g/E)+(g*S-p*m)/E,y=M*(-_/E)+D*(d/E)-(d*S-_*m)/E,M=R,D=y):(T=Ff(t),M=T.x+(~v[0].indexOf("%")?M/100*T.width:M),D=T.y+(~(v[1]||v[0]).indexOf("%")?D/100*T.height:D)),i||i!==!1&&a.smooth?(m=M-c,S=D-u,a.xOffset=h+(m*d+S*g)-m,a.yOffset=f+(m*_+S*p)-S):a.xOffset=a.yOffset=0,a.xOrigin=M,a.yOrigin=D,a.smooth=!!i,a.origin=e,a.originIsAbsolute=!!n,t.style[bn]="0px 0px",o&&(Xi(o,a,"xOrigin",c,M),Xi(o,a,"yOrigin",u,D),Xi(o,a,"xOffset",h,a.xOffset),Xi(o,a,"yOffset",f,a.yOffset)),t.setAttribute("data-svg-origin",M+" "+D)},lo=function(t,e){var n=t._gsap||new fc(t);if("x"in n&&!e&&!n.uncache)return n;var i=t.style,s=n.scaleX<0,o="px",a="deg",l=getComputedStyle(t),c=ui(t,bn)||"0",u,h,f,d,_,g,p,m,S,v,M,D,T,E,R,y,x,L,F,P,B,X,G,J,U,I,A,it,vt,Wt,q,Q;return u=h=f=g=p=m=S=v=M=0,d=_=1,n.svg=!!(t.getCTM&&Nf(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Ee]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Ee]!=="none"?l[Ee]:"")),i.scale=i.rotate=i.translate="none"),E=Cc(t,n.svg),n.svg&&(n.uncache?(U=t.getBBox(),c=n.xOrigin-U.x+"px "+(n.yOrigin-U.y)+"px",J=""):J=!e&&t.getAttribute("data-svg-origin"),Ec(t,J||c,!!J||n.originIsAbsolute,n.smooth!==!1,E)),D=n.xOrigin||0,T=n.yOrigin||0,E!==ao&&(L=E[0],F=E[1],P=E[2],B=E[3],u=X=E[4],h=G=E[5],E.length===6?(d=Math.sqrt(L*L+F*F),_=Math.sqrt(B*B+P*P),g=L||F?rs(F,L)*br:0,S=P||B?rs(P,B)*br+g:0,S&&(_*=Math.abs(Math.cos(S*os))),n.svg&&(u-=D-(D*L+T*P),h-=T-(D*F+T*B))):(Q=E[6],Wt=E[7],A=E[8],it=E[9],vt=E[10],q=E[11],u=E[12],h=E[13],f=E[14],R=rs(Q,vt),p=R*br,R&&(y=Math.cos(-R),x=Math.sin(-R),J=X*y+A*x,U=G*y+it*x,I=Q*y+vt*x,A=X*-x+A*y,it=G*-x+it*y,vt=Q*-x+vt*y,q=Wt*-x+q*y,X=J,G=U,Q=I),R=rs(-P,vt),m=R*br,R&&(y=Math.cos(-R),x=Math.sin(-R),J=L*y-A*x,U=F*y-it*x,I=P*y-vt*x,q=B*x+q*y,L=J,F=U,P=I),R=rs(F,L),g=R*br,R&&(y=Math.cos(R),x=Math.sin(R),J=L*y+F*x,U=X*y+G*x,F=F*y-L*x,G=G*y-X*x,L=J,X=U),p&&Math.abs(p)+Math.abs(g)>359.9&&(p=g=0,m=180-m),d=De(Math.sqrt(L*L+F*F+P*P)),_=De(Math.sqrt(G*G+Q*Q)),R=rs(X,G),S=Math.abs(R)>2e-4?R*br:0,M=q?1/(q<0?-q:q):0),n.svg&&(J=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Of(ui(t,Ee)),J&&t.setAttribute("transform",J))),Math.abs(S)>90&&Math.abs(S)<270&&(s?(d*=-1,S+=g<=0?180:-180,g+=g<=0?180:-180):(_*=-1,S+=S<=0?180:-180)),e=e||n.uncache,n.x=u-((n.xPercent=u&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-u)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+o,n.y=h-((n.yPercent=h&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-h)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+o,n.z=f+o,n.scaleX=De(d),n.scaleY=De(_),n.rotation=De(g)+a,n.rotationX=De(p)+a,n.rotationY=De(m)+a,n.skewX=S+a,n.skewY=v+a,n.transformPerspective=M+o,(n.zOrigin=parseFloat(c.split(" ")[2])||!e&&n.zOrigin||0)&&(i[bn]=sa(c)),n.xOffset=n.yOffset=0,n.force3D=Sn.force3D,n.renderTransform=n.svg?y_:Lf?Bf:v_,n.uncache=0,n},sa=function(t){return(t=t.split(" "))[0]+" "+t[1]},Mc=function(t,e,n){var i=Ye(e);return De(parseFloat(e)+parseFloat(qi(t,"x",n+"px",i)))+i},v_=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Bf(t,e)},Mr="0deg",oo="0px",Sr=") ",Bf=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.z,c=n.rotation,u=n.rotationY,h=n.rotationX,f=n.skewX,d=n.skewY,_=n.scaleX,g=n.scaleY,p=n.transformPerspective,m=n.force3D,S=n.target,v=n.zOrigin,M="",D=m==="auto"&&t&&t!==1||m===!0;if(v&&(h!==Mr||u!==Mr)){var T=parseFloat(u)*os,E=Math.sin(T),R=Math.cos(T),y;T=parseFloat(h)*os,y=Math.cos(T),o=Mc(S,o,E*y*-v),a=Mc(S,a,-Math.sin(T)*-v),l=Mc(S,l,R*y*-v+v)}p!==oo&&(M+="perspective("+p+Sr),(i||s)&&(M+="translate("+i+"%, "+s+"%) "),(D||o!==oo||a!==oo||l!==oo)&&(M+=l!==oo||D?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+Sr),c!==Mr&&(M+="rotate("+c+Sr),u!==Mr&&(M+="rotateY("+u+Sr),h!==Mr&&(M+="rotateX("+h+Sr),(f!==Mr||d!==Mr)&&(M+="skew("+f+", "+d+Sr),(_!==1||g!==1)&&(M+="scale("+_+", "+g+Sr),S.style[Ee]=M||"translate(0, 0)"},y_=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.rotation,c=n.skewX,u=n.skewY,h=n.scaleX,f=n.scaleY,d=n.target,_=n.xOrigin,g=n.yOrigin,p=n.xOffset,m=n.yOffset,S=n.forceCSS,v=parseFloat(o),M=parseFloat(a),D,T,E,R,y;l=parseFloat(l),c=parseFloat(c),u=parseFloat(u),u&&(u=parseFloat(u),c+=u,l+=u),l||c?(l*=os,c*=os,D=Math.cos(l)*h,T=Math.sin(l)*h,E=Math.sin(l-c)*-f,R=Math.cos(l-c)*f,c&&(u*=os,y=Math.tan(c-u),y=Math.sqrt(1+y*y),E*=y,R*=y,u&&(y=Math.tan(u),y=Math.sqrt(1+y*y),D*=y,T*=y)),D=De(D),T=De(T),E=De(E),R=De(R)):(D=h,R=f,T=E=0),(v&&!~(o+"").indexOf("px")||M&&!~(a+"").indexOf("px"))&&(v=qi(d,"x",o,"px"),M=qi(d,"y",a,"px")),(_||g||p||m)&&(v=De(v+_-(_*D+g*E)+p),M=De(M+g-(_*T+g*R)+m)),(i||s)&&(y=d.getBBox(),v=De(v+i/100*y.width),M=De(M+s/100*y.height)),y="matrix("+D+","+T+","+E+","+R+","+v+","+M+")",d.setAttribute("transform",y),S&&(d.style[Ee]=y)},M_=function(t,e,n,i,s){var o=360,a=Ue(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?br:1),c=l-i,u=i+c+"deg",h,f;return a&&(h=s.split("_")[1],h==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-o)),h==="cw"&&c<0?c=(c+o*Sf)%o-~~(c/o)*o:h==="ccw"&&c>0&&(c=(c-o*Sf)%o-~~(c/o)*o)),t._pt=f=new cn(t._pt,e,n,i,c,r_),f.e=u,f.u="deg",t._props.push(n),f},Df=function(t,e){for(var n in e)t[n]=e[n];return t},S_=function(t,e,n){var i=Df({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=n.style,a,l,c,u,h,f,d,_;i.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),o[Ee]=e,a=lo(n,1),Er(n,Ee),n.setAttribute("transform",c)):(c=getComputedStyle(n)[Ee],o[Ee]=e,a=lo(n,1),o[Ee]=c);for(l in Mi)c=i[l],u=a[l],c!==u&&s.indexOf(l)<0&&(d=Ye(c),_=Ye(u),h=d!==_?qi(n,l,c,_):parseFloat(c),f=parseFloat(u),t._pt=new cn(t._pt,a,l,h,f-h,Sc),t._pt.u=_||0,t._props.push(l));Df(a,i)};ln("padding,margin,Width,Radius",function(r,t){var e="Top",n="Right",i="Bottom",s="Left",o=(t<3?[e,n,i,s]:[e+s,e+n,i+n,i+s]).map(function(a){return t<2?r+a:"border"+a+r});ra[t>1?"border"+r:r]=function(a,l,c,u,h){var f,d;if(arguments.length<4)return f=o.map(function(_){return yi(a,_,c)}),d=f.join(" "),d.split(f[0]).length===5?f[0]:d;f=(u+"").split(" "),d={},o.forEach(function(_,g){return d[_]=f[g]=f[g]||f[(g-1)/2|0]}),a.init(l,d,h)}});var Rc={name:"css",register:wc,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,i,s){var o=this._props,a=t.style,l=n.vars.startAt,c,u,h,f,d,_,g,p,m,S,v,M,D,T,E,R;Tc||wc(),this.styles=this.styles||If(t),R=this.styles.props,this.tween=n;for(g in e)if(g!=="autoRound"&&(u=e[g],!(vn[g]&&pc(g,e,n,i,t,s)))){if(d=typeof u,_=ra[g],d==="function"&&(u=u.call(n,i,t,s),d=typeof u),d==="string"&&~u.indexOf("random(")&&(u=is(u)),_)_(this,t,g,u,n)&&(E=1);else if(g.substr(0,2)==="--")c=(getComputedStyle(t).getPropertyValue(g)+"").trim(),u+="",xi.lastIndex=0,xi.test(c)||(p=Ye(c),m=Ye(u)),m?p!==m&&(c=qi(t,g,c,m)+m):p&&(u+=p),this.add(a,"setProperty",c,u,i,s,0,0,g),o.push(g),R.push(g,0,a[g]);else if(d!=="undefined"){if(l&&g in l?(c=typeof l[g]=="function"?l[g].call(n,i,t,s):l[g],Ue(c)&&~c.indexOf("random(")&&(c=is(c)),Ye(c+"")||c==="auto"||(c+=Sn.units[g]||Ye(yi(t,g))||""),(c+"").charAt(1)==="="&&(c=yi(t,g))):c=yi(t,g),f=parseFloat(c),S=d==="string"&&u.charAt(1)==="="&&u.substr(0,2),S&&(u=u.substr(2)),h=parseFloat(u),g in ci&&(g==="autoAlpha"&&(f===1&&yi(t,"visibility")==="hidden"&&h&&(f=0),R.push("visibility",0,a.visibility),Xi(this,a,"visibility",f?"inherit":"hidden",h?"inherit":"hidden",!h)),g!=="scale"&&g!=="transform"&&(g=ci[g],~g.indexOf(",")&&(g=g.split(",")[0]))),v=g in Mi,v){if(this.styles.save(g),M||(D=t._gsap,D.renderTransform&&!e.parseTransform||lo(t,e.parseTransform),T=e.smoothOrigin!==!1&&D.smooth,M=this._pt=new cn(this._pt,a,Ee,0,1,D.renderTransform,D,0,-1),M.dep=1),g==="scale")this._pt=new cn(this._pt,D,"scaleY",D.scaleY,(S?vr(D.scaleY,S+h):h)-D.scaleY||0,Sc),this._pt.u=0,o.push("scaleY",g),g+="X";else if(g==="transformOrigin"){R.push(bn,0,a[bn]),u=__(u),D.svg?Ec(t,u,0,T,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==D.zOrigin&&Xi(this,D,"zOrigin",D.zOrigin,m),Xi(this,a,g,sa(c),sa(u)));continue}else if(g==="svgOrigin"){Ec(t,u,1,T,0,this);continue}else if(g in Uf){M_(this,D,g,f,S?vr(f,S+u):u);continue}else if(g==="smoothOrigin"){Xi(this,D,"smooth",D.smooth,u);continue}else if(g==="force3D"){D[g]=u;continue}else if(g==="transform"){S_(this,u,t);continue}}else g in a||(g=as(g)||g);if(v||(h||h===0)&&(f||f===0)&&!i_.test(u)&&g in a)p=(c+"").substr((f+"").length),h||(h=0),m=Ye(u)||(g in Sn.units?Sn.units[g]:p),p!==m&&(f=qi(t,g,c,m)),this._pt=new cn(this._pt,v?D:a,g,f,(S?vr(f,S+h):h)-f,!v&&(m==="px"||g==="zIndex")&&e.autoRound!==!1?o_:Sc),this._pt.u=m||0,p!==m&&m!=="%"&&(this._pt.b=c,this._pt.r=s_);else if(g in a)g_.call(this,t,g,c,S?S+u:u);else if(g in t)this.add(t,g,c||t[g],S?S+u:u,i,s);else if(g!=="parseTransform"){jo(g,u);continue}v||(g in a?R.push(g,0,a[g]):R.push(g,1,c||t[g])),o.push(g)}}E&&vc(this)},render:function(t,e){if(e.tween._time||!Ac())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:yi,aliases:ci,getSetter:function(t,e,n){var i=ci[e];return i&&i.indexOf(",")<0&&(e=i),e in Mi&&e!==bn&&(t._gsap.x||yi(t,"x"))?n&&Mf===n?e==="scale"?u_:c_:(Mf=n||{})&&(e==="scale"?h_:f_):t.style&&!Qo(t.style[e])?a_:~e.indexOf("-")?l_:ia(t,e)},core:{_removeProperty:Er,_getMatrix:Cc}};je.utils.checkPrefix=as;je.core.getStyleSaver=If;(function(r,t,e,n){var i=ln(r+","+t+","+e,function(s){Mi[s]=1});ln(t,function(s){Sn.units[s]="deg",Uf[s]=1}),ci[i[13]]=r+","+t,ln(n,function(s){var o=s.split(":");ci[o[1]]=i[o[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");ln("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Sn.units[r]="px"});je.registerPlugin(Rc);var he=je.registerPlugin(Rc)||je,Db=he.core.Tween;var zf=()=>{let r=document.querySelector(".is-section-loader");if(!r)return;let t=r.querySelector(".loader_line"),e=r.querySelector(".loader_value");!t||!e||he.to(t,{width:"100%",duration:1.5,onUpdate:function(){let n=Math.round(this.progress()*100);e.innerHTML=`${n}%`},onComplete:function(){he.to(r,{y:"-100dvh",duration:.75})}},"<")};function kf(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function b_(r,t,e){return t&&kf(r.prototype,t),e&&kf(r,e),r}var Ze,la,w_,Cn,Yi,Zi,cs,Hf,Tr,uo,Gf,Si,Jn,Wf,Xf=function(){return Ze||typeof window<"u"&&(Ze=window.gsap)&&Ze.registerPlugin&&Ze},qf=1,ls=[],Kt=[],$n=[],ho=Date.now,Pc=function(t,e){return e},E_=function(){var t=uo.core,e=t.bridge||{},n=t._scrollers,i=t._proxies;n.push.apply(n,Kt),i.push.apply(i,$n),Kt=n,$n=i,Pc=function(o,a){return e[o](a)}},wi=function(t,e){return~$n.indexOf(t)&&$n[$n.indexOf(t)+1][e]},fo=function(t){return!!~Gf.indexOf(t)},hn=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:i!==!1,capture:!!s})},un=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},oa="scrollLeft",aa="scrollTop",Ic=function(){return Si&&Si.isPressed||Kt.cache++},ca=function(t,e){var n=function i(s){if(s||s===0){qf&&(Cn.history.scrollRestoration="manual");var o=Si&&Si.isPressed;s=i.v=Math.round(s)||(Si&&Si.iOS?1:0),t(s),i.cacheID=Kt.cache,o&&Pc("ss",s)}else(e||Kt.cache!==i.cacheID||Pc("ref"))&&(i.cacheID=Kt.cache,i.v=t());return i.v+i.offset};return n.offset=0,t&&n},tn={s:oa,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:ca(function(r){return arguments.length?Cn.scrollTo(r,Le.sc()):Cn.pageXOffset||Yi[oa]||Zi[oa]||cs[oa]||0})},Le={s:aa,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:tn,sc:ca(function(r){return arguments.length?Cn.scrollTo(tn.sc(),r):Cn.pageYOffset||Yi[aa]||Zi[aa]||cs[aa]||0})},fn=function(t,e){return(e&&e._ctx&&e._ctx.selector||Ze.utils.toArray)(t)[0]||(typeof t=="string"&&Ze.config().nullTargetWarn!==!1?console.warn("Element not found:",t):null)},bi=function(t,e){var n=e.s,i=e.sc;fo(t)&&(t=Yi.scrollingElement||Zi);var s=Kt.indexOf(t),o=i===Le.sc?1:2;!~s&&(s=Kt.push(t)-1),Kt[s+o]||hn(t,"scroll",Ic);var a=Kt[s+o],l=a||(Kt[s+o]=ca(wi(t,n),!0)||(fo(t)?i:ca(function(c){return arguments.length?t[n]=c:t[n]})));return l.target=t,a||(l.smooth=Ze.getProperty(t,"scrollBehavior")==="smooth"),l},ua=function(t,e,n){var i=t,s=t,o=ho(),a=o,l=e||50,c=Math.max(500,l*3),u=function(_,g){var p=ho();g||p-o>l?(s=i,i=_,a=o,o=p):n?i+=_:i=s+(_-s)/(p-a)*(o-a)},h=function(){s=i=n?0:i,a=o=0},f=function(_){var g=a,p=s,m=ho();return(_||_===0)&&_!==i&&u(_),o===a||m-a>c?0:(i+(n?p:-p))/((n?m:o)-g)*1e3};return{update:u,reset:h,getVelocity:f}},co=function(t,e){return e&&!t._gsapAllow&&t.preventDefault(),t.changedTouches?t.changedTouches[0]:t},Vf=function(t){var e=Math.max.apply(Math,t),n=Math.min.apply(Math,t);return Math.abs(e)>=Math.abs(n)?e:n},Yf=function(){uo=Ze.core.globals().ScrollTrigger,uo&&uo.core&&E_()},Zf=function(t){return Ze=t||Xf(),!la&&Ze&&typeof document<"u"&&document.body&&(Cn=window,Yi=document,Zi=Yi.documentElement,cs=Yi.body,Gf=[Cn,Yi,Zi,cs],w_=Ze.utils.clamp,Wf=Ze.core.context||function(){},Tr="onpointerenter"in cs?"pointer":"mouse",Hf=Ce.isTouch=Cn.matchMedia&&Cn.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in Cn||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,Jn=Ce.eventTypes=("ontouchstart"in Zi?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in Zi?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return qf=0},500),Yf(),la=1),la};tn.op=Le;Kt.cache=0;var Ce=function(){function r(e){this.init(e)}var t=r.prototype;return t.init=function(n){la||Zf(Ze)||console.warn("Please gsap.registerPlugin(Observer)"),uo||Yf();var i=n.tolerance,s=n.dragMinimum,o=n.type,a=n.target,l=n.lineHeight,c=n.debounce,u=n.preventDefault,h=n.onStop,f=n.onStopDelay,d=n.ignore,_=n.wheelSpeed,g=n.event,p=n.onDragStart,m=n.onDragEnd,S=n.onDrag,v=n.onPress,M=n.onRelease,D=n.onRight,T=n.onLeft,E=n.onUp,R=n.onDown,y=n.onChangeX,x=n.onChangeY,L=n.onChange,F=n.onToggleX,P=n.onToggleY,B=n.onHover,X=n.onHoverEnd,G=n.onMove,J=n.ignoreCheck,U=n.isNormalizer,I=n.onGestureStart,A=n.onGestureEnd,it=n.onWheel,vt=n.onEnable,Wt=n.onDisable,q=n.onClick,Q=n.scrollSpeed,ct=n.capture,tt=n.allowClicks,It=n.lockAxis,Rt=n.onLockAxis;this.target=a=fn(a)||Zi,this.vars=n,d&&(d=Ze.utils.toArray(d)),i=i||1e-9,s=s||0,_=_||1,Q=Q||1,o=o||"wheel,touch,pointer",c=c!==!1,l||(l=parseFloat(Cn.getComputedStyle(cs).lineHeight)||22);var z,Xt,bt,wt,_t,Ft,Pt,k=this,jt=0,C=0,b=n.passive||!u,Y=bi(a,tn),j=bi(a,Le),et=Y(),nt=j(),mt=~o.indexOf("touch")&&!~o.indexOf("pointer")&&Jn[0]==="pointerdown",lt=fo(a),rt=a.ownerDocument||Yi,Lt=[0,0,0],st=[0,0,0],St=0,Jt=function(){return St=ho()},gt=function(yt,ie){return(k.event=yt)&&d&&~d.indexOf(yt.target)||ie&&mt&&yt.pointerType!=="touch"||J&&J(yt,ie)},xt=function(){k._vx.reset(),k._vy.reset(),Xt.pause(),h&&h(k)},Nt=function(){var yt=k.deltaX=Vf(Lt),ie=k.deltaY=Vf(st),ht=Math.abs(yt)>=i,kt=Math.abs(ie)>=i;L&&(ht||kt)&&L(k,yt,ie,Lt,st),ht&&(D&&k.deltaX>0&&D(k),T&&k.deltaX<0&&T(k),y&&y(k),F&&k.deltaX<0!=jt<0&&F(k),jt=k.deltaX,Lt[0]=Lt[1]=Lt[2]=0),kt&&(R&&k.deltaY>0&&R(k),E&&k.deltaY<0&&E(k),x&&x(k),P&&k.deltaY<0!=C<0&&P(k),C=k.deltaY,st[0]=st[1]=st[2]=0),(wt||bt)&&(G&&G(k),bt&&(S(k),bt=!1),wt=!1),Ft&&!(Ft=!1)&&Rt&&Rt(k),_t&&(it(k),_t=!1),z=0},Gt=function(yt,ie,ht){Lt[ht]+=yt,st[ht]+=ie,k._vx.update(yt),k._vy.update(ie),c?z||(z=requestAnimationFrame(Nt)):Nt()},ue=function(yt,ie){It&&!Pt&&(k.axis=Pt=Math.abs(yt)>Math.abs(ie)?"x":"y",Ft=!0),Pt!=="y"&&(Lt[2]+=yt,k._vx.update(yt,!0)),Pt!=="x"&&(st[2]+=ie,k._vy.update(ie,!0)),c?z||(z=requestAnimationFrame(Nt)):Nt()},Ut=function(yt){if(!gt(yt,1)){yt=co(yt,u);var ie=yt.clientX,ht=yt.clientY,kt=ie-k.x,At=ht-k.y,zt=k.isDragging;k.x=ie,k.y=ht,(zt||Math.abs(k.startX-ie)>=s||Math.abs(k.startY-ht)>=s)&&(S&&(bt=!0),zt||(k.isDragging=!0),ue(kt,At),zt||p&&p(k))}},N=k.onPress=function(Ct){gt(Ct,1)||Ct&&Ct.button||(k.axis=Pt=null,Xt.pause(),k.isPressed=!0,Ct=co(Ct),jt=C=0,k.startX=k.x=Ct.clientX,k.startY=k.y=Ct.clientY,k._vx.reset(),k._vy.reset(),hn(U?a:rt,Jn[1],Ut,b,!0),k.deltaX=k.deltaY=0,v&&v(k))},$=k.onRelease=function(Ct){if(!gt(Ct,1)){un(U?a:rt,Jn[1],Ut,!0);var yt=!isNaN(k.y-k.startY),ie=k.isDragging,ht=ie&&(Math.abs(k.x-k.startX)>3||Math.abs(k.y-k.startY)>3),kt=co(Ct);!ht&&yt&&(k._vx.reset(),k._vy.reset(),u&&tt&&Ze.delayedCall(.08,function(){if(ho()-St>300&&!Ct.defaultPrevented){if(Ct.target.click)Ct.target.click();else if(rt.createEvent){var At=rt.createEvent("MouseEvents");At.initMouseEvent("click",!0,!0,Cn,1,kt.screenX,kt.screenY,kt.clientX,kt.clientY,!1,!1,!1,!1,0,null),Ct.target.dispatchEvent(At)}}})),k.isDragging=k.isGesturing=k.isPressed=!1,h&&ie&&!U&&Xt.restart(!0),m&&ie&&m(k),M&&M(k,ht)}},K=function(yt){return yt.touches&&yt.touches.length>1&&(k.isGesturing=!0)&&I(yt,k.isDragging)},at=function(){return(k.isGesturing=!1)||A(k)},ut=function(yt){if(!gt(yt)){var ie=Y(),ht=j();Gt((ie-et)*Q,(ht-nt)*Q,1),et=ie,nt=ht,h&&Xt.restart(!0)}},Vt=function(yt){if(!gt(yt)){yt=co(yt,u),it&&(_t=!0);var ie=(yt.deltaMode===1?l:yt.deltaMode===2?Cn.innerHeight:1)*_;Gt(yt.deltaX*ie,yt.deltaY*ie,0),h&&!U&&Xt.restart(!0)}},se=function(yt){if(!gt(yt)){var ie=yt.clientX,ht=yt.clientY,kt=ie-k.x,At=ht-k.y;k.x=ie,k.y=ht,wt=!0,h&&Xt.restart(!0),(kt||At)&&ue(kt,At)}},ce=function(yt){k.event=yt,B(k)},pe=function(yt){k.event=yt,X(k)},te=function(yt){return gt(yt)||co(yt,u)&&q(k)};Xt=k._dc=Ze.delayedCall(f||.25,xt).pause(),k.deltaX=k.deltaY=0,k._vx=ua(0,50,!0),k._vy=ua(0,50,!0),k.scrollX=Y,k.scrollY=j,k.isDragging=k.isGesturing=k.isPressed=!1,Wf(this),k.enable=function(Ct){return k.isEnabled||(hn(lt?rt:a,"scroll",Ic),o.indexOf("scroll")>=0&&hn(lt?rt:a,"scroll",ut,b,ct),o.indexOf("wheel")>=0&&hn(a,"wheel",Vt,b,ct),(o.indexOf("touch")>=0&&Hf||o.indexOf("pointer")>=0)&&(hn(a,Jn[0],N,b,ct),hn(rt,Jn[2],$),hn(rt,Jn[3],$),tt&&hn(a,"click",Jt,!0,!0),q&&hn(a,"click",te),I&&hn(rt,"gesturestart",K),A&&hn(rt,"gestureend",at),B&&hn(a,Tr+"enter",ce),X&&hn(a,Tr+"leave",pe),G&&hn(a,Tr+"move",se)),k.isEnabled=!0,Ct&&Ct.type&&N(Ct),vt&&vt(k)),k},k.disable=function(){k.isEnabled&&(ls.filter(function(Ct){return Ct!==k&&fo(Ct.target)}).length||un(lt?rt:a,"scroll",Ic),k.isPressed&&(k._vx.reset(),k._vy.reset(),un(U?a:rt,Jn[1],Ut,!0)),un(lt?rt:a,"scroll",ut,ct),un(a,"wheel",Vt,ct),un(a,Jn[0],N,ct),un(rt,Jn[2],$),un(rt,Jn[3],$),un(a,"click",Jt,!0),un(a,"click",te),un(rt,"gesturestart",K),un(rt,"gestureend",at),un(a,Tr+"enter",ce),un(a,Tr+"leave",pe),un(a,Tr+"move",se),k.isEnabled=k.isPressed=k.isDragging=!1,Wt&&Wt(k))},k.kill=k.revert=function(){k.disable();var Ct=ls.indexOf(k);Ct>=0&&ls.splice(Ct,1),Si===k&&(Si=0)},ls.push(k),U&&fo(a)&&(Si=k),k.enable(g)},b_(r,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),r}();Ce.version="3.12.5";Ce.create=function(r){return new Ce(r)};Ce.register=Zf;Ce.getAll=function(){return ls.slice()};Ce.getById=function(r){return ls.filter(function(t){return t.vars.id===r})[0]};Xf()&&Ze.registerPlugin(Ce);var Mt,fs,ne,Te,Kn,_e,fd,Ta,To,yo,mo,ha,en,Ra,kc,pn,Jf,$f,ds,dd,Lc,pd,dn,Vc,md,gd,Ji,Hc,Yc,ps,Zc,Aa,Gc,Fc,fa=1,nn=Date.now,Nc=nn(),Vn=0,go=0,Kf=function(t,e,n){var i=Pn(t)&&(t.substr(0,6)==="clamp("||t.indexOf("max")>-1);return n["_"+e+"Clamp"]=i,i?t.substr(6,t.length-7):t},Qf=function(t,e){return e&&(!Pn(t)||t.substr(0,6)!=="clamp(")?"clamp("+t+")":t},T_=function r(){return go&&requestAnimationFrame(r)},jf=function(){return Ra=1},td=function(){return Ra=0},hi=function(t){return t},_o=function(t){return Math.round(t*1e5)/1e5||0},_d=function(){return typeof window<"u"},xd=function(){return Mt||_d()&&(Mt=window.gsap)&&Mt.registerPlugin&&Mt},Ir=function(t){return!!~fd.indexOf(t)},vd=function(t){return(t==="Height"?Zc:ne["inner"+t])||Kn["client"+t]||_e["client"+t]},yd=function(t){return wi(t,"getBoundingClientRect")||(Ir(t)?function(){return Ea.width=ne.innerWidth,Ea.height=Zc,Ea}:function(){return Ei(t)})},A_=function(t,e,n){var i=n.d,s=n.d2,o=n.a;return(o=wi(t,"getBoundingClientRect"))?function(){return o()[i]}:function(){return(e?vd(s):t["client"+s])||0}},D_=function(t,e){return!e||~$n.indexOf(t)?yd(t):function(){return Ea}},fi=function(t,e){var n=e.s,i=e.d2,s=e.d,o=e.a;return Math.max(0,(n="scroll"+i)&&(o=wi(t,n))?o()-yd(t)()[s]:Ir(t)?(Kn[n]||_e[n])-vd(i):t[n]-t["offset"+i])},da=function(t,e){for(var n=0;n<ds.length;n+=3)(!e||~e.indexOf(ds[n+1]))&&t(ds[n],ds[n+1],ds[n+2])},Pn=function(t){return typeof t=="string"},gn=function(t){return typeof t=="function"},xo=function(t){return typeof t=="number"},Ar=function(t){return typeof t=="object"},po=function(t,e,n){return t&&t.progress(e?0:1)&&n&&t.pause()},Uc=function(t,e){if(t.enabled){var n=t._ctx?t._ctx.add(function(){return e(t)}):e(t);n&&n.totalTime&&(t.callbackAnimation=n)}},us=Math.abs,Md="left",Sd="top",Jc="right",$c="bottom",Cr="width",Rr="height",Mo="Right",So="Left",bo="Top",wo="Bottom",Fe="padding",zn="margin",gs="Width",Kc="Height",Oe="px",kn=function(t){return ne.getComputedStyle(t)},C_=function(t){var e=kn(t).position;t.style.position=e==="absolute"||e==="fixed"?e:"relative"},ed=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Ei=function(t,e){var n=e&&kn(t)[kc]!=="matrix(1, 0, 0, 1, 0, 0)"&&Mt.to(t,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),i=t.getBoundingClientRect();return n&&n.progress(0).kill(),i},Da=function(t,e){var n=e.d2;return t["offset"+n]||t["client"+n]||0},bd=function(t){var e=[],n=t.labels,i=t.duration(),s;for(s in n)e.push(n[s]/i);return e},R_=function(t){return function(e){return Mt.utils.snap(bd(t),e)}},Qc=function(t){var e=Mt.utils.snap(t),n=Array.isArray(t)&&t.slice(0).sort(function(i,s){return i-s});return n?function(i,s,o){o===void 0&&(o=.001);var a;if(!s)return e(i);if(s>0){for(i-=o,a=0;a<n.length;a++)if(n[a]>=i)return n[a];return n[a-1]}else for(a=n.length,i+=o;a--;)if(n[a]<=i)return n[a];return n[0]}:function(i,s,o){o===void 0&&(o=.001);var a=e(i);return!s||Math.abs(a-i)<o||a-i<0==s<0?a:e(s<0?i-t:i+t)}},P_=function(t){return function(e,n){return Qc(bd(t))(e,n.direction)}},pa=function(t,e,n,i){return n.split(",").forEach(function(s){return t(e,s,i)})},Ge=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:!i,capture:!!s})},He=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},ma=function(t,e,n){n=n&&n.wheelHandler,n&&(t(e,"wheel",n),t(e,"touchmove",n))},nd={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},ga={toggleActions:"play",anticipatePin:0},Ca={top:0,left:0,center:.5,bottom:1,right:1},Ma=function(t,e){if(Pn(t)){var n=t.indexOf("="),i=~n?+(t.charAt(n-1)+1)*parseFloat(t.substr(n+1)):0;~n&&(t.indexOf("%")>n&&(i*=e/100),t=t.substr(0,n-1)),t=i+(t in Ca?Ca[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t},_a=function(t,e,n,i,s,o,a,l){var c=s.startColor,u=s.endColor,h=s.fontSize,f=s.indent,d=s.fontWeight,_=Te.createElement("div"),g=Ir(n)||wi(n,"pinType")==="fixed",p=t.indexOf("scroller")!==-1,m=g?_e:n,S=t.indexOf("start")!==-1,v=S?c:u,M="border-color:"+v+";font-size:"+h+";color:"+v+";font-weight:"+d+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return M+="position:"+((p||l)&&g?"fixed;":"absolute;"),(p||l||!g)&&(M+=(i===Le?Jc:$c)+":"+(o+parseFloat(f))+"px;"),a&&(M+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),_._isStart=S,_.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),_.style.cssText=M,_.innerText=e||e===0?t+"-"+e:t,m.children[0]?m.insertBefore(_,m.children[0]):m.appendChild(_),_._offset=_["offset"+i.op.d2],Sa(_,0,i,S),_},Sa=function(t,e,n,i){var s={display:"block"},o=n[i?"os2":"p2"],a=n[i?"p2":"os2"];t._isFlipped=i,s[n.a+"Percent"]=i?-100:0,s[n.a]=i?"1px":0,s["border"+o+gs]=1,s["border"+a+gs]=0,s[n.p]=e+"px",Mt.set(t,s)},Qt=[],Wc={},Ao,id=function(){return nn()-Vn>34&&(Ao||(Ao=requestAnimationFrame(Ti)))},hs=function(){(!dn||!dn.isPressed||dn.startX>_e.clientWidth)&&(Kt.cache++,dn?Ao||(Ao=requestAnimationFrame(Ti)):Ti(),Vn||Fr("scrollStart"),Vn=nn())},Oc=function(){gd=ne.innerWidth,md=ne.innerHeight},vo=function(){Kt.cache++,!en&&!pd&&!Te.fullscreenElement&&!Te.webkitFullscreenElement&&(!Vc||gd!==ne.innerWidth||Math.abs(ne.innerHeight-md)>ne.innerHeight*.25)&&Ta.restart(!0)},Lr={},I_=[],wd=function r(){return He(Ht,"scrollEnd",r)||Dr(!0)},Fr=function(t){return Lr[t]&&Lr[t].map(function(e){return e()})||I_},Rn=[],Ed=function(t){for(var e=0;e<Rn.length;e+=5)(!t||Rn[e+4]&&Rn[e+4].query===t)&&(Rn[e].style.cssText=Rn[e+1],Rn[e].getBBox&&Rn[e].setAttribute("transform",Rn[e+2]||""),Rn[e+3].uncache=1)},jc=function(t,e){var n;for(pn=0;pn<Qt.length;pn++)n=Qt[pn],n&&(!e||n._ctx===e)&&(t?n.kill(1):n.revert(!0,!0));Aa=!0,e&&Ed(e),e||Fr("revert")},Td=function(t,e){Kt.cache++,(e||!mn)&&Kt.forEach(function(n){return gn(n)&&n.cacheID++&&(n.rec=0)}),Pn(t)&&(ne.history.scrollRestoration=Yc=t)},mn,Pr=0,rd,L_=function(){if(rd!==Pr){var t=rd=Pr;requestAnimationFrame(function(){return t===Pr&&Dr(!0)})}},Ad=function(){_e.appendChild(ps),Zc=!dn&&ps.offsetHeight||ne.innerHeight,_e.removeChild(ps)},sd=function(t){return To(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(e){return e.style.display=t?"none":"block"})},Dr=function(t,e){if(Vn&&!t&&!Aa){Ge(Ht,"scrollEnd",wd);return}Ad(),mn=Ht.isRefreshing=!0,Kt.forEach(function(i){return gn(i)&&++i.cacheID&&(i.rec=i())});var n=Fr("refreshInit");dd&&Ht.sort(),e||jc(),Kt.forEach(function(i){gn(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),Qt.slice(0).forEach(function(i){return i.refresh()}),Aa=!1,Qt.forEach(function(i){if(i._subPinOffset&&i.pin){var s=i.vars.horizontal?"offsetWidth":"offsetHeight",o=i.pin[s];i.revert(!0,1),i.adjustPinSpacing(i.pin[s]-o),i.refresh()}}),Gc=1,sd(!0),Qt.forEach(function(i){var s=fi(i.scroller,i._dir),o=i.vars.end==="max"||i._endClamp&&i.end>s,a=i._startClamp&&i.start>=s;(o||a)&&i.setPositions(a?s-1:i.start,o?Math.max(a?s:i.start+1,s):i.end,!0)}),sd(!1),Gc=0,n.forEach(function(i){return i&&i.render&&i.render(-1)}),Kt.forEach(function(i){gn(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),Td(Yc,1),Ta.pause(),Pr++,mn=2,Ti(2),Qt.forEach(function(i){return gn(i.vars.onRefresh)&&i.vars.onRefresh(i)}),mn=Ht.isRefreshing=!1,Fr("refresh")},Xc=0,ba=1,Eo,Ti=function(t){if(t===2||!mn&&!Aa){Ht.isUpdating=!0,Eo&&Eo.update(0);var e=Qt.length,n=nn(),i=n-Nc>=50,s=e&&Qt[0].scroll();if(ba=Xc>s?-1:1,mn||(Xc=s),i&&(Vn&&!Ra&&n-Vn>200&&(Vn=0,Fr("scrollEnd")),mo=Nc,Nc=n),ba<0){for(pn=e;pn-- >0;)Qt[pn]&&Qt[pn].update(0,i);ba=1}else for(pn=0;pn<e;pn++)Qt[pn]&&Qt[pn].update(0,i);Ht.isUpdating=!1}Ao=0},qc=[Md,Sd,$c,Jc,zn+wo,zn+Mo,zn+bo,zn+So,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],wa=qc.concat([Cr,Rr,"boxSizing","max"+gs,"max"+Kc,"position",zn,Fe,Fe+bo,Fe+Mo,Fe+wo,Fe+So]),F_=function(t,e,n){ms(n);var i=t._gsap;if(i.spacerIsNative)ms(i.spacerState);else if(t._gsap.swappedIn){var s=e.parentNode;s&&(s.insertBefore(t,e),s.removeChild(e))}t._gsap.swappedIn=!1},Bc=function(t,e,n,i){if(!t._gsap.swappedIn){for(var s=qc.length,o=e.style,a=t.style,l;s--;)l=qc[s],o[l]=n[l];o.position=n.position==="absolute"?"absolute":"relative",n.display==="inline"&&(o.display="inline-block"),a[$c]=a[Jc]="auto",o.flexBasis=n.flexBasis||"auto",o.overflow="visible",o.boxSizing="border-box",o[Cr]=Da(t,tn)+Oe,o[Rr]=Da(t,Le)+Oe,o[Fe]=a[zn]=a[Sd]=a[Md]="0",ms(i),a[Cr]=a["max"+gs]=n[Cr],a[Rr]=a["max"+Kc]=n[Rr],a[Fe]=n[Fe],t.parentNode!==e&&(t.parentNode.insertBefore(e,t),e.appendChild(t)),t._gsap.swappedIn=!0}},N_=/([A-Z])/g,ms=function(t){if(t){var e=t.t.style,n=t.length,i=0,s,o;for((t.t._gsap||Mt.core.getCache(t.t)).uncache=1;i<n;i+=2)o=t[i+1],s=t[i],o?e[s]=o:e[s]&&e.removeProperty(s.replace(N_,"-$1").toLowerCase())}},xa=function(t){for(var e=wa.length,n=t.style,i=[],s=0;s<e;s++)i.push(wa[s],n[wa[s]]);return i.t=t,i},U_=function(t,e,n){for(var i=[],s=t.length,o=n?8:0,a;o<s;o+=2)a=t[o],i.push(a,a in e?e[a]:t[o+1]);return i.t=t.t,i},Ea={left:0,top:0},od=function(t,e,n,i,s,o,a,l,c,u,h,f,d,_){gn(t)&&(t=t(l)),Pn(t)&&t.substr(0,3)==="max"&&(t=f+(t.charAt(4)==="="?Ma("0"+t.substr(3),n):0));var g=d?d.time():0,p,m,S;if(d&&d.seek(0),isNaN(t)||(t=+t),xo(t))d&&(t=Mt.utils.mapRange(d.scrollTrigger.start,d.scrollTrigger.end,0,f,t)),a&&Sa(a,n,i,!0);else{gn(e)&&(e=e(l));var v=(t||"0").split(" "),M,D,T,E;S=fn(e,l)||_e,M=Ei(S)||{},(!M||!M.left&&!M.top)&&kn(S).display==="none"&&(E=S.style.display,S.style.display="block",M=Ei(S),E?S.style.display=E:S.style.removeProperty("display")),D=Ma(v[0],M[i.d]),T=Ma(v[1]||"0",n),t=M[i.p]-c[i.p]-u+D+s-T,a&&Sa(a,T,i,n-T<20||a._isStart&&T>20),n-=n-T}if(_&&(l[_]=t||-.001,t<0&&(t=0)),o){var R=t+n,y=o._isStart;p="scroll"+i.d2,Sa(o,R,i,y&&R>20||!y&&(h?Math.max(_e[p],Kn[p]):o.parentNode[p])<=R+1),h&&(c=Ei(a),h&&(o.style[i.op.p]=c[i.op.p]-i.op.m-o._offset+Oe))}return d&&S&&(p=Ei(S),d.seek(f),m=Ei(S),d._caScrollDist=p[i.p]-m[i.p],t=t/d._caScrollDist*f),d&&d.seek(g),d?t:Math.round(t)},O_=/(webkit|moz|length|cssText|inset)/i,ad=function(t,e,n,i){if(t.parentNode!==e){var s=t.style,o,a;if(e===_e){t._stOrig=s.cssText,a=kn(t);for(o in a)!+o&&!O_.test(o)&&a[o]&&typeof s[o]=="string"&&o!=="0"&&(s[o]=a[o]);s.top=n,s.left=i}else s.cssText=t._stOrig;Mt.core.getCache(t).uncache=1,e.appendChild(t)}},Dd=function(t,e,n){var i=e,s=i;return function(o){var a=Math.round(t());return a!==i&&a!==s&&Math.abs(a-i)>3&&Math.abs(a-s)>3&&(o=a,n&&n()),s=i,i=o,o}},va=function(t,e,n){var i={};i[e.p]="+="+n,Mt.set(t,i)},ld=function(t,e){var n=bi(t,e),i="_scroll"+e.p2,s=function o(a,l,c,u,h){var f=o.tween,d=l.onComplete,_={};c=c||n();var g=Dd(n,c,function(){f.kill(),o.tween=0});return h=u&&h||0,u=u||a-c,f&&f.kill(),l[i]=a,l.inherit=!1,l.modifiers=_,_[i]=function(){return g(c+u*f.ratio+h*f.ratio*f.ratio)},l.onUpdate=function(){Kt.cache++,o.tween&&Ti()},l.onComplete=function(){o.tween=0,d&&d.call(f)},f=o.tween=Mt.to(t,l),f};return t[i]=n,n.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},Ge(t,"wheel",n.wheelHandler),Ht.isTouch&&Ge(t,"touchmove",n.wheelHandler),s},Ht=function(){function r(e,n){fs||r.register(Mt)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),Hc(this),this.init(e,n)}var t=r.prototype;return t.init=function(n,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!go){this.update=this.refresh=this.kill=hi;return}n=ed(Pn(n)||xo(n)||n.nodeType?{trigger:n}:n,ga);var s=n,o=s.onUpdate,a=s.toggleClass,l=s.id,c=s.onToggle,u=s.onRefresh,h=s.scrub,f=s.trigger,d=s.pin,_=s.pinSpacing,g=s.invalidateOnRefresh,p=s.anticipatePin,m=s.onScrubComplete,S=s.onSnapComplete,v=s.once,M=s.snap,D=s.pinReparent,T=s.pinSpacer,E=s.containerAnimation,R=s.fastScrollEnd,y=s.preventOverlaps,x=n.horizontal||n.containerAnimation&&n.horizontal!==!1?tn:Le,L=!h&&h!==0,F=fn(n.scroller||ne),P=Mt.core.getCache(F),B=Ir(F),X=("pinType"in n?n.pinType:wi(F,"pinType")||B&&"fixed")==="fixed",G=[n.onEnter,n.onLeave,n.onEnterBack,n.onLeaveBack],J=L&&n.toggleActions.split(" "),U="markers"in n?n.markers:ga.markers,I=B?0:parseFloat(kn(F)["border"+x.p2+gs])||0,A=this,it=n.onRefreshInit&&function(){return n.onRefreshInit(A)},vt=A_(F,B,x),Wt=D_(F,B),q=0,Q=0,ct=0,tt=bi(F,x),It,Rt,z,Xt,bt,wt,_t,Ft,Pt,k,jt,C,b,Y,j,et,nt,mt,lt,rt,Lt,st,St,Jt,gt,xt,Nt,Gt,ue,Ut,N,$,K,at,ut,Vt,se,ce,pe;if(A._startClamp=A._endClamp=!1,A._dir=x,p*=45,A.scroller=F,A.scroll=E?E.time.bind(E):tt,Xt=tt(),A.vars=n,i=i||n.animation,"refreshPriority"in n&&(dd=1,n.refreshPriority===-9999&&(Eo=A)),P.tweenScroll=P.tweenScroll||{top:ld(F,Le),left:ld(F,tn)},A.tweenTo=It=P.tweenScroll[x.p],A.scrubDuration=function(ht){K=xo(ht)&&ht,K?$?$.duration(ht):$=Mt.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:K,paused:!0,onComplete:function(){return m&&m(A)}}):($&&$.progress(1).kill(),$=0)},i&&(i.vars.lazy=!1,i._initted&&!A.isReverted||i.vars.immediateRender!==!1&&n.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),A.animation=i.pause(),i.scrollTrigger=A,A.scrubDuration(h),Ut=0,l||(l=i.vars.id)),M&&((!Ar(M)||M.push)&&(M={snapTo:M}),"scrollBehavior"in _e.style&&Mt.set(B?[_e,Kn]:F,{scrollBehavior:"auto"}),Kt.forEach(function(ht){return gn(ht)&&ht.target===(B?Te.scrollingElement||Kn:F)&&(ht.smooth=!1)}),z=gn(M.snapTo)?M.snapTo:M.snapTo==="labels"?R_(i):M.snapTo==="labelsDirectional"?P_(i):M.directional!==!1?function(ht,kt){return Qc(M.snapTo)(ht,nn()-Q<500?0:kt.direction)}:Mt.utils.snap(M.snapTo),at=M.duration||{min:.1,max:2},at=Ar(at)?yo(at.min,at.max):yo(at,at),ut=Mt.delayedCall(M.delay||K/2||.1,function(){var ht=tt(),kt=nn()-Q<500,At=It.tween;if((kt||Math.abs(A.getVelocity())<10)&&!At&&!Ra&&q!==ht){var zt=(ht-wt)/Y,be=i&&!L?i.totalProgress():zt,$t=kt?0:(be-N)/(nn()-mo)*1e3||0,ve=Mt.utils.clamp(-zt,1-zt,us($t/2)*$t/.185),ke=zt+(M.inertia===!1?0:ve),ye,me,w=M,O=w.onStart,V=w.onInterrupt,H=w.onComplete;if(ye=z(ke,A),xo(ye)||(ye=ke),me=Math.round(wt+ye*Y),ht<=_t&&ht>=wt&&me!==ht){if(At&&!At._initted&&At.data<=us(me-ht))return;M.inertia===!1&&(ve=ye-zt),It(me,{duration:at(us(Math.max(us(ke-be),us(ye-be))*.185/$t/.05||0)),ease:M.ease||"power3",data:us(me-ht),onInterrupt:function(){return ut.restart(!0)&&V&&V(A)},onComplete:function(){A.update(),q=tt(),i&&($?$.resetTo("totalProgress",ye,i._tTime/i._tDur):i.progress(ye)),Ut=N=i&&!L?i.totalProgress():A.progress,S&&S(A),H&&H(A)}},ht,ve*Y,me-ht-ve*Y),O&&O(A,It.tween)}}else A.isActive&&q!==ht&&ut.restart(!0)}).pause()),l&&(Wc[l]=A),f=A.trigger=fn(f||d!==!0&&d),pe=f&&f._gsap&&f._gsap.stRevert,pe&&(pe=pe(A)),d=d===!0?f:fn(d),Pn(a)&&(a={targets:f,className:a}),d&&(_===!1||_===zn||(_=!_&&d.parentNode&&d.parentNode.style&&kn(d.parentNode).display==="flex"?!1:Fe),A.pin=d,Rt=Mt.core.getCache(d),Rt.spacer?j=Rt.pinState:(T&&(T=fn(T),T&&!T.nodeType&&(T=T.current||T.nativeElement),Rt.spacerIsNative=!!T,T&&(Rt.spacerState=xa(T))),Rt.spacer=mt=T||Te.createElement("div"),mt.classList.add("pin-spacer"),l&&mt.classList.add("pin-spacer-"+l),Rt.pinState=j=xa(d)),n.force3D!==!1&&Mt.set(d,{force3D:!0}),A.spacer=mt=Rt.spacer,ue=kn(d),Jt=ue[_+x.os2],rt=Mt.getProperty(d),Lt=Mt.quickSetter(d,x.a,Oe),Bc(d,mt,ue),nt=xa(d)),U){C=Ar(U)?ed(U,nd):nd,k=_a("scroller-start",l,F,x,C,0),jt=_a("scroller-end",l,F,x,C,0,k),lt=k["offset"+x.op.d2];var te=fn(wi(F,"content")||F);Ft=this.markerStart=_a("start",l,te,x,C,lt,0,E),Pt=this.markerEnd=_a("end",l,te,x,C,lt,0,E),E&&(ce=Mt.quickSetter([Ft,Pt],x.a,Oe)),!X&&!($n.length&&wi(F,"fixedMarkers")===!0)&&(C_(B?_e:F),Mt.set([k,jt],{force3D:!0}),xt=Mt.quickSetter(k,x.a,Oe),Gt=Mt.quickSetter(jt,x.a,Oe))}if(E){var Ct=E.vars.onUpdate,yt=E.vars.onUpdateParams;E.eventCallback("onUpdate",function(){A.update(0,0,1),Ct&&Ct.apply(E,yt||[])})}if(A.previous=function(){return Qt[Qt.indexOf(A)-1]},A.next=function(){return Qt[Qt.indexOf(A)+1]},A.revert=function(ht,kt){if(!kt)return A.kill(!0);var At=ht!==!1||!A.enabled,zt=en;At!==A.isReverted&&(At&&(Vt=Math.max(tt(),A.scroll.rec||0),ct=A.progress,se=i&&i.progress()),Ft&&[Ft,Pt,k,jt].forEach(function(be){return be.style.display=At?"none":"block"}),At&&(en=A,A.update(At)),d&&(!D||!A.isActive)&&(At?F_(d,mt,j):Bc(d,mt,kn(d),gt)),At||A.update(At),en=zt,A.isReverted=At)},A.refresh=function(ht,kt,At,zt){if(!((en||!A.enabled)&&!kt)){if(d&&ht&&Vn){Ge(r,"scrollEnd",wd);return}!mn&&it&&it(A),en=A,It.tween&&!At&&(It.tween.kill(),It.tween=0),$&&$.pause(),g&&i&&i.revert({kill:!1}).invalidate(),A.isReverted||A.revert(!0,!0),A._subPinOffset=!1;var be=vt(),$t=Wt(),ve=E?E.duration():fi(F,x),ke=Y<=.01,ye=0,me=zt||0,w=Ar(At)?At.end:n.end,O=n.endTrigger||f,V=Ar(At)?At.start:n.start||(n.start===0||!f?0:d?"0 0":"0 100%"),H=A.pinnedContainer=n.pinnedContainer&&fn(n.pinnedContainer,A),W=f&&Math.max(0,Qt.indexOf(A))||0,ot=W,ft,pt,Dt,Bt,Tt,Et,ae,Ie,Je,an,qt,Ot,si;for(U&&Ar(At)&&(Ot=Mt.getProperty(k,x.p),si=Mt.getProperty(jt,x.p));ot--;)Et=Qt[ot],Et.end||Et.refresh(0,1)||(en=A),ae=Et.pin,ae&&(ae===f||ae===d||ae===H)&&!Et.isReverted&&(an||(an=[]),an.unshift(Et),Et.revert(!0,!0)),Et!==Qt[ot]&&(W--,ot--);for(gn(V)&&(V=V(A)),V=Kf(V,"start",A),wt=od(V,f,be,x,tt(),Ft,k,A,$t,I,X,ve,E,A._startClamp&&"_startClamp")||(d?-.001:0),gn(w)&&(w=w(A)),Pn(w)&&!w.indexOf("+=")&&(~w.indexOf(" ")?w=(Pn(V)?V.split(" ")[0]:"")+w:(ye=Ma(w.substr(2),be),w=Pn(V)?V:(E?Mt.utils.mapRange(0,E.duration(),E.scrollTrigger.start,E.scrollTrigger.end,wt):wt)+ye,O=f)),w=Kf(w,"end",A),_t=Math.max(wt,od(w||(O?"100% 0":ve),O,be,x,tt()+ye,Pt,jt,A,$t,I,X,ve,E,A._endClamp&&"_endClamp"))||-.001,ye=0,ot=W;ot--;)Et=Qt[ot],ae=Et.pin,ae&&Et.start-Et._pinPush<=wt&&!E&&Et.end>0&&(ft=Et.end-(A._startClamp?Math.max(0,Et.start):Et.start),(ae===f&&Et.start-Et._pinPush<wt||ae===H)&&isNaN(V)&&(ye+=ft*(1-Et.progress)),ae===d&&(me+=ft));if(wt+=ye,_t+=ye,A._startClamp&&(A._startClamp+=ye),A._endClamp&&!mn&&(A._endClamp=_t||-.001,_t=Math.min(_t,fi(F,x))),Y=_t-wt||(wt-=.01)&&.001,ke&&(ct=Mt.utils.clamp(0,1,Mt.utils.normalize(wt,_t,Vt))),A._pinPush=me,Ft&&ye&&(ft={},ft[x.a]="+="+ye,H&&(ft[x.p]="-="+tt()),Mt.set([Ft,Pt],ft)),d&&!(Gc&&A.end>=fi(F,x)))ft=kn(d),Bt=x===Le,Dt=tt(),st=parseFloat(rt(x.a))+me,!ve&&_t>1&&(qt=(B?Te.scrollingElement||Kn:F).style,qt={style:qt,value:qt["overflow"+x.a.toUpperCase()]},B&&kn(_e)["overflow"+x.a.toUpperCase()]!=="scroll"&&(qt.style["overflow"+x.a.toUpperCase()]="scroll")),Bc(d,mt,ft),nt=xa(d),pt=Ei(d,!0),Ie=X&&bi(F,Bt?tn:Le)(),_?(gt=[_+x.os2,Y+me+Oe],gt.t=mt,ot=_===Fe?Da(d,x)+Y+me:0,ot&&(gt.push(x.d,ot+Oe),mt.style.flexBasis!=="auto"&&(mt.style.flexBasis=ot+Oe)),ms(gt),H&&Qt.forEach(function(le){le.pin===H&&le.vars.pinSpacing!==!1&&(le._subPinOffset=!0)}),X&&tt(Vt)):(ot=Da(d,x),ot&&mt.style.flexBasis!=="auto"&&(mt.style.flexBasis=ot+Oe)),X&&(Tt={top:pt.top+(Bt?Dt-wt:Ie)+Oe,left:pt.left+(Bt?Ie:Dt-wt)+Oe,boxSizing:"border-box",position:"fixed"},Tt[Cr]=Tt["max"+gs]=Math.ceil(pt.width)+Oe,Tt[Rr]=Tt["max"+Kc]=Math.ceil(pt.height)+Oe,Tt[zn]=Tt[zn+bo]=Tt[zn+Mo]=Tt[zn+wo]=Tt[zn+So]="0",Tt[Fe]=ft[Fe],Tt[Fe+bo]=ft[Fe+bo],Tt[Fe+Mo]=ft[Fe+Mo],Tt[Fe+wo]=ft[Fe+wo],Tt[Fe+So]=ft[Fe+So],et=U_(j,Tt,D),mn&&tt(0)),i?(Je=i._initted,Lc(1),i.render(i.duration(),!0,!0),St=rt(x.a)-st+Y+me,Nt=Math.abs(Y-St)>1,X&&Nt&&et.splice(et.length-2,2),i.render(0,!0,!0),Je||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),Lc(0)):St=Y,qt&&(qt.value?qt.style["overflow"+x.a.toUpperCase()]=qt.value:qt.style.removeProperty("overflow-"+x.a));else if(f&&tt()&&!E)for(pt=f.parentNode;pt&&pt!==_e;)pt._pinOffset&&(wt-=pt._pinOffset,_t-=pt._pinOffset),pt=pt.parentNode;an&&an.forEach(function(le){return le.revert(!1,!0)}),A.start=wt,A.end=_t,Xt=bt=mn?Vt:tt(),!E&&!mn&&(Xt<Vt&&tt(Vt),A.scroll.rec=0),A.revert(!1,!0),Q=nn(),ut&&(q=-1,ut.restart(!0)),en=0,i&&L&&(i._initted||se)&&i.progress()!==se&&i.progress(se||0,!0).render(i.time(),!0,!0),(ke||ct!==A.progress||E||g)&&(i&&!L&&i.totalProgress(E&&wt<-.001&&!ct?Mt.utils.normalize(wt,_t,0):ct,!0),A.progress=ke||(Xt-wt)/Y===ct?0:ct),d&&_&&(mt._pinOffset=Math.round(A.progress*St)),$&&$.invalidate(),isNaN(Ot)||(Ot-=Mt.getProperty(k,x.p),si-=Mt.getProperty(jt,x.p),va(k,x,Ot),va(Ft,x,Ot-(zt||0)),va(jt,x,si),va(Pt,x,si-(zt||0))),ke&&!mn&&A.update(),u&&!mn&&!b&&(b=!0,u(A),b=!1)}},A.getVelocity=function(){return(tt()-bt)/(nn()-mo)*1e3||0},A.endAnimation=function(){po(A.callbackAnimation),i&&($?$.progress(1):i.paused()?L||po(i,A.direction<0,1):po(i,i.reversed()))},A.labelToScroll=function(ht){return i&&i.labels&&(wt||A.refresh()||wt)+i.labels[ht]/i.duration()*Y||0},A.getTrailing=function(ht){var kt=Qt.indexOf(A),At=A.direction>0?Qt.slice(0,kt).reverse():Qt.slice(kt+1);return(Pn(ht)?At.filter(function(zt){return zt.vars.preventOverlaps===ht}):At).filter(function(zt){return A.direction>0?zt.end<=wt:zt.start>=_t})},A.update=function(ht,kt,At){if(!(E&&!At&&!ht)){var zt=mn===!0?Vt:A.scroll(),be=ht?0:(zt-wt)/Y,$t=be<0?0:be>1?1:be||0,ve=A.progress,ke,ye,me,w,O,V,H,W;if(kt&&(bt=Xt,Xt=E?tt():zt,M&&(N=Ut,Ut=i&&!L?i.totalProgress():$t)),p&&d&&!en&&!fa&&Vn&&(!$t&&wt<zt+(zt-bt)/(nn()-mo)*p?$t=1e-4:$t===1&&_t>zt+(zt-bt)/(nn()-mo)*p&&($t=.9999)),$t!==ve&&A.enabled){if(ke=A.isActive=!!$t&&$t<1,ye=!!ve&&ve<1,V=ke!==ye,O=V||!!$t!=!!ve,A.direction=$t>ve?1:-1,A.progress=$t,O&&!en&&(me=$t&&!ve?0:$t===1?1:ve===1?2:3,L&&(w=!V&&J[me+1]!=="none"&&J[me+1]||J[me],W=i&&(w==="complete"||w==="reset"||w in i))),y&&(V||W)&&(W||h||!i)&&(gn(y)?y(A):A.getTrailing(y).forEach(function(Dt){return Dt.endAnimation()})),L||($&&!en&&!fa?($._dp._time-$._start!==$._time&&$.render($._dp._time-$._start),$.resetTo?$.resetTo("totalProgress",$t,i._tTime/i._tDur):($.vars.totalProgress=$t,$.invalidate().restart())):i&&i.totalProgress($t,!!(en&&(Q||ht)))),d){if(ht&&_&&(mt.style[_+x.os2]=Jt),!X)Lt(_o(st+St*$t));else if(O){if(H=!ht&&$t>ve&&_t+1>zt&&zt+1>=fi(F,x),D)if(!ht&&(ke||H)){var ot=Ei(d,!0),ft=zt-wt;ad(d,_e,ot.top+(x===Le?ft:0)+Oe,ot.left+(x===Le?0:ft)+Oe)}else ad(d,mt);ms(ke||H?et:nt),Nt&&$t<1&&ke||Lt(st+($t===1&&!H?St:0))}}M&&!It.tween&&!en&&!fa&&ut.restart(!0),a&&(V||v&&$t&&($t<1||!Fc))&&To(a.targets).forEach(function(Dt){return Dt.classList[ke||v?"add":"remove"](a.className)}),o&&!L&&!ht&&o(A),O&&!en?(L&&(W&&(w==="complete"?i.pause().totalProgress(1):w==="reset"?i.restart(!0).pause():w==="restart"?i.restart(!0):i[w]()),o&&o(A)),(V||!Fc)&&(c&&V&&Uc(A,c),G[me]&&Uc(A,G[me]),v&&($t===1?A.kill(!1,1):G[me]=0),V||(me=$t===1?1:3,G[me]&&Uc(A,G[me]))),R&&!ke&&Math.abs(A.getVelocity())>(xo(R)?R:2500)&&(po(A.callbackAnimation),$?$.progress(1):po(i,w==="reverse"?1:!$t,1))):L&&o&&!en&&o(A)}if(Gt){var pt=E?zt/E.duration()*(E._caScrollDist||0):zt;xt(pt+(k._isFlipped?1:0)),Gt(pt)}ce&&ce(-zt/E.duration()*(E._caScrollDist||0))}},A.enable=function(ht,kt){A.enabled||(A.enabled=!0,Ge(F,"resize",vo),B||Ge(F,"scroll",hs),it&&Ge(r,"refreshInit",it),ht!==!1&&(A.progress=ct=0,Xt=bt=q=tt()),kt!==!1&&A.refresh())},A.getTween=function(ht){return ht&&It?It.tween:$},A.setPositions=function(ht,kt,At,zt){if(E){var be=E.scrollTrigger,$t=E.duration(),ve=be.end-be.start;ht=be.start+ve*ht/$t,kt=be.start+ve*kt/$t}A.refresh(!1,!1,{start:Qf(ht,At&&!!A._startClamp),end:Qf(kt,At&&!!A._endClamp)},zt),A.update()},A.adjustPinSpacing=function(ht){if(gt&&ht){var kt=gt.indexOf(x.d)+1;gt[kt]=parseFloat(gt[kt])+ht+Oe,gt[1]=parseFloat(gt[1])+ht+Oe,ms(gt)}},A.disable=function(ht,kt){if(A.enabled&&(ht!==!1&&A.revert(!0,!0),A.enabled=A.isActive=!1,kt||$&&$.pause(),Vt=0,Rt&&(Rt.uncache=1),it&&He(r,"refreshInit",it),ut&&(ut.pause(),It.tween&&It.tween.kill()&&(It.tween=0)),!B)){for(var At=Qt.length;At--;)if(Qt[At].scroller===F&&Qt[At]!==A)return;He(F,"resize",vo),B||He(F,"scroll",hs)}},A.kill=function(ht,kt){A.disable(ht,kt),$&&!kt&&$.kill(),l&&delete Wc[l];var At=Qt.indexOf(A);At>=0&&Qt.splice(At,1),At===pn&&ba>0&&pn--,At=0,Qt.forEach(function(zt){return zt.scroller===A.scroller&&(At=1)}),At||mn||(A.scroll.rec=0),i&&(i.scrollTrigger=null,ht&&i.revert({kill:!1}),kt||i.kill()),Ft&&[Ft,Pt,k,jt].forEach(function(zt){return zt.parentNode&&zt.parentNode.removeChild(zt)}),Eo===A&&(Eo=0),d&&(Rt&&(Rt.uncache=1),At=0,Qt.forEach(function(zt){return zt.pin===d&&At++}),At||(Rt.spacer=0)),n.onKill&&n.onKill(A)},Qt.push(A),A.enable(!1,!1),pe&&pe(A),i&&i.add&&!Y){var ie=A.update;A.update=function(){A.update=ie,wt||_t||A.refresh()},Mt.delayedCall(.01,A.update),Y=.01,wt=_t=0}else A.refresh();d&&L_()},r.register=function(n){return fs||(Mt=n||xd(),_d()&&window.document&&r.enable(),fs=go),fs},r.defaults=function(n){if(n)for(var i in n)ga[i]=n[i];return ga},r.disable=function(n,i){go=0,Qt.forEach(function(o){return o[i?"kill":"disable"](n)}),He(ne,"wheel",hs),He(Te,"scroll",hs),clearInterval(ha),He(Te,"touchcancel",hi),He(_e,"touchstart",hi),pa(He,Te,"pointerdown,touchstart,mousedown",jf),pa(He,Te,"pointerup,touchend,mouseup",td),Ta.kill(),da(He);for(var s=0;s<Kt.length;s+=3)ma(He,Kt[s],Kt[s+1]),ma(He,Kt[s],Kt[s+2])},r.enable=function(){if(ne=window,Te=document,Kn=Te.documentElement,_e=Te.body,Mt&&(To=Mt.utils.toArray,yo=Mt.utils.clamp,Hc=Mt.core.context||hi,Lc=Mt.core.suppressOverwrites||hi,Yc=ne.history.scrollRestoration||"auto",Xc=ne.pageYOffset,Mt.core.globals("ScrollTrigger",r),_e)){go=1,ps=document.createElement("div"),ps.style.height="100vh",ps.style.position="absolute",Ad(),T_(),Ce.register(Mt),r.isTouch=Ce.isTouch,Ji=Ce.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),Vc=Ce.isTouch===1,Ge(ne,"wheel",hs),fd=[ne,Te,Kn,_e],Mt.matchMedia?(r.matchMedia=function(l){var c=Mt.matchMedia(),u;for(u in l)c.add(u,l[u]);return c},Mt.addEventListener("matchMediaInit",function(){return jc()}),Mt.addEventListener("matchMediaRevert",function(){return Ed()}),Mt.addEventListener("matchMedia",function(){Dr(0,1),Fr("matchMedia")}),Mt.matchMedia("(orientation: portrait)",function(){return Oc(),Oc})):console.warn("Requires GSAP 3.11.0 or later"),Oc(),Ge(Te,"scroll",hs);var n=_e.style,i=n.borderTopStyle,s=Mt.core.Animation.prototype,o,a;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle="solid",o=Ei(_e),Le.m=Math.round(o.top+Le.sc())||0,tn.m=Math.round(o.left+tn.sc())||0,i?n.borderTopStyle=i:n.removeProperty("border-top-style"),ha=setInterval(id,250),Mt.delayedCall(.5,function(){return fa=0}),Ge(Te,"touchcancel",hi),Ge(_e,"touchstart",hi),pa(Ge,Te,"pointerdown,touchstart,mousedown",jf),pa(Ge,Te,"pointerup,touchend,mouseup",td),kc=Mt.utils.checkPrefix("transform"),wa.push(kc),fs=nn(),Ta=Mt.delayedCall(.2,Dr).pause(),ds=[Te,"visibilitychange",function(){var l=ne.innerWidth,c=ne.innerHeight;Te.hidden?(Jf=l,$f=c):(Jf!==l||$f!==c)&&vo()},Te,"DOMContentLoaded",Dr,ne,"load",Dr,ne,"resize",vo],da(Ge),Qt.forEach(function(l){return l.enable(0,1)}),a=0;a<Kt.length;a+=3)ma(He,Kt[a],Kt[a+1]),ma(He,Kt[a],Kt[a+2])}},r.config=function(n){"limitCallbacks"in n&&(Fc=!!n.limitCallbacks);var i=n.syncInterval;i&&clearInterval(ha)||(ha=i)&&setInterval(id,i),"ignoreMobileResize"in n&&(Vc=r.isTouch===1&&n.ignoreMobileResize),"autoRefreshEvents"in n&&(da(He)||da(Ge,n.autoRefreshEvents||"none"),pd=(n.autoRefreshEvents+"").indexOf("resize")===-1)},r.scrollerProxy=function(n,i){var s=fn(n),o=Kt.indexOf(s),a=Ir(s);~o&&Kt.splice(o,a?6:2),i&&(a?$n.unshift(ne,i,_e,i,Kn,i):$n.unshift(s,i))},r.clearMatchMedia=function(n){Qt.forEach(function(i){return i._ctx&&i._ctx.query===n&&i._ctx.kill(!0,!0)})},r.isInViewport=function(n,i,s){var o=(Pn(n)?fn(n):n).getBoundingClientRect(),a=o[s?Cr:Rr]*i||0;return s?o.right-a>0&&o.left+a<ne.innerWidth:o.bottom-a>0&&o.top+a<ne.innerHeight},r.positionInViewport=function(n,i,s){Pn(n)&&(n=fn(n));var o=n.getBoundingClientRect(),a=o[s?Cr:Rr],l=i==null?a/2:i in Ca?Ca[i]*a:~i.indexOf("%")?parseFloat(i)*a/100:parseFloat(i)||0;return s?(o.left+l)/ne.innerWidth:(o.top+l)/ne.innerHeight},r.killAll=function(n){if(Qt.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),n!==!0){var i=Lr.killAll||[];Lr={},i.forEach(function(s){return s()})}},r}();Ht.version="3.12.5";Ht.saveStyles=function(r){return r?To(r).forEach(function(t){if(t&&t.style){var e=Rn.indexOf(t);e>=0&&Rn.splice(e,5),Rn.push(t,t.style.cssText,t.getBBox&&t.getAttribute("transform"),Mt.core.getCache(t),Hc())}}):Rn};Ht.revert=function(r,t){return jc(!r,t)};Ht.create=function(r,t){return new Ht(r,t)};Ht.refresh=function(r){return r?vo():(fs||Ht.register())&&Dr(!0)};Ht.update=function(r){return++Kt.cache&&Ti(r===!0?2:0)};Ht.clearScrollMemory=Td;Ht.maxScroll=function(r,t){return fi(r,t?tn:Le)};Ht.getScrollFunc=function(r,t){return bi(fn(r),t?tn:Le)};Ht.getById=function(r){return Wc[r]};Ht.getAll=function(){return Qt.filter(function(r){return r.vars.id!=="ScrollSmoother"})};Ht.isScrolling=function(){return!!Vn};Ht.snapDirectional=Qc;Ht.addEventListener=function(r,t){var e=Lr[r]||(Lr[r]=[]);~e.indexOf(t)||e.push(t)};Ht.removeEventListener=function(r,t){var e=Lr[r],n=e&&e.indexOf(t);n>=0&&e.splice(n,1)};Ht.batch=function(r,t){var e=[],n={},i=t.interval||.016,s=t.batchMax||1e9,o=function(c,u){var h=[],f=[],d=Mt.delayedCall(i,function(){u(h,f),h=[],f=[]}).pause();return function(_){h.length||d.restart(!0),h.push(_.trigger),f.push(_),s<=h.length&&d.progress(1)}},a;for(a in t)n[a]=a.substr(0,2)==="on"&&gn(t[a])&&a!=="onRefreshInit"?o(a,t[a]):t[a];return gn(s)&&(s=s(),Ge(Ht,"refresh",function(){return s=t.batchMax()})),To(r).forEach(function(l){var c={};for(a in n)c[a]=n[a];c.trigger=l,e.push(Ht.create(c))}),e};var cd=function(t,e,n,i){return e>i?t(i):e<0&&t(0),n>i?(i-e)/(n-e):n<0?e/(e-n):1},zc=function r(t,e){e===!0?t.style.removeProperty("touch-action"):t.style.touchAction=e===!0?"auto":e?"pan-"+e+(Ce.isTouch?" pinch-zoom":""):"none",t===Kn&&r(_e,e)},ya={auto:1,scroll:1},B_=function(t){var e=t.event,n=t.target,i=t.axis,s=(e.changedTouches?e.changedTouches[0]:e).target,o=s._gsap||Mt.core.getCache(s),a=nn(),l;if(!o._isScrollT||a-o._isScrollT>2e3){for(;s&&s!==_e&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(ya[(l=kn(s)).overflowY]||ya[l.overflowX]));)s=s.parentNode;o._isScroll=s&&s!==n&&!Ir(s)&&(ya[(l=kn(s)).overflowY]||ya[l.overflowX]),o._isScrollT=a}(o._isScroll||i==="x")&&(e.stopPropagation(),e._gsapAllow=!0)},Cd=function(t,e,n,i){return Ce.create({target:t,capture:!0,debounce:!1,lockAxis:!0,type:e,onWheel:i=i&&B_,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&Ge(Te,Ce.eventTypes[0],hd,!1,!0)},onDisable:function(){return He(Te,Ce.eventTypes[0],hd,!0)}})},z_=/(input|label|select|textarea)/i,ud,hd=function(t){var e=z_.test(t.target.tagName);(e||ud)&&(t._gsapAllow=!0,ud=e)},k_=function(t){Ar(t)||(t={}),t.preventDefault=t.isNormalizer=t.allowClicks=!0,t.type||(t.type="wheel,touch"),t.debounce=!!t.debounce,t.id=t.id||"normalizer";var e=t,n=e.normalizeScrollX,i=e.momentum,s=e.allowNestedScroll,o=e.onRelease,a,l,c=fn(t.target)||Kn,u=Mt.core.globals().ScrollSmoother,h=u&&u.get(),f=Ji&&(t.content&&fn(t.content)||h&&t.content!==!1&&!h.smooth()&&h.content()),d=bi(c,Le),_=bi(c,tn),g=1,p=(Ce.isTouch&&ne.visualViewport?ne.visualViewport.scale*ne.visualViewport.width:ne.outerWidth)/ne.innerWidth,m=0,S=gn(i)?function(){return i(a)}:function(){return i||2.8},v,M,D=Cd(c,t.type,!0,s),T=function(){return M=!1},E=hi,R=hi,y=function(){l=fi(c,Le),R=yo(Ji?1:0,l),n&&(E=yo(0,fi(c,tn))),v=Pr},x=function(){f._gsap.y=_o(parseFloat(f._gsap.y)+d.offset)+"px",f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(f._gsap.y)+", 0, 1)",d.offset=d.cacheID=0},L=function(){if(M){requestAnimationFrame(T);var U=_o(a.deltaY/2),I=R(d.v-U);if(f&&I!==d.v+d.offset){d.offset=I-d.v;var A=_o((parseFloat(f&&f._gsap.y)||0)-d.offset);f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+A+", 0, 1)",f._gsap.y=A+"px",d.cacheID=Kt.cache,Ti()}return!0}d.offset&&x(),M=!0},F,P,B,X,G=function(){y(),F.isActive()&&F.vars.scrollY>l&&(d()>l?F.progress(1)&&d(l):F.resetTo("scrollY",l))};return f&&Mt.set(f,{y:"+=0"}),t.ignoreCheck=function(J){return Ji&&J.type==="touchmove"&&L(J)||g>1.05&&J.type!=="touchstart"||a.isGesturing||J.touches&&J.touches.length>1},t.onPress=function(){M=!1;var J=g;g=_o((ne.visualViewport&&ne.visualViewport.scale||1)/p),F.pause(),J!==g&&zc(c,g>1.01?!0:n?!1:"x"),P=_(),B=d(),y(),v=Pr},t.onRelease=t.onGestureStart=function(J,U){if(d.offset&&x(),!U)X.restart(!0);else{Kt.cache++;var I=S(),A,it;n&&(A=_(),it=A+I*.05*-J.velocityX/.227,I*=cd(_,A,it,fi(c,tn)),F.vars.scrollX=E(it)),A=d(),it=A+I*.05*-J.velocityY/.227,I*=cd(d,A,it,fi(c,Le)),F.vars.scrollY=R(it),F.invalidate().duration(I).play(.01),(Ji&&F.vars.scrollY>=l||A>=l-1)&&Mt.to({},{onUpdate:G,duration:I})}o&&o(J)},t.onWheel=function(){F._ts&&F.pause(),nn()-m>1e3&&(v=0,m=nn())},t.onChange=function(J,U,I,A,it){if(Pr!==v&&y(),U&&n&&_(E(A[2]===U?P+(J.startX-J.x):_()+U-A[1])),I){d.offset&&x();var vt=it[2]===I,Wt=vt?B+J.startY-J.y:d()+I-it[1],q=R(Wt);vt&&Wt!==q&&(B+=q-Wt),d(q)}(I||U)&&Ti()},t.onEnable=function(){zc(c,n?!1:"x"),Ht.addEventListener("refresh",G),Ge(ne,"resize",G),d.smooth&&(d.target.style.scrollBehavior="auto",d.smooth=_.smooth=!1),D.enable()},t.onDisable=function(){zc(c,!0),He(ne,"resize",G),Ht.removeEventListener("refresh",G),D.kill()},t.lockAxis=t.lockAxis!==!1,a=new Ce(t),a.iOS=Ji,Ji&&!d()&&d(1),Ji&&Mt.ticker.add(hi),X=a._dc,F=Mt.to(a,{ease:"power4",paused:!0,inherit:!1,scrollX:n?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:Dd(d,d(),function(){return F.pause()})},onUpdate:Ti,onComplete:X.vars.onComplete}),a};Ht.sort=function(r){return Qt.sort(r||function(t,e){return(t.vars.refreshPriority||0)*-1e6+t.start-(e.start+(e.vars.refreshPriority||0)*-1e6)})};Ht.observe=function(r){return new Ce(r)};Ht.normalizeScroll=function(r){if(typeof r>"u")return dn;if(r===!0&&dn)return dn.enable();if(r===!1){dn&&dn.kill(),dn=r;return}var t=r instanceof Ce?r:k_(r);return dn&&dn.target===t.target&&dn.kill(),Ir(t.target)&&(dn=t),t};Ht.core={_getVelocityProp:ua,_inputObserver:Cd,_scrollers:Kt,_proxies:$n,bridge:{ss:function(){Vn||Fr("scrollStart"),Vn=nn()},ref:function(){return en}}};xd()&&Mt.registerPlugin(Ht);he.registerPlugin(Ht);var Rd=()=>{[{wrapperSelector:".prx-steps-wrap",itemSelector:".prx-step-box, .prx-step-divider"},{wrapperSelector:".prx-trust_grid",itemSelector:".prx-trust-box"},{wrapperSelector:".prx-areas_wrapper",itemSelector:".prx-areas_item",desktopOnly:!0},{wrapperSelector:".prx-mastery_techonologies-wrapper",itemSelector:".mastery_technologies_image"}].forEach(({wrapperSelector:t,itemSelector:e,desktopOnly:n})=>{if(n&&window.innerWidth<992)return;let i=document.querySelector(t);if(!i)return;let s=i.querySelectorAll(e);s.length&&(he.set(s,{opacity:0,y:48}),he.timeline({scrollTrigger:{trigger:i,start:"top bottom-=12%",toggleActions:"play none none reverse"}}).to(s,{opacity:1,y:0,duration:.7,ease:"power2.out",stagger:.22}))})};var V_=/(?:^\s+|\s+$)/g,tu=/([\uD800-\uDBFF][\uDC00-\uDFFF](?:[\u200D\uFE0F][\uD800-\uDBFF][\uDC00-\uDFFF]){2,}|\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\uDD3E\uDDD6-\uDDDF])\u200D[\u2640\u2642]\uFE0F|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F\u200D[\u2640\u2642]|(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642])\uFE0F|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC69\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708]))\uFE0F|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83D\uDC69\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]))|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\u200D(?:(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F)/;function _s(r){var t=r.nodeType,e="";if(t===1||t===9||t===11){if(typeof r.textContent=="string")return r.textContent;for(r=r.firstChild;r;r=r.nextSibling)e+=_s(r)}else if(t===3||t===4)return r.nodeValue;return e}function Qn(r,t,e,n){if(r+="",e&&(r=r.trim?r.trim():r.replace(V_,"")),t&&t!=="")return r.replace(/>/g,"&gt;").replace(/</g,"&lt;").split(t);for(var i=[],s=r.length,o=0,a,l;o<s;o++)l=r.charAt(o),(l.charCodeAt(0)>=55296&&l.charCodeAt(0)<=56319||r.charCodeAt(o+1)>=65024&&r.charCodeAt(o+1)<=65039)&&(a=((r.substr(o,12).split(tu)||[])[1]||"").length||2,l=r.substr(o,a),i.emoji=1,o+=a-1),i.push(l===">"?"&gt;":l==="<"?"&lt;":n&&l===" "&&(r.charAt(o-1)===" "||r.charAt(o+1)===" ")?"&nbsp;":l);return i}var Pa=function(){function r(e){this.chars=Qn(e),this.sets=[],this.length=50;for(var n=0;n<20;n++)this.sets[n]=Id(80,this.chars)}var t=r.prototype;return t.grow=function(n){for(var i=0;i<20;i++)this.sets[i]+=Id(n-this.length,this.chars);this.length=n},r}(),Nr,Nd,Ud=function(){return Nr||typeof window<"u"&&(Nr=window.gsap)&&Nr.registerPlugin&&Nr},H_=1,Pd=/\s+/g,Id=function(t,e){for(var n=e.length,i="";--t>-1;)i+=e[~~(Math.random()*n)];return i},eu="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Ld=eu.toLowerCase(),G_={upperCase:new Pa(eu),lowerCase:new Pa(Ld),upperAndLowerCase:new Pa(eu+Ld)},Fd=function(){Nd=Nr=Ud()},Do={version:"3.12.5",name:"scrambleText",register:function(t,e,n){Nr=t,Fd()},init:function(t,e,n,i,s){if(Nd||Fd(),this.prop="innerHTML"in t?"innerHTML":"textContent"in t?"textContent":0,!!this.prop){this.target=t,typeof e!="object"&&(e={text:e});var o=e.text||e.value||"",a=e.trim!==!1,l=this,c,u,h,f;return l.delimiter=c=e.delimiter||"",l.original=Qn(_s(t).replace(Pd," ").split("&nbsp;").join(""),c,a),(o==="{original}"||o===!0||o==null)&&(o=l.original.join(c)),l.text=Qn((o||"").replace(Pd," "),c,a),l.hasClass=!!(e.newClass||e.oldClass),l.newClass=e.newClass,l.oldClass=e.oldClass,f=c==="",l.textHasEmoji=f&&!!l.text.emoji,l.charsHaveEmoji=!!e.chars&&!!Qn(e.chars).emoji,l.length=f?l.original.length:l.original.join(c).length,l.lengthDif=(f?l.text.length:l.text.join(c).length)-l.length,l.fillChar=e.fillChar||e.chars&&~e.chars.indexOf(" ")?"&nbsp;":"",l.charSet=h=G_[e.chars||"upperCase"]||new Pa(e.chars),l.speed=.05/(e.speed||1),l.prevScrambleTime=0,l.setIndex=Math.random()*20|0,u=l.length+Math.max(l.lengthDif,0),u>h.length&&h.grow(u),l.chars=h.sets[l.setIndex],l.revealDelay=e.revealDelay||0,l.tweenLength=e.tweenLength!==!1,l.tween=n,l.rightToLeft=!!e.rightToLeft,l._props.push("scrambleText","text"),H_}},render:function(t,e){var n=e.target,i=e.prop,s=e.text,o=e.delimiter,a=e.tween,l=e.prevScrambleTime,c=e.revealDelay,u=e.setIndex,h=e.chars,f=e.charSet,d=e.length,_=e.textHasEmoji,g=e.charsHaveEmoji,p=e.lengthDif,m=e.tweenLength,S=e.oldClass,v=e.newClass,M=e.rightToLeft,D=e.fillChar,T=e.speed,E=e.original,R=e.hasClass,y=s.length,x=a._time,L=x-l,F,P,B,X,G,J,U,I,A,it,vt;c&&(a._from&&(x=a._dur-x),t=x===0?0:x<c?1e-6:x===a._dur?1:a._ease((x-c)/(a._dur-c))),t<0?t=0:t>1&&(t=1),M&&(t=1-t),F=~~(t*y+.5),t?((L>T||L<-T)&&(e.setIndex=u=(u+(Math.random()*19|0))%20,e.chars=f.sets[u],e.prevScrambleTime+=L),X=h):X=E.join(o),vt=a._from?t:1-t,it=d+(m?a._from?vt*vt*vt:1-vt*vt*vt:1)*p,M?t===1&&(a._from||a.data==="isFromStart")?(B="",X=E.join(o)):(U=s.slice(F).join(o),g?B=Qn(X).slice(0,it-(_?Qn(U):U).length+.5|0).join(""):B=X.substr(0,it-(_?Qn(U):U).length+.5|0),X=U):(B=s.slice(0,F).join(o),P=(_?Qn(B):B).length,g?X=Qn(X).slice(P,it+.5|0).join(""):X=X.substr(P,it-P+.5|0)),R?(I=M?S:v,A=M?v:S,G=I&&F!==0,J=A&&F!==y,U=(G?"<span class='"+I+"'>":"")+B+(G?"</span>":"")+(J?"<span class='"+A+"'>":"")+o+X+(J?"</span>":"")):U=B+o+X,n[i]=D==="&nbsp;"&&~U.indexOf(" ")?U.split(" ").join("&nbsp;&nbsp;"):U}};Do.emojiSafeSplit=Qn;Do.getText=_s;Ud()&&Nr.registerPlugin(Do);he.registerPlugin(Do);var Od=()=>{document.querySelectorAll("[data-scramble-link]").forEach(t=>{let e=t.querySelector("[data-scramble-text]");if(!e)return;let n=e.textContent;t.addEventListener("mouseenter",()=>{he.matchMedia().add("(min-width: 768px)",()=>{he.to(e,{duration:1,scrambleText:{text:n,chars:"10"}})})})})};he.registerPlugin(Ht);var Bd=()=>{let r=document.querySelector(".prx-header-wrapper-center.prx-pinned"),t=document.querySelector(".prx-special_content"),e=document.querySelectorAll(".prx-special_content .prx-special-row, .prx-special_content .prx-special-row-second");if(!r||!t||!e.length)return;he.matchMedia().add("(min-width: 1440px)",()=>{let o=80+r.offsetHeight;he.set(r,{zIndex:10,position:"relative"}),Ht.create({trigger:r,endTrigger:t,start:"top top+=80",end:"bottom bottom",pin:!0,pinSpacing:!1}),e.forEach((a,l)=>{if(l===e.length-1){Ht.create({trigger:a,endTrigger:t,start:`top top+=${o}`,end:"bottom bottom",pin:!0,pinSpacing:!1});return}he.to(a,{ease:"circ.out",startAt:{filter:"brightness(100%) blur(0px)",scale:1,opacity:1},filter:"brightness(50%) blur(10px)",scale:.6,opacity:0,scrollTrigger:{trigger:a,start:`top top+=${o}`,endTrigger:t,end:"bottom+=5% bottom",pin:!0,pinSpacing:!1,scrub:1,invalidateOnRefresh:!1}})})})};var zd=()=>{if(window.innerWidth>=992)return;let r=document.querySelector(".prx-areas_wrapper"),t=r?.querySelector(".prx-areas_row"),e=t?Array.from(t.querySelectorAll(".prx-areas_item")):[];if(!e.length)return;let n=2,i=n,s=!1;e.slice(-n).reverse().forEach(_=>t.prepend(_.cloneNode(!0))),e.slice(0,n).forEach(_=>t.appendChild(_.cloneNode(!0)));let o=Array.from(t.querySelectorAll(".prx-areas_item")),a=0,l=0,c=0,u=()=>{he.set(t,{x:0}),l=o[0].offsetWidth,c=r.offsetWidth,a=l+16},h=_=>-_*a+(c-l)/2,f=_=>{s||(s=!0,he.to(t,{x:h(_),duration:.45,ease:"power2.out",onComplete:()=>{_<n?(i=_+e.length,he.set(t,{x:h(i)})):_>=n+e.length?(i=_-e.length,he.set(t,{x:h(i)})):i=_,s=!1}}))},d=0;r.addEventListener("touchstart",_=>d=_.touches[0].clientX),r.addEventListener("touchend",_=>{let g=d-_.changedTouches[0].clientX;Math.abs(g)>50&&f(i+(g>0?1:-1))}),requestAnimationFrame(()=>{he.set(o,{clearProps:"y,opacity"}),u(),he.set(t,{x:h(i)})}),window.addEventListener("resize",()=>{window.innerWidth>=992||(u(),he.set(t,{x:h(i)}))})};var vh="164";var W_=0,kd=1,X_=2;var fm=1,yh=2,Ii=3,lr=0,Tn=1,Fi=2,sr=0,or=1,Vd=2,Hd=3,Gd=4,q_=5,Gr=100,Y_=101,Z_=102,J_=103,$_=104,K_=200,Q_=201,j_=202,t0=203,Uu=204,Ou=205,e0=206,n0=207,i0=208,r0=209,s0=210,o0=211,a0=212,l0=213,c0=214,u0=0,h0=1,f0=2,il=3,d0=4,p0=5,m0=6,g0=7,dm=0,_0=1,x0=2,ar=0,v0=1,y0=2,M0=3,S0=4,b0=5,w0=6,E0=7;var pm=300,ks=301,Vs=302,Bu=303,zu=304,Rl=306,ku=1e3,Xr=1001,Vu=1002,Wn=1003,T0=1004;var Ia=1005;var ni=1006,nu=1007;var qr=1008;var cr=1009,A0=1010,D0=1011,mm=1012,gm=1013,Hs=1014,ir=1015,Pl=1016,_m=1017,xm=1018,ko=1020,C0=35902,R0=1021,P0=1022,pi=1023,I0=1024,L0=1025,Os=1026,Uo=1027,F0=1028,vm=1029,N0=1030,ym=1031,Mm=1033,iu=33776,ru=33777,su=33778,ou=33779,Wd=35840,Xd=35841,qd=35842,Yd=35843,Zd=36196,Jd=37492,$d=37496,Kd=37808,Qd=37809,jd=37810,tp=37811,ep=37812,np=37813,ip=37814,rp=37815,sp=37816,op=37817,ap=37818,lp=37819,cp=37820,up=37821,au=36492,hp=36494,fp=36495,U0=36283,dp=36284,pp=36285,mp=36286;var rl=2300,sl=2301,lu=2302,gp=2400,_p=2401,xp=2402;var O0=3200,B0=3201,z0=0,k0=1,nr="",Gn="srgb",fr="srgb-linear",Mh="display-p3",Il="display-p3-linear",ol="linear",xe="srgb",al="rec709",ll="p3";var xs=7680;var vp=519,V0=512,H0=513,G0=514,Sm=515,W0=516,X0=517,q0=518,Y0=519,yp=35044;var Mp="300 es",Ni=2e3,cl=2001,ur=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,t);t.target=null}}},rn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var cu=Math.PI/180,Hu=180/Math.PI;function Vo(){let r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(rn[r&255]+rn[r>>8&255]+rn[r>>16&255]+rn[r>>24&255]+"-"+rn[t&255]+rn[t>>8&255]+"-"+rn[t>>16&15|64]+rn[t>>24&255]+"-"+rn[e&63|128]+rn[e>>8&255]+"-"+rn[e>>16&255]+rn[e>>24&255]+rn[n&255]+rn[n>>8&255]+rn[n>>16&255]+rn[n>>24&255]).toLowerCase()}function En(r,t,e){return Math.max(t,Math.min(e,r))}function Z0(r,t){return(r%t+t)%t}function uu(r,t,e){return(1-e)*r+e*t}function Co(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function wn(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var oe=class r{constructor(t=0,e=0){r.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(En(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,o=this.y-t.y;return this.x=s*n-o*i+t.x,this.y=s*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Zt=class r{constructor(t,e,n,i,s,o,a,l,c){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,l,c)}set(t,e,n,i,s,o,a,l,c){let u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],f=n[2],d=n[5],_=n[8],g=i[0],p=i[3],m=i[6],S=i[1],v=i[4],M=i[7],D=i[2],T=i[5],E=i[8];return s[0]=o*g+a*S+l*D,s[3]=o*p+a*v+l*T,s[6]=o*m+a*M+l*E,s[1]=c*g+u*S+h*D,s[4]=c*p+u*v+h*T,s[7]=c*m+u*M+h*E,s[2]=f*g+d*S+_*D,s[5]=f*p+d*v+_*T,s[8]=f*m+d*M+_*E,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e*o*u-e*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*o-a*c,f=a*l-u*s,d=c*s-o*l,_=e*h+n*f+i*d;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/_;return t[0]=h*g,t[1]=(i*c-u*n)*g,t[2]=(a*n-i*o)*g,t[3]=f*g,t[4]=(u*e-i*l)*g,t[5]=(i*s-a*e)*g,t[6]=d*g,t[7]=(n*l-c*e)*g,t[8]=(o*e-n*s)*g,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+t,-i*c,i*l,-i*(-c*o+l*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(hu.makeScale(t,e)),this}rotate(t){return this.premultiply(hu.makeRotation(-t)),this}translate(t,e){return this.premultiply(hu.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},hu=new Zt;function bm(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function ul(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function J0(){let r=ul("canvas");return r.style.display="block",r}var Sp={};function $0(r){r in Sp||(Sp[r]=!0,console.warn(r))}var bp=new Zt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),wp=new Zt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),La={[fr]:{transfer:ol,primaries:al,toReference:r=>r,fromReference:r=>r},[Gn]:{transfer:xe,primaries:al,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Il]:{transfer:ol,primaries:ll,toReference:r=>r.applyMatrix3(wp),fromReference:r=>r.applyMatrix3(bp)},[Mh]:{transfer:xe,primaries:ll,toReference:r=>r.convertSRGBToLinear().applyMatrix3(wp),fromReference:r=>r.applyMatrix3(bp).convertLinearToSRGB()}},K0=new Set([fr,Il]),fe={enabled:!0,_workingColorSpace:fr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!K0.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,t,e){if(this.enabled===!1||t===e||!t||!e)return r;let n=La[t].toReference,i=La[e].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,t){return this.convert(r,this._workingColorSpace,t)},toWorkingColorSpace:function(r,t){return this.convert(r,t,this._workingColorSpace)},getPrimaries:function(r){return La[r].primaries},getTransfer:function(r){return r===nr?ol:La[r].transfer}};function Bs(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function fu(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var vs,Gu=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{vs===void 0&&(vs=ul("canvas")),vs.width=t.width,vs.height=t.height;let n=vs.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=vs}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=ul("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=Bs(s[o]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(Bs(e[n]/255)*255):e[n]=Bs(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},Q0=0,hl=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Q0++}),this.uuid=Vo(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(du(i[o].image)):s.push(du(i[o]))}else s=du(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function du(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Gu.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var j0=0,Yn=class r extends ur{constructor(t=r.DEFAULT_IMAGE,e=r.DEFAULT_MAPPING,n=Xr,i=Xr,s=ni,o=qr,a=pi,l=cr,c=r.DEFAULT_ANISOTROPY,u=nr){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:j0++}),this.uuid=Vo(),this.name="",this.source=new hl(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new oe(0,0),this.repeat=new oe(1,1),this.center=new oe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Zt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,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),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==pm)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ku:t.x=t.x-Math.floor(t.x);break;case Xr:t.x=t.x<0?0:1;break;case Vu:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case ku:t.y=t.y-Math.floor(t.y);break;case Xr:t.y=t.y<0?0:1;break;case Vu:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};Yn.DEFAULT_IMAGE=null;Yn.DEFAULT_MAPPING=pm;Yn.DEFAULT_ANISOTROPY=1;var Xe=class r{constructor(t=0,e=0,n=0,i=1){r.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,s,l=t.elements,c=l[0],u=l[4],h=l[8],f=l[1],d=l[5],_=l[9],g=l[2],p=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-g)<.01&&Math.abs(_-p)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+g)<.1&&Math.abs(_+p)<.1&&Math.abs(c+d+m-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let v=(c+1)/2,M=(d+1)/2,D=(m+1)/2,T=(u+f)/4,E=(h+g)/4,R=(_+p)/4;return v>M&&v>D?v<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(v),i=T/n,s=E/n):M>D?M<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(M),n=T/i,s=R/i):D<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(D),n=E/s,i=R/s),this.set(n,i,s,e),this}let S=Math.sqrt((p-_)*(p-_)+(h-g)*(h-g)+(f-u)*(f-u));return Math.abs(S)<.001&&(S=1),this.x=(p-_)/S,this.y=(h-g)/S,this.z=(f-u)/S,this.w=Math.acos((c+d+m-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Wu=class extends ur{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Xe(0,0,t,e),this.scissorTest=!1,this.viewport=new Xe(0,0,t,e);let i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ni,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let s=new Yn(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];let o=n.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let n=0,i=t.textures.length;n<i;n++)this.textures[n]=t.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new hl(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},Ui=class extends Wu{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},fl=class extends Yn{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=Wn,this.minFilter=Wn,this.wrapR=Xr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Xu=class extends Yn{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=Wn,this.minFilter=Wn,this.wrapR=Xr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var hr=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,s,o,a){let l=n[i+0],c=n[i+1],u=n[i+2],h=n[i+3],f=s[o+0],d=s[o+1],_=s[o+2],g=s[o+3];if(a===0){t[e+0]=l,t[e+1]=c,t[e+2]=u,t[e+3]=h;return}if(a===1){t[e+0]=f,t[e+1]=d,t[e+2]=_,t[e+3]=g;return}if(h!==g||l!==f||c!==d||u!==_){let p=1-a,m=l*f+c*d+u*_+h*g,S=m>=0?1:-1,v=1-m*m;if(v>Number.EPSILON){let D=Math.sqrt(v),T=Math.atan2(D,m*S);p=Math.sin(p*T)/D,a=Math.sin(a*T)/D}let M=a*S;if(l=l*p+f*M,c=c*p+d*M,u=u*p+_*M,h=h*p+g*M,p===1-a){let D=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=D,c*=D,u*=D,h*=D}}t[e]=l,t[e+1]=c,t[e+2]=u,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],f=s[o+1],d=s[o+2],_=s[o+3];return t[e]=a*_+u*h+l*d-c*f,t[e+1]=l*_+u*f+c*h-a*d,t[e+2]=c*_+u*d+a*f-l*h,t[e+3]=u*_-a*h-l*f-c*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,i=t._y,s=t._z,o=t._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),f=l(n/2),d=l(i/2),_=l(s/2);switch(o){case"XYZ":this._x=f*u*h+c*d*_,this._y=c*d*h-f*u*_,this._z=c*u*_+f*d*h,this._w=c*u*h-f*d*_;break;case"YXZ":this._x=f*u*h+c*d*_,this._y=c*d*h-f*u*_,this._z=c*u*_-f*d*h,this._w=c*u*h+f*d*_;break;case"ZXY":this._x=f*u*h-c*d*_,this._y=c*d*h+f*u*_,this._z=c*u*_+f*d*h,this._w=c*u*h-f*d*_;break;case"ZYX":this._x=f*u*h-c*d*_,this._y=c*d*h+f*u*_,this._z=c*u*_-f*d*h,this._w=c*u*h+f*d*_;break;case"YZX":this._x=f*u*h+c*d*_,this._y=c*d*h+f*u*_,this._z=c*u*_-f*d*h,this._w=c*u*h-f*d*_;break;case"XZY":this._x=f*u*h-c*d*_,this._y=c*d*h-f*u*_,this._z=c*u*_+f*d*h,this._w=c*u*h+f*d*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],o=e[1],a=e[5],l=e[9],c=e[2],u=e[6],h=e[10],f=n+a+h;if(f>0){let d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(u-l)*d,this._y=(s-c)*d,this._z=(o-i)*d}else if(n>a&&n>h){let d=2*Math.sqrt(1+n-a-h);this._w=(u-l)/d,this._x=.25*d,this._y=(i+o)/d,this._z=(s+c)/d}else if(a>h){let d=2*Math.sqrt(1+a-n-h);this._w=(s-c)/d,this._x=(i+o)/d,this._y=.25*d,this._z=(l+u)/d}else{let d=2*Math.sqrt(1+h-n-a);this._w=(o-i)/d,this._x=(s+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(En(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,i=t._y,s=t._z,o=t._w,a=e._x,l=e._y,c=e._z,u=e._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+s*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let d=1-e;return this._w=d*o+e*this._w,this._x=d*n+e*this._x,this._y=d*i+e*this._y,this._z=d*s+e*this._z,this.normalize(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-e)*u)/c,f=Math.sin(e*u)/c;return this._w=o*h+this._w*f,this._x=n*h+this._x*f,this._y=i*h+this._y*f,this._z=s*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},Z=class r{constructor(t=0,e=0,n=0){r.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Ep.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Ep.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,o=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,o=t.y,a=t.z,l=t.w,c=2*(o*i-a*n),u=2*(a*e-s*i),h=2*(s*n-o*e);return this.x=e+l*c+o*h-a*u,this.y=n+l*u+a*c-s*h,this.z=i+l*h+s*u-o*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,o=e.x,a=e.y,l=e.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return pu.copy(this).projectOnVector(t),this.sub(pu)}reflect(t){return this.sub(pu.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(En(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},pu=new Z,Ep=new hr,Yr=class{constructor(t=new Z(1/0,1/0,1/0),e=new Z(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(jn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(jn.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=jn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let n=t.geometry;if(n!==void 0){let s=n.getAttribute("position");if(e===!0&&s!==void 0&&t.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)t.isMesh===!0?t.getVertexPosition(o,jn):jn.fromBufferAttribute(s,o),jn.applyMatrix4(t.matrixWorld),this.expandByPoint(jn);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Fa.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Fa.copy(n.boundingBox)),Fa.applyMatrix4(t.matrixWorld),this.union(Fa)}let i=t.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,jn),jn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Ro),Na.subVectors(this.max,Ro),ys.subVectors(t.a,Ro),Ms.subVectors(t.b,Ro),Ss.subVectors(t.c,Ro),$i.subVectors(Ms,ys),Ki.subVectors(Ss,Ms),Ur.subVectors(ys,Ss);let e=[0,-$i.z,$i.y,0,-Ki.z,Ki.y,0,-Ur.z,Ur.y,$i.z,0,-$i.x,Ki.z,0,-Ki.x,Ur.z,0,-Ur.x,-$i.y,$i.x,0,-Ki.y,Ki.x,0,-Ur.y,Ur.x,0];return!mu(e,ys,Ms,Ss,Na)||(e=[1,0,0,0,1,0,0,0,1],!mu(e,ys,Ms,Ss,Na))?!1:(Ua.crossVectors($i,Ki),e=[Ua.x,Ua.y,Ua.z],mu(e,ys,Ms,Ss,Na))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,jn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(jn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Ai[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ai[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ai[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ai[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ai[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ai[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ai[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ai[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ai),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},Ai=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],jn=new Z,Fa=new Yr,ys=new Z,Ms=new Z,Ss=new Z,$i=new Z,Ki=new Z,Ur=new Z,Ro=new Z,Na=new Z,Ua=new Z,Or=new Z;function mu(r,t,e,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){Or.fromArray(r,s);let a=i.x*Math.abs(Or.x)+i.y*Math.abs(Or.y)+i.z*Math.abs(Or.z),l=t.dot(Or),c=e.dot(Or),u=n.dot(Or);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var tx=new Yr,Po=new Z,gu=new Z,Gs=class{constructor(t=new Z,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):tx.setFromPoints(t).getCenter(n);let i=0;for(let s=0,o=t.length;s<o;s++)i=Math.max(i,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Po.subVectors(t,this.center);let e=Po.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(Po,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(gu.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Po.copy(t.center).add(gu)),this.expandByPoint(Po.copy(t.center).sub(gu))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},Di=new Z,_u=new Z,Oa=new Z,Qi=new Z,xu=new Z,Ba=new Z,vu=new Z,dl=class{constructor(t=new Z,e=new Z(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Di)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=Di.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Di.copy(this.origin).addScaledVector(this.direction,e),Di.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){_u.copy(t).add(e).multiplyScalar(.5),Oa.copy(e).sub(t).normalize(),Qi.copy(this.origin).sub(_u);let s=t.distanceTo(e)*.5,o=-this.direction.dot(Oa),a=Qi.dot(this.direction),l=-Qi.dot(Oa),c=Qi.lengthSq(),u=Math.abs(1-o*o),h,f,d,_;if(u>0)if(h=o*l-a,f=o*a-l,_=s*u,h>=0)if(f>=-_)if(f<=_){let g=1/u;h*=g,f*=g,d=h*(h+o*f+2*a)+f*(o*h+f+2*l)+c}else f=s,h=Math.max(0,-(o*f+a)),d=-h*h+f*(f+2*l)+c;else f=-s,h=Math.max(0,-(o*f+a)),d=-h*h+f*(f+2*l)+c;else f<=-_?(h=Math.max(0,-(-o*s+a)),f=h>0?-s:Math.min(Math.max(-s,-l),s),d=-h*h+f*(f+2*l)+c):f<=_?(h=0,f=Math.min(Math.max(-s,-l),s),d=f*(f+2*l)+c):(h=Math.max(0,-(o*s+a)),f=h>0?s:Math.min(Math.max(-s,-l),s),d=-h*h+f*(f+2*l)+c);else f=o>0?-s:s,h=Math.max(0,-(o*f+a)),d=-h*h+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(_u).addScaledVector(Oa,f),d}intersectSphere(t,e){Di.subVectors(t.center,this.origin);let n=Di.dot(this.direction),i=Di.dot(Di)-n*n,s=t.radius*t.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(n=(t.min.x-f.x)*c,i=(t.max.x-f.x)*c):(n=(t.max.x-f.x)*c,i=(t.min.x-f.x)*c),u>=0?(s=(t.min.y-f.y)*u,o=(t.max.y-f.y)*u):(s=(t.max.y-f.y)*u,o=(t.min.y-f.y)*u),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),h>=0?(a=(t.min.z-f.z)*h,l=(t.max.z-f.z)*h):(a=(t.max.z-f.z)*h,l=(t.min.z-f.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,Di)!==null}intersectTriangle(t,e,n,i,s){xu.subVectors(e,t),Ba.subVectors(n,t),vu.crossVectors(xu,Ba);let o=this.direction.dot(vu),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Qi.subVectors(this.origin,t);let l=a*this.direction.dot(Ba.crossVectors(Qi,Ba));if(l<0)return null;let c=a*this.direction.dot(xu.cross(Qi));if(c<0||l+c>o)return null;let u=-a*Qi.dot(vu);return u<0?null:this.at(u/o,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Pe=class r{constructor(t,e,n,i,s,o,a,l,c,u,h,f,d,_,g,p){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,l,c,u,h,f,d,_,g,p)}set(t,e,n,i,s,o,a,l,c,u,h,f,d,_,g,p){let m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=i,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=f,m[3]=d,m[7]=_,m[11]=g,m[15]=p,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 r().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/bs.setFromMatrixColumn(t,0).length(),s=1/bs.setFromMatrixColumn(t,1).length(),o=1/bs.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(t.order==="XYZ"){let f=o*u,d=o*h,_=a*u,g=a*h;e[0]=l*u,e[4]=-l*h,e[8]=c,e[1]=d+_*c,e[5]=f-g*c,e[9]=-a*l,e[2]=g-f*c,e[6]=_+d*c,e[10]=o*l}else if(t.order==="YXZ"){let f=l*u,d=l*h,_=c*u,g=c*h;e[0]=f+g*a,e[4]=_*a-d,e[8]=o*c,e[1]=o*h,e[5]=o*u,e[9]=-a,e[2]=d*a-_,e[6]=g+f*a,e[10]=o*l}else if(t.order==="ZXY"){let f=l*u,d=l*h,_=c*u,g=c*h;e[0]=f-g*a,e[4]=-o*h,e[8]=_+d*a,e[1]=d+_*a,e[5]=o*u,e[9]=g-f*a,e[2]=-o*c,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){let f=o*u,d=o*h,_=a*u,g=a*h;e[0]=l*u,e[4]=_*c-d,e[8]=f*c+g,e[1]=l*h,e[5]=g*c+f,e[9]=d*c-_,e[2]=-c,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){let f=o*l,d=o*c,_=a*l,g=a*c;e[0]=l*u,e[4]=g-f*h,e[8]=_*h+d,e[1]=h,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=d*h+_,e[10]=f-g*h}else if(t.order==="XZY"){let f=o*l,d=o*c,_=a*l,g=a*c;e[0]=l*u,e[4]=-h,e[8]=c*u,e[1]=f*h+g,e[5]=o*u,e[9]=d*h-_,e[2]=_*h-d,e[6]=a*u,e[10]=g*h+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(ex,t,nx)}lookAt(t,e,n){let i=this.elements;return In.subVectors(t,e),In.lengthSq()===0&&(In.z=1),In.normalize(),ji.crossVectors(n,In),ji.lengthSq()===0&&(Math.abs(n.z)===1?In.x+=1e-4:In.z+=1e-4,In.normalize(),ji.crossVectors(n,In)),ji.normalize(),za.crossVectors(In,ji),i[0]=ji.x,i[4]=za.x,i[8]=In.x,i[1]=ji.y,i[5]=za.y,i[9]=In.y,i[2]=ji.z,i[6]=za.z,i[10]=In.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],f=n[9],d=n[13],_=n[2],g=n[6],p=n[10],m=n[14],S=n[3],v=n[7],M=n[11],D=n[15],T=i[0],E=i[4],R=i[8],y=i[12],x=i[1],L=i[5],F=i[9],P=i[13],B=i[2],X=i[6],G=i[10],J=i[14],U=i[3],I=i[7],A=i[11],it=i[15];return s[0]=o*T+a*x+l*B+c*U,s[4]=o*E+a*L+l*X+c*I,s[8]=o*R+a*F+l*G+c*A,s[12]=o*y+a*P+l*J+c*it,s[1]=u*T+h*x+f*B+d*U,s[5]=u*E+h*L+f*X+d*I,s[9]=u*R+h*F+f*G+d*A,s[13]=u*y+h*P+f*J+d*it,s[2]=_*T+g*x+p*B+m*U,s[6]=_*E+g*L+p*X+m*I,s[10]=_*R+g*F+p*G+m*A,s[14]=_*y+g*P+p*J+m*it,s[3]=S*T+v*x+M*B+D*U,s[7]=S*E+v*L+M*X+D*I,s[11]=S*R+v*F+M*G+D*A,s[15]=S*y+v*P+M*J+D*it,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],o=t[1],a=t[5],l=t[9],c=t[13],u=t[2],h=t[6],f=t[10],d=t[14],_=t[3],g=t[7],p=t[11],m=t[15];return _*(+s*l*h-i*c*h-s*a*f+n*c*f+i*a*d-n*l*d)+g*(+e*l*d-e*c*f+s*o*f-i*o*d+i*c*u-s*l*u)+p*(+e*c*h-e*a*d-s*o*h+n*o*d+s*a*u-n*c*u)+m*(-i*a*u-e*l*h+e*a*f+i*o*h-n*o*f+n*l*u)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],d=t[11],_=t[12],g=t[13],p=t[14],m=t[15],S=h*p*c-g*f*c+g*l*d-a*p*d-h*l*m+a*f*m,v=_*f*c-u*p*c-_*l*d+o*p*d+u*l*m-o*f*m,M=u*g*c-_*h*c+_*a*d-o*g*d-u*a*m+o*h*m,D=_*h*l-u*g*l-_*a*f+o*g*f+u*a*p-o*h*p,T=e*S+n*v+i*M+s*D;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let E=1/T;return t[0]=S*E,t[1]=(g*f*s-h*p*s-g*i*d+n*p*d+h*i*m-n*f*m)*E,t[2]=(a*p*s-g*l*s+g*i*c-n*p*c-a*i*m+n*l*m)*E,t[3]=(h*l*s-a*f*s-h*i*c+n*f*c+a*i*d-n*l*d)*E,t[4]=v*E,t[5]=(u*p*s-_*f*s+_*i*d-e*p*d-u*i*m+e*f*m)*E,t[6]=(_*l*s-o*p*s-_*i*c+e*p*c+o*i*m-e*l*m)*E,t[7]=(o*f*s-u*l*s+u*i*c-e*f*c-o*i*d+e*l*d)*E,t[8]=M*E,t[9]=(_*h*s-u*g*s-_*n*d+e*g*d+u*n*m-e*h*m)*E,t[10]=(o*g*s-_*a*s+_*n*c-e*g*c-o*n*m+e*a*m)*E,t[11]=(u*a*s-o*h*s-u*n*c+e*h*c+o*n*d-e*a*d)*E,t[12]=D*E,t[13]=(u*g*i-_*h*i+_*n*f-e*g*f-u*n*p+e*h*p)*E,t[14]=(_*a*i-o*g*i-_*n*l+e*g*l+o*n*p-e*a*p)*E,t[15]=(o*h*i-u*a*i+u*n*l-e*h*l-o*n*f+e*a*f)*E,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,o=t.x,a=t.y,l=t.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,o){return this.set(1,n,s,0,t,1,o,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,o=e._y,a=e._z,l=e._w,c=s+s,u=o+o,h=a+a,f=s*c,d=s*u,_=s*h,g=o*u,p=o*h,m=a*h,S=l*c,v=l*u,M=l*h,D=n.x,T=n.y,E=n.z;return i[0]=(1-(g+m))*D,i[1]=(d+M)*D,i[2]=(_-v)*D,i[3]=0,i[4]=(d-M)*T,i[5]=(1-(f+m))*T,i[6]=(p+S)*T,i[7]=0,i[8]=(_+v)*E,i[9]=(p-S)*E,i[10]=(1-(f+g))*E,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=bs.set(i[0],i[1],i[2]).length(),o=bs.set(i[4],i[5],i[6]).length(),a=bs.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],ti.copy(this);let c=1/s,u=1/o,h=1/a;return ti.elements[0]*=c,ti.elements[1]*=c,ti.elements[2]*=c,ti.elements[4]*=u,ti.elements[5]*=u,ti.elements[6]*=u,ti.elements[8]*=h,ti.elements[9]*=h,ti.elements[10]*=h,e.setFromRotationMatrix(ti),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,i,s,o,a=Ni){let l=this.elements,c=2*s/(e-t),u=2*s/(n-i),h=(e+t)/(e-t),f=(n+i)/(n-i),d,_;if(a===Ni)d=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(a===cl)d=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,o,a=Ni){let l=this.elements,c=1/(e-t),u=1/(n-i),h=1/(o-s),f=(e+t)*c,d=(n+i)*u,_,g;if(a===Ni)_=(o+s)*h,g=-2*h;else if(a===cl)_=s*h,g=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=g,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},bs=new Z,ti=new Pe,ex=new Z(0,0,0),nx=new Z(1,1,1),ji=new Z,za=new Z,In=new Z,Tp=new Pe,Ap=new hr,Oi=class r{constructor(t=0,e=0,n=0,i=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let i=t.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],f=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(En(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-En(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(En(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-En(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(En(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-En(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return Tp.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Tp,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Ap.setFromEuler(this),this.setFromQuaternion(Ap,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Oi.DEFAULT_ORDER="XYZ";var pl=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},ix=0,Dp=new Z,ws=new hr,Ci=new Pe,ka=new Z,Io=new Z,rx=new Z,sx=new hr,Cp=new Z(1,0,0),Rp=new Z(0,1,0),Pp=new Z(0,0,1),Ip={type:"added"},ox={type:"removed"},Es={type:"childadded",child:null},yu={type:"childremoved",child:null},on=class r extends ur{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:ix++}),this.uuid=Vo(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new Z,e=new Oi,n=new hr,i=new Z(1,1,1);function s(){n.setFromEuler(e,!1)}function o(){e.setFromQuaternion(n,void 0,!1)}e._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Pe},normalMatrix:{value:new Zt}}),this.matrix=new Pe,this.matrixWorld=new Pe,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new pl,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return ws.setFromAxisAngle(t,e),this.quaternion.multiply(ws),this}rotateOnWorldAxis(t,e){return ws.setFromAxisAngle(t,e),this.quaternion.premultiply(ws),this}rotateX(t){return this.rotateOnAxis(Cp,t)}rotateY(t){return this.rotateOnAxis(Rp,t)}rotateZ(t){return this.rotateOnAxis(Pp,t)}translateOnAxis(t,e){return Dp.copy(t).applyQuaternion(this.quaternion),this.position.add(Dp.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Cp,t)}translateY(t){return this.translateOnAxis(Rp,t)}translateZ(t){return this.translateOnAxis(Pp,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ci.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?ka.copy(t):ka.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),Io.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ci.lookAt(Io,ka,this.up):Ci.lookAt(ka,Io,this.up),this.quaternion.setFromRotationMatrix(Ci),i&&(Ci.extractRotation(i.matrixWorld),ws.setFromRotationMatrix(Ci),this.quaternion.premultiply(ws.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(Ip),Es.child=t,this.dispatchEvent(Es),Es.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(ox),yu.child=t,this.dispatchEvent(yu),yu.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ci.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Ci.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ci),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Ip),Es.child=t,this.dispatchEvent(Es),Es.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){let o=this.children[n].getObjectByProperty(t,e);if(o!==void 0)return o}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);let i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Io,t,rx),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Io,sx,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let n=0,i=e.length;n<i;n++){let s=e[n];(s.matrixWorldAutoUpdate===!0||t===!0)&&s.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let i=this.children;for(let s=0,o=i.length;s<o;s++){let a=i[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){let l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){let h=l[c];s(t.shapes,h)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(t.materials,this.material[l]));i.material=a}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){let l=this.animations[a];i.animations.push(s(t.animations,l))}}if(e){let a=o(t.geometries),l=o(t.materials),c=o(t.textures),u=o(t.images),h=o(t.shapes),f=o(t.skeletons),d=o(t.animations),_=o(t.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),f.length>0&&(n.skeletons=f),d.length>0&&(n.animations=d),_.length>0&&(n.nodes=_)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){let i=t.children[n];this.add(i.clone())}return this}};on.DEFAULT_UP=new Z(0,1,0);on.DEFAULT_MATRIX_AUTO_UPDATE=!0;on.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var ei=new Z,Ri=new Z,Mu=new Z,Pi=new Z,Ts=new Z,As=new Z,Lp=new Z,Su=new Z,bu=new Z,wu=new Z,Ns=class r{constructor(t=new Z,e=new Z,n=new Z){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),ei.subVectors(t,e),i.cross(ei);let s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){ei.subVectors(i,e),Ri.subVectors(n,e),Mu.subVectors(t,e);let o=ei.dot(ei),a=ei.dot(Ri),l=ei.dot(Mu),c=Ri.dot(Ri),u=Ri.dot(Mu),h=o*c-a*a;if(h===0)return s.set(0,0,0),null;let f=1/h,d=(c*l-a*u)*f,_=(o*u-a*l)*f;return s.set(1-d-_,_,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Pi)===null?!1:Pi.x>=0&&Pi.y>=0&&Pi.x+Pi.y<=1}static getInterpolation(t,e,n,i,s,o,a,l){return this.getBarycoord(t,e,n,i,Pi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Pi.x),l.addScaledVector(o,Pi.y),l.addScaledVector(a,Pi.z),l)}static isFrontFacing(t,e,n,i){return ei.subVectors(n,e),Ri.subVectors(t,e),ei.cross(Ri).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return ei.subVectors(this.c,this.b),Ri.subVectors(this.a,this.b),ei.cross(Ri).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return r.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return r.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,s){return r.getInterpolation(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return r.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return r.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,i=this.b,s=this.c,o,a;Ts.subVectors(i,n),As.subVectors(s,n),Su.subVectors(t,n);let l=Ts.dot(Su),c=As.dot(Su);if(l<=0&&c<=0)return e.copy(n);bu.subVectors(t,i);let u=Ts.dot(bu),h=As.dot(bu);if(u>=0&&h<=u)return e.copy(i);let f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return o=l/(l-u),e.copy(n).addScaledVector(Ts,o);wu.subVectors(t,s);let d=Ts.dot(wu),_=As.dot(wu);if(_>=0&&d<=_)return e.copy(s);let g=d*c-l*_;if(g<=0&&c>=0&&_<=0)return a=c/(c-_),e.copy(n).addScaledVector(As,a);let p=u*_-d*h;if(p<=0&&h-u>=0&&d-_>=0)return Lp.subVectors(s,i),a=(h-u)/(h-u+(d-_)),e.copy(i).addScaledVector(Lp,a);let m=1/(p+g+f);return o=g*m,a=f*m,e.copy(n).addScaledVector(Ts,o).addScaledVector(As,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},wm={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},tr={h:0,s:0,l:0},Va={h:0,s:0,l:0};function Eu(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}var re=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Gn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,fe.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=fe.workingColorSpace){return this.r=t,this.g=e,this.b=n,fe.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=fe.workingColorSpace){if(t=Z0(t,1),e=En(e,0,1),n=En(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,o=2*n-s;this.r=Eu(o,s,t+1/3),this.g=Eu(o,s,t),this.b=Eu(o,s,t-1/3)}return fe.toWorkingColorSpace(this,i),this}setStyle(t,e=Gn){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let s,o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(o===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Gn){let n=wm[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Bs(t.r),this.g=Bs(t.g),this.b=Bs(t.b),this}copyLinearToSRGB(t){return this.r=fu(t.r),this.g=fu(t.g),this.b=fu(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Gn){return fe.fromWorkingColorSpace(sn.copy(this),t),Math.round(En(sn.r*255,0,255))*65536+Math.round(En(sn.g*255,0,255))*256+Math.round(En(sn.b*255,0,255))}getHexString(t=Gn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=fe.workingColorSpace){fe.fromWorkingColorSpace(sn.copy(this),e);let n=sn.r,i=sn.g,s=sn.b,o=Math.max(n,i,s),a=Math.min(n,i,s),l,c,u=(a+o)/2;if(a===o)l=0,c=0;else{let h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case n:l=(i-s)/h+(i<s?6:0);break;case i:l=(s-n)/h+2;break;case s:l=(n-i)/h+4;break}l/=6}return t.h=l,t.s=c,t.l=u,t}getRGB(t,e=fe.workingColorSpace){return fe.fromWorkingColorSpace(sn.copy(this),e),t.r=sn.r,t.g=sn.g,t.b=sn.b,t}getStyle(t=Gn){fe.fromWorkingColorSpace(sn.copy(this),t);let e=sn.r,n=sn.g,i=sn.b;return t!==Gn?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){return this.getHSL(tr),this.setHSL(tr.h+t,tr.s+e,tr.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(tr),t.getHSL(Va);let n=uu(tr.h,Va.h,e),i=uu(tr.s,Va.s,e),s=uu(tr.l,Va.l,e);return this.setHSL(n,i,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,i=this.b,s=t.elements;return this.r=s[0]*e+s[3]*n+s[6]*i,this.g=s[1]*e+s[4]*n+s[7]*i,this.b=s[2]*e+s[5]*n+s[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},sn=new re;re.NAMES=wm;var ax=0,Zr=class extends ur{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ax++}),this.uuid=Vo(),this.name="",this.type="Material",this.blending=or,this.side=lr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Uu,this.blendDst=Ou,this.blendEquation=Gr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new re(0,0,0),this.blendAlpha=0,this.depthFunc=il,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=vp,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=xs,this.stencilZFail=xs,this.stencilZPass=xs,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let i=this[e];if(i===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.6,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(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),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(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).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(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).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(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).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!==or&&(n.blending=this.blending),this.side!==lr&&(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!==Uu&&(n.blendSrc=this.blendSrc),this.blendDst!==Ou&&(n.blendDst=this.blendDst),this.blendEquation!==Gr&&(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!==il&&(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!==vp&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==xs&&(n.stencilFail=this.stencilFail),this.stencilZFail!==xs&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==xs&&(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.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 i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(e){let s=i(t.textures),o=i(t.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let i=e.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},ml=class extends Zr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new re(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 Oi,this.combine=dm,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var Ne=new Z,Ha=new oe,Xn=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=yp,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ir,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return $0("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)Ha.fromBufferAttribute(this,e),Ha.applyMatrix3(t),this.setXY(e,Ha.x,Ha.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Ne.fromBufferAttribute(this,e),Ne.applyMatrix3(t),this.setXYZ(e,Ne.x,Ne.y,Ne.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Ne.fromBufferAttribute(this,e),Ne.applyMatrix4(t),this.setXYZ(e,Ne.x,Ne.y,Ne.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Ne.fromBufferAttribute(this,e),Ne.applyNormalMatrix(t),this.setXYZ(e,Ne.x,Ne.y,Ne.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Ne.fromBufferAttribute(this,e),Ne.transformDirection(t),this.setXYZ(e,Ne.x,Ne.y,Ne.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Co(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=wn(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Co(e,this.array)),e}setX(t,e){return this.normalized&&(e=wn(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Co(e,this.array)),e}setY(t,e){return this.normalized&&(e=wn(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Co(e,this.array)),e}setZ(t,e){return this.normalized&&(e=wn(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Co(e,this.array)),e}setW(t,e){return this.normalized&&(e=wn(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=wn(e,this.array),n=wn(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=wn(e,this.array),n=wn(n,this.array),i=wn(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,s){return t*=this.itemSize,this.normalized&&(e=wn(e,this.array),n=wn(n,this.array),i=wn(i,this.array),s=wn(s,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==yp&&(t.usage=this.usage),t}};var gl=class extends Xn{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var _l=class extends Xn{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var qn=class extends Xn{constructor(t,e,n){super(new Float32Array(t),e,n)}},lx=0,Hn=new Pe,Tu=new on,Ds=new Z,Ln=new Yr,Lo=new Yr,We=new Z,mi=class r extends ur{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:lx++}),this.uuid=Vo(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(bm(t)?_l:gl)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Zt().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Hn.makeRotationFromQuaternion(t),this.applyMatrix4(Hn),this}rotateX(t){return Hn.makeRotationX(t),this.applyMatrix4(Hn),this}rotateY(t){return Hn.makeRotationY(t),this.applyMatrix4(Hn),this}rotateZ(t){return Hn.makeRotationZ(t),this.applyMatrix4(Hn),this}translate(t,e,n){return Hn.makeTranslation(t,e,n),this.applyMatrix4(Hn),this}scale(t,e,n){return Hn.makeScale(t,e,n),this.applyMatrix4(Hn),this}lookAt(t){return Tu.lookAt(t),Tu.updateMatrix(),this.applyMatrix4(Tu.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ds).negate(),this.translate(Ds.x,Ds.y,Ds.z),this}setFromPoints(t){let e=[];for(let n=0,i=t.length;n<i;n++){let s=t[n];e.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new qn(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Yr);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){let s=e[n];Ln.setFromBufferAttribute(s),this.morphTargetsRelative?(We.addVectors(this.boundingBox.min,Ln.min),this.boundingBox.expandByPoint(We),We.addVectors(this.boundingBox.max,Ln.max),this.boundingBox.expandByPoint(We)):(this.boundingBox.expandByPoint(Ln.min),this.boundingBox.expandByPoint(Ln.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.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 Gs);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Z,1/0);return}if(t){let n=this.boundingSphere.center;if(Ln.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){let a=e[s];Lo.setFromBufferAttribute(a),this.morphTargetsRelative?(We.addVectors(Ln.min,Lo.min),Ln.expandByPoint(We),We.addVectors(Ln.max,Lo.max),Ln.expandByPoint(We)):(Ln.expandByPoint(Lo.min),Ln.expandByPoint(Lo.max))}Ln.getCenter(n);let i=0;for(let s=0,o=t.count;s<o;s++)We.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(We));if(e)for(let s=0,o=e.length;s<o;s++){let a=e[s],l=this.morphTargetsRelative;for(let c=0,u=a.count;c<u;c++)We.fromBufferAttribute(a,c),l&&(Ds.fromBufferAttribute(t,c),We.add(Ds)),i=Math.max(i,n.distanceToSquared(We))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=e.position,i=e.normal,s=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Xn(new Float32Array(4*n.count),4));let o=this.getAttribute("tangent"),a=[],l=[];for(let R=0;R<n.count;R++)a[R]=new Z,l[R]=new Z;let c=new Z,u=new Z,h=new Z,f=new oe,d=new oe,_=new oe,g=new Z,p=new Z;function m(R,y,x){c.fromBufferAttribute(n,R),u.fromBufferAttribute(n,y),h.fromBufferAttribute(n,x),f.fromBufferAttribute(s,R),d.fromBufferAttribute(s,y),_.fromBufferAttribute(s,x),u.sub(c),h.sub(c),d.sub(f),_.sub(f);let L=1/(d.x*_.y-_.x*d.y);isFinite(L)&&(g.copy(u).multiplyScalar(_.y).addScaledVector(h,-d.y).multiplyScalar(L),p.copy(h).multiplyScalar(d.x).addScaledVector(u,-_.x).multiplyScalar(L),a[R].add(g),a[y].add(g),a[x].add(g),l[R].add(p),l[y].add(p),l[x].add(p))}let S=this.groups;S.length===0&&(S=[{start:0,count:t.count}]);for(let R=0,y=S.length;R<y;++R){let x=S[R],L=x.start,F=x.count;for(let P=L,B=L+F;P<B;P+=3)m(t.getX(P+0),t.getX(P+1),t.getX(P+2))}let v=new Z,M=new Z,D=new Z,T=new Z;function E(R){D.fromBufferAttribute(i,R),T.copy(D);let y=a[R];v.copy(y),v.sub(D.multiplyScalar(D.dot(y))).normalize(),M.crossVectors(T,y);let L=M.dot(l[R])<0?-1:1;o.setXYZW(R,v.x,v.y,v.z,L)}for(let R=0,y=S.length;R<y;++R){let x=S[R],L=x.start,F=x.count;for(let P=L,B=L+F;P<B;P+=3)E(t.getX(P+0)),E(t.getX(P+1)),E(t.getX(P+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Xn(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let f=0,d=n.count;f<d;f++)n.setXYZ(f,0,0,0);let i=new Z,s=new Z,o=new Z,a=new Z,l=new Z,c=new Z,u=new Z,h=new Z;if(t)for(let f=0,d=t.count;f<d;f+=3){let _=t.getX(f+0),g=t.getX(f+1),p=t.getX(f+2);i.fromBufferAttribute(e,_),s.fromBufferAttribute(e,g),o.fromBufferAttribute(e,p),u.subVectors(o,s),h.subVectors(i,s),u.cross(h),a.fromBufferAttribute(n,_),l.fromBufferAttribute(n,g),c.fromBufferAttribute(n,p),a.add(u),l.add(u),c.add(u),n.setXYZ(_,a.x,a.y,a.z),n.setXYZ(g,l.x,l.y,l.z),n.setXYZ(p,c.x,c.y,c.z)}else for(let f=0,d=e.count;f<d;f+=3)i.fromBufferAttribute(e,f+0),s.fromBufferAttribute(e,f+1),o.fromBufferAttribute(e,f+2),u.subVectors(o,s),h.subVectors(i,s),u.cross(h),n.setXYZ(f+0,u.x,u.y,u.z),n.setXYZ(f+1,u.x,u.y,u.z),n.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)We.fromBufferAttribute(t,e),We.normalize(),t.setXYZ(e,We.x,We.y,We.z)}toNonIndexed(){function t(a,l){let c=a.array,u=a.itemSize,h=a.normalized,f=new c.constructor(l.length*u),d=0,_=0;for(let g=0,p=l.length;g<p;g++){a.isInterleavedBufferAttribute?d=l[g]*a.data.stride+a.offset:d=l[g]*u;for(let m=0;m<u;m++)f[_++]=c[d++]}return new Xn(f,u,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new r,n=this.index.array,i=this.attributes;for(let a in i){let l=i[a],c=t(l,n);e.setAttribute(a,c)}let s=this.morphAttributes;for(let a in s){let l=[],c=s[a];for(let u=0,h=c.length;u<h;u++){let f=c[u],d=t(f,n);l.push(d)}e.morphAttributes[a]=l}e.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let a=0,l=o.length;a<l;a++){let c=o[a];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let l in n){let c=n[l];t.data.attributes[l]=c.toJSON(t.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h<f;h++){let d=c[h];u.push(d.toJSON(t.data))}u.length>0&&(i[l]=u,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let i=t.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(e))}let s=t.morphAttributes;for(let c in s){let u=[],h=s[c];for(let f=0,d=h.length;f<d;f++)u.push(h[f].clone(e));this.morphAttributes[c]=u}this.morphTargetsRelative=t.morphTargetsRelative;let o=t.groups;for(let c=0,u=o.length;c<u;c++){let h=o[c];this.addGroup(h.start,h.count,h.materialIndex)}let a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());let l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},Fp=new Pe,Br=new dl,Ga=new Gs,Np=new Z,Cs=new Z,Rs=new Z,Ps=new Z,Au=new Z,Wa=new Z,Xa=new oe,qa=new oe,Ya=new oe,Up=new Z,Op=new Z,Bp=new Z,Za=new Z,Ja=new Z,ii=class extends on{constructor(t=new mi,e=new ml){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(t,e){let n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;e.fromBufferAttribute(i,t);let a=this.morphTargetInfluences;if(s&&a){Wa.set(0,0,0);for(let l=0,c=s.length;l<c;l++){let u=a[l],h=s[l];u!==0&&(Au.fromBufferAttribute(h,t),o?Wa.addScaledVector(Au,u):Wa.addScaledVector(Au.sub(e),u))}e.add(Wa)}return e}raycast(t,e){let n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Ga.copy(n.boundingSphere),Ga.applyMatrix4(s),Br.copy(t.ray).recast(t.near),!(Ga.containsPoint(Br.origin)===!1&&(Br.intersectSphere(Ga,Np)===null||Br.origin.distanceToSquared(Np)>(t.far-t.near)**2))&&(Fp.copy(s).invert(),Br.copy(t.ray).applyMatrix4(Fp),!(n.boundingBox!==null&&Br.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Br)))}_computeIntersections(t,e,n){let i,s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,d=s.drawRange;if(a!==null)if(Array.isArray(o))for(let _=0,g=f.length;_<g;_++){let p=f[_],m=o[p.materialIndex],S=Math.max(p.start,d.start),v=Math.min(a.count,Math.min(p.start+p.count,d.start+d.count));for(let M=S,D=v;M<D;M+=3){let T=a.getX(M),E=a.getX(M+1),R=a.getX(M+2);i=$a(this,m,t,n,c,u,h,T,E,R),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=p.materialIndex,e.push(i))}}else{let _=Math.max(0,d.start),g=Math.min(a.count,d.start+d.count);for(let p=_,m=g;p<m;p+=3){let S=a.getX(p),v=a.getX(p+1),M=a.getX(p+2);i=$a(this,o,t,n,c,u,h,S,v,M),i&&(i.faceIndex=Math.floor(p/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(o))for(let _=0,g=f.length;_<g;_++){let p=f[_],m=o[p.materialIndex],S=Math.max(p.start,d.start),v=Math.min(l.count,Math.min(p.start+p.count,d.start+d.count));for(let M=S,D=v;M<D;M+=3){let T=M,E=M+1,R=M+2;i=$a(this,m,t,n,c,u,h,T,E,R),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=p.materialIndex,e.push(i))}}else{let _=Math.max(0,d.start),g=Math.min(l.count,d.start+d.count);for(let p=_,m=g;p<m;p+=3){let S=p,v=p+1,M=p+2;i=$a(this,o,t,n,c,u,h,S,v,M),i&&(i.faceIndex=Math.floor(p/3),e.push(i))}}}};function cx(r,t,e,n,i,s,o,a){let l;if(t.side===Tn?l=n.intersectTriangle(o,s,i,!0,a):l=n.intersectTriangle(i,s,o,t.side===lr,a),l===null)return null;Ja.copy(a),Ja.applyMatrix4(r.matrixWorld);let c=e.ray.origin.distanceTo(Ja);return c<e.near||c>e.far?null:{distance:c,point:Ja.clone(),object:r}}function $a(r,t,e,n,i,s,o,a,l,c){r.getVertexPosition(a,Cs),r.getVertexPosition(l,Rs),r.getVertexPosition(c,Ps);let u=cx(r,t,e,n,Cs,Rs,Ps,Za);if(u){i&&(Xa.fromBufferAttribute(i,a),qa.fromBufferAttribute(i,l),Ya.fromBufferAttribute(i,c),u.uv=Ns.getInterpolation(Za,Cs,Rs,Ps,Xa,qa,Ya,new oe)),s&&(Xa.fromBufferAttribute(s,a),qa.fromBufferAttribute(s,l),Ya.fromBufferAttribute(s,c),u.uv1=Ns.getInterpolation(Za,Cs,Rs,Ps,Xa,qa,Ya,new oe)),o&&(Up.fromBufferAttribute(o,a),Op.fromBufferAttribute(o,l),Bp.fromBufferAttribute(o,c),u.normal=Ns.getInterpolation(Za,Cs,Rs,Ps,Up,Op,Bp,new Z),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));let h={a,b:l,c,normal:new Z,materialIndex:0};Ns.getNormal(Cs,Rs,Ps,h.normal),u.face=h}return u}var Oo=class r extends mi{constructor(t=1,e=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};let a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);let l=[],c=[],u=[],h=[],f=0,d=0;_("z","y","x",-1,-1,n,e,t,o,s,0),_("z","y","x",1,-1,n,e,-t,o,s,1),_("x","z","y",1,1,t,n,e,i,o,2),_("x","z","y",1,-1,t,n,-e,i,o,3),_("x","y","z",1,-1,t,e,n,i,s,4),_("x","y","z",-1,-1,t,e,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new qn(c,3)),this.setAttribute("normal",new qn(u,3)),this.setAttribute("uv",new qn(h,2));function _(g,p,m,S,v,M,D,T,E,R,y){let x=M/E,L=D/R,F=M/2,P=D/2,B=T/2,X=E+1,G=R+1,J=0,U=0,I=new Z;for(let A=0;A<G;A++){let it=A*L-P;for(let vt=0;vt<X;vt++){let Wt=vt*x-F;I[g]=Wt*S,I[p]=it*v,I[m]=B,c.push(I.x,I.y,I.z),I[g]=0,I[p]=0,I[m]=T>0?1:-1,u.push(I.x,I.y,I.z),h.push(vt/E),h.push(1-A/R),J+=1}}for(let A=0;A<R;A++)for(let it=0;it<E;it++){let vt=f+it+X*A,Wt=f+it+X*(A+1),q=f+(it+1)+X*(A+1),Q=f+(it+1)+X*A;l.push(vt,Wt,Q),l.push(Wt,q,Q),U+=6}a.addGroup(d,U,y),d+=U,f+=J}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function Ws(r){let t={};for(let e in r){t[e]={};for(let n in r[e]){let i=r[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function _n(r){let t={};for(let e=0;e<r.length;e++){let n=Ws(r[e]);for(let i in n)t[i]=n[i]}return t}function ux(r){let t=[];for(let e=0;e<r.length;e++)t.push(r[e].clone());return t}function Em(r){let t=r.getRenderTarget();return t===null?r.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:fe.workingColorSpace}var hx={clone:Ws,merge:_n},fx=`void main() {
2
2
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3
- }`,Y0=`void main() {
3
+ }`,dx=`void main() {
4
4
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
5
- }`,Zn=class extends Yr{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=q0,this.fragmentShader=Y0,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,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Hs(t.uniforms),this.uniformsGroups=W0(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let a=this.uniforms[i].value;a&&a.isTexture?e.uniforms[i]={type:"t",value:a.toJSON(t).uuid}:a&&a.isColor?e.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?e.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?e.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?e.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?e.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?e.uniforms[i]={type:"m4",value:a.toArray()}:e.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},pl=class extends sn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Re,this.projectionMatrix=new Re,this.projectionMatrixInverse=new Re,this.coordinateSystem=Fi}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},tr=new q,Dp=new ae,Cp=new ae,_n=class extends pl{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=Nu*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(iu*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Nu*2*Math.atan(Math.tan(iu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){tr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(tr.x,tr.y).multiplyScalar(-t/tr.z),tr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(tr.x,tr.y).multiplyScalar(-t/tr.z)}getViewSize(t,e){return this.getViewBounds(t,Dp,Cp),e.subVectors(Cp,Dp)}setViewOffset(t,e,n,i,s,a){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(iu*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,s=-.5*i,a=this.view;if(this.view!==null&&this.view.enabled){let l=a.fullWidth,c=a.fullHeight;s+=a.offsetX*i/l,e-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}let o=this.filmOffset;o!==0&&(s+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Rs=-90,Ps=1,ku=class extends sn{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let i=new _n(Rs,Ps,t,e);i.layers=this.layers,this.add(i);let s=new _n(Rs,Ps,t,e);s.layers=this.layers,this.add(s);let a=new _n(Rs,Ps,t,e);a.layers=this.layers,this.add(a);let o=new _n(Rs,Ps,t,e);o.layers=this.layers,this.add(o);let l=new _n(Rs,Ps,t,e);l.layers=this.layers,this.add(l);let c=new _n(Rs,Ps,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,i,s,a,o,l]=e;for(let c of e)this.remove(c);if(t===Fi)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.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),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===sl)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.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),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[s,a,o,l,c,u]=this.children,f=t.getRenderTarget(),h=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),_=t.xr.enabled;t.xr.enabled=!1;let g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,s),t.setRenderTarget(n,1,i),t.render(e,a),t.setRenderTarget(n,2,i),t.render(e,o),t.setRenderTarget(n,3,i),t.render(e,l),t.setRenderTarget(n,4,i),t.render(e,c),n.texture.generateMipmaps=g,t.setRenderTarget(n,5,i),t.render(e,u),t.setRenderTarget(f,h,d),t.xr.enabled=_,n.texture.needsPMREMUpdate=!0}},ml=class extends Yn{constructor(t,e,n,i,s,a,o,l,c,u){t=t!==void 0?t:[],e=e!==void 0?e:Bs,super(t,e,n,i,s,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},Vu=class extends Ui{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new ml(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:ni}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`
5
+ }`,Zn=class extends Zr{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=fx,this.fragmentShader=dx,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,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Ws(t.uniforms),this.uniformsGroups=ux(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let o=this.uniforms[i].value;o&&o.isTexture?e.uniforms[i]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?e.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?e.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?e.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?e.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?e.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?e.uniforms[i]={type:"m4",value:o.toArray()}:e.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},xl=class extends on{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Pe,this.projectionMatrix=new Pe,this.projectionMatrixInverse=new Pe,this.coordinateSystem=Ni}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},er=new Z,zp=new oe,kp=new oe,xn=class extends xl{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=Hu*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(cu*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Hu*2*Math.atan(Math.tan(cu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){er.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(er.x,er.y).multiplyScalar(-t/er.z),er.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(er.x,er.y).multiplyScalar(-t/er.z)}getViewSize(t,e){return this.getViewBounds(t,zp,kp),e.subVectors(kp,zp)}setViewOffset(t,e,n,i,s,o){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(cu*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,e-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Is=-90,Ls=1,qu=class extends on{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let i=new xn(Is,Ls,t,e);i.layers=this.layers,this.add(i);let s=new xn(Is,Ls,t,e);s.layers=this.layers,this.add(s);let o=new xn(Is,Ls,t,e);o.layers=this.layers,this.add(o);let a=new xn(Is,Ls,t,e);a.layers=this.layers,this.add(a);let l=new xn(Is,Ls,t,e);l.layers=this.layers,this.add(l);let c=new xn(Is,Ls,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,i,s,o,a,l]=e;for(let c of e)this.remove(c);if(t===Ni)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===cl)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[s,o,a,l,c,u]=this.children,h=t.getRenderTarget(),f=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),_=t.xr.enabled;t.xr.enabled=!1;let g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,s),t.setRenderTarget(n,1,i),t.render(e,o),t.setRenderTarget(n,2,i),t.render(e,a),t.setRenderTarget(n,3,i),t.render(e,l),t.setRenderTarget(n,4,i),t.render(e,c),n.texture.generateMipmaps=g,t.setRenderTarget(n,5,i),t.render(e,u),t.setRenderTarget(h,f,d),t.xr.enabled=_,n.texture.needsPMREMUpdate=!0}},vl=class extends Yn{constructor(t,e,n,i,s,o,a,l,c,u){t=t!==void 0?t:[],e=e!==void 0?e:ks,super(t,e,n,i,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},Yu=class extends Ui{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new vl(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:ni}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`
6
6
 
7
7
  varying vec3 vWorldDirection;
8
8
 
@@ -37,9 +37,9 @@
37
37
  gl_FragColor = texture2D( tEquirect, sampleUV );
38
38
 
39
39
  }
40
- `},i=new Ia(5,5,5),s=new Zn({name:"CubemapFromEquirect",uniforms:Hs(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Tn,blending:rr});s.uniforms.tEquirect.value=e;let a=new ii(i,s),o=e.minFilter;return e.minFilter===Xr&&(e.minFilter=ni),new ku(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,i){let s=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,i);t.setRenderTarget(s)}},Su=new q,Z0=new q,J0=new qt,Ii=class{constructor(t=new q(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let i=Su.subVectors(n,e).cross(Z0.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let n=t.delta(Su),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:e.copy(t.start).addScaledVector(n,s)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||J0.getNormalMatrix(t),i=this.coplanarPoint(Su).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},Br=new Vs,Yo=new q,La=class{constructor(t=new Ii,e=new Ii,n=new Ii,i=new Ii,s=new Ii,a=new Ii){this.planes=[t,e,n,i,s,a]}set(t,e,n,i,s,a){let o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(i),o[4].copy(s),o[5].copy(a),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Fi){let n=this.planes,i=t.elements,s=i[0],a=i[1],o=i[2],l=i[3],c=i[4],u=i[5],f=i[6],h=i[7],d=i[8],_=i[9],g=i[10],p=i[11],m=i[12],S=i[13],v=i[14],M=i[15];if(n[0].setComponents(l-s,h-c,p-d,M-m).normalize(),n[1].setComponents(l+s,h+c,p+d,M+m).normalize(),n[2].setComponents(l+a,h+u,p+_,M+S).normalize(),n[3].setComponents(l-a,h-u,p-_,M-S).normalize(),n[4].setComponents(l-o,h-f,p-g,M-v).normalize(),e===Fi)n[5].setComponents(l+o,h+f,p+g,M+v).normalize();else if(e===sl)n[5].setComponents(o,f,g,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Br.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Br.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Br)}intersectsSprite(t){return Br.center.set(0,0,0),Br.radius=.7071067811865476,Br.applyMatrix4(t.matrixWorld),this.intersectsSphere(Br)}intersectsSphere(t){let e=this.planes,n=t.center,i=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(t){let e=this.planes;for(let n=0;n<6;n++){let i=e[n];if(Yo.x=i.normal.x>0?t.max.x:t.min.x,Yo.y=i.normal.y>0?t.max.y:t.min.y,Yo.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Yo)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function mm(){let r=null,t=!1,e=null,n=null;function i(s,a){e(s,a),n=r.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&(n=r.requestAnimationFrame(i),t=!0)},stop:function(){r.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){r=s}}}function $0(r){let t=new WeakMap;function e(o,l){let c=o.array,u=o.usage,f=c.byteLength,h=r.createBuffer();r.bindBuffer(l,h),r.bufferData(l,c,u),o.onUploadCallback();let d;if(c instanceof Float32Array)d=r.FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?d=r.HALF_FLOAT:d=r.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=r.SHORT;else if(c instanceof Uint32Array)d=r.UNSIGNED_INT;else if(c instanceof Int32Array)d=r.INT;else if(c instanceof Int8Array)d=r.BYTE;else if(c instanceof Uint8Array)d=r.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:h,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:f}}function n(o,l,c){let u=l.array,f=l._updateRange,h=l.updateRanges;if(r.bindBuffer(c,o),f.count===-1&&h.length===0&&r.bufferSubData(c,0,u),h.length!==0){for(let d=0,_=h.length;d<_;d++){let g=h[d];r.bufferSubData(c,g.start*u.BYTES_PER_ELEMENT,u,g.start,g.count)}l.clearUpdateRanges()}f.count!==-1&&(r.bufferSubData(c,f.offset*u.BYTES_PER_ELEMENT,u,f.offset,f.count),f.count=-1),l.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),t.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);let l=t.get(o);l&&(r.deleteBuffer(l.buffer),t.delete(o))}function a(o,l){if(o.isGLBufferAttribute){let u=t.get(o);(!u||u.version<o.version)&&t.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}o.isInterleavedBufferAttribute&&(o=o.data);let c=t.get(o);if(c===void 0)t.set(o,e(o,l));else if(c.version<o.version){if(c.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,o,l),c.version=o.version}}return{get:i,remove:s,update:a}}var gl=class r extends mi{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};let s=t/2,a=e/2,o=Math.floor(n),l=Math.floor(i),c=o+1,u=l+1,f=t/o,h=e/l,d=[],_=[],g=[],p=[];for(let m=0;m<u;m++){let S=m*h-a;for(let v=0;v<c;v++){let M=v*f-s;_.push(M,-S,0),g.push(0,0,1),p.push(v/o),p.push(1-m/l)}}for(let m=0;m<l;m++)for(let S=0;S<o;S++){let v=S+c*m,M=S+c*(m+1),D=S+1+c*(m+1),T=S+1+c*m;d.push(v,M,T),d.push(M,D,T)}this.setIndex(d),this.setAttribute("position",new qn(_,3)),this.setAttribute("normal",new qn(g,3)),this.setAttribute("uv",new qn(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r(t.width,t.height,t.widthSegments,t.heightSegments)}},K0=`#ifdef USE_ALPHAHASH
40
+ `},i=new Oo(5,5,5),s=new Zn({name:"CubemapFromEquirect",uniforms:Ws(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Tn,blending:sr});s.uniforms.tEquirect.value=e;let o=new ii(i,s),a=e.minFilter;return e.minFilter===qr&&(e.minFilter=ni),new qu(1,10,this).update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,i){let s=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,n,i);t.setRenderTarget(s)}},Du=new Z,px=new Z,mx=new Zt,Li=class{constructor(t=new Z(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let i=Du.subVectors(n,e).cross(px.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let n=t.delta(Du),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:e.copy(t.start).addScaledVector(n,s)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||mx.getNormalMatrix(t),i=this.coplanarPoint(Du).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},zr=new Gs,Ka=new Z,Bo=class{constructor(t=new Li,e=new Li,n=new Li,i=new Li,s=new Li,o=new Li){this.planes=[t,e,n,i,s,o]}set(t,e,n,i,s,o){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Ni){let n=this.planes,i=t.elements,s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],u=i[5],h=i[6],f=i[7],d=i[8],_=i[9],g=i[10],p=i[11],m=i[12],S=i[13],v=i[14],M=i[15];if(n[0].setComponents(l-s,f-c,p-d,M-m).normalize(),n[1].setComponents(l+s,f+c,p+d,M+m).normalize(),n[2].setComponents(l+o,f+u,p+_,M+S).normalize(),n[3].setComponents(l-o,f-u,p-_,M-S).normalize(),n[4].setComponents(l-a,f-h,p-g,M-v).normalize(),e===Ni)n[5].setComponents(l+a,f+h,p+g,M+v).normalize();else if(e===cl)n[5].setComponents(a,h,g,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),zr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),zr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(zr)}intersectsSprite(t){return zr.center.set(0,0,0),zr.radius=.7071067811865476,zr.applyMatrix4(t.matrixWorld),this.intersectsSphere(zr)}intersectsSphere(t){let e=this.planes,n=t.center,i=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(t){let e=this.planes;for(let n=0;n<6;n++){let i=e[n];if(Ka.x=i.normal.x>0?t.max.x:t.min.x,Ka.y=i.normal.y>0?t.max.y:t.min.y,Ka.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Ka)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function Tm(){let r=null,t=!1,e=null,n=null;function i(s,o){e(s,o),n=r.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&(n=r.requestAnimationFrame(i),t=!0)},stop:function(){r.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){r=s}}}function gx(r){let t=new WeakMap;function e(a,l){let c=a.array,u=a.usage,h=c.byteLength,f=r.createBuffer();r.bindBuffer(l,f),r.bufferData(l,c,u),a.onUploadCallback();let d;if(c instanceof Float32Array)d=r.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?d=r.HALF_FLOAT:d=r.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=r.SHORT;else if(c instanceof Uint32Array)d=r.UNSIGNED_INT;else if(c instanceof Int32Array)d=r.INT;else if(c instanceof Int8Array)d=r.BYTE;else if(c instanceof Uint8Array)d=r.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:f,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:h}}function n(a,l,c){let u=l.array,h=l._updateRange,f=l.updateRanges;if(r.bindBuffer(c,a),h.count===-1&&f.length===0&&r.bufferSubData(c,0,u),f.length!==0){for(let d=0,_=f.length;d<_;d++){let g=f[d];r.bufferSubData(c,g.start*u.BYTES_PER_ELEMENT,u,g.start,g.count)}l.clearUpdateRanges()}h.count!==-1&&(r.bufferSubData(c,h.offset*u.BYTES_PER_ELEMENT,u,h.offset,h.count),h.count=-1),l.onUploadCallback()}function i(a){return a.isInterleavedBufferAttribute&&(a=a.data),t.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);let l=t.get(a);l&&(r.deleteBuffer(l.buffer),t.delete(a))}function o(a,l){if(a.isGLBufferAttribute){let u=t.get(a);(!u||u.version<a.version)&&t.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}a.isInterleavedBufferAttribute&&(a=a.data);let c=t.get(a);if(c===void 0)t.set(a,e(a,l));else if(c.version<a.version){if(c.size!==a.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,a,l),c.version=a.version}}return{get:i,remove:s,update:o}}var yl=class r extends mi{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};let s=t/2,o=e/2,a=Math.floor(n),l=Math.floor(i),c=a+1,u=l+1,h=t/a,f=e/l,d=[],_=[],g=[],p=[];for(let m=0;m<u;m++){let S=m*f-o;for(let v=0;v<c;v++){let M=v*h-s;_.push(M,-S,0),g.push(0,0,1),p.push(v/a),p.push(1-m/l)}}for(let m=0;m<l;m++)for(let S=0;S<a;S++){let v=S+c*m,M=S+c*(m+1),D=S+1+c*(m+1),T=S+1+c*m;d.push(v,M,T),d.push(M,D,T)}this.setIndex(d),this.setAttribute("position",new qn(_,3)),this.setAttribute("normal",new qn(g,3)),this.setAttribute("uv",new qn(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r(t.width,t.height,t.widthSegments,t.heightSegments)}},_x=`#ifdef USE_ALPHAHASH
41
41
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
42
- #endif`,Q0=`#ifdef USE_ALPHAHASH
42
+ #endif`,xx=`#ifdef USE_ALPHAHASH
43
43
  const float ALPHA_HASH_SCALE = 0.05;
44
44
  float hash2D( vec2 value ) {
45
45
  return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
@@ -74,20 +74,20 @@
74
74
  : cases.z;
75
75
  return clamp( threshold , 1.0e-6, 1.0 );
76
76
  }
77
- #endif`,j0=`#ifdef USE_ALPHAMAP
77
+ #endif`,vx=`#ifdef USE_ALPHAMAP
78
78
  diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
79
- #endif`,tx=`#ifdef USE_ALPHAMAP
79
+ #endif`,yx=`#ifdef USE_ALPHAMAP
80
80
  uniform sampler2D alphaMap;
81
- #endif`,ex=`#ifdef USE_ALPHATEST
81
+ #endif`,Mx=`#ifdef USE_ALPHATEST
82
82
  #ifdef ALPHA_TO_COVERAGE
83
83
  diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
84
84
  if ( diffuseColor.a == 0.0 ) discard;
85
85
  #else
86
86
  if ( diffuseColor.a < alphaTest ) discard;
87
87
  #endif
88
- #endif`,nx=`#ifdef USE_ALPHATEST
88
+ #endif`,Sx=`#ifdef USE_ALPHATEST
89
89
  uniform float alphaTest;
90
- #endif`,ix=`#ifdef USE_AOMAP
90
+ #endif`,bx=`#ifdef USE_AOMAP
91
91
  float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
92
92
  reflectedLight.indirectDiffuse *= ambientOcclusion;
93
93
  #if defined( USE_CLEARCOAT )
@@ -100,10 +100,10 @@
100
100
  float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
101
101
  reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
102
102
  #endif
103
- #endif`,rx=`#ifdef USE_AOMAP
103
+ #endif`,wx=`#ifdef USE_AOMAP
104
104
  uniform sampler2D aoMap;
105
105
  uniform float aoMapIntensity;
106
- #endif`,sx=`#ifdef USE_BATCHING
106
+ #endif`,Ex=`#ifdef USE_BATCHING
107
107
  attribute float batchId;
108
108
  uniform highp sampler2D batchingTexture;
109
109
  mat4 getBatchingMatrix( const in float i ) {
@@ -117,15 +117,15 @@
117
117
  vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
118
118
  return mat4( v1, v2, v3, v4 );
119
119
  }
120
- #endif`,ax=`#ifdef USE_BATCHING
120
+ #endif`,Tx=`#ifdef USE_BATCHING
121
121
  mat4 batchingMatrix = getBatchingMatrix( batchId );
122
- #endif`,ox=`vec3 transformed = vec3( position );
122
+ #endif`,Ax=`vec3 transformed = vec3( position );
123
123
  #ifdef USE_ALPHAHASH
124
124
  vPosition = vec3( position );
125
- #endif`,lx=`vec3 objectNormal = vec3( normal );
125
+ #endif`,Dx=`vec3 objectNormal = vec3( normal );
126
126
  #ifdef USE_TANGENT
127
127
  vec3 objectTangent = vec3( tangent.xyz );
128
- #endif`,cx=`float G_BlinnPhong_Implicit( ) {
128
+ #endif`,Cx=`float G_BlinnPhong_Implicit( ) {
129
129
  return 0.25;
130
130
  }
131
131
  float D_BlinnPhong( const in float shininess, const in float dotNH ) {
@@ -139,7 +139,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
139
139
  float G = G_BlinnPhong_Implicit( );
140
140
  float D = D_BlinnPhong( shininess, dotNH );
141
141
  return F * ( G * D );
142
- } // validated`,ux=`#ifdef USE_IRIDESCENCE
142
+ } // validated`,Rx=`#ifdef USE_IRIDESCENCE
143
143
  const mat3 XYZ_TO_REC709 = mat3(
144
144
  3.2404542, -0.9692660, 0.0556434,
145
145
  -1.5371385, 1.8760108, -0.2040259,
@@ -202,7 +202,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
202
202
  }
203
203
  return max( I, vec3( 0.0 ) );
204
204
  }
205
- #endif`,hx=`#ifdef USE_BUMPMAP
205
+ #endif`,Px=`#ifdef USE_BUMPMAP
206
206
  uniform sampler2D bumpMap;
207
207
  uniform float bumpScale;
208
208
  vec2 dHdxy_fwd() {
@@ -223,7 +223,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
223
223
  vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
224
224
  return normalize( abs( fDet ) * surf_norm - vGrad );
225
225
  }
226
- #endif`,fx=`#if NUM_CLIPPING_PLANES > 0
226
+ #endif`,Ix=`#if NUM_CLIPPING_PLANES > 0
227
227
  vec4 plane;
228
228
  #ifdef ALPHA_TO_COVERAGE
229
229
  float distanceToPlane, distanceGradient;
@@ -269,26 +269,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
269
269
  if ( clipped ) discard;
270
270
  #endif
271
271
  #endif
272
- #endif`,dx=`#if NUM_CLIPPING_PLANES > 0
272
+ #endif`,Lx=`#if NUM_CLIPPING_PLANES > 0
273
273
  varying vec3 vClipPosition;
274
274
  uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
275
- #endif`,px=`#if NUM_CLIPPING_PLANES > 0
275
+ #endif`,Fx=`#if NUM_CLIPPING_PLANES > 0
276
276
  varying vec3 vClipPosition;
277
- #endif`,mx=`#if NUM_CLIPPING_PLANES > 0
277
+ #endif`,Nx=`#if NUM_CLIPPING_PLANES > 0
278
278
  vClipPosition = - mvPosition.xyz;
279
- #endif`,gx=`#if defined( USE_COLOR_ALPHA )
279
+ #endif`,Ux=`#if defined( USE_COLOR_ALPHA )
280
280
  diffuseColor *= vColor;
281
281
  #elif defined( USE_COLOR )
282
282
  diffuseColor.rgb *= vColor;
283
- #endif`,_x=`#if defined( USE_COLOR_ALPHA )
283
+ #endif`,Ox=`#if defined( USE_COLOR_ALPHA )
284
284
  varying vec4 vColor;
285
285
  #elif defined( USE_COLOR )
286
286
  varying vec3 vColor;
287
- #endif`,xx=`#if defined( USE_COLOR_ALPHA )
287
+ #endif`,Bx=`#if defined( USE_COLOR_ALPHA )
288
288
  varying vec4 vColor;
289
289
  #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
290
290
  varying vec3 vColor;
291
- #endif`,vx=`#if defined( USE_COLOR_ALPHA )
291
+ #endif`,zx=`#if defined( USE_COLOR_ALPHA )
292
292
  vColor = vec4( 1.0 );
293
293
  #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
294
294
  vColor = vec3( 1.0 );
@@ -298,7 +298,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
298
298
  #endif
299
299
  #ifdef USE_INSTANCING_COLOR
300
300
  vColor.xyz *= instanceColor.xyz;
301
- #endif`,yx=`#define PI 3.141592653589793
301
+ #endif`,kx=`#define PI 3.141592653589793
302
302
  #define PI2 6.283185307179586
303
303
  #define PI_HALF 1.5707963267948966
304
304
  #define RECIPROCAL_PI 0.3183098861837907
@@ -376,7 +376,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
376
376
  float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
377
377
  float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
378
378
  return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
379
- } // validated`,Mx=`#ifdef ENVMAP_TYPE_CUBE_UV
379
+ } // validated`,Vx=`#ifdef ENVMAP_TYPE_CUBE_UV
380
380
  #define cubeUV_minMipLevel 4.0
381
381
  #define cubeUV_minTileSize 16.0
382
382
  float getFace( vec3 direction ) {
@@ -469,7 +469,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
469
469
  return vec4( mix( color0, color1, mipF ), 1.0 );
470
470
  }
471
471
  }
472
- #endif`,Sx=`vec3 transformedNormal = objectNormal;
472
+ #endif`,Hx=`vec3 transformedNormal = objectNormal;
473
473
  #ifdef USE_TANGENT
474
474
  vec3 transformedTangent = objectTangent;
475
475
  #endif
@@ -498,18 +498,18 @@ transformedNormal = normalMatrix * transformedNormal;
498
498
  #ifdef FLIP_SIDED
499
499
  transformedTangent = - transformedTangent;
500
500
  #endif
501
- #endif`,bx=`#ifdef USE_DISPLACEMENTMAP
501
+ #endif`,Gx=`#ifdef USE_DISPLACEMENTMAP
502
502
  uniform sampler2D displacementMap;
503
503
  uniform float displacementScale;
504
504
  uniform float displacementBias;
505
- #endif`,Ex=`#ifdef USE_DISPLACEMENTMAP
505
+ #endif`,Wx=`#ifdef USE_DISPLACEMENTMAP
506
506
  transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
507
- #endif`,wx=`#ifdef USE_EMISSIVEMAP
507
+ #endif`,Xx=`#ifdef USE_EMISSIVEMAP
508
508
  vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
509
509
  totalEmissiveRadiance *= emissiveColor.rgb;
510
- #endif`,Tx=`#ifdef USE_EMISSIVEMAP
510
+ #endif`,qx=`#ifdef USE_EMISSIVEMAP
511
511
  uniform sampler2D emissiveMap;
512
- #endif`,Ax="gl_FragColor = linearToOutputTexel( gl_FragColor );",Dx=`
512
+ #endif`,Yx="gl_FragColor = linearToOutputTexel( gl_FragColor );",Zx=`
513
513
  const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(
514
514
  vec3( 0.8224621, 0.177538, 0.0 ),
515
515
  vec3( 0.0331941, 0.9668058, 0.0 ),
@@ -537,7 +537,7 @@ vec4 LinearToLinear( in vec4 value ) {
537
537
  }
538
538
  vec4 LinearTosRGB( in vec4 value ) {
539
539
  return sRGBTransferOETF( value );
540
- }`,Cx=`#ifdef USE_ENVMAP
540
+ }`,Jx=`#ifdef USE_ENVMAP
541
541
  #ifdef ENV_WORLDPOS
542
542
  vec3 cameraToFrag;
543
543
  if ( isOrthographic ) {
@@ -566,7 +566,7 @@ vec4 LinearTosRGB( in vec4 value ) {
566
566
  #elif defined( ENVMAP_BLENDING_ADD )
567
567
  outgoingLight += envColor.xyz * specularStrength * reflectivity;
568
568
  #endif
569
- #endif`,Rx=`#ifdef USE_ENVMAP
569
+ #endif`,$x=`#ifdef USE_ENVMAP
570
570
  uniform float envMapIntensity;
571
571
  uniform float flipEnvMap;
572
572
  uniform mat3 envMapRotation;
@@ -576,7 +576,7 @@ vec4 LinearTosRGB( in vec4 value ) {
576
576
  uniform sampler2D envMap;
577
577
  #endif
578
578
 
579
- #endif`,Px=`#ifdef USE_ENVMAP
579
+ #endif`,Kx=`#ifdef USE_ENVMAP
580
580
  uniform float reflectivity;
581
581
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
582
582
  #define ENV_WORLDPOS
@@ -587,7 +587,7 @@ vec4 LinearTosRGB( in vec4 value ) {
587
587
  #else
588
588
  varying vec3 vReflect;
589
589
  #endif
590
- #endif`,Ix=`#ifdef USE_ENVMAP
590
+ #endif`,Qx=`#ifdef USE_ENVMAP
591
591
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
592
592
  #define ENV_WORLDPOS
593
593
  #endif
@@ -598,7 +598,7 @@ vec4 LinearTosRGB( in vec4 value ) {
598
598
  varying vec3 vReflect;
599
599
  uniform float refractionRatio;
600
600
  #endif
601
- #endif`,Lx=`#ifdef USE_ENVMAP
601
+ #endif`,jx=`#ifdef USE_ENVMAP
602
602
  #ifdef ENV_WORLDPOS
603
603
  vWorldPosition = worldPosition.xyz;
604
604
  #else
@@ -615,18 +615,18 @@ vec4 LinearTosRGB( in vec4 value ) {
615
615
  vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
616
616
  #endif
617
617
  #endif
618
- #endif`,Fx=`#ifdef USE_FOG
618
+ #endif`,tv=`#ifdef USE_FOG
619
619
  vFogDepth = - mvPosition.z;
620
- #endif`,Ux=`#ifdef USE_FOG
620
+ #endif`,ev=`#ifdef USE_FOG
621
621
  varying float vFogDepth;
622
- #endif`,Nx=`#ifdef USE_FOG
622
+ #endif`,nv=`#ifdef USE_FOG
623
623
  #ifdef FOG_EXP2
624
624
  float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
625
625
  #else
626
626
  float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
627
627
  #endif
628
628
  gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
629
- #endif`,Ox=`#ifdef USE_FOG
629
+ #endif`,iv=`#ifdef USE_FOG
630
630
  uniform vec3 fogColor;
631
631
  varying float vFogDepth;
632
632
  #ifdef FOG_EXP2
@@ -635,7 +635,7 @@ vec4 LinearTosRGB( in vec4 value ) {
635
635
  uniform float fogNear;
636
636
  uniform float fogFar;
637
637
  #endif
638
- #endif`,Bx=`#ifdef USE_GRADIENTMAP
638
+ #endif`,rv=`#ifdef USE_GRADIENTMAP
639
639
  uniform sampler2D gradientMap;
640
640
  #endif
641
641
  vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
@@ -647,12 +647,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
647
647
  vec2 fw = fwidth( coord ) * 0.5;
648
648
  return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
649
649
  #endif
650
- }`,zx=`#ifdef USE_LIGHTMAP
650
+ }`,sv=`#ifdef USE_LIGHTMAP
651
651
  uniform sampler2D lightMap;
652
652
  uniform float lightMapIntensity;
653
- #endif`,kx=`LambertMaterial material;
653
+ #endif`,ov=`LambertMaterial material;
654
654
  material.diffuseColor = diffuseColor.rgb;
655
- material.specularStrength = specularStrength;`,Vx=`varying vec3 vViewPosition;
655
+ material.specularStrength = specularStrength;`,av=`varying vec3 vViewPosition;
656
656
  struct LambertMaterial {
657
657
  vec3 diffuseColor;
658
658
  float specularStrength;
@@ -666,7 +666,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr
666
666
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
667
667
  }
668
668
  #define RE_Direct RE_Direct_Lambert
669
- #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Hx=`uniform bool receiveShadow;
669
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,lv=`uniform bool receiveShadow;
670
670
  uniform vec3 ambientLightColor;
671
671
  #if defined( USE_LIGHT_PROBES )
672
672
  uniform vec3 lightProbe[ 9 ];
@@ -789,7 +789,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
789
789
  vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
790
790
  return irradiance;
791
791
  }
792
- #endif`,Gx=`#ifdef USE_ENVMAP
792
+ #endif`,cv=`#ifdef USE_ENVMAP
793
793
  vec3 getIBLIrradiance( const in vec3 normal ) {
794
794
  #ifdef ENVMAP_TYPE_CUBE_UV
795
795
  vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
@@ -822,8 +822,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
822
822
  #endif
823
823
  }
824
824
  #endif
825
- #endif`,Wx=`ToonMaterial material;
826
- material.diffuseColor = diffuseColor.rgb;`,Xx=`varying vec3 vViewPosition;
825
+ #endif`,uv=`ToonMaterial material;
826
+ material.diffuseColor = diffuseColor.rgb;`,hv=`varying vec3 vViewPosition;
827
827
  struct ToonMaterial {
828
828
  vec3 diffuseColor;
829
829
  };
@@ -835,11 +835,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo
835
835
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
836
836
  }
837
837
  #define RE_Direct RE_Direct_Toon
838
- #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,qx=`BlinnPhongMaterial material;
838
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,fv=`BlinnPhongMaterial material;
839
839
  material.diffuseColor = diffuseColor.rgb;
840
840
  material.specularColor = specular;
841
841
  material.specularShininess = shininess;
842
- material.specularStrength = specularStrength;`,Yx=`varying vec3 vViewPosition;
842
+ material.specularStrength = specularStrength;`,dv=`varying vec3 vViewPosition;
843
843
  struct BlinnPhongMaterial {
844
844
  vec3 diffuseColor;
845
845
  vec3 specularColor;
@@ -856,7 +856,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom
856
856
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
857
857
  }
858
858
  #define RE_Direct RE_Direct_BlinnPhong
859
- #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Zx=`PhysicalMaterial material;
859
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,pv=`PhysicalMaterial material;
860
860
  material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
861
861
  vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
862
862
  float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
@@ -942,7 +942,7 @@ material.roughness = min( material.roughness, 1.0 );
942
942
  material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
943
943
  material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
944
944
  material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
945
- #endif`,Jx=`struct PhysicalMaterial {
945
+ #endif`,mv=`struct PhysicalMaterial {
946
946
  vec3 diffuseColor;
947
947
  float roughness;
948
948
  vec3 specularColor;
@@ -1243,7 +1243,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
1243
1243
  #define RE_IndirectSpecular RE_IndirectSpecular_Physical
1244
1244
  float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1245
1245
  return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1246
- }`,$x=`
1246
+ }`,gv=`
1247
1247
  vec3 geometryPosition = - vViewPosition;
1248
1248
  vec3 geometryNormal = normal;
1249
1249
  vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
@@ -1358,7 +1358,7 @@ IncidentLight directLight;
1358
1358
  #if defined( RE_IndirectSpecular )
1359
1359
  vec3 radiance = vec3( 0.0 );
1360
1360
  vec3 clearcoatRadiance = vec3( 0.0 );
1361
- #endif`,Kx=`#if defined( RE_IndirectDiffuse )
1361
+ #endif`,_v=`#if defined( RE_IndirectDiffuse )
1362
1362
  #ifdef USE_LIGHTMAP
1363
1363
  vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1364
1364
  vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
@@ -1377,33 +1377,33 @@ IncidentLight directLight;
1377
1377
  #ifdef USE_CLEARCOAT
1378
1378
  clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1379
1379
  #endif
1380
- #endif`,Qx=`#if defined( RE_IndirectDiffuse )
1380
+ #endif`,xv=`#if defined( RE_IndirectDiffuse )
1381
1381
  RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1382
1382
  #endif
1383
1383
  #if defined( RE_IndirectSpecular )
1384
1384
  RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1385
- #endif`,jx=`#if defined( USE_LOGDEPTHBUF )
1385
+ #endif`,vv=`#if defined( USE_LOGDEPTHBUF )
1386
1386
  gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1387
- #endif`,tv=`#if defined( USE_LOGDEPTHBUF )
1387
+ #endif`,yv=`#if defined( USE_LOGDEPTHBUF )
1388
1388
  uniform float logDepthBufFC;
1389
1389
  varying float vFragDepth;
1390
1390
  varying float vIsPerspective;
1391
- #endif`,ev=`#ifdef USE_LOGDEPTHBUF
1391
+ #endif`,Mv=`#ifdef USE_LOGDEPTHBUF
1392
1392
  varying float vFragDepth;
1393
1393
  varying float vIsPerspective;
1394
- #endif`,nv=`#ifdef USE_LOGDEPTHBUF
1394
+ #endif`,Sv=`#ifdef USE_LOGDEPTHBUF
1395
1395
  vFragDepth = 1.0 + gl_Position.w;
1396
1396
  vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1397
- #endif`,iv=`#ifdef USE_MAP
1397
+ #endif`,bv=`#ifdef USE_MAP
1398
1398
  vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1399
1399
  #ifdef DECODE_VIDEO_TEXTURE
1400
1400
  sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
1401
1401
 
1402
1402
  #endif
1403
1403
  diffuseColor *= sampledDiffuseColor;
1404
- #endif`,rv=`#ifdef USE_MAP
1404
+ #endif`,wv=`#ifdef USE_MAP
1405
1405
  uniform sampler2D map;
1406
- #endif`,sv=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1406
+ #endif`,Ev=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1407
1407
  #if defined( USE_POINTS_UV )
1408
1408
  vec2 uv = vUv;
1409
1409
  #else
@@ -1415,7 +1415,7 @@ IncidentLight directLight;
1415
1415
  #endif
1416
1416
  #ifdef USE_ALPHAMAP
1417
1417
  diffuseColor.a *= texture2D( alphaMap, uv ).g;
1418
- #endif`,av=`#if defined( USE_POINTS_UV )
1418
+ #endif`,Tv=`#if defined( USE_POINTS_UV )
1419
1419
  varying vec2 vUv;
1420
1420
  #else
1421
1421
  #if defined( USE_MAP ) || defined( USE_ALPHAMAP )
@@ -1427,19 +1427,19 @@ IncidentLight directLight;
1427
1427
  #endif
1428
1428
  #ifdef USE_ALPHAMAP
1429
1429
  uniform sampler2D alphaMap;
1430
- #endif`,ov=`float metalnessFactor = metalness;
1430
+ #endif`,Av=`float metalnessFactor = metalness;
1431
1431
  #ifdef USE_METALNESSMAP
1432
1432
  vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1433
1433
  metalnessFactor *= texelMetalness.b;
1434
- #endif`,lv=`#ifdef USE_METALNESSMAP
1434
+ #endif`,Dv=`#ifdef USE_METALNESSMAP
1435
1435
  uniform sampler2D metalnessMap;
1436
- #endif`,cv=`#ifdef USE_INSTANCING_MORPH
1436
+ #endif`,Cv=`#ifdef USE_INSTANCING_MORPH
1437
1437
  float morphTargetInfluences[MORPHTARGETS_COUNT];
1438
1438
  float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1439
1439
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1440
1440
  morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1441
1441
  }
1442
- #endif`,uv=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
1442
+ #endif`,Rv=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
1443
1443
  vColor *= morphTargetBaseInfluence;
1444
1444
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1445
1445
  #if defined( USE_COLOR_ALPHA )
@@ -1448,7 +1448,7 @@ IncidentLight directLight;
1448
1448
  if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1449
1449
  #endif
1450
1450
  }
1451
- #endif`,hv=`#ifdef USE_MORPHNORMALS
1451
+ #endif`,Pv=`#ifdef USE_MORPHNORMALS
1452
1452
  objectNormal *= morphTargetBaseInfluence;
1453
1453
  #ifdef MORPHTARGETS_TEXTURE
1454
1454
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
@@ -1460,7 +1460,7 @@ IncidentLight directLight;
1460
1460
  objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
1461
1461
  objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
1462
1462
  #endif
1463
- #endif`,fv=`#ifdef USE_MORPHTARGETS
1463
+ #endif`,Iv=`#ifdef USE_MORPHTARGETS
1464
1464
  #ifndef USE_INSTANCING_MORPH
1465
1465
  uniform float morphTargetBaseInfluence;
1466
1466
  #endif
@@ -1484,7 +1484,7 @@ IncidentLight directLight;
1484
1484
  uniform float morphTargetInfluences[ 4 ];
1485
1485
  #endif
1486
1486
  #endif
1487
- #endif`,dv=`#ifdef USE_MORPHTARGETS
1487
+ #endif`,Lv=`#ifdef USE_MORPHTARGETS
1488
1488
  transformed *= morphTargetBaseInfluence;
1489
1489
  #ifdef MORPHTARGETS_TEXTURE
1490
1490
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
@@ -1502,7 +1502,7 @@ IncidentLight directLight;
1502
1502
  transformed += morphTarget7 * morphTargetInfluences[ 7 ];
1503
1503
  #endif
1504
1504
  #endif
1505
- #endif`,pv=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1505
+ #endif`,Fv=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1506
1506
  #ifdef FLAT_SHADED
1507
1507
  vec3 fdx = dFdx( vViewPosition );
1508
1508
  vec3 fdy = dFdy( vViewPosition );
@@ -1543,7 +1543,7 @@ IncidentLight directLight;
1543
1543
  tbn2[1] *= faceDirection;
1544
1544
  #endif
1545
1545
  #endif
1546
- vec3 nonPerturbedNormal = normal;`,mv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1546
+ vec3 nonPerturbedNormal = normal;`,Nv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1547
1547
  normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1548
1548
  #ifdef FLIP_SIDED
1549
1549
  normal = - normal;
@@ -1558,25 +1558,25 @@ vec3 nonPerturbedNormal = normal;`,mv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1558
1558
  normal = normalize( tbn * mapN );
1559
1559
  #elif defined( USE_BUMPMAP )
1560
1560
  normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1561
- #endif`,gv=`#ifndef FLAT_SHADED
1561
+ #endif`,Uv=`#ifndef FLAT_SHADED
1562
1562
  varying vec3 vNormal;
1563
1563
  #ifdef USE_TANGENT
1564
1564
  varying vec3 vTangent;
1565
1565
  varying vec3 vBitangent;
1566
1566
  #endif
1567
- #endif`,_v=`#ifndef FLAT_SHADED
1567
+ #endif`,Ov=`#ifndef FLAT_SHADED
1568
1568
  varying vec3 vNormal;
1569
1569
  #ifdef USE_TANGENT
1570
1570
  varying vec3 vTangent;
1571
1571
  varying vec3 vBitangent;
1572
1572
  #endif
1573
- #endif`,xv=`#ifndef FLAT_SHADED
1573
+ #endif`,Bv=`#ifndef FLAT_SHADED
1574
1574
  vNormal = normalize( transformedNormal );
1575
1575
  #ifdef USE_TANGENT
1576
1576
  vTangent = normalize( transformedTangent );
1577
1577
  vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1578
1578
  #endif
1579
- #endif`,vv=`#ifdef USE_NORMALMAP
1579
+ #endif`,zv=`#ifdef USE_NORMALMAP
1580
1580
  uniform sampler2D normalMap;
1581
1581
  uniform vec2 normalScale;
1582
1582
  #endif
@@ -1598,13 +1598,13 @@ vec3 nonPerturbedNormal = normal;`,mv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1598
1598
  float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1599
1599
  return mat3( T * scale, B * scale, N );
1600
1600
  }
1601
- #endif`,yv=`#ifdef USE_CLEARCOAT
1601
+ #endif`,kv=`#ifdef USE_CLEARCOAT
1602
1602
  vec3 clearcoatNormal = nonPerturbedNormal;
1603
- #endif`,Mv=`#ifdef USE_CLEARCOAT_NORMALMAP
1603
+ #endif`,Vv=`#ifdef USE_CLEARCOAT_NORMALMAP
1604
1604
  vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1605
1605
  clearcoatMapN.xy *= clearcoatNormalScale;
1606
1606
  clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1607
- #endif`,Sv=`#ifdef USE_CLEARCOATMAP
1607
+ #endif`,Hv=`#ifdef USE_CLEARCOATMAP
1608
1608
  uniform sampler2D clearcoatMap;
1609
1609
  #endif
1610
1610
  #ifdef USE_CLEARCOAT_NORMALMAP
@@ -1613,18 +1613,18 @@ vec3 nonPerturbedNormal = normal;`,mv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1613
1613
  #endif
1614
1614
  #ifdef USE_CLEARCOAT_ROUGHNESSMAP
1615
1615
  uniform sampler2D clearcoatRoughnessMap;
1616
- #endif`,bv=`#ifdef USE_IRIDESCENCEMAP
1616
+ #endif`,Gv=`#ifdef USE_IRIDESCENCEMAP
1617
1617
  uniform sampler2D iridescenceMap;
1618
1618
  #endif
1619
1619
  #ifdef USE_IRIDESCENCE_THICKNESSMAP
1620
1620
  uniform sampler2D iridescenceThicknessMap;
1621
- #endif`,Ev=`#ifdef OPAQUE
1621
+ #endif`,Wv=`#ifdef OPAQUE
1622
1622
  diffuseColor.a = 1.0;
1623
1623
  #endif
1624
1624
  #ifdef USE_TRANSMISSION
1625
1625
  diffuseColor.a *= material.transmissionAlpha;
1626
1626
  #endif
1627
- gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,wv=`vec3 packNormalToRGB( const in vec3 normal ) {
1627
+ gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Xv=`vec3 packNormalToRGB( const in vec3 normal ) {
1628
1628
  return normalize( normal ) * 0.5 + 0.5;
1629
1629
  }
1630
1630
  vec3 unpackRGBToNormal( const in vec3 rgb ) {
@@ -1665,9 +1665,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const
1665
1665
  }
1666
1666
  float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1667
1667
  return ( near * far ) / ( ( far - near ) * depth - far );
1668
- }`,Tv=`#ifdef PREMULTIPLIED_ALPHA
1668
+ }`,qv=`#ifdef PREMULTIPLIED_ALPHA
1669
1669
  gl_FragColor.rgb *= gl_FragColor.a;
1670
- #endif`,Av=`vec4 mvPosition = vec4( transformed, 1.0 );
1670
+ #endif`,Yv=`vec4 mvPosition = vec4( transformed, 1.0 );
1671
1671
  #ifdef USE_BATCHING
1672
1672
  mvPosition = batchingMatrix * mvPosition;
1673
1673
  #endif
@@ -1675,22 +1675,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const
1675
1675
  mvPosition = instanceMatrix * mvPosition;
1676
1676
  #endif
1677
1677
  mvPosition = modelViewMatrix * mvPosition;
1678
- gl_Position = projectionMatrix * mvPosition;`,Dv=`#ifdef DITHERING
1678
+ gl_Position = projectionMatrix * mvPosition;`,Zv=`#ifdef DITHERING
1679
1679
  gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1680
- #endif`,Cv=`#ifdef DITHERING
1680
+ #endif`,Jv=`#ifdef DITHERING
1681
1681
  vec3 dithering( vec3 color ) {
1682
1682
  float grid_position = rand( gl_FragCoord.xy );
1683
1683
  vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1684
1684
  dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1685
1685
  return color + dither_shift_RGB;
1686
1686
  }
1687
- #endif`,Rv=`float roughnessFactor = roughness;
1687
+ #endif`,$v=`float roughnessFactor = roughness;
1688
1688
  #ifdef USE_ROUGHNESSMAP
1689
1689
  vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1690
1690
  roughnessFactor *= texelRoughness.g;
1691
- #endif`,Pv=`#ifdef USE_ROUGHNESSMAP
1691
+ #endif`,Kv=`#ifdef USE_ROUGHNESSMAP
1692
1692
  uniform sampler2D roughnessMap;
1693
- #endif`,Iv=`#if NUM_SPOT_LIGHT_COORDS > 0
1693
+ #endif`,Qv=`#if NUM_SPOT_LIGHT_COORDS > 0
1694
1694
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1695
1695
  #endif
1696
1696
  #if NUM_SPOT_LIGHT_MAPS > 0
@@ -1873,7 +1873,7 @@ gl_Position = projectionMatrix * mvPosition;`,Dv=`#ifdef DITHERING
1873
1873
  }
1874
1874
  return shadow;
1875
1875
  }
1876
- #endif`,Lv=`#if NUM_SPOT_LIGHT_COORDS > 0
1876
+ #endif`,jv=`#if NUM_SPOT_LIGHT_COORDS > 0
1877
1877
  uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1878
1878
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1879
1879
  #endif
@@ -1911,7 +1911,7 @@ gl_Position = projectionMatrix * mvPosition;`,Dv=`#ifdef DITHERING
1911
1911
  };
1912
1912
  uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1913
1913
  #endif
1914
- #endif`,Fv=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1914
+ #endif`,ty=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1915
1915
  vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
1916
1916
  vec4 shadowWorldPosition;
1917
1917
  #endif
@@ -1943,7 +1943,7 @@ gl_Position = projectionMatrix * mvPosition;`,Dv=`#ifdef DITHERING
1943
1943
  vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
1944
1944
  }
1945
1945
  #pragma unroll_loop_end
1946
- #endif`,Uv=`float getShadowMask() {
1946
+ #endif`,ey=`float getShadowMask() {
1947
1947
  float shadow = 1.0;
1948
1948
  #ifdef USE_SHADOWMAP
1949
1949
  #if NUM_DIR_LIGHT_SHADOWS > 0
@@ -1975,12 +1975,12 @@ gl_Position = projectionMatrix * mvPosition;`,Dv=`#ifdef DITHERING
1975
1975
  #endif
1976
1976
  #endif
1977
1977
  return shadow;
1978
- }`,Nv=`#ifdef USE_SKINNING
1978
+ }`,ny=`#ifdef USE_SKINNING
1979
1979
  mat4 boneMatX = getBoneMatrix( skinIndex.x );
1980
1980
  mat4 boneMatY = getBoneMatrix( skinIndex.y );
1981
1981
  mat4 boneMatZ = getBoneMatrix( skinIndex.z );
1982
1982
  mat4 boneMatW = getBoneMatrix( skinIndex.w );
1983
- #endif`,Ov=`#ifdef USE_SKINNING
1983
+ #endif`,iy=`#ifdef USE_SKINNING
1984
1984
  uniform mat4 bindMatrix;
1985
1985
  uniform mat4 bindMatrixInverse;
1986
1986
  uniform highp sampler2D boneTexture;
@@ -1995,7 +1995,7 @@ gl_Position = projectionMatrix * mvPosition;`,Dv=`#ifdef DITHERING
1995
1995
  vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
1996
1996
  return mat4( v1, v2, v3, v4 );
1997
1997
  }
1998
- #endif`,Bv=`#ifdef USE_SKINNING
1998
+ #endif`,ry=`#ifdef USE_SKINNING
1999
1999
  vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2000
2000
  vec4 skinned = vec4( 0.0 );
2001
2001
  skinned += boneMatX * skinVertex * skinWeight.x;
@@ -2003,7 +2003,7 @@ gl_Position = projectionMatrix * mvPosition;`,Dv=`#ifdef DITHERING
2003
2003
  skinned += boneMatZ * skinVertex * skinWeight.z;
2004
2004
  skinned += boneMatW * skinVertex * skinWeight.w;
2005
2005
  transformed = ( bindMatrixInverse * skinned ).xyz;
2006
- #endif`,zv=`#ifdef USE_SKINNING
2006
+ #endif`,sy=`#ifdef USE_SKINNING
2007
2007
  mat4 skinMatrix = mat4( 0.0 );
2008
2008
  skinMatrix += skinWeight.x * boneMatX;
2009
2009
  skinMatrix += skinWeight.y * boneMatY;
@@ -2014,17 +2014,17 @@ gl_Position = projectionMatrix * mvPosition;`,Dv=`#ifdef DITHERING
2014
2014
  #ifdef USE_TANGENT
2015
2015
  objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2016
2016
  #endif
2017
- #endif`,kv=`float specularStrength;
2017
+ #endif`,oy=`float specularStrength;
2018
2018
  #ifdef USE_SPECULARMAP
2019
2019
  vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2020
2020
  specularStrength = texelSpecular.r;
2021
2021
  #else
2022
2022
  specularStrength = 1.0;
2023
- #endif`,Vv=`#ifdef USE_SPECULARMAP
2023
+ #endif`,ay=`#ifdef USE_SPECULARMAP
2024
2024
  uniform sampler2D specularMap;
2025
- #endif`,Hv=`#if defined( TONE_MAPPING )
2025
+ #endif`,ly=`#if defined( TONE_MAPPING )
2026
2026
  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2027
- #endif`,Gv=`#ifndef saturate
2027
+ #endif`,cy=`#ifndef saturate
2028
2028
  #define saturate( a ) clamp( a, 0.0, 1.0 )
2029
2029
  #endif
2030
2030
  uniform float toneMappingExposure;
@@ -2121,7 +2121,7 @@ vec3 NeutralToneMapping( vec3 color ) {
2121
2121
  float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2122
2122
  return mix( color, vec3( newPeak ), g );
2123
2123
  }
2124
- vec3 CustomToneMapping( vec3 color ) { return color; }`,Wv=`#ifdef USE_TRANSMISSION
2124
+ vec3 CustomToneMapping( vec3 color ) { return color; }`,uy=`#ifdef USE_TRANSMISSION
2125
2125
  material.transmission = transmission;
2126
2126
  material.transmissionAlpha = 1.0;
2127
2127
  material.thickness = thickness;
@@ -2142,7 +2142,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Wv=`#ifdef USE_TRANSMISS
2142
2142
  material.attenuationColor, material.attenuationDistance );
2143
2143
  material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2144
2144
  totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2145
- #endif`,Xv=`#ifdef USE_TRANSMISSION
2145
+ #endif`,hy=`#ifdef USE_TRANSMISSION
2146
2146
  uniform float transmission;
2147
2147
  uniform float thickness;
2148
2148
  uniform float attenuationDistance;
@@ -2273,7 +2273,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Wv=`#ifdef USE_TRANSMISS
2273
2273
  float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2274
2274
  return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2275
2275
  }
2276
- #endif`,qv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2276
+ #endif`,fy=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2277
2277
  varying vec2 vUv;
2278
2278
  #endif
2279
2279
  #ifdef USE_MAP
@@ -2343,7 +2343,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Wv=`#ifdef USE_TRANSMISS
2343
2343
  #ifdef USE_THICKNESSMAP
2344
2344
  uniform mat3 thicknessMapTransform;
2345
2345
  varying vec2 vThicknessMapUv;
2346
- #endif`,Yv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2346
+ #endif`,dy=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2347
2347
  varying vec2 vUv;
2348
2348
  #endif
2349
2349
  #ifdef USE_MAP
@@ -2437,7 +2437,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Wv=`#ifdef USE_TRANSMISS
2437
2437
  #ifdef USE_THICKNESSMAP
2438
2438
  uniform mat3 thicknessMapTransform;
2439
2439
  varying vec2 vThicknessMapUv;
2440
- #endif`,Zv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2440
+ #endif`,py=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2441
2441
  vUv = vec3( uv, 1 ).xy;
2442
2442
  #endif
2443
2443
  #ifdef USE_MAP
@@ -2508,7 +2508,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Wv=`#ifdef USE_TRANSMISS
2508
2508
  #endif
2509
2509
  #ifdef USE_THICKNESSMAP
2510
2510
  vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2511
- #endif`,Jv=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2511
+ #endif`,my=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2512
2512
  vec4 worldPosition = vec4( transformed, 1.0 );
2513
2513
  #ifdef USE_BATCHING
2514
2514
  worldPosition = batchingMatrix * worldPosition;
@@ -2517,12 +2517,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Wv=`#ifdef USE_TRANSMISS
2517
2517
  worldPosition = instanceMatrix * worldPosition;
2518
2518
  #endif
2519
2519
  worldPosition = modelMatrix * worldPosition;
2520
- #endif`,$v=`varying vec2 vUv;
2520
+ #endif`,gy=`varying vec2 vUv;
2521
2521
  uniform mat3 uvTransform;
2522
2522
  void main() {
2523
2523
  vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2524
2524
  gl_Position = vec4( position.xy, 1.0, 1.0 );
2525
- }`,Kv=`uniform sampler2D t2D;
2525
+ }`,_y=`uniform sampler2D t2D;
2526
2526
  uniform float backgroundIntensity;
2527
2527
  varying vec2 vUv;
2528
2528
  void main() {
@@ -2534,14 +2534,14 @@ void main() {
2534
2534
  gl_FragColor = texColor;
2535
2535
  #include <tonemapping_fragment>
2536
2536
  #include <colorspace_fragment>
2537
- }`,Qv=`varying vec3 vWorldDirection;
2537
+ }`,xy=`varying vec3 vWorldDirection;
2538
2538
  #include <common>
2539
2539
  void main() {
2540
2540
  vWorldDirection = transformDirection( position, modelMatrix );
2541
2541
  #include <begin_vertex>
2542
2542
  #include <project_vertex>
2543
2543
  gl_Position.z = gl_Position.w;
2544
- }`,jv=`#ifdef ENVMAP_TYPE_CUBE
2544
+ }`,vy=`#ifdef ENVMAP_TYPE_CUBE
2545
2545
  uniform samplerCube envMap;
2546
2546
  #elif defined( ENVMAP_TYPE_CUBE_UV )
2547
2547
  uniform sampler2D envMap;
@@ -2564,14 +2564,14 @@ void main() {
2564
2564
  gl_FragColor = texColor;
2565
2565
  #include <tonemapping_fragment>
2566
2566
  #include <colorspace_fragment>
2567
- }`,ty=`varying vec3 vWorldDirection;
2567
+ }`,yy=`varying vec3 vWorldDirection;
2568
2568
  #include <common>
2569
2569
  void main() {
2570
2570
  vWorldDirection = transformDirection( position, modelMatrix );
2571
2571
  #include <begin_vertex>
2572
2572
  #include <project_vertex>
2573
2573
  gl_Position.z = gl_Position.w;
2574
- }`,ey=`uniform samplerCube tCube;
2574
+ }`,My=`uniform samplerCube tCube;
2575
2575
  uniform float tFlip;
2576
2576
  uniform float opacity;
2577
2577
  varying vec3 vWorldDirection;
@@ -2581,7 +2581,7 @@ void main() {
2581
2581
  gl_FragColor.a *= opacity;
2582
2582
  #include <tonemapping_fragment>
2583
2583
  #include <colorspace_fragment>
2584
- }`,ny=`#include <common>
2584
+ }`,Sy=`#include <common>
2585
2585
  #include <batching_pars_vertex>
2586
2586
  #include <uv_pars_vertex>
2587
2587
  #include <displacementmap_pars_vertex>
@@ -2608,7 +2608,7 @@ void main() {
2608
2608
  #include <logdepthbuf_vertex>
2609
2609
  #include <clipping_planes_vertex>
2610
2610
  vHighPrecisionZW = gl_Position.zw;
2611
- }`,iy=`#if DEPTH_PACKING == 3200
2611
+ }`,by=`#if DEPTH_PACKING == 3200
2612
2612
  uniform float opacity;
2613
2613
  #endif
2614
2614
  #include <common>
@@ -2638,7 +2638,7 @@ void main() {
2638
2638
  #elif DEPTH_PACKING == 3201
2639
2639
  gl_FragColor = packDepthToRGBA( fragCoordZ );
2640
2640
  #endif
2641
- }`,ry=`#define DISTANCE
2641
+ }`,wy=`#define DISTANCE
2642
2642
  varying vec3 vWorldPosition;
2643
2643
  #include <common>
2644
2644
  #include <batching_pars_vertex>
@@ -2665,7 +2665,7 @@ void main() {
2665
2665
  #include <worldpos_vertex>
2666
2666
  #include <clipping_planes_vertex>
2667
2667
  vWorldPosition = worldPosition.xyz;
2668
- }`,sy=`#define DISTANCE
2668
+ }`,Ey=`#define DISTANCE
2669
2669
  uniform vec3 referencePosition;
2670
2670
  uniform float nearDistance;
2671
2671
  uniform float farDistance;
@@ -2689,13 +2689,13 @@ void main () {
2689
2689
  dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2690
2690
  dist = saturate( dist );
2691
2691
  gl_FragColor = packDepthToRGBA( dist );
2692
- }`,ay=`varying vec3 vWorldDirection;
2692
+ }`,Ty=`varying vec3 vWorldDirection;
2693
2693
  #include <common>
2694
2694
  void main() {
2695
2695
  vWorldDirection = transformDirection( position, modelMatrix );
2696
2696
  #include <begin_vertex>
2697
2697
  #include <project_vertex>
2698
- }`,oy=`uniform sampler2D tEquirect;
2698
+ }`,Ay=`uniform sampler2D tEquirect;
2699
2699
  varying vec3 vWorldDirection;
2700
2700
  #include <common>
2701
2701
  void main() {
@@ -2704,7 +2704,7 @@ void main() {
2704
2704
  gl_FragColor = texture2D( tEquirect, sampleUV );
2705
2705
  #include <tonemapping_fragment>
2706
2706
  #include <colorspace_fragment>
2707
- }`,ly=`uniform float scale;
2707
+ }`,Dy=`uniform float scale;
2708
2708
  attribute float lineDistance;
2709
2709
  varying float vLineDistance;
2710
2710
  #include <common>
@@ -2726,7 +2726,7 @@ void main() {
2726
2726
  #include <logdepthbuf_vertex>
2727
2727
  #include <clipping_planes_vertex>
2728
2728
  #include <fog_vertex>
2729
- }`,cy=`uniform vec3 diffuse;
2729
+ }`,Cy=`uniform vec3 diffuse;
2730
2730
  uniform float opacity;
2731
2731
  uniform float dashSize;
2732
2732
  uniform float totalSize;
@@ -2754,7 +2754,7 @@ void main() {
2754
2754
  #include <colorspace_fragment>
2755
2755
  #include <fog_fragment>
2756
2756
  #include <premultiplied_alpha_fragment>
2757
- }`,uy=`#include <common>
2757
+ }`,Ry=`#include <common>
2758
2758
  #include <batching_pars_vertex>
2759
2759
  #include <uv_pars_vertex>
2760
2760
  #include <envmap_pars_vertex>
@@ -2786,7 +2786,7 @@ void main() {
2786
2786
  #include <worldpos_vertex>
2787
2787
  #include <envmap_vertex>
2788
2788
  #include <fog_vertex>
2789
- }`,hy=`uniform vec3 diffuse;
2789
+ }`,Py=`uniform vec3 diffuse;
2790
2790
  uniform float opacity;
2791
2791
  #ifndef FLAT_SHADED
2792
2792
  varying vec3 vNormal;
@@ -2834,7 +2834,7 @@ void main() {
2834
2834
  #include <fog_fragment>
2835
2835
  #include <premultiplied_alpha_fragment>
2836
2836
  #include <dithering_fragment>
2837
- }`,fy=`#define LAMBERT
2837
+ }`,Iy=`#define LAMBERT
2838
2838
  varying vec3 vViewPosition;
2839
2839
  #include <common>
2840
2840
  #include <batching_pars_vertex>
@@ -2873,7 +2873,7 @@ void main() {
2873
2873
  #include <envmap_vertex>
2874
2874
  #include <shadowmap_vertex>
2875
2875
  #include <fog_vertex>
2876
- }`,dy=`#define LAMBERT
2876
+ }`,Ly=`#define LAMBERT
2877
2877
  uniform vec3 diffuse;
2878
2878
  uniform vec3 emissive;
2879
2879
  uniform float opacity;
@@ -2930,7 +2930,7 @@ void main() {
2930
2930
  #include <fog_fragment>
2931
2931
  #include <premultiplied_alpha_fragment>
2932
2932
  #include <dithering_fragment>
2933
- }`,py=`#define MATCAP
2933
+ }`,Fy=`#define MATCAP
2934
2934
  varying vec3 vViewPosition;
2935
2935
  #include <common>
2936
2936
  #include <batching_pars_vertex>
@@ -2964,7 +2964,7 @@ void main() {
2964
2964
  #include <clipping_planes_vertex>
2965
2965
  #include <fog_vertex>
2966
2966
  vViewPosition = - mvPosition.xyz;
2967
- }`,my=`#define MATCAP
2967
+ }`,Ny=`#define MATCAP
2968
2968
  uniform vec3 diffuse;
2969
2969
  uniform float opacity;
2970
2970
  uniform sampler2D matcap;
@@ -3010,7 +3010,7 @@ void main() {
3010
3010
  #include <fog_fragment>
3011
3011
  #include <premultiplied_alpha_fragment>
3012
3012
  #include <dithering_fragment>
3013
- }`,gy=`#define NORMAL
3013
+ }`,Uy=`#define NORMAL
3014
3014
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3015
3015
  varying vec3 vViewPosition;
3016
3016
  #endif
@@ -3043,7 +3043,7 @@ void main() {
3043
3043
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3044
3044
  vViewPosition = - mvPosition.xyz;
3045
3045
  #endif
3046
- }`,_y=`#define NORMAL
3046
+ }`,Oy=`#define NORMAL
3047
3047
  uniform float opacity;
3048
3048
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3049
3049
  varying vec3 vViewPosition;
@@ -3065,7 +3065,7 @@ void main() {
3065
3065
  #ifdef OPAQUE
3066
3066
  gl_FragColor.a = 1.0;
3067
3067
  #endif
3068
- }`,xy=`#define PHONG
3068
+ }`,By=`#define PHONG
3069
3069
  varying vec3 vViewPosition;
3070
3070
  #include <common>
3071
3071
  #include <batching_pars_vertex>
@@ -3104,7 +3104,7 @@ void main() {
3104
3104
  #include <envmap_vertex>
3105
3105
  #include <shadowmap_vertex>
3106
3106
  #include <fog_vertex>
3107
- }`,vy=`#define PHONG
3107
+ }`,zy=`#define PHONG
3108
3108
  uniform vec3 diffuse;
3109
3109
  uniform vec3 emissive;
3110
3110
  uniform vec3 specular;
@@ -3163,7 +3163,7 @@ void main() {
3163
3163
  #include <fog_fragment>
3164
3164
  #include <premultiplied_alpha_fragment>
3165
3165
  #include <dithering_fragment>
3166
- }`,yy=`#define STANDARD
3166
+ }`,ky=`#define STANDARD
3167
3167
  varying vec3 vViewPosition;
3168
3168
  #ifdef USE_TRANSMISSION
3169
3169
  varying vec3 vWorldPosition;
@@ -3206,7 +3206,7 @@ void main() {
3206
3206
  #ifdef USE_TRANSMISSION
3207
3207
  vWorldPosition = worldPosition.xyz;
3208
3208
  #endif
3209
- }`,My=`#define STANDARD
3209
+ }`,Vy=`#define STANDARD
3210
3210
  #ifdef PHYSICAL
3211
3211
  #define IOR
3212
3212
  #define USE_SPECULAR
@@ -3331,7 +3331,7 @@ void main() {
3331
3331
  #include <fog_fragment>
3332
3332
  #include <premultiplied_alpha_fragment>
3333
3333
  #include <dithering_fragment>
3334
- }`,Sy=`#define TOON
3334
+ }`,Hy=`#define TOON
3335
3335
  varying vec3 vViewPosition;
3336
3336
  #include <common>
3337
3337
  #include <batching_pars_vertex>
@@ -3368,7 +3368,7 @@ void main() {
3368
3368
  #include <worldpos_vertex>
3369
3369
  #include <shadowmap_vertex>
3370
3370
  #include <fog_vertex>
3371
- }`,by=`#define TOON
3371
+ }`,Gy=`#define TOON
3372
3372
  uniform vec3 diffuse;
3373
3373
  uniform vec3 emissive;
3374
3374
  uniform float opacity;
@@ -3421,7 +3421,7 @@ void main() {
3421
3421
  #include <fog_fragment>
3422
3422
  #include <premultiplied_alpha_fragment>
3423
3423
  #include <dithering_fragment>
3424
- }`,Ey=`uniform float size;
3424
+ }`,Wy=`uniform float size;
3425
3425
  uniform float scale;
3426
3426
  #include <common>
3427
3427
  #include <color_pars_vertex>
@@ -3452,7 +3452,7 @@ void main() {
3452
3452
  #include <clipping_planes_vertex>
3453
3453
  #include <worldpos_vertex>
3454
3454
  #include <fog_vertex>
3455
- }`,wy=`uniform vec3 diffuse;
3455
+ }`,Xy=`uniform vec3 diffuse;
3456
3456
  uniform float opacity;
3457
3457
  #include <common>
3458
3458
  #include <color_pars_fragment>
@@ -3477,7 +3477,7 @@ void main() {
3477
3477
  #include <colorspace_fragment>
3478
3478
  #include <fog_fragment>
3479
3479
  #include <premultiplied_alpha_fragment>
3480
- }`,Ty=`#include <common>
3480
+ }`,qy=`#include <common>
3481
3481
  #include <batching_pars_vertex>
3482
3482
  #include <fog_pars_vertex>
3483
3483
  #include <morphtarget_pars_vertex>
@@ -3500,7 +3500,7 @@ void main() {
3500
3500
  #include <worldpos_vertex>
3501
3501
  #include <shadowmap_vertex>
3502
3502
  #include <fog_vertex>
3503
- }`,Ay=`uniform vec3 color;
3503
+ }`,Yy=`uniform vec3 color;
3504
3504
  uniform float opacity;
3505
3505
  #include <common>
3506
3506
  #include <packing>
@@ -3516,7 +3516,7 @@ void main() {
3516
3516
  #include <tonemapping_fragment>
3517
3517
  #include <colorspace_fragment>
3518
3518
  #include <fog_fragment>
3519
- }`,Dy=`uniform float rotation;
3519
+ }`,Zy=`uniform float rotation;
3520
3520
  uniform vec2 center;
3521
3521
  #include <common>
3522
3522
  #include <uv_pars_vertex>
@@ -3542,7 +3542,7 @@ void main() {
3542
3542
  #include <logdepthbuf_vertex>
3543
3543
  #include <clipping_planes_vertex>
3544
3544
  #include <fog_vertex>
3545
- }`,Cy=`uniform vec3 diffuse;
3545
+ }`,Jy=`uniform vec3 diffuse;
3546
3546
  uniform float opacity;
3547
3547
  #include <common>
3548
3548
  #include <uv_pars_fragment>
@@ -3567,7 +3567,7 @@ void main() {
3567
3567
  #include <tonemapping_fragment>
3568
3568
  #include <colorspace_fragment>
3569
3569
  #include <fog_fragment>
3570
- }`,Xt={alphahash_fragment:K0,alphahash_pars_fragment:Q0,alphamap_fragment:j0,alphamap_pars_fragment:tx,alphatest_fragment:ex,alphatest_pars_fragment:nx,aomap_fragment:ix,aomap_pars_fragment:rx,batching_pars_vertex:sx,batching_vertex:ax,begin_vertex:ox,beginnormal_vertex:lx,bsdfs:cx,iridescence_fragment:ux,bumpmap_pars_fragment:hx,clipping_planes_fragment:fx,clipping_planes_pars_fragment:dx,clipping_planes_pars_vertex:px,clipping_planes_vertex:mx,color_fragment:gx,color_pars_fragment:_x,color_pars_vertex:xx,color_vertex:vx,common:yx,cube_uv_reflection_fragment:Mx,defaultnormal_vertex:Sx,displacementmap_pars_vertex:bx,displacementmap_vertex:Ex,emissivemap_fragment:wx,emissivemap_pars_fragment:Tx,colorspace_fragment:Ax,colorspace_pars_fragment:Dx,envmap_fragment:Cx,envmap_common_pars_fragment:Rx,envmap_pars_fragment:Px,envmap_pars_vertex:Ix,envmap_physical_pars_fragment:Gx,envmap_vertex:Lx,fog_vertex:Fx,fog_pars_vertex:Ux,fog_fragment:Nx,fog_pars_fragment:Ox,gradientmap_pars_fragment:Bx,lightmap_pars_fragment:zx,lights_lambert_fragment:kx,lights_lambert_pars_fragment:Vx,lights_pars_begin:Hx,lights_toon_fragment:Wx,lights_toon_pars_fragment:Xx,lights_phong_fragment:qx,lights_phong_pars_fragment:Yx,lights_physical_fragment:Zx,lights_physical_pars_fragment:Jx,lights_fragment_begin:$x,lights_fragment_maps:Kx,lights_fragment_end:Qx,logdepthbuf_fragment:jx,logdepthbuf_pars_fragment:tv,logdepthbuf_pars_vertex:ev,logdepthbuf_vertex:nv,map_fragment:iv,map_pars_fragment:rv,map_particle_fragment:sv,map_particle_pars_fragment:av,metalnessmap_fragment:ov,metalnessmap_pars_fragment:lv,morphinstance_vertex:cv,morphcolor_vertex:uv,morphnormal_vertex:hv,morphtarget_pars_vertex:fv,morphtarget_vertex:dv,normal_fragment_begin:pv,normal_fragment_maps:mv,normal_pars_fragment:gv,normal_pars_vertex:_v,normal_vertex:xv,normalmap_pars_fragment:vv,clearcoat_normal_fragment_begin:yv,clearcoat_normal_fragment_maps:Mv,clearcoat_pars_fragment:Sv,iridescence_pars_fragment:bv,opaque_fragment:Ev,packing:wv,premultiplied_alpha_fragment:Tv,project_vertex:Av,dithering_fragment:Dv,dithering_pars_fragment:Cv,roughnessmap_fragment:Rv,roughnessmap_pars_fragment:Pv,shadowmap_pars_fragment:Iv,shadowmap_pars_vertex:Lv,shadowmap_vertex:Fv,shadowmask_pars_fragment:Uv,skinbase_vertex:Nv,skinning_pars_vertex:Ov,skinning_vertex:Bv,skinnormal_vertex:zv,specularmap_fragment:kv,specularmap_pars_fragment:Vv,tonemapping_fragment:Hv,tonemapping_pars_fragment:Gv,transmission_fragment:Wv,transmission_pars_fragment:Xv,uv_pars_fragment:qv,uv_pars_vertex:Yv,uv_vertex:Zv,worldpos_vertex:Jv,background_vert:$v,background_frag:Kv,backgroundCube_vert:Qv,backgroundCube_frag:jv,cube_vert:ty,cube_frag:ey,depth_vert:ny,depth_frag:iy,distanceRGBA_vert:ry,distanceRGBA_frag:sy,equirect_vert:ay,equirect_frag:oy,linedashed_vert:ly,linedashed_frag:cy,meshbasic_vert:uy,meshbasic_frag:hy,meshlambert_vert:fy,meshlambert_frag:dy,meshmatcap_vert:py,meshmatcap_frag:my,meshnormal_vert:gy,meshnormal_frag:_y,meshphong_vert:xy,meshphong_frag:vy,meshphysical_vert:yy,meshphysical_frag:My,meshtoon_vert:Sy,meshtoon_frag:by,points_vert:Ey,points_frag:wy,shadow_vert:Ty,shadow_frag:Ay,sprite_vert:Dy,sprite_frag:Cy},dt={common:{diffuse:{value:new re(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new qt},alphaMap:{value:null},alphaMapTransform:{value:new qt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new qt}},envmap:{envMap:{value:null},envMapRotation:{value:new qt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new qt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new qt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new qt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new qt},normalScale:{value:new ae(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new qt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new qt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new qt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new qt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new re(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new re(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new qt},alphaTest:{value:0},uvTransform:{value:new qt}},sprite:{diffuse:{value:new re(16777215)},opacity:{value:1},center:{value:new ae(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new qt},alphaMap:{value:null},alphaMapTransform:{value:new qt},alphaTest:{value:0}}},di={basic:{uniforms:gn([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.fog]),vertexShader:Xt.meshbasic_vert,fragmentShader:Xt.meshbasic_frag},lambert:{uniforms:gn([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new re(0)}}]),vertexShader:Xt.meshlambert_vert,fragmentShader:Xt.meshlambert_frag},phong:{uniforms:gn([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new re(0)},specular:{value:new re(1118481)},shininess:{value:30}}]),vertexShader:Xt.meshphong_vert,fragmentShader:Xt.meshphong_frag},standard:{uniforms:gn([dt.common,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.roughnessmap,dt.metalnessmap,dt.fog,dt.lights,{emissive:{value:new re(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Xt.meshphysical_vert,fragmentShader:Xt.meshphysical_frag},toon:{uniforms:gn([dt.common,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.gradientmap,dt.fog,dt.lights,{emissive:{value:new re(0)}}]),vertexShader:Xt.meshtoon_vert,fragmentShader:Xt.meshtoon_frag},matcap:{uniforms:gn([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,{matcap:{value:null}}]),vertexShader:Xt.meshmatcap_vert,fragmentShader:Xt.meshmatcap_frag},points:{uniforms:gn([dt.points,dt.fog]),vertexShader:Xt.points_vert,fragmentShader:Xt.points_frag},dashed:{uniforms:gn([dt.common,dt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Xt.linedashed_vert,fragmentShader:Xt.linedashed_frag},depth:{uniforms:gn([dt.common,dt.displacementmap]),vertexShader:Xt.depth_vert,fragmentShader:Xt.depth_frag},normal:{uniforms:gn([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,{opacity:{value:1}}]),vertexShader:Xt.meshnormal_vert,fragmentShader:Xt.meshnormal_frag},sprite:{uniforms:gn([dt.sprite,dt.fog]),vertexShader:Xt.sprite_vert,fragmentShader:Xt.sprite_frag},background:{uniforms:{uvTransform:{value:new qt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Xt.background_vert,fragmentShader:Xt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new qt}},vertexShader:Xt.backgroundCube_vert,fragmentShader:Xt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Xt.cube_vert,fragmentShader:Xt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Xt.equirect_vert,fragmentShader:Xt.equirect_frag},distanceRGBA:{uniforms:gn([dt.common,dt.displacementmap,{referencePosition:{value:new q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Xt.distanceRGBA_vert,fragmentShader:Xt.distanceRGBA_frag},shadow:{uniforms:gn([dt.lights,dt.fog,{color:{value:new re(0)},opacity:{value:1}}]),vertexShader:Xt.shadow_vert,fragmentShader:Xt.shadow_frag}};di.physical={uniforms:gn([di.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new qt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new qt},clearcoatNormalScale:{value:new ae(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new qt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new qt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new qt},sheen:{value:0},sheenColor:{value:new re(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new qt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new qt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new qt},transmissionSamplerSize:{value:new ae},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new qt},attenuationDistance:{value:0},attenuationColor:{value:new re(0)},specularColor:{value:new re(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new qt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new qt},anisotropyVector:{value:new ae},anisotropyMap:{value:null},anisotropyMapTransform:{value:new qt}}]),vertexShader:Xt.meshphysical_vert,fragmentShader:Xt.meshphysical_frag};var Zo={r:0,b:0,g:0},zr=new Ni,Ry=new Re;function Py(r,t,e,n,i,s,a){let o=new re(0),l=s===!0?0:1,c,u,f=null,h=0,d=null;function _(S){let v=S.isScene===!0?S.background:null;return v&&v.isTexture&&(v=(S.backgroundBlurriness>0?e:t).get(v)),v}function g(S){let v=!1,M=_(S);M===null?m(o,l):M&&M.isColor&&(m(M,1),v=!0);let D=r.xr.getEnvironmentBlendMode();D==="additive"?n.buffers.color.setClear(0,0,0,1,a):D==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil)}function p(S,v){let M=_(v);M&&(M.isCubeTexture||M.mapping===Tl)?(u===void 0&&(u=new ii(new Ia(1,1,1),new Zn({name:"BackgroundCubeMaterial",uniforms:Hs(di.backgroundCube.uniforms),vertexShader:di.backgroundCube.vertexShader,fragmentShader:di.backgroundCube.fragmentShader,side:Tn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(D,T,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),zr.copy(v.backgroundRotation),zr.x*=-1,zr.y*=-1,zr.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(zr.y*=-1,zr.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Ry.makeRotationFromEuler(zr)),u.material.toneMapped=he.getTransfer(M.colorSpace)!==_e,(f!==M||h!==M.version||d!==r.toneMapping)&&(u.material.needsUpdate=!0,f=M,h=M.version,d=r.toneMapping),u.layers.enableAll(),S.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new ii(new gl(2,2),new Zn({name:"BackgroundMaterial",uniforms:Hs(di.background.uniforms),vertexShader:di.background.vertexShader,fragmentShader:di.background.fragmentShader,side:or,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=he.getTransfer(M.colorSpace)!==_e,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(f!==M||h!==M.version||d!==r.toneMapping)&&(c.material.needsUpdate=!0,f=M,h=M.version,d=r.toneMapping),c.layers.enableAll(),S.unshift(c,c.geometry,c.material,0,0,null))}function m(S,v){S.getRGB(Zo,pm(r)),n.buffers.color.setClear(Zo.r,Zo.g,Zo.b,v,a)}return{getClearColor:function(){return o},setClearColor:function(S,v=1){o.set(S),l=v,m(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(S){l=S,m(o,l)},render:g,addToRenderList:p}}function Iy(r,t){let e=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=h(null),s=i,a=!1;function o(x,F,I,R,B){let G=!1,Z=f(R,I,F);s!==Z&&(s=Z,c(s.object)),G=d(x,R,I,B),G&&_(x,R,I,B),B!==null&&t.update(B,r.ELEMENT_ARRAY_BUFFER),(G||a)&&(a=!1,M(x,F,I,R),B!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(B).buffer))}function l(){return r.createVertexArray()}function c(x){return r.bindVertexArray(x)}function u(x){return r.deleteVertexArray(x)}function f(x,F,I){let R=I.wireframe===!0,B=n[x.id];B===void 0&&(B={},n[x.id]=B);let G=B[F.id];G===void 0&&(G={},B[F.id]=G);let Z=G[R];return Z===void 0&&(Z=h(l()),G[R]=Z),Z}function h(x){let F=[],I=[],R=[];for(let B=0;B<e;B++)F[B]=0,I[B]=0,R[B]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:F,enabledAttributes:I,attributeDivisors:R,object:x,attributes:{},index:null}}function d(x,F,I,R){let B=s.attributes,G=F.attributes,Z=0,J=I.getAttributes();for(let N in J)if(J[N].location>=0){let A=B[N],at=G[N];if(at===void 0&&(N==="instanceMatrix"&&x.instanceMatrix&&(at=x.instanceMatrix),N==="instanceColor"&&x.instanceColor&&(at=x.instanceColor)),A===void 0||A.attribute!==at||at&&A.data!==at.data)return!0;Z++}return s.attributesNum!==Z||s.index!==R}function _(x,F,I,R){let B={},G=F.attributes,Z=0,J=I.getAttributes();for(let N in J)if(J[N].location>=0){let A=G[N];A===void 0&&(N==="instanceMatrix"&&x.instanceMatrix&&(A=x.instanceMatrix),N==="instanceColor"&&x.instanceColor&&(A=x.instanceColor));let at={};at.attribute=A,A&&A.data&&(at.data=A.data),B[N]=at,Z++}s.attributes=B,s.attributesNum=Z,s.index=R}function g(){let x=s.newAttributes;for(let F=0,I=x.length;F<I;F++)x[F]=0}function p(x){m(x,0)}function m(x,F){let I=s.newAttributes,R=s.enabledAttributes,B=s.attributeDivisors;I[x]=1,R[x]===0&&(r.enableVertexAttribArray(x),R[x]=1),B[x]!==F&&(r.vertexAttribDivisor(x,F),B[x]=F)}function S(){let x=s.newAttributes,F=s.enabledAttributes;for(let I=0,R=F.length;I<R;I++)F[I]!==x[I]&&(r.disableVertexAttribArray(I),F[I]=0)}function v(x,F,I,R,B,G,Z){Z===!0?r.vertexAttribIPointer(x,F,I,B,G):r.vertexAttribPointer(x,F,I,R,B,G)}function M(x,F,I,R){g();let B=R.attributes,G=I.getAttributes(),Z=F.defaultAttributeValues;for(let J in G){let N=G[J];if(N.location>=0){let Q=B[J];if(Q===void 0&&(J==="instanceMatrix"&&x.instanceMatrix&&(Q=x.instanceMatrix),J==="instanceColor"&&x.instanceColor&&(Q=x.instanceColor)),Q!==void 0){let A=Q.normalized,at=Q.itemSize,bt=t.get(Q);if(bt===void 0)continue;let Zt=bt.buffer,X=bt.type,tt=bt.bytesPerElement,ft=X===r.INT||X===r.UNSIGNED_INT||Q.gpuType===sm;if(Q.isInterleavedBufferAttribute){let nt=Q.data,It=nt.stride,Rt=Q.offset;if(nt.isInstancedInterleavedBuffer){for(let O=0;O<N.locationSize;O++)m(N.location+O,nt.meshPerAttribute);x.isInstancedMesh!==!0&&R._maxInstanceCount===void 0&&(R._maxInstanceCount=nt.meshPerAttribute*nt.count)}else for(let O=0;O<N.locationSize;O++)p(N.location+O);r.bindBuffer(r.ARRAY_BUFFER,Zt);for(let O=0;O<N.locationSize;O++)v(N.location+O,at/N.locationSize,X,A,It*tt,(Rt+at/N.locationSize*O)*tt,ft)}else{if(Q.isInstancedBufferAttribute){for(let nt=0;nt<N.locationSize;nt++)m(N.location+nt,Q.meshPerAttribute);x.isInstancedMesh!==!0&&R._maxInstanceCount===void 0&&(R._maxInstanceCount=Q.meshPerAttribute*Q.count)}else for(let nt=0;nt<N.locationSize;nt++)p(N.location+nt);r.bindBuffer(r.ARRAY_BUFFER,Zt);for(let nt=0;nt<N.locationSize;nt++)v(N.location+nt,at/N.locationSize,X,A,at*tt,at/N.locationSize*nt*tt,ft)}}else if(Z!==void 0){let A=Z[J];if(A!==void 0)switch(A.length){case 2:r.vertexAttrib2fv(N.location,A);break;case 3:r.vertexAttrib3fv(N.location,A);break;case 4:r.vertexAttrib4fv(N.location,A);break;default:r.vertexAttrib1fv(N.location,A)}}}}S()}function D(){P();for(let x in n){let F=n[x];for(let I in F){let R=F[I];for(let B in R)u(R[B].object),delete R[B];delete F[I]}delete n[x]}}function T(x){if(n[x.id]===void 0)return;let F=n[x.id];for(let I in F){let R=F[I];for(let B in R)u(R[B].object),delete R[B];delete F[I]}delete n[x.id]}function w(x){for(let F in n){let I=n[F];if(I[x.id]===void 0)continue;let R=I[x.id];for(let B in R)u(R[B].object),delete R[B];delete I[x.id]}}function P(){y(),a=!0,s!==i&&(s=i,c(s.object))}function y(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:P,resetDefaultState:y,dispose:D,releaseStatesOfGeometry:T,releaseStatesOfProgram:w,initAttributes:g,enableAttribute:p,disableUnusedAttributes:S}}function Ly(r,t,e){let n;function i(c){n=c}function s(c,u){r.drawArrays(n,c,u),e.update(u,n,1)}function a(c,u,f){f!==0&&(r.drawArraysInstanced(n,c,u,f),e.update(u,n,f))}function o(c,u,f){if(f===0)return;let h=t.get("WEBGL_multi_draw");if(h===null)for(let d=0;d<f;d++)this.render(c[d],u[d]);else{h.multiDrawArraysWEBGL(n,c,0,u,0,f);let d=0;for(let _=0;_<f;_++)d+=u[_];e.update(d,n,1)}}function l(c,u,f,h){if(f===0)return;let d=t.get("WEBGL_multi_draw");if(d===null)for(let _=0;_<c.length;_++)a(c[_],u[_],h[_]);else{d.multiDrawArraysInstancedWEBGL(n,c,0,u,0,h,0,f);let _=0;for(let g=0;g<f;g++)_+=u[g];for(let g=0;g<h.length;g++)e.update(_,n,h[g])}}this.setMode=i,this.render=s,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function Fy(r,t,e,n){let i;function s(){if(i!==void 0)return i;if(t.has("EXT_texture_filter_anisotropic")===!0){let T=t.get("EXT_texture_filter_anisotropic");i=r.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(T){return!(T!==pi&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(T){let w=T===Al&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(T!==lr&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==nr&&!w)}function l(T){if(T==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp",u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);let f=e.logarithmicDepthBuffer===!0,h=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),m=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),S=r.getParameter(r.MAX_VARYING_VECTORS),v=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),M=d>0,D=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:f,maxTextures:h,maxVertexTextures:d,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:m,maxVaryings:S,maxFragmentUniforms:v,vertexTextures:M,maxSamples:D}}function Uy(r){let t=this,e=null,n=0,i=!1,s=!1,a=new Ii,o=new qt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){let d=f.length!==0||h||n!==0||i;return i=h,n=f.length,d},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,h){e=u(f,h,0)},this.setState=function(f,h,d){let _=f.clippingPlanes,g=f.clipIntersection,p=f.clipShadows,m=r.get(f);if(!i||_===null||_.length===0||s&&!p)s?u(null):c();else{let S=s?0:n,v=S*4,M=m.clippingState||null;l.value=M,M=u(_,h,v,d);for(let D=0;D!==v;++D)M[D]=e[D];m.clippingState=M,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(f,h,d,_){let g=f!==null?f.length:0,p=null;if(g!==0){if(p=l.value,_!==!0||p===null){let m=d+g*4,S=h.matrixWorldInverse;o.getNormalMatrix(S),(p===null||p.length<m)&&(p=new Float32Array(m));for(let v=0,M=d;v!==g;++v,M+=4)a.copy(f[v]).applyMatrix4(S,o),a.normal.toArray(p,M),p[M+3]=a.constant}l.value=p,l.needsUpdate=!0}return t.numPlanes=g,t.numIntersection=0,p}}function Ny(r){let t=new WeakMap;function e(a,o){return o===Iu?a.mapping=Bs:o===Lu&&(a.mapping=zs),a}function n(a){if(a&&a.isTexture){let o=a.mapping;if(o===Iu||o===Lu)if(t.has(a)){let l=t.get(a).texture;return e(l,a.mapping)}else{let l=a.image;if(l&&l.height>0){let c=new Vu(l.height);return c.fromEquirectangularTexture(r,a),t.set(a,c),a.addEventListener("dispose",i),e(c.texture,a.mapping)}else return null}}return a}function i(a){let o=a.target;o.removeEventListener("dispose",i);let l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}var _l=class extends pl{constructor(t=-1,e=1,n=1,i=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,s,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-t,a=n+t,o=i+e,l=i-e;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,a=s+c*this.view.width,o-=u*this.view.offsetY,l=o-u*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},Fs=4,Rp=[.125,.215,.35,.446,.526,.582],Gr=20,bu=new _l,Pp=new re,Eu=null,wu=0,Tu=0,Au=!1,Vr=(1+Math.sqrt(5))/2,Is=1/Vr,Ip=[new q(-Vr,Is,0),new q(Vr,Is,0),new q(-Is,0,Vr),new q(Is,0,Vr),new q(0,Vr,-Is),new q(0,Vr,Is),new q(-1,1,-1),new q(1,1,-1),new q(-1,1,1),new q(1,1,1)],xl=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Eu=this._renderer.getRenderTarget(),wu=this._renderer.getActiveCubeFace(),Tu=this._renderer.getActiveMipmapLevel(),Au=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,i,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Up(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Fp(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Eu,wu,Tu),this._renderer.xr.enabled=Au,t.scissorTest=!1,Jo(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===Bs||t.mapping===zs?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Eu=this._renderer.getRenderTarget(),wu=this._renderer.getActiveCubeFace(),Tu=this._renderer.getActiveMipmapLevel(),Au=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:ni,minFilter:ni,generateMipmaps:!1,type:Al,format:pi,colorSpace:hr,depthBuffer:!1},i=Lp(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Lp(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Oy(s)),this._blurMaterial=By(s,t,e)}return i}_compileMaterial(t){let e=new ii(this._lodPlanes[0],t);this._renderer.compile(e,bu)}_sceneToCubeUV(t,e,n,i){let o=new _n(90,1,e,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,f=u.autoClear,h=u.toneMapping;u.getClearColor(Pp),u.toneMapping=ar,u.autoClear=!1;let d=new hl({name:"PMREM.Background",side:Tn,depthWrite:!1,depthTest:!1}),_=new ii(new Ia,d),g=!1,p=t.background;p?p.isColor&&(d.color.copy(p),t.background=null,g=!0):(d.color.copy(Pp),g=!0);for(let m=0;m<6;m++){let S=m%3;S===0?(o.up.set(0,l[m],0),o.lookAt(c[m],0,0)):S===1?(o.up.set(0,0,l[m]),o.lookAt(0,c[m],0)):(o.up.set(0,l[m],0),o.lookAt(0,0,c[m]));let v=this._cubeSize;Jo(i,S*v,m>2?v:0,v,v),u.setRenderTarget(i),g&&u.render(_,o),u.render(t,o)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=h,u.autoClear=f,t.background=p}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===Bs||t.mapping===zs;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Up()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Fp());let s=i?this._cubemapMaterial:this._equirectMaterial,a=new ii(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=t;let l=this._cubeSize;Jo(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(a,bu)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let i=this._lodPlanes.length;for(let s=1;s<i;s++){let a=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),o=Ip[(i-s-1)%Ip.length];this._blur(t,s-1,s,a,o)}e.autoClear=n}_blur(t,e,n,i,s){let a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,i,"latitudinal",s),this._halfBlur(a,t,n,n,i,"longitudinal",s)}_halfBlur(t,e,n,i,s,a,o){let l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let u=3,f=new ii(this._lodPlanes[i],c),h=c.uniforms,d=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*d):2*Math.PI/(2*Gr-1),g=s/_,p=isFinite(s)?1+Math.floor(u*g):Gr;p>Gr&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${Gr}`);let m=[],S=0;for(let w=0;w<Gr;++w){let P=w/g,y=Math.exp(-P*P/2);m.push(y),w===0?S+=y:w<p&&(S+=2*y)}for(let w=0;w<m.length;w++)m[w]=m[w]/S;h.envMap.value=t.texture,h.samples.value=p,h.weights.value=m,h.latitudinal.value=a==="latitudinal",o&&(h.poleAxis.value=o);let{_lodMax:v}=this;h.dTheta.value=_,h.mipInt.value=v-n;let M=this._sizeLods[i],D=3*M*(i>v-Fs?i-v+Fs:0),T=4*(this._cubeSize-M);Jo(e,D,T,3*M,2*M),l.setRenderTarget(e),l.render(f,bu)}};function Oy(r){let t=[],e=[],n=[],i=r,s=r-Fs+1+Rp.length;for(let a=0;a<s;a++){let o=Math.pow(2,i);e.push(o);let l=1/o;a>r-Fs?l=Rp[a-r+Fs-1]:a===0&&(l=0),n.push(l);let c=1/(o-2),u=-c,f=1+c,h=[u,u,f,u,f,f,u,u,f,f,u,f],d=6,_=6,g=3,p=2,m=1,S=new Float32Array(g*_*d),v=new Float32Array(p*_*d),M=new Float32Array(m*_*d);for(let T=0;T<d;T++){let w=T%3*2/3-1,P=T>2?0:-1,y=[w,P,0,w+2/3,P,0,w+2/3,P+1,0,w,P,0,w+2/3,P+1,0,w,P+1,0];S.set(y,g*_*T),v.set(h,p*_*T);let x=[T,T,T,T,T,T];M.set(x,m*_*T)}let D=new mi;D.setAttribute("position",new Xn(S,g)),D.setAttribute("uv",new Xn(v,p)),D.setAttribute("faceIndex",new Xn(M,m)),t.push(D),i>Fs&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function Lp(r,t,e){let n=new Ui(r,t,e);return n.texture.mapping=Tl,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Jo(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function By(r,t,e){let n=new Float32Array(Gr),i=new q(0,1,0);return new Zn({name:"SphericalGaussianBlur",defines:{n:Gr,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:gh(),fragmentShader:`
3570
+ }`,Yt={alphahash_fragment:_x,alphahash_pars_fragment:xx,alphamap_fragment:vx,alphamap_pars_fragment:yx,alphatest_fragment:Mx,alphatest_pars_fragment:Sx,aomap_fragment:bx,aomap_pars_fragment:wx,batching_pars_vertex:Ex,batching_vertex:Tx,begin_vertex:Ax,beginnormal_vertex:Dx,bsdfs:Cx,iridescence_fragment:Rx,bumpmap_pars_fragment:Px,clipping_planes_fragment:Ix,clipping_planes_pars_fragment:Lx,clipping_planes_pars_vertex:Fx,clipping_planes_vertex:Nx,color_fragment:Ux,color_pars_fragment:Ox,color_pars_vertex:Bx,color_vertex:zx,common:kx,cube_uv_reflection_fragment:Vx,defaultnormal_vertex:Hx,displacementmap_pars_vertex:Gx,displacementmap_vertex:Wx,emissivemap_fragment:Xx,emissivemap_pars_fragment:qx,colorspace_fragment:Yx,colorspace_pars_fragment:Zx,envmap_fragment:Jx,envmap_common_pars_fragment:$x,envmap_pars_fragment:Kx,envmap_pars_vertex:Qx,envmap_physical_pars_fragment:cv,envmap_vertex:jx,fog_vertex:tv,fog_pars_vertex:ev,fog_fragment:nv,fog_pars_fragment:iv,gradientmap_pars_fragment:rv,lightmap_pars_fragment:sv,lights_lambert_fragment:ov,lights_lambert_pars_fragment:av,lights_pars_begin:lv,lights_toon_fragment:uv,lights_toon_pars_fragment:hv,lights_phong_fragment:fv,lights_phong_pars_fragment:dv,lights_physical_fragment:pv,lights_physical_pars_fragment:mv,lights_fragment_begin:gv,lights_fragment_maps:_v,lights_fragment_end:xv,logdepthbuf_fragment:vv,logdepthbuf_pars_fragment:yv,logdepthbuf_pars_vertex:Mv,logdepthbuf_vertex:Sv,map_fragment:bv,map_pars_fragment:wv,map_particle_fragment:Ev,map_particle_pars_fragment:Tv,metalnessmap_fragment:Av,metalnessmap_pars_fragment:Dv,morphinstance_vertex:Cv,morphcolor_vertex:Rv,morphnormal_vertex:Pv,morphtarget_pars_vertex:Iv,morphtarget_vertex:Lv,normal_fragment_begin:Fv,normal_fragment_maps:Nv,normal_pars_fragment:Uv,normal_pars_vertex:Ov,normal_vertex:Bv,normalmap_pars_fragment:zv,clearcoat_normal_fragment_begin:kv,clearcoat_normal_fragment_maps:Vv,clearcoat_pars_fragment:Hv,iridescence_pars_fragment:Gv,opaque_fragment:Wv,packing:Xv,premultiplied_alpha_fragment:qv,project_vertex:Yv,dithering_fragment:Zv,dithering_pars_fragment:Jv,roughnessmap_fragment:$v,roughnessmap_pars_fragment:Kv,shadowmap_pars_fragment:Qv,shadowmap_pars_vertex:jv,shadowmap_vertex:ty,shadowmask_pars_fragment:ey,skinbase_vertex:ny,skinning_pars_vertex:iy,skinning_vertex:ry,skinnormal_vertex:sy,specularmap_fragment:oy,specularmap_pars_fragment:ay,tonemapping_fragment:ly,tonemapping_pars_fragment:cy,transmission_fragment:uy,transmission_pars_fragment:hy,uv_pars_fragment:fy,uv_pars_vertex:dy,uv_vertex:py,worldpos_vertex:my,background_vert:gy,background_frag:_y,backgroundCube_vert:xy,backgroundCube_frag:vy,cube_vert:yy,cube_frag:My,depth_vert:Sy,depth_frag:by,distanceRGBA_vert:wy,distanceRGBA_frag:Ey,equirect_vert:Ty,equirect_frag:Ay,linedashed_vert:Dy,linedashed_frag:Cy,meshbasic_vert:Ry,meshbasic_frag:Py,meshlambert_vert:Iy,meshlambert_frag:Ly,meshmatcap_vert:Fy,meshmatcap_frag:Ny,meshnormal_vert:Uy,meshnormal_frag:Oy,meshphong_vert:By,meshphong_frag:zy,meshphysical_vert:ky,meshphysical_frag:Vy,meshtoon_vert:Hy,meshtoon_frag:Gy,points_vert:Wy,points_frag:Xy,shadow_vert:qy,shadow_frag:Yy,sprite_vert:Zy,sprite_frag:Jy},dt={common:{diffuse:{value:new re(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Zt},alphaMap:{value:null},alphaMapTransform:{value:new Zt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Zt}},envmap:{envMap:{value:null},envMapRotation:{value:new Zt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Zt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Zt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Zt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Zt},normalScale:{value:new oe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Zt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Zt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Zt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Zt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new re(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new re(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Zt},alphaTest:{value:0},uvTransform:{value:new Zt}},sprite:{diffuse:{value:new re(16777215)},opacity:{value:1},center:{value:new oe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Zt},alphaMap:{value:null},alphaMapTransform:{value:new Zt},alphaTest:{value:0}}},di={basic:{uniforms:_n([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.fog]),vertexShader:Yt.meshbasic_vert,fragmentShader:Yt.meshbasic_frag},lambert:{uniforms:_n([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new re(0)}}]),vertexShader:Yt.meshlambert_vert,fragmentShader:Yt.meshlambert_frag},phong:{uniforms:_n([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new re(0)},specular:{value:new re(1118481)},shininess:{value:30}}]),vertexShader:Yt.meshphong_vert,fragmentShader:Yt.meshphong_frag},standard:{uniforms:_n([dt.common,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.roughnessmap,dt.metalnessmap,dt.fog,dt.lights,{emissive:{value:new re(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Yt.meshphysical_vert,fragmentShader:Yt.meshphysical_frag},toon:{uniforms:_n([dt.common,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.gradientmap,dt.fog,dt.lights,{emissive:{value:new re(0)}}]),vertexShader:Yt.meshtoon_vert,fragmentShader:Yt.meshtoon_frag},matcap:{uniforms:_n([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,{matcap:{value:null}}]),vertexShader:Yt.meshmatcap_vert,fragmentShader:Yt.meshmatcap_frag},points:{uniforms:_n([dt.points,dt.fog]),vertexShader:Yt.points_vert,fragmentShader:Yt.points_frag},dashed:{uniforms:_n([dt.common,dt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Yt.linedashed_vert,fragmentShader:Yt.linedashed_frag},depth:{uniforms:_n([dt.common,dt.displacementmap]),vertexShader:Yt.depth_vert,fragmentShader:Yt.depth_frag},normal:{uniforms:_n([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,{opacity:{value:1}}]),vertexShader:Yt.meshnormal_vert,fragmentShader:Yt.meshnormal_frag},sprite:{uniforms:_n([dt.sprite,dt.fog]),vertexShader:Yt.sprite_vert,fragmentShader:Yt.sprite_frag},background:{uniforms:{uvTransform:{value:new Zt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Yt.background_vert,fragmentShader:Yt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Zt}},vertexShader:Yt.backgroundCube_vert,fragmentShader:Yt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Yt.cube_vert,fragmentShader:Yt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Yt.equirect_vert,fragmentShader:Yt.equirect_frag},distanceRGBA:{uniforms:_n([dt.common,dt.displacementmap,{referencePosition:{value:new Z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Yt.distanceRGBA_vert,fragmentShader:Yt.distanceRGBA_frag},shadow:{uniforms:_n([dt.lights,dt.fog,{color:{value:new re(0)},opacity:{value:1}}]),vertexShader:Yt.shadow_vert,fragmentShader:Yt.shadow_frag}};di.physical={uniforms:_n([di.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Zt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Zt},clearcoatNormalScale:{value:new oe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Zt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Zt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Zt},sheen:{value:0},sheenColor:{value:new re(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Zt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Zt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Zt},transmissionSamplerSize:{value:new oe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Zt},attenuationDistance:{value:0},attenuationColor:{value:new re(0)},specularColor:{value:new re(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Zt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Zt},anisotropyVector:{value:new oe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Zt}}]),vertexShader:Yt.meshphysical_vert,fragmentShader:Yt.meshphysical_frag};var Qa={r:0,b:0,g:0},kr=new Oi,$y=new Pe;function Ky(r,t,e,n,i,s,o){let a=new re(0),l=s===!0?0:1,c,u,h=null,f=0,d=null;function _(S){let v=S.isScene===!0?S.background:null;return v&&v.isTexture&&(v=(S.backgroundBlurriness>0?e:t).get(v)),v}function g(S){let v=!1,M=_(S);M===null?m(a,l):M&&M.isColor&&(m(M,1),v=!0);let D=r.xr.getEnvironmentBlendMode();D==="additive"?n.buffers.color.setClear(0,0,0,1,o):D==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil)}function p(S,v){let M=_(v);M&&(M.isCubeTexture||M.mapping===Rl)?(u===void 0&&(u=new ii(new Oo(1,1,1),new Zn({name:"BackgroundCubeMaterial",uniforms:Ws(di.backgroundCube.uniforms),vertexShader:di.backgroundCube.vertexShader,fragmentShader:di.backgroundCube.fragmentShader,side:Tn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(D,T,E){this.matrixWorld.copyPosition(E.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),kr.copy(v.backgroundRotation),kr.x*=-1,kr.y*=-1,kr.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(kr.y*=-1,kr.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4($y.makeRotationFromEuler(kr)),u.material.toneMapped=fe.getTransfer(M.colorSpace)!==xe,(h!==M||f!==M.version||d!==r.toneMapping)&&(u.material.needsUpdate=!0,h=M,f=M.version,d=r.toneMapping),u.layers.enableAll(),S.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new ii(new yl(2,2),new Zn({name:"BackgroundMaterial",uniforms:Ws(di.background.uniforms),vertexShader:di.background.vertexShader,fragmentShader:di.background.fragmentShader,side:lr,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=fe.getTransfer(M.colorSpace)!==xe,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(h!==M||f!==M.version||d!==r.toneMapping)&&(c.material.needsUpdate=!0,h=M,f=M.version,d=r.toneMapping),c.layers.enableAll(),S.unshift(c,c.geometry,c.material,0,0,null))}function m(S,v){S.getRGB(Qa,Em(r)),n.buffers.color.setClear(Qa.r,Qa.g,Qa.b,v,o)}return{getClearColor:function(){return a},setClearColor:function(S,v=1){a.set(S),l=v,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(S){l=S,m(a,l)},render:g,addToRenderList:p}}function Qy(r,t){let e=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=f(null),s=i,o=!1;function a(x,L,F,P,B){let X=!1,G=h(P,F,L);s!==G&&(s=G,c(s.object)),X=d(x,P,F,B),X&&_(x,P,F,B),B!==null&&t.update(B,r.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,M(x,L,F,P),B!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(B).buffer))}function l(){return r.createVertexArray()}function c(x){return r.bindVertexArray(x)}function u(x){return r.deleteVertexArray(x)}function h(x,L,F){let P=F.wireframe===!0,B=n[x.id];B===void 0&&(B={},n[x.id]=B);let X=B[L.id];X===void 0&&(X={},B[L.id]=X);let G=X[P];return G===void 0&&(G=f(l()),X[P]=G),G}function f(x){let L=[],F=[],P=[];for(let B=0;B<e;B++)L[B]=0,F[B]=0,P[B]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:F,attributeDivisors:P,object:x,attributes:{},index:null}}function d(x,L,F,P){let B=s.attributes,X=L.attributes,G=0,J=F.getAttributes();for(let U in J)if(J[U].location>=0){let A=B[U],it=X[U];if(it===void 0&&(U==="instanceMatrix"&&x.instanceMatrix&&(it=x.instanceMatrix),U==="instanceColor"&&x.instanceColor&&(it=x.instanceColor)),A===void 0||A.attribute!==it||it&&A.data!==it.data)return!0;G++}return s.attributesNum!==G||s.index!==P}function _(x,L,F,P){let B={},X=L.attributes,G=0,J=F.getAttributes();for(let U in J)if(J[U].location>=0){let A=X[U];A===void 0&&(U==="instanceMatrix"&&x.instanceMatrix&&(A=x.instanceMatrix),U==="instanceColor"&&x.instanceColor&&(A=x.instanceColor));let it={};it.attribute=A,A&&A.data&&(it.data=A.data),B[U]=it,G++}s.attributes=B,s.attributesNum=G,s.index=P}function g(){let x=s.newAttributes;for(let L=0,F=x.length;L<F;L++)x[L]=0}function p(x){m(x,0)}function m(x,L){let F=s.newAttributes,P=s.enabledAttributes,B=s.attributeDivisors;F[x]=1,P[x]===0&&(r.enableVertexAttribArray(x),P[x]=1),B[x]!==L&&(r.vertexAttribDivisor(x,L),B[x]=L)}function S(){let x=s.newAttributes,L=s.enabledAttributes;for(let F=0,P=L.length;F<P;F++)L[F]!==x[F]&&(r.disableVertexAttribArray(F),L[F]=0)}function v(x,L,F,P,B,X,G){G===!0?r.vertexAttribIPointer(x,L,F,B,X):r.vertexAttribPointer(x,L,F,P,B,X)}function M(x,L,F,P){g();let B=P.attributes,X=F.getAttributes(),G=L.defaultAttributeValues;for(let J in X){let U=X[J];if(U.location>=0){let I=B[J];if(I===void 0&&(J==="instanceMatrix"&&x.instanceMatrix&&(I=x.instanceMatrix),J==="instanceColor"&&x.instanceColor&&(I=x.instanceColor)),I!==void 0){let A=I.normalized,it=I.itemSize,vt=t.get(I);if(vt===void 0)continue;let Wt=vt.buffer,q=vt.type,Q=vt.bytesPerElement,ct=q===r.INT||q===r.UNSIGNED_INT||I.gpuType===gm;if(I.isInterleavedBufferAttribute){let tt=I.data,It=tt.stride,Rt=I.offset;if(tt.isInstancedInterleavedBuffer){for(let z=0;z<U.locationSize;z++)m(U.location+z,tt.meshPerAttribute);x.isInstancedMesh!==!0&&P._maxInstanceCount===void 0&&(P._maxInstanceCount=tt.meshPerAttribute*tt.count)}else for(let z=0;z<U.locationSize;z++)p(U.location+z);r.bindBuffer(r.ARRAY_BUFFER,Wt);for(let z=0;z<U.locationSize;z++)v(U.location+z,it/U.locationSize,q,A,It*Q,(Rt+it/U.locationSize*z)*Q,ct)}else{if(I.isInstancedBufferAttribute){for(let tt=0;tt<U.locationSize;tt++)m(U.location+tt,I.meshPerAttribute);x.isInstancedMesh!==!0&&P._maxInstanceCount===void 0&&(P._maxInstanceCount=I.meshPerAttribute*I.count)}else for(let tt=0;tt<U.locationSize;tt++)p(U.location+tt);r.bindBuffer(r.ARRAY_BUFFER,Wt);for(let tt=0;tt<U.locationSize;tt++)v(U.location+tt,it/U.locationSize,q,A,it*Q,it/U.locationSize*tt*Q,ct)}}else if(G!==void 0){let A=G[J];if(A!==void 0)switch(A.length){case 2:r.vertexAttrib2fv(U.location,A);break;case 3:r.vertexAttrib3fv(U.location,A);break;case 4:r.vertexAttrib4fv(U.location,A);break;default:r.vertexAttrib1fv(U.location,A)}}}}S()}function D(){R();for(let x in n){let L=n[x];for(let F in L){let P=L[F];for(let B in P)u(P[B].object),delete P[B];delete L[F]}delete n[x]}}function T(x){if(n[x.id]===void 0)return;let L=n[x.id];for(let F in L){let P=L[F];for(let B in P)u(P[B].object),delete P[B];delete L[F]}delete n[x.id]}function E(x){for(let L in n){let F=n[L];if(F[x.id]===void 0)continue;let P=F[x.id];for(let B in P)u(P[B].object),delete P[B];delete F[x.id]}}function R(){y(),o=!0,s!==i&&(s=i,c(s.object))}function y(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:a,reset:R,resetDefaultState:y,dispose:D,releaseStatesOfGeometry:T,releaseStatesOfProgram:E,initAttributes:g,enableAttribute:p,disableUnusedAttributes:S}}function jy(r,t,e){let n;function i(c){n=c}function s(c,u){r.drawArrays(n,c,u),e.update(u,n,1)}function o(c,u,h){h!==0&&(r.drawArraysInstanced(n,c,u,h),e.update(u,n,h))}function a(c,u,h){if(h===0)return;let f=t.get("WEBGL_multi_draw");if(f===null)for(let d=0;d<h;d++)this.render(c[d],u[d]);else{f.multiDrawArraysWEBGL(n,c,0,u,0,h);let d=0;for(let _=0;_<h;_++)d+=u[_];e.update(d,n,1)}}function l(c,u,h,f){if(h===0)return;let d=t.get("WEBGL_multi_draw");if(d===null)for(let _=0;_<c.length;_++)o(c[_],u[_],f[_]);else{d.multiDrawArraysInstancedWEBGL(n,c,0,u,0,f,0,h);let _=0;for(let g=0;g<h;g++)_+=u[g];for(let g=0;g<f.length;g++)e.update(_,n,f[g])}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function tM(r,t,e,n){let i;function s(){if(i!==void 0)return i;if(t.has("EXT_texture_filter_anisotropic")===!0){let T=t.get("EXT_texture_filter_anisotropic");i=r.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(T){return!(T!==pi&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(T){let E=T===Pl&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(T!==cr&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==ir&&!E)}function l(T){if(T==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp",u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);let h=e.logarithmicDepthBuffer===!0,f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),m=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),S=r.getParameter(r.MAX_VARYING_VECTORS),v=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),M=d>0,D=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,maxTextures:f,maxVertexTextures:d,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:m,maxVaryings:S,maxFragmentUniforms:v,vertexTextures:M,maxSamples:D}}function eM(r){let t=this,e=null,n=0,i=!1,s=!1,o=new Li,a=new Zt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){let d=h.length!==0||f||n!==0||i;return i=f,n=h.length,d},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,f){e=u(h,f,0)},this.setState=function(h,f,d){let _=h.clippingPlanes,g=h.clipIntersection,p=h.clipShadows,m=r.get(h);if(!i||_===null||_.length===0||s&&!p)s?u(null):c();else{let S=s?0:n,v=S*4,M=m.clippingState||null;l.value=M,M=u(_,f,v,d);for(let D=0;D!==v;++D)M[D]=e[D];m.clippingState=M,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(h,f,d,_){let g=h!==null?h.length:0,p=null;if(g!==0){if(p=l.value,_!==!0||p===null){let m=d+g*4,S=f.matrixWorldInverse;a.getNormalMatrix(S),(p===null||p.length<m)&&(p=new Float32Array(m));for(let v=0,M=d;v!==g;++v,M+=4)o.copy(h[v]).applyMatrix4(S,a),o.normal.toArray(p,M),p[M+3]=o.constant}l.value=p,l.needsUpdate=!0}return t.numPlanes=g,t.numIntersection=0,p}}function nM(r){let t=new WeakMap;function e(o,a){return a===Bu?o.mapping=ks:a===zu&&(o.mapping=Vs),o}function n(o){if(o&&o.isTexture){let a=o.mapping;if(a===Bu||a===zu)if(t.has(o)){let l=t.get(o).texture;return e(l,o.mapping)}else{let l=o.image;if(l&&l.height>0){let c=new Yu(l.height);return c.fromEquirectangularTexture(r,o),t.set(o,c),o.addEventListener("dispose",i),e(c.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}var Ml=class extends xl{constructor(t=-1,e=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,s,o){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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-t,o=n+t,a=i+e,l=i-e;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},Us=4,Vp=[.125,.215,.35,.446,.526,.582],Wr=20,Cu=new Ml,Hp=new re,Ru=null,Pu=0,Iu=0,Lu=!1,Hr=(1+Math.sqrt(5))/2,Fs=1/Hr,Gp=[new Z(-Hr,Fs,0),new Z(Hr,Fs,0),new Z(-Fs,0,Hr),new Z(Fs,0,Hr),new Z(0,Hr,-Fs),new Z(0,Hr,Fs),new Z(-1,1,-1),new Z(1,1,-1),new Z(-1,1,1),new Z(1,1,1)],Sl=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Ru=this._renderer.getRenderTarget(),Pu=this._renderer.getActiveCubeFace(),Iu=this._renderer.getActiveMipmapLevel(),Lu=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,i,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=qp(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Xp(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Ru,Pu,Iu),this._renderer.xr.enabled=Lu,t.scissorTest=!1,ja(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===ks||t.mapping===Vs?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Ru=this._renderer.getRenderTarget(),Pu=this._renderer.getActiveCubeFace(),Iu=this._renderer.getActiveMipmapLevel(),Lu=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:ni,minFilter:ni,generateMipmaps:!1,type:Pl,format:pi,colorSpace:fr,depthBuffer:!1},i=Wp(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Wp(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=iM(s)),this._blurMaterial=rM(s,t,e)}return i}_compileMaterial(t){let e=new ii(this._lodPlanes[0],t);this._renderer.compile(e,Cu)}_sceneToCubeUV(t,e,n,i){let a=new xn(90,1,e,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,h=u.autoClear,f=u.toneMapping;u.getClearColor(Hp),u.toneMapping=ar,u.autoClear=!1;let d=new ml({name:"PMREM.Background",side:Tn,depthWrite:!1,depthTest:!1}),_=new ii(new Oo,d),g=!1,p=t.background;p?p.isColor&&(d.color.copy(p),t.background=null,g=!0):(d.color.copy(Hp),g=!0);for(let m=0;m<6;m++){let S=m%3;S===0?(a.up.set(0,l[m],0),a.lookAt(c[m],0,0)):S===1?(a.up.set(0,0,l[m]),a.lookAt(0,c[m],0)):(a.up.set(0,l[m],0),a.lookAt(0,0,c[m]));let v=this._cubeSize;ja(i,S*v,m>2?v:0,v,v),u.setRenderTarget(i),g&&u.render(_,a),u.render(t,a)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=f,u.autoClear=h,t.background=p}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===ks||t.mapping===Vs;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=qp()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Xp());let s=i?this._cubemapMaterial:this._equirectMaterial,o=new ii(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=t;let l=this._cubeSize;ja(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(o,Cu)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let i=this._lodPlanes.length;for(let s=1;s<i;s++){let o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),a=Gp[(i-s-1)%Gp.length];this._blur(t,s-1,s,o,a)}e.autoClear=n}_blur(t,e,n,i,s){let o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,i,"latitudinal",s),this._halfBlur(o,t,n,n,i,"longitudinal",s)}_halfBlur(t,e,n,i,s,o,a){let l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let u=3,h=new ii(this._lodPlanes[i],c),f=c.uniforms,d=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*d):2*Math.PI/(2*Wr-1),g=s/_,p=isFinite(s)?1+Math.floor(u*g):Wr;p>Wr&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${Wr}`);let m=[],S=0;for(let E=0;E<Wr;++E){let R=E/g,y=Math.exp(-R*R/2);m.push(y),E===0?S+=y:E<p&&(S+=2*y)}for(let E=0;E<m.length;E++)m[E]=m[E]/S;f.envMap.value=t.texture,f.samples.value=p,f.weights.value=m,f.latitudinal.value=o==="latitudinal",a&&(f.poleAxis.value=a);let{_lodMax:v}=this;f.dTheta.value=_,f.mipInt.value=v-n;let M=this._sizeLods[i],D=3*M*(i>v-Us?i-v+Us:0),T=4*(this._cubeSize-M);ja(e,D,T,3*M,2*M),l.setRenderTarget(e),l.render(h,Cu)}};function iM(r){let t=[],e=[],n=[],i=r,s=r-Us+1+Vp.length;for(let o=0;o<s;o++){let a=Math.pow(2,i);e.push(a);let l=1/a;o>r-Us?l=Vp[o-r+Us-1]:o===0&&(l=0),n.push(l);let c=1/(a-2),u=-c,h=1+c,f=[u,u,h,u,h,h,u,u,h,h,u,h],d=6,_=6,g=3,p=2,m=1,S=new Float32Array(g*_*d),v=new Float32Array(p*_*d),M=new Float32Array(m*_*d);for(let T=0;T<d;T++){let E=T%3*2/3-1,R=T>2?0:-1,y=[E,R,0,E+2/3,R,0,E+2/3,R+1,0,E,R,0,E+2/3,R+1,0,E,R+1,0];S.set(y,g*_*T),v.set(f,p*_*T);let x=[T,T,T,T,T,T];M.set(x,m*_*T)}let D=new mi;D.setAttribute("position",new Xn(S,g)),D.setAttribute("uv",new Xn(v,p)),D.setAttribute("faceIndex",new Xn(M,m)),t.push(D),i>Us&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function Wp(r,t,e){let n=new Ui(r,t,e);return n.texture.mapping=Rl,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function ja(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function rM(r,t,e){let n=new Float32Array(Wr),i=new Z(0,1,0);return new Zn({name:"SphericalGaussianBlur",defines:{n:Wr,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Sh(),fragmentShader:`
3571
3571
 
3572
3572
  precision mediump float;
3573
3573
  precision mediump int;
@@ -3627,7 +3627,7 @@ void main() {
3627
3627
  }
3628
3628
 
3629
3629
  }
3630
- `,blending:rr,depthTest:!1,depthWrite:!1})}function Fp(){return new Zn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:gh(),fragmentShader:`
3630
+ `,blending:sr,depthTest:!1,depthWrite:!1})}function Xp(){return new Zn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Sh(),fragmentShader:`
3631
3631
 
3632
3632
  precision mediump float;
3633
3633
  precision mediump int;
@@ -3646,7 +3646,7 @@ void main() {
3646
3646
  gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3647
3647
 
3648
3648
  }
3649
- `,blending:rr,depthTest:!1,depthWrite:!1})}function Up(){return new Zn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:gh(),fragmentShader:`
3649
+ `,blending:sr,depthTest:!1,depthWrite:!1})}function qp(){return new Zn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Sh(),fragmentShader:`
3650
3650
 
3651
3651
  precision mediump float;
3652
3652
  precision mediump int;
@@ -3662,7 +3662,7 @@ void main() {
3662
3662
  gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3663
3663
 
3664
3664
  }
3665
- `,blending:rr,depthTest:!1,depthWrite:!1})}function gh(){return`
3665
+ `,blending:sr,depthTest:!1,depthWrite:!1})}function Sh(){return`
3666
3666
 
3667
3667
  precision mediump float;
3668
3668
  precision mediump int;
@@ -3717,15 +3717,15 @@ void main() {
3717
3717
  gl_Position = vec4( position, 1.0 );
3718
3718
 
3719
3719
  }
3720
- `}function zy(r){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){let l=o.mapping,c=l===Iu||l===Lu,u=l===Bs||l===zs;if(c||u){let f=t.get(o),h=f!==void 0?f.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==h)return e===null&&(e=new xl(r)),f=c?e.fromEquirectangular(o,f):e.fromCubemap(o,f),f.texture.pmremVersion=o.pmremVersion,t.set(o,f),f.texture;if(f!==void 0)return f.texture;{let d=o.image;return c&&d&&d.height>0||u&&d&&i(d)?(e===null&&(e=new xl(r)),f=c?e.fromEquirectangular(o):e.fromCubemap(o),f.texture.pmremVersion=o.pmremVersion,t.set(o,f),o.addEventListener("dispose",s),f.texture):null}}}return o}function i(o){let l=0,c=6;for(let u=0;u<c;u++)o[u]!==void 0&&l++;return l===c}function s(o){let l=o.target;l.removeEventListener("dispose",s);let c=t.get(l);c!==void 0&&(t.delete(l),c.dispose())}function a(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:n,dispose:a}}function ky(r){let t={};function e(n){if(t[n]!==void 0)return t[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(n){let i=e(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function Vy(r,t,e,n){let i={},s=new WeakMap;function a(f){let h=f.target;h.index!==null&&t.remove(h.index);for(let _ in h.attributes)t.remove(h.attributes[_]);for(let _ in h.morphAttributes){let g=h.morphAttributes[_];for(let p=0,m=g.length;p<m;p++)t.remove(g[p])}h.removeEventListener("dispose",a),delete i[h.id];let d=s.get(h);d&&(t.remove(d),s.delete(h)),n.releaseStatesOfGeometry(h),h.isInstancedBufferGeometry===!0&&delete h._maxInstanceCount,e.memory.geometries--}function o(f,h){return i[h.id]===!0||(h.addEventListener("dispose",a),i[h.id]=!0,e.memory.geometries++),h}function l(f){let h=f.attributes;for(let _ in h)t.update(h[_],r.ARRAY_BUFFER);let d=f.morphAttributes;for(let _ in d){let g=d[_];for(let p=0,m=g.length;p<m;p++)t.update(g[p],r.ARRAY_BUFFER)}}function c(f){let h=[],d=f.index,_=f.attributes.position,g=0;if(d!==null){let S=d.array;g=d.version;for(let v=0,M=S.length;v<M;v+=3){let D=S[v+0],T=S[v+1],w=S[v+2];h.push(D,T,T,w,w,D)}}else if(_!==void 0){let S=_.array;g=_.version;for(let v=0,M=S.length/3-1;v<M;v+=3){let D=v+0,T=v+1,w=v+2;h.push(D,T,T,w,w,D)}}else return;let p=new(fm(h)?dl:fl)(h,1);p.version=g;let m=s.get(f);m&&t.remove(m),s.set(f,p)}function u(f){let h=s.get(f);if(h){let d=f.index;d!==null&&h.version<d.version&&c(f)}else c(f);return s.get(f)}return{get:o,update:l,getWireframeAttribute:u}}function Hy(r,t,e){let n;function i(h){n=h}let s,a;function o(h){s=h.type,a=h.bytesPerElement}function l(h,d){r.drawElements(n,d,s,h*a),e.update(d,n,1)}function c(h,d,_){_!==0&&(r.drawElementsInstanced(n,d,s,h*a,_),e.update(d,n,_))}function u(h,d,_){if(_===0)return;let g=t.get("WEBGL_multi_draw");if(g===null)for(let p=0;p<_;p++)this.render(h[p]/a,d[p]);else{g.multiDrawElementsWEBGL(n,d,0,s,h,0,_);let p=0;for(let m=0;m<_;m++)p+=d[m];e.update(p,n,1)}}function f(h,d,_,g){if(_===0)return;let p=t.get("WEBGL_multi_draw");if(p===null)for(let m=0;m<h.length;m++)c(h[m]/a,d[m],g[m]);else{p.multiDrawElementsInstancedWEBGL(n,d,0,s,h,0,g,0,_);let m=0;for(let S=0;S<_;S++)m+=d[S];for(let S=0;S<g.length;S++)e.update(m,n,g[S])}}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=f}function Gy(r){let t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,a,o){switch(e.calls++,a){case r.TRIANGLES:e.triangles+=o*(s/3);break;case r.LINES:e.lines+=o*(s/2);break;case r.LINE_STRIP:e.lines+=o*(s-1);break;case r.LINE_LOOP:e.lines+=o*s;break;case r.POINTS:e.points+=o*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function Wy(r,t,e){let n=new WeakMap,i=new We;function s(a,o,l){let c=a.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,f=u!==void 0?u.length:0,h=n.get(o);if(h===void 0||h.count!==f){let y=function(){w.dispose(),n.delete(o),o.removeEventListener("dispose",y)};h!==void 0&&h.texture.dispose();let d=o.morphAttributes.position!==void 0,_=o.morphAttributes.normal!==void 0,g=o.morphAttributes.color!==void 0,p=o.morphAttributes.position||[],m=o.morphAttributes.normal||[],S=o.morphAttributes.color||[],v=0;d===!0&&(v=1),_===!0&&(v=2),g===!0&&(v=3);let M=o.attributes.position.count*v,D=1;M>t.maxTextureSize&&(D=Math.ceil(M/t.maxTextureSize),M=t.maxTextureSize);let T=new Float32Array(M*D*4*f),w=new ll(T,M,D,f);w.type=nr,w.needsUpdate=!0;let P=v*4;for(let x=0;x<f;x++){let F=p[x],I=m[x],R=S[x],B=M*D*4*x;for(let G=0;G<F.count;G++){let Z=G*P;d===!0&&(i.fromBufferAttribute(F,G),T[B+Z+0]=i.x,T[B+Z+1]=i.y,T[B+Z+2]=i.z,T[B+Z+3]=0),_===!0&&(i.fromBufferAttribute(I,G),T[B+Z+4]=i.x,T[B+Z+5]=i.y,T[B+Z+6]=i.z,T[B+Z+7]=0),g===!0&&(i.fromBufferAttribute(R,G),T[B+Z+8]=i.x,T[B+Z+9]=i.y,T[B+Z+10]=i.z,T[B+Z+11]=R.itemSize===4?i.w:1)}}h={count:f,texture:w,size:new ae(M,D)},n.set(o,h),o.addEventListener("dispose",y)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(r,"morphTexture",a.morphTexture,e);else{let d=0;for(let g=0;g<c.length;g++)d+=c[g];let _=o.morphTargetsRelative?1:1-d;l.getUniforms().setValue(r,"morphTargetBaseInfluence",_),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",h.texture,e),l.getUniforms().setValue(r,"morphTargetsTextureSize",h.size)}return{update:s}}function Xy(r,t,e,n){let i=new WeakMap;function s(l){let c=n.render.frame,u=l.geometry,f=t.get(l,u);if(i.get(f)!==c&&(t.update(f),i.set(f,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==c&&(e.update(l.instanceMatrix,r.ARRAY_BUFFER),l.instanceColor!==null&&e.update(l.instanceColor,r.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){let h=l.skeleton;i.get(h)!==c&&(h.update(),i.set(h,c))}return f}function a(){i=new WeakMap}function o(l){let c=l.target;c.removeEventListener("dispose",o),e.remove(c.instanceMatrix),c.instanceColor!==null&&e.remove(c.instanceColor)}return{update:s,dispose:a}}var vl=class extends Yn{constructor(t,e,n,i,s,a,o,l,c,u){if(u=u!==void 0?u:Us,u!==Us&&u!==Pa)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Us&&(n=ks),n===void 0&&u===Pa&&(n=Ua),super(null,i,s,a,o,l,u,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:Wn,this.minFilter=l!==void 0?l:Wn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}},gm=new Yn,_m=new vl(1,1);_m.compareFunction=hm;var xm=new ll,vm=new zu,ym=new ml,Np=[],Op=[],Bp=new Float32Array(16),zp=new Float32Array(9),kp=new Float32Array(4);function Ws(r,t,e){let n=r[0];if(n<=0||n>0)return r;let i=t*e,s=Np[i];if(s===void 0&&(s=new Float32Array(i),Np[i]=s),t!==0){n.toArray(s,0);for(let a=1,o=0;a!==t;++a)o+=e,r[a].toArray(s,o)}return s}function Oe(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e<n;e++)if(r[e]!==t[e])return!1;return!0}function Be(r,t){for(let e=0,n=t.length;e<n;e++)r[e]=t[e]}function Cl(r,t){let e=Op[t];e===void 0&&(e=new Int32Array(t),Op[t]=e);for(let n=0;n!==t;++n)e[n]=r.allocateTextureUnit();return e}function qy(r,t){let e=this.cache;e[0]!==t&&(r.uniform1f(this.addr,t),e[0]=t)}function Yy(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Oe(e,t))return;r.uniform2fv(this.addr,t),Be(e,t)}}function Zy(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(r.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(Oe(e,t))return;r.uniform3fv(this.addr,t),Be(e,t)}}function Jy(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Oe(e,t))return;r.uniform4fv(this.addr,t),Be(e,t)}}function $y(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Oe(e,t))return;r.uniformMatrix2fv(this.addr,!1,t),Be(e,t)}else{if(Oe(e,n))return;kp.set(n),r.uniformMatrix2fv(this.addr,!1,kp),Be(e,n)}}function Ky(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Oe(e,t))return;r.uniformMatrix3fv(this.addr,!1,t),Be(e,t)}else{if(Oe(e,n))return;zp.set(n),r.uniformMatrix3fv(this.addr,!1,zp),Be(e,n)}}function Qy(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Oe(e,t))return;r.uniformMatrix4fv(this.addr,!1,t),Be(e,t)}else{if(Oe(e,n))return;Bp.set(n),r.uniformMatrix4fv(this.addr,!1,Bp),Be(e,n)}}function jy(r,t){let e=this.cache;e[0]!==t&&(r.uniform1i(this.addr,t),e[0]=t)}function tM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Oe(e,t))return;r.uniform2iv(this.addr,t),Be(e,t)}}function eM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Oe(e,t))return;r.uniform3iv(this.addr,t),Be(e,t)}}function nM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Oe(e,t))return;r.uniform4iv(this.addr,t),Be(e,t)}}function iM(r,t){let e=this.cache;e[0]!==t&&(r.uniform1ui(this.addr,t),e[0]=t)}function rM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Oe(e,t))return;r.uniform2uiv(this.addr,t),Be(e,t)}}function sM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Oe(e,t))return;r.uniform3uiv(this.addr,t),Be(e,t)}}function aM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Oe(e,t))return;r.uniform4uiv(this.addr,t),Be(e,t)}}function oM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s=this.type===r.SAMPLER_2D_SHADOW?_m:gm;e.setTexture2D(t||s,i)}function lM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||vm,i)}function cM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||ym,i)}function uM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||xm,i)}function hM(r){switch(r){case 5126:return qy;case 35664:return Yy;case 35665:return Zy;case 35666:return Jy;case 35674:return $y;case 35675:return Ky;case 35676:return Qy;case 5124:case 35670:return jy;case 35667:case 35671:return tM;case 35668:case 35672:return eM;case 35669:case 35673:return nM;case 5125:return iM;case 36294:return rM;case 36295:return sM;case 36296:return aM;case 35678:case 36198:case 36298:case 36306:case 35682:return oM;case 35679:case 36299:case 36307:return lM;case 35680:case 36300:case 36308:case 36293:return cM;case 36289:case 36303:case 36311:case 36292:return uM}}function fM(r,t){r.uniform1fv(this.addr,t)}function dM(r,t){let e=Ws(t,this.size,2);r.uniform2fv(this.addr,e)}function pM(r,t){let e=Ws(t,this.size,3);r.uniform3fv(this.addr,e)}function mM(r,t){let e=Ws(t,this.size,4);r.uniform4fv(this.addr,e)}function gM(r,t){let e=Ws(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,e)}function _M(r,t){let e=Ws(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,e)}function xM(r,t){let e=Ws(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,e)}function vM(r,t){r.uniform1iv(this.addr,t)}function yM(r,t){r.uniform2iv(this.addr,t)}function MM(r,t){r.uniform3iv(this.addr,t)}function SM(r,t){r.uniform4iv(this.addr,t)}function bM(r,t){r.uniform1uiv(this.addr,t)}function EM(r,t){r.uniform2uiv(this.addr,t)}function wM(r,t){r.uniform3uiv(this.addr,t)}function TM(r,t){r.uniform4uiv(this.addr,t)}function AM(r,t,e){let n=this.cache,i=t.length,s=Cl(e,i);Oe(n,s)||(r.uniform1iv(this.addr,s),Be(n,s));for(let a=0;a!==i;++a)e.setTexture2D(t[a]||gm,s[a])}function DM(r,t,e){let n=this.cache,i=t.length,s=Cl(e,i);Oe(n,s)||(r.uniform1iv(this.addr,s),Be(n,s));for(let a=0;a!==i;++a)e.setTexture3D(t[a]||vm,s[a])}function CM(r,t,e){let n=this.cache,i=t.length,s=Cl(e,i);Oe(n,s)||(r.uniform1iv(this.addr,s),Be(n,s));for(let a=0;a!==i;++a)e.setTextureCube(t[a]||ym,s[a])}function RM(r,t,e){let n=this.cache,i=t.length,s=Cl(e,i);Oe(n,s)||(r.uniform1iv(this.addr,s),Be(n,s));for(let a=0;a!==i;++a)e.setTexture2DArray(t[a]||xm,s[a])}function PM(r){switch(r){case 5126:return fM;case 35664:return dM;case 35665:return pM;case 35666:return mM;case 35674:return gM;case 35675:return _M;case 35676:return xM;case 5124:case 35670:return vM;case 35667:case 35671:return yM;case 35668:case 35672:return MM;case 35669:case 35673:return SM;case 5125:return bM;case 36294:return EM;case 36295:return wM;case 36296:return TM;case 35678:case 36198:case 36298:case 36306:case 35682:return AM;case 35679:case 36299:case 36307:return DM;case 35680:case 36300:case 36308:case 36293:return CM;case 36289:case 36303:case 36311:case 36292:return RM}}var Hu=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=hM(e.type)}},Gu=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=PM(e.type)}},Wu=class{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){let i=this.seq;for(let s=0,a=i.length;s!==a;++s){let o=i[s];o.setValue(t,e[o.id],n)}}},Du=/(\w+)(\])?(\[|\.)?/g;function Vp(r,t){r.seq.push(t),r.map[t.id]=t}function IM(r,t,e){let n=r.name,i=n.length;for(Du.lastIndex=0;;){let s=Du.exec(n),a=Du.lastIndex,o=s[1],l=s[2]==="]",c=s[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){Vp(e,c===void 0?new Hu(o,r,t):new Gu(o,r,t));break}else{let f=e.map[o];f===void 0&&(f=new Wu(o),Vp(e,f)),e=f}}}var Os=class{constructor(t,e){this.seq=[],this.map={};let n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){let s=t.getActiveUniform(e,i),a=t.getUniformLocation(e,s.name);IM(s,a,this)}}setValue(t,e,n,i){let s=this.map[e];s!==void 0&&s.setValue(t,n,i)}setOptional(t,e,n){let i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let s=0,a=e.length;s!==a;++s){let o=e[s],l=n[o.id];l.needsUpdate!==!1&&o.setValue(t,l.value,i)}}static seqWithValue(t,e){let n=[];for(let i=0,s=t.length;i!==s;++i){let a=t[i];a.id in e&&n.push(a)}return n}};function Hp(r,t,e){let n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}var LM=37297,FM=0;function UM(r,t){let e=r.split(`
3721
- `),n=[],i=Math.max(t-6,0),s=Math.min(t+6,e.length);for(let a=i;a<s;a++){let o=a+1;n.push(`${o===t?">":" "} ${o}: ${e[a]}`)}return n.join(`
3722
- `)}function NM(r){let t=he.getPrimaries(he.workingColorSpace),e=he.getPrimaries(r),n;switch(t===e?n="":t===rl&&e===il?n="LinearDisplayP3ToLinearSRGB":t===il&&e===rl&&(n="LinearSRGBToLinearDisplayP3"),r){case hr:case Dl:return[n,"LinearTransferOETF"];case Gn:case mh:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function Gp(r,t,e){let n=r.getShaderParameter(t,r.COMPILE_STATUS),i=r.getShaderInfoLog(t).trim();if(n&&i==="")return"";let s=/ERROR: 0:(\d+)/.exec(i);if(s){let a=parseInt(s[1]);return e.toUpperCase()+`
3720
+ `}function sM(r){let t=new WeakMap,e=null;function n(a){if(a&&a.isTexture){let l=a.mapping,c=l===Bu||l===zu,u=l===ks||l===Vs;if(c||u){let h=t.get(a),f=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==f)return e===null&&(e=new Sl(r)),h=c?e.fromEquirectangular(a,h):e.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,t.set(a,h),h.texture;if(h!==void 0)return h.texture;{let d=a.image;return c&&d&&d.height>0||u&&d&&i(d)?(e===null&&(e=new Sl(r)),h=c?e.fromEquirectangular(a):e.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,t.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function i(a){let l=0,c=6;for(let u=0;u<c;u++)a[u]!==void 0&&l++;return l===c}function s(a){let l=a.target;l.removeEventListener("dispose",s);let c=t.get(l);c!==void 0&&(t.delete(l),c.dispose())}function o(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:n,dispose:o}}function oM(r){let t={};function e(n){if(t[n]!==void 0)return t[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(n){let i=e(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function aM(r,t,e,n){let i={},s=new WeakMap;function o(h){let f=h.target;f.index!==null&&t.remove(f.index);for(let _ in f.attributes)t.remove(f.attributes[_]);for(let _ in f.morphAttributes){let g=f.morphAttributes[_];for(let p=0,m=g.length;p<m;p++)t.remove(g[p])}f.removeEventListener("dispose",o),delete i[f.id];let d=s.get(f);d&&(t.remove(d),s.delete(f)),n.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,e.memory.geometries--}function a(h,f){return i[f.id]===!0||(f.addEventListener("dispose",o),i[f.id]=!0,e.memory.geometries++),f}function l(h){let f=h.attributes;for(let _ in f)t.update(f[_],r.ARRAY_BUFFER);let d=h.morphAttributes;for(let _ in d){let g=d[_];for(let p=0,m=g.length;p<m;p++)t.update(g[p],r.ARRAY_BUFFER)}}function c(h){let f=[],d=h.index,_=h.attributes.position,g=0;if(d!==null){let S=d.array;g=d.version;for(let v=0,M=S.length;v<M;v+=3){let D=S[v+0],T=S[v+1],E=S[v+2];f.push(D,T,T,E,E,D)}}else if(_!==void 0){let S=_.array;g=_.version;for(let v=0,M=S.length/3-1;v<M;v+=3){let D=v+0,T=v+1,E=v+2;f.push(D,T,T,E,E,D)}}else return;let p=new(bm(f)?_l:gl)(f,1);p.version=g;let m=s.get(h);m&&t.remove(m),s.set(h,p)}function u(h){let f=s.get(h);if(f){let d=h.index;d!==null&&f.version<d.version&&c(h)}else c(h);return s.get(h)}return{get:a,update:l,getWireframeAttribute:u}}function lM(r,t,e){let n;function i(f){n=f}let s,o;function a(f){s=f.type,o=f.bytesPerElement}function l(f,d){r.drawElements(n,d,s,f*o),e.update(d,n,1)}function c(f,d,_){_!==0&&(r.drawElementsInstanced(n,d,s,f*o,_),e.update(d,n,_))}function u(f,d,_){if(_===0)return;let g=t.get("WEBGL_multi_draw");if(g===null)for(let p=0;p<_;p++)this.render(f[p]/o,d[p]);else{g.multiDrawElementsWEBGL(n,d,0,s,f,0,_);let p=0;for(let m=0;m<_;m++)p+=d[m];e.update(p,n,1)}}function h(f,d,_,g){if(_===0)return;let p=t.get("WEBGL_multi_draw");if(p===null)for(let m=0;m<f.length;m++)c(f[m]/o,d[m],g[m]);else{p.multiDrawElementsInstancedWEBGL(n,d,0,s,f,0,g,0,_);let m=0;for(let S=0;S<_;S++)m+=d[S];for(let S=0;S<g.length;S++)e.update(m,n,g[S])}}this.setMode=i,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=h}function cM(r){let t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,a){switch(e.calls++,o){case r.TRIANGLES:e.triangles+=a*(s/3);break;case r.LINES:e.lines+=a*(s/2);break;case r.LINE_STRIP:e.lines+=a*(s-1);break;case r.LINE_LOOP:e.lines+=a*s;break;case r.POINTS:e.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function uM(r,t,e){let n=new WeakMap,i=new Xe;function s(o,a,l){let c=o.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,h=u!==void 0?u.length:0,f=n.get(a);if(f===void 0||f.count!==h){let y=function(){E.dispose(),n.delete(a),a.removeEventListener("dispose",y)};f!==void 0&&f.texture.dispose();let d=a.morphAttributes.position!==void 0,_=a.morphAttributes.normal!==void 0,g=a.morphAttributes.color!==void 0,p=a.morphAttributes.position||[],m=a.morphAttributes.normal||[],S=a.morphAttributes.color||[],v=0;d===!0&&(v=1),_===!0&&(v=2),g===!0&&(v=3);let M=a.attributes.position.count*v,D=1;M>t.maxTextureSize&&(D=Math.ceil(M/t.maxTextureSize),M=t.maxTextureSize);let T=new Float32Array(M*D*4*h),E=new fl(T,M,D,h);E.type=ir,E.needsUpdate=!0;let R=v*4;for(let x=0;x<h;x++){let L=p[x],F=m[x],P=S[x],B=M*D*4*x;for(let X=0;X<L.count;X++){let G=X*R;d===!0&&(i.fromBufferAttribute(L,X),T[B+G+0]=i.x,T[B+G+1]=i.y,T[B+G+2]=i.z,T[B+G+3]=0),_===!0&&(i.fromBufferAttribute(F,X),T[B+G+4]=i.x,T[B+G+5]=i.y,T[B+G+6]=i.z,T[B+G+7]=0),g===!0&&(i.fromBufferAttribute(P,X),T[B+G+8]=i.x,T[B+G+9]=i.y,T[B+G+10]=i.z,T[B+G+11]=P.itemSize===4?i.w:1)}}f={count:h,texture:E,size:new oe(M,D)},n.set(a,f),a.addEventListener("dispose",y)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(r,"morphTexture",o.morphTexture,e);else{let d=0;for(let g=0;g<c.length;g++)d+=c[g];let _=a.morphTargetsRelative?1:1-d;l.getUniforms().setValue(r,"morphTargetBaseInfluence",_),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",f.texture,e),l.getUniforms().setValue(r,"morphTargetsTextureSize",f.size)}return{update:s}}function hM(r,t,e,n){let i=new WeakMap;function s(l){let c=n.render.frame,u=l.geometry,h=t.get(l,u);if(i.get(h)!==c&&(t.update(h),i.set(h,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),i.get(l)!==c&&(e.update(l.instanceMatrix,r.ARRAY_BUFFER),l.instanceColor!==null&&e.update(l.instanceColor,r.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){let f=l.skeleton;i.get(f)!==c&&(f.update(),i.set(f,c))}return h}function o(){i=new WeakMap}function a(l){let c=l.target;c.removeEventListener("dispose",a),e.remove(c.instanceMatrix),c.instanceColor!==null&&e.remove(c.instanceColor)}return{update:s,dispose:o}}var bl=class extends Yn{constructor(t,e,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Os,u!==Os&&u!==Uo)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Os&&(n=Hs),n===void 0&&u===Uo&&(n=ko),super(null,i,s,o,a,l,u,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=a!==void 0?a:Wn,this.minFilter=l!==void 0?l:Wn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}},Am=new Yn,Dm=new bl(1,1);Dm.compareFunction=Sm;var Cm=new fl,Rm=new Xu,Pm=new vl,Yp=[],Zp=[],Jp=new Float32Array(16),$p=new Float32Array(9),Kp=new Float32Array(4);function qs(r,t,e){let n=r[0];if(n<=0||n>0)return r;let i=t*e,s=Yp[i];if(s===void 0&&(s=new Float32Array(i),Yp[i]=s),t!==0){n.toArray(s,0);for(let o=1,a=0;o!==t;++o)a+=e,r[o].toArray(s,a)}return s}function Be(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e<n;e++)if(r[e]!==t[e])return!1;return!0}function ze(r,t){for(let e=0,n=t.length;e<n;e++)r[e]=t[e]}function Ll(r,t){let e=Zp[t];e===void 0&&(e=new Int32Array(t),Zp[t]=e);for(let n=0;n!==t;++n)e[n]=r.allocateTextureUnit();return e}function fM(r,t){let e=this.cache;e[0]!==t&&(r.uniform1f(this.addr,t),e[0]=t)}function dM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Be(e,t))return;r.uniform2fv(this.addr,t),ze(e,t)}}function pM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(r.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(Be(e,t))return;r.uniform3fv(this.addr,t),ze(e,t)}}function mM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Be(e,t))return;r.uniform4fv(this.addr,t),ze(e,t)}}function gM(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Be(e,t))return;r.uniformMatrix2fv(this.addr,!1,t),ze(e,t)}else{if(Be(e,n))return;Kp.set(n),r.uniformMatrix2fv(this.addr,!1,Kp),ze(e,n)}}function _M(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Be(e,t))return;r.uniformMatrix3fv(this.addr,!1,t),ze(e,t)}else{if(Be(e,n))return;$p.set(n),r.uniformMatrix3fv(this.addr,!1,$p),ze(e,n)}}function xM(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Be(e,t))return;r.uniformMatrix4fv(this.addr,!1,t),ze(e,t)}else{if(Be(e,n))return;Jp.set(n),r.uniformMatrix4fv(this.addr,!1,Jp),ze(e,n)}}function vM(r,t){let e=this.cache;e[0]!==t&&(r.uniform1i(this.addr,t),e[0]=t)}function yM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Be(e,t))return;r.uniform2iv(this.addr,t),ze(e,t)}}function MM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Be(e,t))return;r.uniform3iv(this.addr,t),ze(e,t)}}function SM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Be(e,t))return;r.uniform4iv(this.addr,t),ze(e,t)}}function bM(r,t){let e=this.cache;e[0]!==t&&(r.uniform1ui(this.addr,t),e[0]=t)}function wM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Be(e,t))return;r.uniform2uiv(this.addr,t),ze(e,t)}}function EM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Be(e,t))return;r.uniform3uiv(this.addr,t),ze(e,t)}}function TM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Be(e,t))return;r.uniform4uiv(this.addr,t),ze(e,t)}}function AM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s=this.type===r.SAMPLER_2D_SHADOW?Dm:Am;e.setTexture2D(t||s,i)}function DM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||Rm,i)}function CM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||Pm,i)}function RM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||Cm,i)}function PM(r){switch(r){case 5126:return fM;case 35664:return dM;case 35665:return pM;case 35666:return mM;case 35674:return gM;case 35675:return _M;case 35676:return xM;case 5124:case 35670:return vM;case 35667:case 35671:return yM;case 35668:case 35672:return MM;case 35669:case 35673:return SM;case 5125:return bM;case 36294:return wM;case 36295:return EM;case 36296:return TM;case 35678:case 36198:case 36298:case 36306:case 35682:return AM;case 35679:case 36299:case 36307:return DM;case 35680:case 36300:case 36308:case 36293:return CM;case 36289:case 36303:case 36311:case 36292:return RM}}function IM(r,t){r.uniform1fv(this.addr,t)}function LM(r,t){let e=qs(t,this.size,2);r.uniform2fv(this.addr,e)}function FM(r,t){let e=qs(t,this.size,3);r.uniform3fv(this.addr,e)}function NM(r,t){let e=qs(t,this.size,4);r.uniform4fv(this.addr,e)}function UM(r,t){let e=qs(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,e)}function OM(r,t){let e=qs(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,e)}function BM(r,t){let e=qs(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,e)}function zM(r,t){r.uniform1iv(this.addr,t)}function kM(r,t){r.uniform2iv(this.addr,t)}function VM(r,t){r.uniform3iv(this.addr,t)}function HM(r,t){r.uniform4iv(this.addr,t)}function GM(r,t){r.uniform1uiv(this.addr,t)}function WM(r,t){r.uniform2uiv(this.addr,t)}function XM(r,t){r.uniform3uiv(this.addr,t)}function qM(r,t){r.uniform4uiv(this.addr,t)}function YM(r,t,e){let n=this.cache,i=t.length,s=Ll(e,i);Be(n,s)||(r.uniform1iv(this.addr,s),ze(n,s));for(let o=0;o!==i;++o)e.setTexture2D(t[o]||Am,s[o])}function ZM(r,t,e){let n=this.cache,i=t.length,s=Ll(e,i);Be(n,s)||(r.uniform1iv(this.addr,s),ze(n,s));for(let o=0;o!==i;++o)e.setTexture3D(t[o]||Rm,s[o])}function JM(r,t,e){let n=this.cache,i=t.length,s=Ll(e,i);Be(n,s)||(r.uniform1iv(this.addr,s),ze(n,s));for(let o=0;o!==i;++o)e.setTextureCube(t[o]||Pm,s[o])}function $M(r,t,e){let n=this.cache,i=t.length,s=Ll(e,i);Be(n,s)||(r.uniform1iv(this.addr,s),ze(n,s));for(let o=0;o!==i;++o)e.setTexture2DArray(t[o]||Cm,s[o])}function KM(r){switch(r){case 5126:return IM;case 35664:return LM;case 35665:return FM;case 35666:return NM;case 35674:return UM;case 35675:return OM;case 35676:return BM;case 5124:case 35670:return zM;case 35667:case 35671:return kM;case 35668:case 35672:return VM;case 35669:case 35673:return HM;case 5125:return GM;case 36294:return WM;case 36295:return XM;case 36296:return qM;case 35678:case 36198:case 36298:case 36306:case 35682:return YM;case 35679:case 36299:case 36307:return ZM;case 35680:case 36300:case 36308:case 36293:return JM;case 36289:case 36303:case 36311:case 36292:return $M}}var Zu=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=PM(e.type)}},Ju=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=KM(e.type)}},$u=class{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){let i=this.seq;for(let s=0,o=i.length;s!==o;++s){let a=i[s];a.setValue(t,e[a.id],n)}}},Fu=/(\w+)(\])?(\[|\.)?/g;function Qp(r,t){r.seq.push(t),r.map[t.id]=t}function QM(r,t,e){let n=r.name,i=n.length;for(Fu.lastIndex=0;;){let s=Fu.exec(n),o=Fu.lastIndex,a=s[1],l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===i){Qp(e,c===void 0?new Zu(a,r,t):new Ju(a,r,t));break}else{let h=e.map[a];h===void 0&&(h=new $u(a),Qp(e,h)),e=h}}}var zs=class{constructor(t,e){this.seq=[],this.map={};let n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){let s=t.getActiveUniform(e,i),o=t.getUniformLocation(e,s.name);QM(s,o,this)}}setValue(t,e,n,i){let s=this.map[e];s!==void 0&&s.setValue(t,n,i)}setOptional(t,e,n){let i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let s=0,o=e.length;s!==o;++s){let a=e[s],l=n[a.id];l.needsUpdate!==!1&&a.setValue(t,l.value,i)}}static seqWithValue(t,e){let n=[];for(let i=0,s=t.length;i!==s;++i){let o=t[i];o.id in e&&n.push(o)}return n}};function jp(r,t,e){let n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}var jM=37297,tS=0;function eS(r,t){let e=r.split(`
3721
+ `),n=[],i=Math.max(t-6,0),s=Math.min(t+6,e.length);for(let o=i;o<s;o++){let a=o+1;n.push(`${a===t?">":" "} ${a}: ${e[o]}`)}return n.join(`
3722
+ `)}function nS(r){let t=fe.getPrimaries(fe.workingColorSpace),e=fe.getPrimaries(r),n;switch(t===e?n="":t===ll&&e===al?n="LinearDisplayP3ToLinearSRGB":t===al&&e===ll&&(n="LinearSRGBToLinearDisplayP3"),r){case fr:case Il:return[n,"LinearTransferOETF"];case Gn:case Mh:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function tm(r,t,e){let n=r.getShaderParameter(t,r.COMPILE_STATUS),i=r.getShaderInfoLog(t).trim();if(n&&i==="")return"";let s=/ERROR: 0:(\d+)/.exec(i);if(s){let o=parseInt(s[1]);return e.toUpperCase()+`
3723
3723
 
3724
3724
  `+i+`
3725
3725
 
3726
- `+UM(r.getShaderSource(t),a)}else return i}function OM(r,t){let e=NM(t);return`vec4 ${r}( vec4 value ) { return ${e[0]}( ${e[1]}( value ) ); }`}function BM(r,t){let e;switch(t){case j_:e="Linear";break;case t0:e="Reinhard";break;case e0:e="OptimizedCineon";break;case n0:e="ACESFilmic";break;case r0:e="AgX";break;case s0:e="Neutral";break;case i0:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}function zM(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ca).join(`
3727
- `)}function kM(r){let t=[];for(let e in r){let n=r[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(`
3728
- `)}function VM(r,t){let e={},n=r.getProgramParameter(t,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){let s=r.getActiveAttrib(t,i),a=s.name,o=1;s.type===r.FLOAT_MAT2&&(o=2),s.type===r.FLOAT_MAT3&&(o=3),s.type===r.FLOAT_MAT4&&(o=4),e[a]={type:s.type,location:r.getAttribLocation(t,a),locationSize:o}}return e}function Ca(r){return r!==""}function Wp(r,t){let e=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return r.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,e).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 Xp(r,t){return r.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var HM=/^[ \t]*#include +<([\w\d./]+)>/gm;function Xu(r){return r.replace(HM,WM)}var GM=new Map;function WM(r,t){let e=Xt[t];if(e===void 0){let n=GM.get(t);if(n!==void 0)e=Xt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return Xu(e)}var XM=/#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 qp(r){return r.replace(XM,qM)}function qM(r,t,e,n){let i="";for(let s=parseInt(t);s<parseInt(e);s++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function Yp(r){let t=`precision ${r.precision} float;
3726
+ `+eS(r.getShaderSource(t),o)}else return i}function iS(r,t){let e=nS(t);return`vec4 ${r}( vec4 value ) { return ${e[0]}( ${e[1]}( value ) ); }`}function rS(r,t){let e;switch(t){case v0:e="Linear";break;case y0:e="Reinhard";break;case M0:e="OptimizedCineon";break;case S0:e="ACESFilmic";break;case w0:e="AgX";break;case E0:e="Neutral";break;case b0:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}function sS(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Fo).join(`
3727
+ `)}function oS(r){let t=[];for(let e in r){let n=r[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(`
3728
+ `)}function aS(r,t){let e={},n=r.getProgramParameter(t,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){let s=r.getActiveAttrib(t,i),o=s.name,a=1;s.type===r.FLOAT_MAT2&&(a=2),s.type===r.FLOAT_MAT3&&(a=3),s.type===r.FLOAT_MAT4&&(a=4),e[o]={type:s.type,location:r.getAttribLocation(t,o),locationSize:a}}return e}function Fo(r){return r!==""}function em(r,t){let e=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return r.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,e).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 nm(r,t){return r.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var lS=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ku(r){return r.replace(lS,uS)}var cS=new Map;function uS(r,t){let e=Yt[t];if(e===void 0){let n=cS.get(t);if(n!==void 0)e=Yt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return Ku(e)}var hS=/#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 im(r){return r.replace(hS,fS)}function fS(r,t,e,n){let i="";for(let s=parseInt(t);s<parseInt(e);s++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function rm(r){let t=`precision ${r.precision} float;
3729
3729
  precision ${r.precision} int;
3730
3730
  precision ${r.precision} sampler2D;
3731
3731
  precision ${r.precision} samplerCube;
@@ -3745,30 +3745,30 @@ void main() {
3745
3745
  `;return r.precision==="highp"?t+=`
3746
3746
  #define HIGH_PRECISION`:r.precision==="mediump"?t+=`
3747
3747
  #define MEDIUM_PRECISION`:r.precision==="lowp"&&(t+=`
3748
- #define LOW_PRECISION`),t}function YM(r){let t="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===em?t="SHADOWMAP_TYPE_PCF":r.shadowMapType===ph?t="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===Pi&&(t="SHADOWMAP_TYPE_VSM"),t}function ZM(r){let t="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case Bs:case zs:t="ENVMAP_TYPE_CUBE";break;case Tl:t="ENVMAP_TYPE_CUBE_UV";break}return t}function JM(r){let t="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case zs:t="ENVMAP_MODE_REFRACTION";break}return t}function $M(r){let t="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case nm:t="ENVMAP_BLENDING_MULTIPLY";break;case K_:t="ENVMAP_BLENDING_MIX";break;case Q_:t="ENVMAP_BLENDING_ADD";break}return t}function KM(r){let t=r.envMapCubeUVHeight;if(t===null)return null;let e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:n,maxMip:e}}function QM(r,t,e,n){let i=r.getContext(),s=e.defines,a=e.vertexShader,o=e.fragmentShader,l=YM(e),c=ZM(e),u=JM(e),f=$M(e),h=KM(e),d=zM(e),_=kM(s),g=i.createProgram(),p,m,S=e.glslVersion?"#version "+e.glslVersion+`
3749
- `:"";e.isRawShaderMaterial?(p=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Ca).join(`
3748
+ #define LOW_PRECISION`),t}function dS(r){let t="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===fm?t="SHADOWMAP_TYPE_PCF":r.shadowMapType===yh?t="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===Ii&&(t="SHADOWMAP_TYPE_VSM"),t}function pS(r){let t="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case ks:case Vs:t="ENVMAP_TYPE_CUBE";break;case Rl:t="ENVMAP_TYPE_CUBE_UV";break}return t}function mS(r){let t="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case Vs:t="ENVMAP_MODE_REFRACTION";break}return t}function gS(r){let t="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case dm:t="ENVMAP_BLENDING_MULTIPLY";break;case _0:t="ENVMAP_BLENDING_MIX";break;case x0:t="ENVMAP_BLENDING_ADD";break}return t}function _S(r){let t=r.envMapCubeUVHeight;if(t===null)return null;let e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:n,maxMip:e}}function xS(r,t,e,n){let i=r.getContext(),s=e.defines,o=e.vertexShader,a=e.fragmentShader,l=dS(e),c=pS(e),u=mS(e),h=gS(e),f=_S(e),d=sS(e),_=oS(s),g=i.createProgram(),p,m,S=e.glslVersion?"#version "+e.glslVersion+`
3749
+ `:"";e.isRawShaderMaterial?(p=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Fo).join(`
3750
3750
  `),p.length>0&&(p+=`
3751
- `),m=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Ca).join(`
3751
+ `),m=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Fo).join(`
3752
3752
  `),m.length>0&&(m+=`
3753
- `)):(p=[Yp(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+u:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3754
- `].filter(Ca).join(`
3755
- `),m=[Yp(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+u:"",e.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==ar?"#define TONE_MAPPING":"",e.toneMapping!==ar?Xt.tonemapping_pars_fragment:"",e.toneMapping!==ar?BM("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Xt.colorspace_pars_fragment,OM("linearToOutputTexel",e.outputColorSpace),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
3756
- `].filter(Ca).join(`
3757
- `)),a=Xu(a),a=Wp(a,e),a=Xp(a,e),o=Xu(o),o=Wp(o,e),o=Xp(o,e),a=qp(a),o=qp(o),e.isRawShaderMaterial!==!0&&(S=`#version 300 es
3753
+ `)):(p=[rm(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+u:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3754
+ `].filter(Fo).join(`
3755
+ `),m=[rm(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+u:"",e.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==ar?"#define TONE_MAPPING":"",e.toneMapping!==ar?Yt.tonemapping_pars_fragment:"",e.toneMapping!==ar?rS("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Yt.colorspace_pars_fragment,iS("linearToOutputTexel",e.outputColorSpace),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
3756
+ `].filter(Fo).join(`
3757
+ `)),o=Ku(o),o=em(o,e),o=nm(o,e),a=Ku(a),a=em(a,e),a=nm(a,e),o=im(o),a=im(a),e.isRawShaderMaterial!==!0&&(S=`#version 300 es
3758
3758
  `,p=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3759
3759
  `)+`
3760
- `+p,m=["#define varying in",e.glslVersion===up?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===up?"":"#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(`
3760
+ `+p,m=["#define varying in",e.glslVersion===Mp?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Mp?"":"#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(`
3761
3761
  `)+`
3762
- `+m);let v=S+p+a,M=S+m+o,D=Hp(i,i.VERTEX_SHADER,v),T=Hp(i,i.FRAGMENT_SHADER,M);i.attachShader(g,D),i.attachShader(g,T),e.index0AttributeName!==void 0?i.bindAttribLocation(g,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g);function w(F){if(r.debug.checkShaderErrors){let I=i.getProgramInfoLog(g).trim(),R=i.getShaderInfoLog(D).trim(),B=i.getShaderInfoLog(T).trim(),G=!0,Z=!0;if(i.getProgramParameter(g,i.LINK_STATUS)===!1)if(G=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,g,D,T);else{let J=Gp(i,D,"vertex"),N=Gp(i,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(g,i.VALIDATE_STATUS)+`
3762
+ `+m);let v=S+p+o,M=S+m+a,D=jp(i,i.VERTEX_SHADER,v),T=jp(i,i.FRAGMENT_SHADER,M);i.attachShader(g,D),i.attachShader(g,T),e.index0AttributeName!==void 0?i.bindAttribLocation(g,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g);function E(L){if(r.debug.checkShaderErrors){let F=i.getProgramInfoLog(g).trim(),P=i.getShaderInfoLog(D).trim(),B=i.getShaderInfoLog(T).trim(),X=!0,G=!0;if(i.getProgramParameter(g,i.LINK_STATUS)===!1)if(X=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,g,D,T);else{let J=tm(i,D,"vertex"),U=tm(i,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(g,i.VALIDATE_STATUS)+`
3763
3763
 
3764
- Material Name: `+F.name+`
3765
- Material Type: `+F.type+`
3764
+ Material Name: `+L.name+`
3765
+ Material Type: `+L.type+`
3766
3766
 
3767
- Program Info Log: `+I+`
3767
+ Program Info Log: `+F+`
3768
3768
  `+J+`
3769
- `+N)}else I!==""?console.warn("THREE.WebGLProgram: Program Info Log:",I):(R===""||B==="")&&(Z=!1);Z&&(F.diagnostics={runnable:G,programLog:I,vertexShader:{log:R,prefix:p},fragmentShader:{log:B,prefix:m}})}i.deleteShader(D),i.deleteShader(T),P=new Os(i,g),y=VM(i,g)}let P;this.getUniforms=function(){return P===void 0&&w(this),P};let y;this.getAttributes=function(){return y===void 0&&w(this),y};let x=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return x===!1&&(x=i.getProgramParameter(g,LM)),x},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=FM++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=D,this.fragmentShader=T,this}var jM=0,qu=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new Yu(t),e.set(t,n)),n}},Yu=class{constructor(t){this.id=jM++,this.code=t,this.usedTimes=0}};function tS(r,t,e,n,i,s,a){let o=new ul,l=new qu,c=new Set,u=[],f=i.logarithmicDepthBuffer,h=i.vertexTextures,d=i.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",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 g(y){return c.add(y),y===0?"uv":`uv${y}`}function p(y,x,F,I,R){let B=I.fog,G=R.geometry,Z=y.isMeshStandardMaterial?I.environment:null,J=(y.isMeshStandardMaterial?e:t).get(y.envMap||Z),N=J&&J.mapping===Tl?J.image.height:null,Q=_[y.type];y.precision!==null&&(d=i.getMaxPrecision(y.precision),d!==y.precision&&console.warn("THREE.WebGLProgram.getParameters:",y.precision,"not supported, using",d,"instead."));let A=G.morphAttributes.position||G.morphAttributes.normal||G.morphAttributes.color,at=A!==void 0?A.length:0,bt=0;G.morphAttributes.position!==void 0&&(bt=1),G.morphAttributes.normal!==void 0&&(bt=2),G.morphAttributes.color!==void 0&&(bt=3);let Zt,X,tt,ft;if(Q){let te=di[Q];Zt=te.vertexShader,X=te.fragmentShader}else Zt=y.vertexShader,X=y.fragmentShader,l.update(y),tt=l.getVertexShaderID(y),ft=l.getFragmentShaderID(y);let nt=r.getRenderTarget(),It=R.isInstancedMesh===!0,Rt=R.isBatchedMesh===!0,O=!!y.map,Gt=!!y.matcap,St=!!J,Et=!!y.aoMap,_t=!!y.lightMap,Ft=!!y.bumpMap,Pt=!!y.normalMap,z=!!y.displacementMap,jt=!!y.emissiveMap,C=!!y.metalnessMap,b=!!y.roughnessMap,W=y.anisotropy>0,K=y.clearcoat>0,j=y.dispersion>0,et=y.iridescence>0,mt=y.sheen>0,lt=y.transmission>0,it=W&&!!y.anisotropyMap,Lt=K&&!!y.clearcoatMap,rt=K&&!!y.clearcoatNormalMap,Mt=K&&!!y.clearcoatRoughnessMap,Yt=et&&!!y.iridescenceMap,gt=et&&!!y.iridescenceThicknessMap,xt=mt&&!!y.sheenColorMap,Ut=mt&&!!y.sheenRoughnessMap,Ht=!!y.specularMap,ue=!!y.specularColorMap,Nt=!!y.specularIntensityMap,L=lt&&!!y.transmissionMap,Y=lt&&!!y.thicknessMap,$=!!y.gradientMap,ot=!!y.alphaMap,ct=y.alphaTest>0,Vt=!!y.alphaHash,se=!!y.extensions,ce=ar;y.toneMapped&&(nt===null||nt.isXRRenderTarget===!0)&&(ce=r.toneMapping);let de={shaderID:Q,shaderType:y.type,shaderName:y.name,vertexShader:Zt,fragmentShader:X,defines:y.defines,customVertexShaderID:tt,customFragmentShaderID:ft,isRawShaderMaterial:y.isRawShaderMaterial===!0,glslVersion:y.glslVersion,precision:d,batching:Rt,instancing:It,instancingColor:It&&R.instanceColor!==null,instancingMorph:It&&R.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:nt===null?r.outputColorSpace:nt.isXRRenderTarget===!0?nt.texture.colorSpace:hr,alphaToCoverage:!!y.alphaToCoverage,map:O,matcap:Gt,envMap:St,envMapMode:St&&J.mapping,envMapCubeUVHeight:N,aoMap:Et,lightMap:_t,bumpMap:Ft,normalMap:Pt,displacementMap:h&&z,emissiveMap:jt,normalMapObjectSpace:Pt&&y.normalMapType===y0,normalMapTangentSpace:Pt&&y.normalMapType===v0,metalnessMap:C,roughnessMap:b,anisotropy:W,anisotropyMap:it,clearcoat:K,clearcoatMap:Lt,clearcoatNormalMap:rt,clearcoatRoughnessMap:Mt,dispersion:j,iridescence:et,iridescenceMap:Yt,iridescenceThicknessMap:gt,sheen:mt,sheenColorMap:xt,sheenRoughnessMap:Ut,specularMap:Ht,specularColorMap:ue,specularIntensityMap:Nt,transmission:lt,transmissionMap:L,thicknessMap:Y,gradientMap:$,opaque:y.transparent===!1&&y.blending===sr&&y.alphaToCoverage===!1,alphaMap:ot,alphaTest:ct,alphaHash:Vt,combine:y.combine,mapUv:O&&g(y.map.channel),aoMapUv:Et&&g(y.aoMap.channel),lightMapUv:_t&&g(y.lightMap.channel),bumpMapUv:Ft&&g(y.bumpMap.channel),normalMapUv:Pt&&g(y.normalMap.channel),displacementMapUv:z&&g(y.displacementMap.channel),emissiveMapUv:jt&&g(y.emissiveMap.channel),metalnessMapUv:C&&g(y.metalnessMap.channel),roughnessMapUv:b&&g(y.roughnessMap.channel),anisotropyMapUv:it&&g(y.anisotropyMap.channel),clearcoatMapUv:Lt&&g(y.clearcoatMap.channel),clearcoatNormalMapUv:rt&&g(y.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Mt&&g(y.clearcoatRoughnessMap.channel),iridescenceMapUv:Yt&&g(y.iridescenceMap.channel),iridescenceThicknessMapUv:gt&&g(y.iridescenceThicknessMap.channel),sheenColorMapUv:xt&&g(y.sheenColorMap.channel),sheenRoughnessMapUv:Ut&&g(y.sheenRoughnessMap.channel),specularMapUv:Ht&&g(y.specularMap.channel),specularColorMapUv:ue&&g(y.specularColorMap.channel),specularIntensityMapUv:Nt&&g(y.specularIntensityMap.channel),transmissionMapUv:L&&g(y.transmissionMap.channel),thicknessMapUv:Y&&g(y.thicknessMap.channel),alphaMapUv:ot&&g(y.alphaMap.channel),vertexTangents:!!G.attributes.tangent&&(Pt||W),vertexColors:y.vertexColors,vertexAlphas:y.vertexColors===!0&&!!G.attributes.color&&G.attributes.color.itemSize===4,pointsUvs:R.isPoints===!0&&!!G.attributes.uv&&(O||ot),fog:!!B,useFog:y.fog===!0,fogExp2:!!B&&B.isFogExp2,flatShading:y.flatShading===!0,sizeAttenuation:y.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:R.isSkinnedMesh===!0,morphTargets:G.morphAttributes.position!==void 0,morphNormals:G.morphAttributes.normal!==void 0,morphColors:G.morphAttributes.color!==void 0,morphTargetsCount:at,morphTextureStride:bt,numDirLights:x.directional.length,numPointLights:x.point.length,numSpotLights:x.spot.length,numSpotLightMaps:x.spotLightMap.length,numRectAreaLights:x.rectArea.length,numHemiLights:x.hemi.length,numDirLightShadows:x.directionalShadowMap.length,numPointLightShadows:x.pointShadowMap.length,numSpotLightShadows:x.spotShadowMap.length,numSpotLightShadowsWithMaps:x.numSpotLightShadowsWithMaps,numLightProbes:x.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:y.dithering,shadowMapEnabled:r.shadowMap.enabled&&F.length>0,shadowMapType:r.shadowMap.type,toneMapping:ce,useLegacyLights:r._useLegacyLights,decodeVideoTexture:O&&y.map.isVideoTexture===!0&&he.getTransfer(y.map.colorSpace)===_e,premultipliedAlpha:y.premultipliedAlpha,doubleSided:y.side===Li,flipSided:y.side===Tn,useDepthPacking:y.depthPacking>=0,depthPacking:y.depthPacking||0,index0AttributeName:y.index0AttributeName,extensionClipCullDistance:se&&y.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:se&&y.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:y.customProgramCacheKey()};return de.vertexUv1s=c.has(1),de.vertexUv2s=c.has(2),de.vertexUv3s=c.has(3),c.clear(),de}function m(y){let x=[];if(y.shaderID?x.push(y.shaderID):(x.push(y.customVertexShaderID),x.push(y.customFragmentShaderID)),y.defines!==void 0)for(let F in y.defines)x.push(F),x.push(y.defines[F]);return y.isRawShaderMaterial===!1&&(S(x,y),v(x,y),x.push(r.outputColorSpace)),x.push(y.customProgramCacheKey),x.join()}function S(y,x){y.push(x.precision),y.push(x.outputColorSpace),y.push(x.envMapMode),y.push(x.envMapCubeUVHeight),y.push(x.mapUv),y.push(x.alphaMapUv),y.push(x.lightMapUv),y.push(x.aoMapUv),y.push(x.bumpMapUv),y.push(x.normalMapUv),y.push(x.displacementMapUv),y.push(x.emissiveMapUv),y.push(x.metalnessMapUv),y.push(x.roughnessMapUv),y.push(x.anisotropyMapUv),y.push(x.clearcoatMapUv),y.push(x.clearcoatNormalMapUv),y.push(x.clearcoatRoughnessMapUv),y.push(x.iridescenceMapUv),y.push(x.iridescenceThicknessMapUv),y.push(x.sheenColorMapUv),y.push(x.sheenRoughnessMapUv),y.push(x.specularMapUv),y.push(x.specularColorMapUv),y.push(x.specularIntensityMapUv),y.push(x.transmissionMapUv),y.push(x.thicknessMapUv),y.push(x.combine),y.push(x.fogExp2),y.push(x.sizeAttenuation),y.push(x.morphTargetsCount),y.push(x.morphAttributeCount),y.push(x.numDirLights),y.push(x.numPointLights),y.push(x.numSpotLights),y.push(x.numSpotLightMaps),y.push(x.numHemiLights),y.push(x.numRectAreaLights),y.push(x.numDirLightShadows),y.push(x.numPointLightShadows),y.push(x.numSpotLightShadows),y.push(x.numSpotLightShadowsWithMaps),y.push(x.numLightProbes),y.push(x.shadowMapType),y.push(x.toneMapping),y.push(x.numClippingPlanes),y.push(x.numClipIntersection),y.push(x.depthPacking)}function v(y,x){o.disableAll(),x.supportsVertexTextures&&o.enable(0),x.instancing&&o.enable(1),x.instancingColor&&o.enable(2),x.instancingMorph&&o.enable(3),x.matcap&&o.enable(4),x.envMap&&o.enable(5),x.normalMapObjectSpace&&o.enable(6),x.normalMapTangentSpace&&o.enable(7),x.clearcoat&&o.enable(8),x.iridescence&&o.enable(9),x.alphaTest&&o.enable(10),x.vertexColors&&o.enable(11),x.vertexAlphas&&o.enable(12),x.vertexUv1s&&o.enable(13),x.vertexUv2s&&o.enable(14),x.vertexUv3s&&o.enable(15),x.vertexTangents&&o.enable(16),x.anisotropy&&o.enable(17),x.alphaHash&&o.enable(18),x.batching&&o.enable(19),x.dispersion&&o.enable(20),y.push(o.mask),o.disableAll(),x.fog&&o.enable(0),x.useFog&&o.enable(1),x.flatShading&&o.enable(2),x.logarithmicDepthBuffer&&o.enable(3),x.skinning&&o.enable(4),x.morphTargets&&o.enable(5),x.morphNormals&&o.enable(6),x.morphColors&&o.enable(7),x.premultipliedAlpha&&o.enable(8),x.shadowMapEnabled&&o.enable(9),x.useLegacyLights&&o.enable(10),x.doubleSided&&o.enable(11),x.flipSided&&o.enable(12),x.useDepthPacking&&o.enable(13),x.dithering&&o.enable(14),x.transmission&&o.enable(15),x.sheen&&o.enable(16),x.opaque&&o.enable(17),x.pointsUvs&&o.enable(18),x.decodeVideoTexture&&o.enable(19),x.alphaToCoverage&&o.enable(20),y.push(o.mask)}function M(y){let x=_[y.type],F;if(x){let I=di[x];F=X0.clone(I.uniforms)}else F=y.uniforms;return F}function D(y,x){let F;for(let I=0,R=u.length;I<R;I++){let B=u[I];if(B.cacheKey===x){F=B,++F.usedTimes;break}}return F===void 0&&(F=new QM(r,x,y,s),u.push(F)),F}function T(y){if(--y.usedTimes===0){let x=u.indexOf(y);u[x]=u[u.length-1],u.pop(),y.destroy()}}function w(y){l.remove(y)}function P(){l.dispose()}return{getParameters:p,getProgramCacheKey:m,getUniforms:M,acquireProgram:D,releaseProgram:T,releaseShaderCache:w,programs:u,dispose:P}}function eS(){let r=new WeakMap;function t(s){let a=r.get(s);return a===void 0&&(a={},r.set(s,a)),a}function e(s){r.delete(s)}function n(s,a,o){r.get(s)[a]=o}function i(){r=new WeakMap}return{get:t,remove:e,update:n,dispose:i}}function nS(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.material.id!==t.material.id?r.material.id-t.material.id:r.z!==t.z?r.z-t.z:r.id-t.id}function Zp(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.z!==t.z?t.z-r.z:r.id-t.id}function Jp(){let r=[],t=0,e=[],n=[],i=[];function s(){t=0,e.length=0,n.length=0,i.length=0}function a(f,h,d,_,g,p){let m=r[t];return m===void 0?(m={id:f.id,object:f,geometry:h,material:d,groupOrder:_,renderOrder:f.renderOrder,z:g,group:p},r[t]=m):(m.id=f.id,m.object=f,m.geometry=h,m.material=d,m.groupOrder=_,m.renderOrder=f.renderOrder,m.z=g,m.group=p),t++,m}function o(f,h,d,_,g,p){let m=a(f,h,d,_,g,p);d.transmission>0?n.push(m):d.transparent===!0?i.push(m):e.push(m)}function l(f,h,d,_,g,p){let m=a(f,h,d,_,g,p);d.transmission>0?n.unshift(m):d.transparent===!0?i.unshift(m):e.unshift(m)}function c(f,h){e.length>1&&e.sort(f||nS),n.length>1&&n.sort(h||Zp),i.length>1&&i.sort(h||Zp)}function u(){for(let f=t,h=r.length;f<h;f++){let d=r[f];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.group=null}}return{opaque:e,transmissive:n,transparent:i,init:s,push:o,unshift:l,finish:u,sort:c}}function iS(){let r=new WeakMap;function t(n,i){let s=r.get(n),a;return s===void 0?(a=new Jp,r.set(n,[a])):i>=s.length?(a=new Jp,s.push(a)):a=s[i],a}function e(){r=new WeakMap}return{get:t,dispose:e}}function rS(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new q,color:new re};break;case"SpotLight":e={position:new q,direction:new q,color:new re,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new q,color:new re,distance:0,decay:0};break;case"HemisphereLight":e={direction:new q,skyColor:new re,groundColor:new re};break;case"RectAreaLight":e={color:new re,position:new q,halfWidth:new q,halfHeight:new q};break}return r[t.id]=e,e}}}function sS(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ae};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ae};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ae,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var aS=0;function oS(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function lS(r){let t=new rS,e=sS(),n={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 c=0;c<9;c++)n.probe.push(new q);let i=new q,s=new Re,a=new Re;function o(c,u){let f=0,h=0,d=0;for(let F=0;F<9;F++)n.probe[F].set(0,0,0);let _=0,g=0,p=0,m=0,S=0,v=0,M=0,D=0,T=0,w=0,P=0;c.sort(oS);let y=u===!0?Math.PI:1;for(let F=0,I=c.length;F<I;F++){let R=c[F],B=R.color,G=R.intensity,Z=R.distance,J=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)f+=B.r*G*y,h+=B.g*G*y,d+=B.b*G*y;else if(R.isLightProbe){for(let N=0;N<9;N++)n.probe[N].addScaledVector(R.sh.coefficients[N],G);P++}else if(R.isDirectionalLight){let N=t.get(R);if(N.color.copy(R.color).multiplyScalar(R.intensity*y),R.castShadow){let Q=R.shadow,A=e.get(R);A.shadowBias=Q.bias,A.shadowNormalBias=Q.normalBias,A.shadowRadius=Q.radius,A.shadowMapSize=Q.mapSize,n.directionalShadow[_]=A,n.directionalShadowMap[_]=J,n.directionalShadowMatrix[_]=R.shadow.matrix,v++}n.directional[_]=N,_++}else if(R.isSpotLight){let N=t.get(R);N.position.setFromMatrixPosition(R.matrixWorld),N.color.copy(B).multiplyScalar(G*y),N.distance=Z,N.coneCos=Math.cos(R.angle),N.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),N.decay=R.decay,n.spot[p]=N;let Q=R.shadow;if(R.map&&(n.spotLightMap[T]=R.map,T++,Q.updateMatrices(R),R.castShadow&&w++),n.spotLightMatrix[p]=Q.matrix,R.castShadow){let A=e.get(R);A.shadowBias=Q.bias,A.shadowNormalBias=Q.normalBias,A.shadowRadius=Q.radius,A.shadowMapSize=Q.mapSize,n.spotShadow[p]=A,n.spotShadowMap[p]=J,D++}p++}else if(R.isRectAreaLight){let N=t.get(R);N.color.copy(B).multiplyScalar(G),N.halfWidth.set(R.width*.5,0,0),N.halfHeight.set(0,R.height*.5,0),n.rectArea[m]=N,m++}else if(R.isPointLight){let N=t.get(R);if(N.color.copy(R.color).multiplyScalar(R.intensity*y),N.distance=R.distance,N.decay=R.decay,R.castShadow){let Q=R.shadow,A=e.get(R);A.shadowBias=Q.bias,A.shadowNormalBias=Q.normalBias,A.shadowRadius=Q.radius,A.shadowMapSize=Q.mapSize,A.shadowCameraNear=Q.camera.near,A.shadowCameraFar=Q.camera.far,n.pointShadow[g]=A,n.pointShadowMap[g]=J,n.pointShadowMatrix[g]=R.shadow.matrix,M++}n.point[g]=N,g++}else if(R.isHemisphereLight){let N=t.get(R);N.skyColor.copy(R.color).multiplyScalar(G*y),N.groundColor.copy(R.groundColor).multiplyScalar(G*y),n.hemi[S]=N,S++}}m>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=dt.LTC_FLOAT_1,n.rectAreaLTC2=dt.LTC_FLOAT_2):(n.rectAreaLTC1=dt.LTC_HALF_1,n.rectAreaLTC2=dt.LTC_HALF_2)),n.ambient[0]=f,n.ambient[1]=h,n.ambient[2]=d;let x=n.hash;(x.directionalLength!==_||x.pointLength!==g||x.spotLength!==p||x.rectAreaLength!==m||x.hemiLength!==S||x.numDirectionalShadows!==v||x.numPointShadows!==M||x.numSpotShadows!==D||x.numSpotMaps!==T||x.numLightProbes!==P)&&(n.directional.length=_,n.spot.length=p,n.rectArea.length=m,n.point.length=g,n.hemi.length=S,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=M,n.pointShadowMap.length=M,n.spotShadow.length=D,n.spotShadowMap.length=D,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=M,n.spotLightMatrix.length=D+T-w,n.spotLightMap.length=T,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=P,x.directionalLength=_,x.pointLength=g,x.spotLength=p,x.rectAreaLength=m,x.hemiLength=S,x.numDirectionalShadows=v,x.numPointShadows=M,x.numSpotShadows=D,x.numSpotMaps=T,x.numLightProbes=P,n.version=aS++)}function l(c,u){let f=0,h=0,d=0,_=0,g=0,p=u.matrixWorldInverse;for(let m=0,S=c.length;m<S;m++){let v=c[m];if(v.isDirectionalLight){let M=n.directional[f];M.direction.setFromMatrixPosition(v.matrixWorld),i.setFromMatrixPosition(v.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(p),f++}else if(v.isSpotLight){let M=n.spot[d];M.position.setFromMatrixPosition(v.matrixWorld),M.position.applyMatrix4(p),M.direction.setFromMatrixPosition(v.matrixWorld),i.setFromMatrixPosition(v.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(p),d++}else if(v.isRectAreaLight){let M=n.rectArea[_];M.position.setFromMatrixPosition(v.matrixWorld),M.position.applyMatrix4(p),a.identity(),s.copy(v.matrixWorld),s.premultiply(p),a.extractRotation(s),M.halfWidth.set(v.width*.5,0,0),M.halfHeight.set(0,v.height*.5,0),M.halfWidth.applyMatrix4(a),M.halfHeight.applyMatrix4(a),_++}else if(v.isPointLight){let M=n.point[h];M.position.setFromMatrixPosition(v.matrixWorld),M.position.applyMatrix4(p),h++}else if(v.isHemisphereLight){let M=n.hemi[g];M.direction.setFromMatrixPosition(v.matrixWorld),M.direction.transformDirection(p),g++}}}return{setup:o,setupView:l,state:n}}function $p(r){let t=new lS(r),e=[],n=[];function i(u){c.camera=u,e.length=0,n.length=0}function s(u){e.push(u)}function a(u){n.push(u)}function o(u){t.setup(e,u)}function l(u){t.setupView(e,u)}let c={lightsArray:e,shadowsArray:n,camera:null,lights:t,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:o,setupLightsView:l,pushLight:s,pushShadow:a}}function cS(r){let t=new WeakMap;function e(i,s=0){let a=t.get(i),o;return a===void 0?(o=new $p(r),t.set(i,[o])):s>=a.length?(o=new $p(r),a.push(o)):o=a[s],o}function n(){t=new WeakMap}return{get:e,dispose:n}}var Zu=class extends Yr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=_0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},Ju=class extends Yr{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},uS=`void main() {
3769
+ `+U)}else F!==""?console.warn("THREE.WebGLProgram: Program Info Log:",F):(P===""||B==="")&&(G=!1);G&&(L.diagnostics={runnable:X,programLog:F,vertexShader:{log:P,prefix:p},fragmentShader:{log:B,prefix:m}})}i.deleteShader(D),i.deleteShader(T),R=new zs(i,g),y=aS(i,g)}let R;this.getUniforms=function(){return R===void 0&&E(this),R};let y;this.getAttributes=function(){return y===void 0&&E(this),y};let x=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return x===!1&&(x=i.getProgramParameter(g,jM)),x},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=tS++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=D,this.fragmentShader=T,this}var vS=0,Qu=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new ju(t),e.set(t,n)),n}},ju=class{constructor(t){this.id=vS++,this.code=t,this.usedTimes=0}};function yS(r,t,e,n,i,s,o){let a=new pl,l=new Qu,c=new Set,u=[],h=i.logarithmicDepthBuffer,f=i.vertexTextures,d=i.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",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 g(y){return c.add(y),y===0?"uv":`uv${y}`}function p(y,x,L,F,P){let B=F.fog,X=P.geometry,G=y.isMeshStandardMaterial?F.environment:null,J=(y.isMeshStandardMaterial?e:t).get(y.envMap||G),U=J&&J.mapping===Rl?J.image.height:null,I=_[y.type];y.precision!==null&&(d=i.getMaxPrecision(y.precision),d!==y.precision&&console.warn("THREE.WebGLProgram.getParameters:",y.precision,"not supported, using",d,"instead."));let A=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,it=A!==void 0?A.length:0,vt=0;X.morphAttributes.position!==void 0&&(vt=1),X.morphAttributes.normal!==void 0&&(vt=2),X.morphAttributes.color!==void 0&&(vt=3);let Wt,q,Q,ct;if(I){let te=di[I];Wt=te.vertexShader,q=te.fragmentShader}else Wt=y.vertexShader,q=y.fragmentShader,l.update(y),Q=l.getVertexShaderID(y),ct=l.getFragmentShaderID(y);let tt=r.getRenderTarget(),It=P.isInstancedMesh===!0,Rt=P.isBatchedMesh===!0,z=!!y.map,Xt=!!y.matcap,bt=!!J,wt=!!y.aoMap,_t=!!y.lightMap,Ft=!!y.bumpMap,Pt=!!y.normalMap,k=!!y.displacementMap,jt=!!y.emissiveMap,C=!!y.metalnessMap,b=!!y.roughnessMap,Y=y.anisotropy>0,j=y.clearcoat>0,et=y.dispersion>0,nt=y.iridescence>0,mt=y.sheen>0,lt=y.transmission>0,rt=Y&&!!y.anisotropyMap,Lt=j&&!!y.clearcoatMap,st=j&&!!y.clearcoatNormalMap,St=j&&!!y.clearcoatRoughnessMap,Jt=nt&&!!y.iridescenceMap,gt=nt&&!!y.iridescenceThicknessMap,xt=mt&&!!y.sheenColorMap,Nt=mt&&!!y.sheenRoughnessMap,Gt=!!y.specularMap,ue=!!y.specularColorMap,Ut=!!y.specularIntensityMap,N=lt&&!!y.transmissionMap,$=lt&&!!y.thicknessMap,K=!!y.gradientMap,at=!!y.alphaMap,ut=y.alphaTest>0,Vt=!!y.alphaHash,se=!!y.extensions,ce=ar;y.toneMapped&&(tt===null||tt.isXRRenderTarget===!0)&&(ce=r.toneMapping);let pe={shaderID:I,shaderType:y.type,shaderName:y.name,vertexShader:Wt,fragmentShader:q,defines:y.defines,customVertexShaderID:Q,customFragmentShaderID:ct,isRawShaderMaterial:y.isRawShaderMaterial===!0,glslVersion:y.glslVersion,precision:d,batching:Rt,instancing:It,instancingColor:It&&P.instanceColor!==null,instancingMorph:It&&P.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:tt===null?r.outputColorSpace:tt.isXRRenderTarget===!0?tt.texture.colorSpace:fr,alphaToCoverage:!!y.alphaToCoverage,map:z,matcap:Xt,envMap:bt,envMapMode:bt&&J.mapping,envMapCubeUVHeight:U,aoMap:wt,lightMap:_t,bumpMap:Ft,normalMap:Pt,displacementMap:f&&k,emissiveMap:jt,normalMapObjectSpace:Pt&&y.normalMapType===k0,normalMapTangentSpace:Pt&&y.normalMapType===z0,metalnessMap:C,roughnessMap:b,anisotropy:Y,anisotropyMap:rt,clearcoat:j,clearcoatMap:Lt,clearcoatNormalMap:st,clearcoatRoughnessMap:St,dispersion:et,iridescence:nt,iridescenceMap:Jt,iridescenceThicknessMap:gt,sheen:mt,sheenColorMap:xt,sheenRoughnessMap:Nt,specularMap:Gt,specularColorMap:ue,specularIntensityMap:Ut,transmission:lt,transmissionMap:N,thicknessMap:$,gradientMap:K,opaque:y.transparent===!1&&y.blending===or&&y.alphaToCoverage===!1,alphaMap:at,alphaTest:ut,alphaHash:Vt,combine:y.combine,mapUv:z&&g(y.map.channel),aoMapUv:wt&&g(y.aoMap.channel),lightMapUv:_t&&g(y.lightMap.channel),bumpMapUv:Ft&&g(y.bumpMap.channel),normalMapUv:Pt&&g(y.normalMap.channel),displacementMapUv:k&&g(y.displacementMap.channel),emissiveMapUv:jt&&g(y.emissiveMap.channel),metalnessMapUv:C&&g(y.metalnessMap.channel),roughnessMapUv:b&&g(y.roughnessMap.channel),anisotropyMapUv:rt&&g(y.anisotropyMap.channel),clearcoatMapUv:Lt&&g(y.clearcoatMap.channel),clearcoatNormalMapUv:st&&g(y.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:St&&g(y.clearcoatRoughnessMap.channel),iridescenceMapUv:Jt&&g(y.iridescenceMap.channel),iridescenceThicknessMapUv:gt&&g(y.iridescenceThicknessMap.channel),sheenColorMapUv:xt&&g(y.sheenColorMap.channel),sheenRoughnessMapUv:Nt&&g(y.sheenRoughnessMap.channel),specularMapUv:Gt&&g(y.specularMap.channel),specularColorMapUv:ue&&g(y.specularColorMap.channel),specularIntensityMapUv:Ut&&g(y.specularIntensityMap.channel),transmissionMapUv:N&&g(y.transmissionMap.channel),thicknessMapUv:$&&g(y.thicknessMap.channel),alphaMapUv:at&&g(y.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(Pt||Y),vertexColors:y.vertexColors,vertexAlphas:y.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:P.isPoints===!0&&!!X.attributes.uv&&(z||at),fog:!!B,useFog:y.fog===!0,fogExp2:!!B&&B.isFogExp2,flatShading:y.flatShading===!0,sizeAttenuation:y.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:P.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:it,morphTextureStride:vt,numDirLights:x.directional.length,numPointLights:x.point.length,numSpotLights:x.spot.length,numSpotLightMaps:x.spotLightMap.length,numRectAreaLights:x.rectArea.length,numHemiLights:x.hemi.length,numDirLightShadows:x.directionalShadowMap.length,numPointLightShadows:x.pointShadowMap.length,numSpotLightShadows:x.spotShadowMap.length,numSpotLightShadowsWithMaps:x.numSpotLightShadowsWithMaps,numLightProbes:x.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:y.dithering,shadowMapEnabled:r.shadowMap.enabled&&L.length>0,shadowMapType:r.shadowMap.type,toneMapping:ce,useLegacyLights:r._useLegacyLights,decodeVideoTexture:z&&y.map.isVideoTexture===!0&&fe.getTransfer(y.map.colorSpace)===xe,premultipliedAlpha:y.premultipliedAlpha,doubleSided:y.side===Fi,flipSided:y.side===Tn,useDepthPacking:y.depthPacking>=0,depthPacking:y.depthPacking||0,index0AttributeName:y.index0AttributeName,extensionClipCullDistance:se&&y.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:se&&y.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:y.customProgramCacheKey()};return pe.vertexUv1s=c.has(1),pe.vertexUv2s=c.has(2),pe.vertexUv3s=c.has(3),c.clear(),pe}function m(y){let x=[];if(y.shaderID?x.push(y.shaderID):(x.push(y.customVertexShaderID),x.push(y.customFragmentShaderID)),y.defines!==void 0)for(let L in y.defines)x.push(L),x.push(y.defines[L]);return y.isRawShaderMaterial===!1&&(S(x,y),v(x,y),x.push(r.outputColorSpace)),x.push(y.customProgramCacheKey),x.join()}function S(y,x){y.push(x.precision),y.push(x.outputColorSpace),y.push(x.envMapMode),y.push(x.envMapCubeUVHeight),y.push(x.mapUv),y.push(x.alphaMapUv),y.push(x.lightMapUv),y.push(x.aoMapUv),y.push(x.bumpMapUv),y.push(x.normalMapUv),y.push(x.displacementMapUv),y.push(x.emissiveMapUv),y.push(x.metalnessMapUv),y.push(x.roughnessMapUv),y.push(x.anisotropyMapUv),y.push(x.clearcoatMapUv),y.push(x.clearcoatNormalMapUv),y.push(x.clearcoatRoughnessMapUv),y.push(x.iridescenceMapUv),y.push(x.iridescenceThicknessMapUv),y.push(x.sheenColorMapUv),y.push(x.sheenRoughnessMapUv),y.push(x.specularMapUv),y.push(x.specularColorMapUv),y.push(x.specularIntensityMapUv),y.push(x.transmissionMapUv),y.push(x.thicknessMapUv),y.push(x.combine),y.push(x.fogExp2),y.push(x.sizeAttenuation),y.push(x.morphTargetsCount),y.push(x.morphAttributeCount),y.push(x.numDirLights),y.push(x.numPointLights),y.push(x.numSpotLights),y.push(x.numSpotLightMaps),y.push(x.numHemiLights),y.push(x.numRectAreaLights),y.push(x.numDirLightShadows),y.push(x.numPointLightShadows),y.push(x.numSpotLightShadows),y.push(x.numSpotLightShadowsWithMaps),y.push(x.numLightProbes),y.push(x.shadowMapType),y.push(x.toneMapping),y.push(x.numClippingPlanes),y.push(x.numClipIntersection),y.push(x.depthPacking)}function v(y,x){a.disableAll(),x.supportsVertexTextures&&a.enable(0),x.instancing&&a.enable(1),x.instancingColor&&a.enable(2),x.instancingMorph&&a.enable(3),x.matcap&&a.enable(4),x.envMap&&a.enable(5),x.normalMapObjectSpace&&a.enable(6),x.normalMapTangentSpace&&a.enable(7),x.clearcoat&&a.enable(8),x.iridescence&&a.enable(9),x.alphaTest&&a.enable(10),x.vertexColors&&a.enable(11),x.vertexAlphas&&a.enable(12),x.vertexUv1s&&a.enable(13),x.vertexUv2s&&a.enable(14),x.vertexUv3s&&a.enable(15),x.vertexTangents&&a.enable(16),x.anisotropy&&a.enable(17),x.alphaHash&&a.enable(18),x.batching&&a.enable(19),x.dispersion&&a.enable(20),y.push(a.mask),a.disableAll(),x.fog&&a.enable(0),x.useFog&&a.enable(1),x.flatShading&&a.enable(2),x.logarithmicDepthBuffer&&a.enable(3),x.skinning&&a.enable(4),x.morphTargets&&a.enable(5),x.morphNormals&&a.enable(6),x.morphColors&&a.enable(7),x.premultipliedAlpha&&a.enable(8),x.shadowMapEnabled&&a.enable(9),x.useLegacyLights&&a.enable(10),x.doubleSided&&a.enable(11),x.flipSided&&a.enable(12),x.useDepthPacking&&a.enable(13),x.dithering&&a.enable(14),x.transmission&&a.enable(15),x.sheen&&a.enable(16),x.opaque&&a.enable(17),x.pointsUvs&&a.enable(18),x.decodeVideoTexture&&a.enable(19),x.alphaToCoverage&&a.enable(20),y.push(a.mask)}function M(y){let x=_[y.type],L;if(x){let F=di[x];L=hx.clone(F.uniforms)}else L=y.uniforms;return L}function D(y,x){let L;for(let F=0,P=u.length;F<P;F++){let B=u[F];if(B.cacheKey===x){L=B,++L.usedTimes;break}}return L===void 0&&(L=new xS(r,x,y,s),u.push(L)),L}function T(y){if(--y.usedTimes===0){let x=u.indexOf(y);u[x]=u[u.length-1],u.pop(),y.destroy()}}function E(y){l.remove(y)}function R(){l.dispose()}return{getParameters:p,getProgramCacheKey:m,getUniforms:M,acquireProgram:D,releaseProgram:T,releaseShaderCache:E,programs:u,dispose:R}}function MS(){let r=new WeakMap;function t(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function e(s){r.delete(s)}function n(s,o,a){r.get(s)[o]=a}function i(){r=new WeakMap}return{get:t,remove:e,update:n,dispose:i}}function SS(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.material.id!==t.material.id?r.material.id-t.material.id:r.z!==t.z?r.z-t.z:r.id-t.id}function sm(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.z!==t.z?t.z-r.z:r.id-t.id}function om(){let r=[],t=0,e=[],n=[],i=[];function s(){t=0,e.length=0,n.length=0,i.length=0}function o(h,f,d,_,g,p){let m=r[t];return m===void 0?(m={id:h.id,object:h,geometry:f,material:d,groupOrder:_,renderOrder:h.renderOrder,z:g,group:p},r[t]=m):(m.id=h.id,m.object=h,m.geometry=f,m.material=d,m.groupOrder=_,m.renderOrder=h.renderOrder,m.z=g,m.group=p),t++,m}function a(h,f,d,_,g,p){let m=o(h,f,d,_,g,p);d.transmission>0?n.push(m):d.transparent===!0?i.push(m):e.push(m)}function l(h,f,d,_,g,p){let m=o(h,f,d,_,g,p);d.transmission>0?n.unshift(m):d.transparent===!0?i.unshift(m):e.unshift(m)}function c(h,f){e.length>1&&e.sort(h||SS),n.length>1&&n.sort(f||sm),i.length>1&&i.sort(f||sm)}function u(){for(let h=t,f=r.length;h<f;h++){let d=r[h];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.group=null}}return{opaque:e,transmissive:n,transparent:i,init:s,push:a,unshift:l,finish:u,sort:c}}function bS(){let r=new WeakMap;function t(n,i){let s=r.get(n),o;return s===void 0?(o=new om,r.set(n,[o])):i>=s.length?(o=new om,s.push(o)):o=s[i],o}function e(){r=new WeakMap}return{get:t,dispose:e}}function wS(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new Z,color:new re};break;case"SpotLight":e={position:new Z,direction:new Z,color:new re,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new Z,color:new re,distance:0,decay:0};break;case"HemisphereLight":e={direction:new Z,skyColor:new re,groundColor:new re};break;case"RectAreaLight":e={color:new re,position:new Z,halfWidth:new Z,halfHeight:new Z};break}return r[t.id]=e,e}}}function ES(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var TS=0;function AS(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function DS(r){let t=new wS,e=ES(),n={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 c=0;c<9;c++)n.probe.push(new Z);let i=new Z,s=new Pe,o=new Pe;function a(c,u){let h=0,f=0,d=0;for(let L=0;L<9;L++)n.probe[L].set(0,0,0);let _=0,g=0,p=0,m=0,S=0,v=0,M=0,D=0,T=0,E=0,R=0;c.sort(AS);let y=u===!0?Math.PI:1;for(let L=0,F=c.length;L<F;L++){let P=c[L],B=P.color,X=P.intensity,G=P.distance,J=P.shadow&&P.shadow.map?P.shadow.map.texture:null;if(P.isAmbientLight)h+=B.r*X*y,f+=B.g*X*y,d+=B.b*X*y;else if(P.isLightProbe){for(let U=0;U<9;U++)n.probe[U].addScaledVector(P.sh.coefficients[U],X);R++}else if(P.isDirectionalLight){let U=t.get(P);if(U.color.copy(P.color).multiplyScalar(P.intensity*y),P.castShadow){let I=P.shadow,A=e.get(P);A.shadowBias=I.bias,A.shadowNormalBias=I.normalBias,A.shadowRadius=I.radius,A.shadowMapSize=I.mapSize,n.directionalShadow[_]=A,n.directionalShadowMap[_]=J,n.directionalShadowMatrix[_]=P.shadow.matrix,v++}n.directional[_]=U,_++}else if(P.isSpotLight){let U=t.get(P);U.position.setFromMatrixPosition(P.matrixWorld),U.color.copy(B).multiplyScalar(X*y),U.distance=G,U.coneCos=Math.cos(P.angle),U.penumbraCos=Math.cos(P.angle*(1-P.penumbra)),U.decay=P.decay,n.spot[p]=U;let I=P.shadow;if(P.map&&(n.spotLightMap[T]=P.map,T++,I.updateMatrices(P),P.castShadow&&E++),n.spotLightMatrix[p]=I.matrix,P.castShadow){let A=e.get(P);A.shadowBias=I.bias,A.shadowNormalBias=I.normalBias,A.shadowRadius=I.radius,A.shadowMapSize=I.mapSize,n.spotShadow[p]=A,n.spotShadowMap[p]=J,D++}p++}else if(P.isRectAreaLight){let U=t.get(P);U.color.copy(B).multiplyScalar(X),U.halfWidth.set(P.width*.5,0,0),U.halfHeight.set(0,P.height*.5,0),n.rectArea[m]=U,m++}else if(P.isPointLight){let U=t.get(P);if(U.color.copy(P.color).multiplyScalar(P.intensity*y),U.distance=P.distance,U.decay=P.decay,P.castShadow){let I=P.shadow,A=e.get(P);A.shadowBias=I.bias,A.shadowNormalBias=I.normalBias,A.shadowRadius=I.radius,A.shadowMapSize=I.mapSize,A.shadowCameraNear=I.camera.near,A.shadowCameraFar=I.camera.far,n.pointShadow[g]=A,n.pointShadowMap[g]=J,n.pointShadowMatrix[g]=P.shadow.matrix,M++}n.point[g]=U,g++}else if(P.isHemisphereLight){let U=t.get(P);U.skyColor.copy(P.color).multiplyScalar(X*y),U.groundColor.copy(P.groundColor).multiplyScalar(X*y),n.hemi[S]=U,S++}}m>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=dt.LTC_FLOAT_1,n.rectAreaLTC2=dt.LTC_FLOAT_2):(n.rectAreaLTC1=dt.LTC_HALF_1,n.rectAreaLTC2=dt.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=f,n.ambient[2]=d;let x=n.hash;(x.directionalLength!==_||x.pointLength!==g||x.spotLength!==p||x.rectAreaLength!==m||x.hemiLength!==S||x.numDirectionalShadows!==v||x.numPointShadows!==M||x.numSpotShadows!==D||x.numSpotMaps!==T||x.numLightProbes!==R)&&(n.directional.length=_,n.spot.length=p,n.rectArea.length=m,n.point.length=g,n.hemi.length=S,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=M,n.pointShadowMap.length=M,n.spotShadow.length=D,n.spotShadowMap.length=D,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=M,n.spotLightMatrix.length=D+T-E,n.spotLightMap.length=T,n.numSpotLightShadowsWithMaps=E,n.numLightProbes=R,x.directionalLength=_,x.pointLength=g,x.spotLength=p,x.rectAreaLength=m,x.hemiLength=S,x.numDirectionalShadows=v,x.numPointShadows=M,x.numSpotShadows=D,x.numSpotMaps=T,x.numLightProbes=R,n.version=TS++)}function l(c,u){let h=0,f=0,d=0,_=0,g=0,p=u.matrixWorldInverse;for(let m=0,S=c.length;m<S;m++){let v=c[m];if(v.isDirectionalLight){let M=n.directional[h];M.direction.setFromMatrixPosition(v.matrixWorld),i.setFromMatrixPosition(v.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(p),h++}else if(v.isSpotLight){let M=n.spot[d];M.position.setFromMatrixPosition(v.matrixWorld),M.position.applyMatrix4(p),M.direction.setFromMatrixPosition(v.matrixWorld),i.setFromMatrixPosition(v.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(p),d++}else if(v.isRectAreaLight){let M=n.rectArea[_];M.position.setFromMatrixPosition(v.matrixWorld),M.position.applyMatrix4(p),o.identity(),s.copy(v.matrixWorld),s.premultiply(p),o.extractRotation(s),M.halfWidth.set(v.width*.5,0,0),M.halfHeight.set(0,v.height*.5,0),M.halfWidth.applyMatrix4(o),M.halfHeight.applyMatrix4(o),_++}else if(v.isPointLight){let M=n.point[f];M.position.setFromMatrixPosition(v.matrixWorld),M.position.applyMatrix4(p),f++}else if(v.isHemisphereLight){let M=n.hemi[g];M.direction.setFromMatrixPosition(v.matrixWorld),M.direction.transformDirection(p),g++}}}return{setup:a,setupView:l,state:n}}function am(r){let t=new DS(r),e=[],n=[];function i(u){c.camera=u,e.length=0,n.length=0}function s(u){e.push(u)}function o(u){n.push(u)}function a(u){t.setup(e,u)}function l(u){t.setupView(e,u)}let c={lightsArray:e,shadowsArray:n,camera:null,lights:t,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function CS(r){let t=new WeakMap;function e(i,s=0){let o=t.get(i),a;return o===void 0?(a=new am(r),t.set(i,[a])):s>=o.length?(a=new am(r),o.push(a)):a=o[s],a}function n(){t=new WeakMap}return{get:e,dispose:n}}var th=class extends Zr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=O0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},eh=class extends Zr{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},RS=`void main() {
3770
3770
  gl_Position = vec4( position, 1.0 );
3771
- }`,hS=`uniform sampler2D shadow_pass;
3771
+ }`,PS=`uniform sampler2D shadow_pass;
3772
3772
  uniform vec2 resolution;
3773
3773
  uniform float radius;
3774
3774
  #include <packing>
@@ -3794,12 +3794,12 @@ void main() {
3794
3794
  squared_mean = squared_mean / samples;
3795
3795
  float std_dev = sqrt( squared_mean - mean * mean );
3796
3796
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3797
- }`;function fS(r,t,e){let n=new La,i=new ae,s=new ae,a=new We,o=new Zu({depthPacking:x0}),l=new Ju,c={},u=e.maxTextureSize,f={[or]:Tn,[Tn]:or,[Li]:Li},h=new Zn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ae},radius:{value:4}},vertexShader:uS,fragmentShader:hS}),d=h.clone();d.defines.HORIZONTAL_PASS=1;let _=new mi;_.setAttribute("position",new Xn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new ii(_,h),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=em;let m=this.type;this.render=function(T,w,P){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||T.length===0)return;let y=r.getRenderTarget(),x=r.getActiveCubeFace(),F=r.getActiveMipmapLevel(),I=r.state;I.setBlending(rr),I.buffers.color.setClear(1,1,1,1),I.buffers.depth.setTest(!0),I.setScissorTest(!1);let R=m!==Pi&&this.type===Pi,B=m===Pi&&this.type!==Pi;for(let G=0,Z=T.length;G<Z;G++){let J=T[G],N=J.shadow;if(N===void 0){console.warn("THREE.WebGLShadowMap:",J,"has no shadow.");continue}if(N.autoUpdate===!1&&N.needsUpdate===!1)continue;i.copy(N.mapSize);let Q=N.getFrameExtents();if(i.multiply(Q),s.copy(N.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/Q.x),i.x=s.x*Q.x,N.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/Q.y),i.y=s.y*Q.y,N.mapSize.y=s.y)),N.map===null||R===!0||B===!0){let at=this.type!==Pi?{minFilter:Wn,magFilter:Wn}:{};N.map!==null&&N.map.dispose(),N.map=new Ui(i.x,i.y,at),N.map.texture.name=J.name+".shadowMap",N.camera.updateProjectionMatrix()}r.setRenderTarget(N.map),r.clear();let A=N.getViewportCount();for(let at=0;at<A;at++){let bt=N.getViewport(at);a.set(s.x*bt.x,s.y*bt.y,s.x*bt.z,s.y*bt.w),I.viewport(a),N.updateMatrices(J,at),n=N.getFrustum(),M(w,P,N.camera,J,this.type)}N.isPointLightShadow!==!0&&this.type===Pi&&S(N,P),N.needsUpdate=!1}m=this.type,p.needsUpdate=!1,r.setRenderTarget(y,x,F)};function S(T,w){let P=t.update(g);h.defines.VSM_SAMPLES!==T.blurSamples&&(h.defines.VSM_SAMPLES=T.blurSamples,d.defines.VSM_SAMPLES=T.blurSamples,h.needsUpdate=!0,d.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new Ui(i.x,i.y)),h.uniforms.shadow_pass.value=T.map.texture,h.uniforms.resolution.value=T.mapSize,h.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(w,null,P,h,g,null),d.uniforms.shadow_pass.value=T.mapPass.texture,d.uniforms.resolution.value=T.mapSize,d.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(w,null,P,d,g,null)}function v(T,w,P,y){let x=null,F=P.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(F!==void 0)x=F;else if(x=P.isPointLight===!0?l:o,r.localClippingEnabled&&w.clipShadows===!0&&Array.isArray(w.clippingPlanes)&&w.clippingPlanes.length!==0||w.displacementMap&&w.displacementScale!==0||w.alphaMap&&w.alphaTest>0||w.map&&w.alphaTest>0){let I=x.uuid,R=w.uuid,B=c[I];B===void 0&&(B={},c[I]=B);let G=B[R];G===void 0&&(G=x.clone(),B[R]=G,w.addEventListener("dispose",D)),x=G}if(x.visible=w.visible,x.wireframe=w.wireframe,y===Pi?x.side=w.shadowSide!==null?w.shadowSide:w.side:x.side=w.shadowSide!==null?w.shadowSide:f[w.side],x.alphaMap=w.alphaMap,x.alphaTest=w.alphaTest,x.map=w.map,x.clipShadows=w.clipShadows,x.clippingPlanes=w.clippingPlanes,x.clipIntersection=w.clipIntersection,x.displacementMap=w.displacementMap,x.displacementScale=w.displacementScale,x.displacementBias=w.displacementBias,x.wireframeLinewidth=w.wireframeLinewidth,x.linewidth=w.linewidth,P.isPointLight===!0&&x.isMeshDistanceMaterial===!0){let I=r.properties.get(x);I.light=P}return x}function M(T,w,P,y,x){if(T.visible===!1)return;if(T.layers.test(w.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&x===Pi)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);let R=t.update(T),B=T.material;if(Array.isArray(B)){let G=R.groups;for(let Z=0,J=G.length;Z<J;Z++){let N=G[Z],Q=B[N.materialIndex];if(Q&&Q.visible){let A=v(T,Q,y,x);T.onBeforeShadow(r,T,w,P,R,A,N),r.renderBufferDirect(P,null,R,A,T,N),T.onAfterShadow(r,T,w,P,R,A,N)}}}else if(B.visible){let G=v(T,B,y,x);T.onBeforeShadow(r,T,w,P,R,G,null),r.renderBufferDirect(P,null,R,G,T,null),T.onAfterShadow(r,T,w,P,R,G,null)}}let I=T.children;for(let R=0,B=I.length;R<B;R++)M(I[R],w,P,y,x)}function D(T){T.target.removeEventListener("dispose",D);for(let P in c){let y=c[P],x=T.target.uuid;x in y&&(y[x].dispose(),delete y[x])}}}function dS(r){function t(){let L=!1,Y=new We,$=null,ot=new We(0,0,0,0);return{setMask:function(ct){$!==ct&&!L&&(r.colorMask(ct,ct,ct,ct),$=ct)},setLocked:function(ct){L=ct},setClear:function(ct,Vt,se,ce,de){de===!0&&(ct*=ce,Vt*=ce,se*=ce),Y.set(ct,Vt,se,ce),ot.equals(Y)===!1&&(r.clearColor(ct,Vt,se,ce),ot.copy(Y))},reset:function(){L=!1,$=null,ot.set(-1,0,0,0)}}}function e(){let L=!1,Y=null,$=null,ot=null;return{setTest:function(ct){ct?ft(r.DEPTH_TEST):nt(r.DEPTH_TEST)},setMask:function(ct){Y!==ct&&!L&&(r.depthMask(ct),Y=ct)},setFunc:function(ct){if($!==ct){switch(ct){case W_:r.depthFunc(r.NEVER);break;case X_:r.depthFunc(r.ALWAYS);break;case q_:r.depthFunc(r.LESS);break;case jo:r.depthFunc(r.LEQUAL);break;case Y_:r.depthFunc(r.EQUAL);break;case Z_:r.depthFunc(r.GEQUAL);break;case J_:r.depthFunc(r.GREATER);break;case $_:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}$=ct}},setLocked:function(ct){L=ct},setClear:function(ct){ot!==ct&&(r.clearDepth(ct),ot=ct)},reset:function(){L=!1,Y=null,$=null,ot=null}}}function n(){let L=!1,Y=null,$=null,ot=null,ct=null,Vt=null,se=null,ce=null,de=null;return{setTest:function(te){L||(te?ft(r.STENCIL_TEST):nt(r.STENCIL_TEST))},setMask:function(te){Y!==te&&!L&&(r.stencilMask(te),Y=te)},setFunc:function(te,Ct,vt){($!==te||ot!==Ct||ct!==vt)&&(r.stencilFunc(te,Ct,vt),$=te,ot=Ct,ct=vt)},setOp:function(te,Ct,vt){(Vt!==te||se!==Ct||ce!==vt)&&(r.stencilOp(te,Ct,vt),Vt=te,se=Ct,ce=vt)},setLocked:function(te){L=te},setClear:function(te){de!==te&&(r.clearStencil(te),de=te)},reset:function(){L=!1,Y=null,$=null,ot=null,ct=null,Vt=null,se=null,ce=null,de=null}}}let i=new t,s=new e,a=new n,o=new WeakMap,l=new WeakMap,c={},u={},f=new WeakMap,h=[],d=null,_=!1,g=null,p=null,m=null,S=null,v=null,M=null,D=null,T=new re(0,0,0),w=0,P=!1,y=null,x=null,F=null,I=null,R=null,B=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS),G=!1,Z=0,J=r.getParameter(r.VERSION);J.indexOf("WebGL")!==-1?(Z=parseFloat(/^WebGL (\d)/.exec(J)[1]),G=Z>=1):J.indexOf("OpenGL ES")!==-1&&(Z=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),G=Z>=2);let N=null,Q={},A=r.getParameter(r.SCISSOR_BOX),at=r.getParameter(r.VIEWPORT),bt=new We().fromArray(A),Zt=new We().fromArray(at);function X(L,Y,$,ot){let ct=new Uint8Array(4),Vt=r.createTexture();r.bindTexture(L,Vt),r.texParameteri(L,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(L,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let se=0;se<$;se++)L===r.TEXTURE_3D||L===r.TEXTURE_2D_ARRAY?r.texImage3D(Y,0,r.RGBA,1,1,ot,0,r.RGBA,r.UNSIGNED_BYTE,ct):r.texImage2D(Y+se,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,ct);return Vt}let tt={};tt[r.TEXTURE_2D]=X(r.TEXTURE_2D,r.TEXTURE_2D,1),tt[r.TEXTURE_CUBE_MAP]=X(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),tt[r.TEXTURE_2D_ARRAY]=X(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),tt[r.TEXTURE_3D]=X(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),a.setClear(0),ft(r.DEPTH_TEST),s.setFunc(jo),Ft(!1),Pt(Cd),ft(r.CULL_FACE),Et(rr);function ft(L){c[L]!==!0&&(r.enable(L),c[L]=!0)}function nt(L){c[L]!==!1&&(r.disable(L),c[L]=!1)}function It(L,Y){return u[L]!==Y?(r.bindFramebuffer(L,Y),u[L]=Y,L===r.DRAW_FRAMEBUFFER&&(u[r.FRAMEBUFFER]=Y),L===r.FRAMEBUFFER&&(u[r.DRAW_FRAMEBUFFER]=Y),!0):!1}function Rt(L,Y){let $=h,ot=!1;if(L){$=f.get(Y),$===void 0&&($=[],f.set(Y,$));let ct=L.textures;if($.length!==ct.length||$[0]!==r.COLOR_ATTACHMENT0){for(let Vt=0,se=ct.length;Vt<se;Vt++)$[Vt]=r.COLOR_ATTACHMENT0+Vt;$.length=ct.length,ot=!0}}else $[0]!==r.BACK&&($[0]=r.BACK,ot=!0);ot&&r.drawBuffers($)}function O(L){return d!==L?(r.useProgram(L),d=L,!0):!1}let Gt={[Hr]:r.FUNC_ADD,[A_]:r.FUNC_SUBTRACT,[D_]:r.FUNC_REVERSE_SUBTRACT};Gt[C_]=r.MIN,Gt[R_]=r.MAX;let St={[P_]:r.ZERO,[I_]:r.ONE,[L_]:r.SRC_COLOR,[Ru]:r.SRC_ALPHA,[z_]:r.SRC_ALPHA_SATURATE,[O_]:r.DST_COLOR,[U_]:r.DST_ALPHA,[F_]:r.ONE_MINUS_SRC_COLOR,[Pu]:r.ONE_MINUS_SRC_ALPHA,[B_]:r.ONE_MINUS_DST_COLOR,[N_]:r.ONE_MINUS_DST_ALPHA,[k_]:r.CONSTANT_COLOR,[V_]:r.ONE_MINUS_CONSTANT_COLOR,[H_]:r.CONSTANT_ALPHA,[G_]:r.ONE_MINUS_CONSTANT_ALPHA};function Et(L,Y,$,ot,ct,Vt,se,ce,de,te){if(L===rr){_===!0&&(nt(r.BLEND),_=!1);return}if(_===!1&&(ft(r.BLEND),_=!0),L!==T_){if(L!==g||te!==P){if((p!==Hr||v!==Hr)&&(r.blendEquation(r.FUNC_ADD),p=Hr,v=Hr),te)switch(L){case sr:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Rd:r.blendFunc(r.ONE,r.ONE);break;case Pd:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Id:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",L);break}else switch(L){case sr:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Rd:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Pd:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Id:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",L);break}m=null,S=null,M=null,D=null,T.set(0,0,0),w=0,g=L,P=te}return}ct=ct||Y,Vt=Vt||$,se=se||ot,(Y!==p||ct!==v)&&(r.blendEquationSeparate(Gt[Y],Gt[ct]),p=Y,v=ct),($!==m||ot!==S||Vt!==M||se!==D)&&(r.blendFuncSeparate(St[$],St[ot],St[Vt],St[se]),m=$,S=ot,M=Vt,D=se),(ce.equals(T)===!1||de!==w)&&(r.blendColor(ce.r,ce.g,ce.b,de),T.copy(ce),w=de),g=L,P=!1}function _t(L,Y){L.side===Li?nt(r.CULL_FACE):ft(r.CULL_FACE);let $=L.side===Tn;Y&&($=!$),Ft($),L.blending===sr&&L.transparent===!1?Et(rr):Et(L.blending,L.blendEquation,L.blendSrc,L.blendDst,L.blendEquationAlpha,L.blendSrcAlpha,L.blendDstAlpha,L.blendColor,L.blendAlpha,L.premultipliedAlpha),s.setFunc(L.depthFunc),s.setTest(L.depthTest),s.setMask(L.depthWrite),i.setMask(L.colorWrite);let ot=L.stencilWrite;a.setTest(ot),ot&&(a.setMask(L.stencilWriteMask),a.setFunc(L.stencilFunc,L.stencilRef,L.stencilFuncMask),a.setOp(L.stencilFail,L.stencilZFail,L.stencilZPass)),jt(L.polygonOffset,L.polygonOffsetFactor,L.polygonOffsetUnits),L.alphaToCoverage===!0?ft(r.SAMPLE_ALPHA_TO_COVERAGE):nt(r.SAMPLE_ALPHA_TO_COVERAGE)}function Ft(L){y!==L&&(L?r.frontFace(r.CW):r.frontFace(r.CCW),y=L)}function Pt(L){L!==E_?(ft(r.CULL_FACE),L!==x&&(L===Cd?r.cullFace(r.BACK):L===w_?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):nt(r.CULL_FACE),x=L}function z(L){L!==F&&(G&&r.lineWidth(L),F=L)}function jt(L,Y,$){L?(ft(r.POLYGON_OFFSET_FILL),(I!==Y||R!==$)&&(r.polygonOffset(Y,$),I=Y,R=$)):nt(r.POLYGON_OFFSET_FILL)}function C(L){L?ft(r.SCISSOR_TEST):nt(r.SCISSOR_TEST)}function b(L){L===void 0&&(L=r.TEXTURE0+B-1),N!==L&&(r.activeTexture(L),N=L)}function W(L,Y,$){$===void 0&&(N===null?$=r.TEXTURE0+B-1:$=N);let ot=Q[$];ot===void 0&&(ot={type:void 0,texture:void 0},Q[$]=ot),(ot.type!==L||ot.texture!==Y)&&(N!==$&&(r.activeTexture($),N=$),r.bindTexture(L,Y||tt[L]),ot.type=L,ot.texture=Y)}function K(){let L=Q[N];L!==void 0&&L.type!==void 0&&(r.bindTexture(L.type,null),L.type=void 0,L.texture=void 0)}function j(){try{r.compressedTexImage2D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function et(){try{r.compressedTexImage3D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function mt(){try{r.texSubImage2D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function lt(){try{r.texSubImage3D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function it(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function Lt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function rt(){try{r.texStorage2D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function Mt(){try{r.texStorage3D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function Yt(){try{r.texImage2D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function gt(){try{r.texImage3D.apply(r,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function xt(L){bt.equals(L)===!1&&(r.scissor(L.x,L.y,L.z,L.w),bt.copy(L))}function Ut(L){Zt.equals(L)===!1&&(r.viewport(L.x,L.y,L.z,L.w),Zt.copy(L))}function Ht(L,Y){let $=l.get(Y);$===void 0&&($=new WeakMap,l.set(Y,$));let ot=$.get(L);ot===void 0&&(ot=r.getUniformBlockIndex(Y,L.name),$.set(L,ot))}function ue(L,Y){let ot=l.get(Y).get(L);o.get(Y)!==ot&&(r.uniformBlockBinding(Y,ot,L.__bindingPointIndex),o.set(Y,ot))}function Nt(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),c={},N=null,Q={},u={},f=new WeakMap,h=[],d=null,_=!1,g=null,p=null,m=null,S=null,v=null,M=null,D=null,T=new re(0,0,0),w=0,P=!1,y=null,x=null,F=null,I=null,R=null,bt.set(0,0,r.canvas.width,r.canvas.height),Zt.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),a.reset()}return{buffers:{color:i,depth:s,stencil:a},enable:ft,disable:nt,bindFramebuffer:It,drawBuffers:Rt,useProgram:O,setBlending:Et,setMaterial:_t,setFlipSided:Ft,setCullFace:Pt,setLineWidth:z,setPolygonOffset:jt,setScissorTest:C,activeTexture:b,bindTexture:W,unbindTexture:K,compressedTexImage2D:j,compressedTexImage3D:et,texImage2D:Yt,texImage3D:gt,updateUBOMapping:Ht,uniformBlockBinding:ue,texStorage2D:rt,texStorage3D:Mt,texSubImage2D:mt,texSubImage3D:lt,compressedTexSubImage2D:it,compressedTexSubImage3D:Lt,scissor:xt,viewport:Ut,reset:Nt}}function pS(r,t,e,n,i,s,a){let o=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new ae,u=new WeakMap,f,h=new WeakMap,d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(C,b){return d?new OffscreenCanvas(C,b):al("canvas")}function g(C,b,W){let K=1,j=jt(C);if((j.width>W||j.height>W)&&(K=W/Math.max(j.width,j.height)),K<1)if(typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&C instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&C instanceof ImageBitmap||typeof VideoFrame<"u"&&C instanceof VideoFrame){let et=Math.floor(K*j.width),mt=Math.floor(K*j.height);f===void 0&&(f=_(et,mt));let lt=b?_(et,mt):f;return lt.width=et,lt.height=mt,lt.getContext("2d").drawImage(C,0,0,et,mt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+j.width+"x"+j.height+") to ("+et+"x"+mt+")."),lt}else return"data"in C&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+j.width+"x"+j.height+")."),C;return C}function p(C){return C.generateMipmaps&&C.minFilter!==Wn&&C.minFilter!==ni}function m(C){r.generateMipmap(C)}function S(C,b,W,K,j=!1){if(C!==null){if(r[C]!==void 0)return r[C];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+C+"'")}let et=b;if(b===r.RED&&(W===r.FLOAT&&(et=r.R32F),W===r.HALF_FLOAT&&(et=r.R16F),W===r.UNSIGNED_BYTE&&(et=r.R8)),b===r.RED_INTEGER&&(W===r.UNSIGNED_BYTE&&(et=r.R8UI),W===r.UNSIGNED_SHORT&&(et=r.R16UI),W===r.UNSIGNED_INT&&(et=r.R32UI),W===r.BYTE&&(et=r.R8I),W===r.SHORT&&(et=r.R16I),W===r.INT&&(et=r.R32I)),b===r.RG&&(W===r.FLOAT&&(et=r.RG32F),W===r.HALF_FLOAT&&(et=r.RG16F),W===r.UNSIGNED_BYTE&&(et=r.RG8)),b===r.RG_INTEGER&&(W===r.UNSIGNED_BYTE&&(et=r.RG8UI),W===r.UNSIGNED_SHORT&&(et=r.RG16UI),W===r.UNSIGNED_INT&&(et=r.RG32UI),W===r.BYTE&&(et=r.RG8I),W===r.SHORT&&(et=r.RG16I),W===r.INT&&(et=r.RG32I)),b===r.RGB&&W===r.UNSIGNED_INT_5_9_9_9_REV&&(et=r.RGB9_E5),b===r.RGBA){let mt=j?nl:he.getTransfer(K);W===r.FLOAT&&(et=r.RGBA32F),W===r.HALF_FLOAT&&(et=r.RGBA16F),W===r.UNSIGNED_BYTE&&(et=mt===_e?r.SRGB8_ALPHA8:r.RGBA8),W===r.UNSIGNED_SHORT_4_4_4_4&&(et=r.RGBA4),W===r.UNSIGNED_SHORT_5_5_5_1&&(et=r.RGB5_A1)}return(et===r.R16F||et===r.R32F||et===r.RG16F||et===r.RG32F||et===r.RGBA16F||et===r.RGBA32F)&&t.get("EXT_color_buffer_float"),et}function v(C,b){return p(C)===!0||C.isFramebufferTexture&&C.minFilter!==Wn&&C.minFilter!==ni?Math.log2(Math.max(b.width,b.height))+1:C.mipmaps!==void 0&&C.mipmaps.length>0?C.mipmaps.length:C.isCompressedTexture&&Array.isArray(C.image)?b.mipmaps.length:1}function M(C){let b=C.target;b.removeEventListener("dispose",M),T(b),b.isVideoTexture&&u.delete(b)}function D(C){let b=C.target;b.removeEventListener("dispose",D),P(b)}function T(C){let b=n.get(C);if(b.__webglInit===void 0)return;let W=C.source,K=h.get(W);if(K){let j=K[b.__cacheKey];j.usedTimes--,j.usedTimes===0&&w(C),Object.keys(K).length===0&&h.delete(W)}n.remove(C)}function w(C){let b=n.get(C);r.deleteTexture(b.__webglTexture);let W=C.source,K=h.get(W);delete K[b.__cacheKey],a.memory.textures--}function P(C){let b=n.get(C);if(C.depthTexture&&C.depthTexture.dispose(),C.isWebGLCubeRenderTarget)for(let K=0;K<6;K++){if(Array.isArray(b.__webglFramebuffer[K]))for(let j=0;j<b.__webglFramebuffer[K].length;j++)r.deleteFramebuffer(b.__webglFramebuffer[K][j]);else r.deleteFramebuffer(b.__webglFramebuffer[K]);b.__webglDepthbuffer&&r.deleteRenderbuffer(b.__webglDepthbuffer[K])}else{if(Array.isArray(b.__webglFramebuffer))for(let K=0;K<b.__webglFramebuffer.length;K++)r.deleteFramebuffer(b.__webglFramebuffer[K]);else r.deleteFramebuffer(b.__webglFramebuffer);if(b.__webglDepthbuffer&&r.deleteRenderbuffer(b.__webglDepthbuffer),b.__webglMultisampledFramebuffer&&r.deleteFramebuffer(b.__webglMultisampledFramebuffer),b.__webglColorRenderbuffer)for(let K=0;K<b.__webglColorRenderbuffer.length;K++)b.__webglColorRenderbuffer[K]&&r.deleteRenderbuffer(b.__webglColorRenderbuffer[K]);b.__webglDepthRenderbuffer&&r.deleteRenderbuffer(b.__webglDepthRenderbuffer)}let W=C.textures;for(let K=0,j=W.length;K<j;K++){let et=n.get(W[K]);et.__webglTexture&&(r.deleteTexture(et.__webglTexture),a.memory.textures--),n.remove(W[K])}n.remove(C)}let y=0;function x(){y=0}function F(){let C=y;return C>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+C+" texture units while this GPU supports only "+i.maxTextures),y+=1,C}function I(C){let b=[];return b.push(C.wrapS),b.push(C.wrapT),b.push(C.wrapR||0),b.push(C.magFilter),b.push(C.minFilter),b.push(C.anisotropy),b.push(C.internalFormat),b.push(C.format),b.push(C.type),b.push(C.generateMipmaps),b.push(C.premultiplyAlpha),b.push(C.flipY),b.push(C.unpackAlignment),b.push(C.colorSpace),b.join()}function R(C,b){let W=n.get(C);if(C.isVideoTexture&&Pt(C),C.isRenderTargetTexture===!1&&C.version>0&&W.__version!==C.version){let K=C.image;if(K===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(K.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{bt(W,C,b);return}}e.bindTexture(r.TEXTURE_2D,W.__webglTexture,r.TEXTURE0+b)}function B(C,b){let W=n.get(C);if(C.version>0&&W.__version!==C.version){bt(W,C,b);return}e.bindTexture(r.TEXTURE_2D_ARRAY,W.__webglTexture,r.TEXTURE0+b)}function G(C,b){let W=n.get(C);if(C.version>0&&W.__version!==C.version){bt(W,C,b);return}e.bindTexture(r.TEXTURE_3D,W.__webglTexture,r.TEXTURE0+b)}function Z(C,b){let W=n.get(C);if(C.version>0&&W.__version!==C.version){Zt(W,C,b);return}e.bindTexture(r.TEXTURE_CUBE_MAP,W.__webglTexture,r.TEXTURE0+b)}let J={[Fu]:r.REPEAT,[Wr]:r.CLAMP_TO_EDGE,[Uu]:r.MIRRORED_REPEAT},N={[Wn]:r.NEAREST,[a0]:r.NEAREST_MIPMAP_NEAREST,[Do]:r.NEAREST_MIPMAP_LINEAR,[ni]:r.LINEAR,[$c]:r.LINEAR_MIPMAP_NEAREST,[Xr]:r.LINEAR_MIPMAP_LINEAR},Q={[M0]:r.NEVER,[A0]:r.ALWAYS,[S0]:r.LESS,[hm]:r.LEQUAL,[b0]:r.EQUAL,[T0]:r.GEQUAL,[E0]:r.GREATER,[w0]:r.NOTEQUAL};function A(C,b){if(b.type===nr&&t.has("OES_texture_float_linear")===!1&&(b.magFilter===ni||b.magFilter===$c||b.magFilter===Do||b.magFilter===Xr||b.minFilter===ni||b.minFilter===$c||b.minFilter===Do||b.minFilter===Xr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(C,r.TEXTURE_WRAP_S,J[b.wrapS]),r.texParameteri(C,r.TEXTURE_WRAP_T,J[b.wrapT]),(C===r.TEXTURE_3D||C===r.TEXTURE_2D_ARRAY)&&r.texParameteri(C,r.TEXTURE_WRAP_R,J[b.wrapR]),r.texParameteri(C,r.TEXTURE_MAG_FILTER,N[b.magFilter]),r.texParameteri(C,r.TEXTURE_MIN_FILTER,N[b.minFilter]),b.compareFunction&&(r.texParameteri(C,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(C,r.TEXTURE_COMPARE_FUNC,Q[b.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Wn||b.minFilter!==Do&&b.minFilter!==Xr||b.type===nr&&t.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||n.get(b).__currentAnisotropy){let W=t.get("EXT_texture_filter_anisotropic");r.texParameterf(C,W.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,i.getMaxAnisotropy())),n.get(b).__currentAnisotropy=b.anisotropy}}}function at(C,b){let W=!1;C.__webglInit===void 0&&(C.__webglInit=!0,b.addEventListener("dispose",M));let K=b.source,j=h.get(K);j===void 0&&(j={},h.set(K,j));let et=I(b);if(et!==C.__cacheKey){j[et]===void 0&&(j[et]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,W=!0),j[et].usedTimes++;let mt=j[C.__cacheKey];mt!==void 0&&(j[C.__cacheKey].usedTimes--,mt.usedTimes===0&&w(b)),C.__cacheKey=et,C.__webglTexture=j[et].texture}return W}function bt(C,b,W){let K=r.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(K=r.TEXTURE_2D_ARRAY),b.isData3DTexture&&(K=r.TEXTURE_3D);let j=at(C,b),et=b.source;e.bindTexture(K,C.__webglTexture,r.TEXTURE0+W);let mt=n.get(et);if(et.version!==mt.__version||j===!0){e.activeTexture(r.TEXTURE0+W);let lt=he.getPrimaries(he.workingColorSpace),it=b.colorSpace===er?null:he.getPrimaries(b.colorSpace),Lt=b.colorSpace===er||lt===it?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,b.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Lt);let rt=g(b.image,!1,i.maxTextureSize);rt=z(b,rt);let Mt=s.convert(b.format,b.colorSpace),Yt=s.convert(b.type),gt=S(b.internalFormat,Mt,Yt,b.colorSpace,b.isVideoTexture);A(K,b);let xt,Ut=b.mipmaps,Ht=b.isVideoTexture!==!0,ue=mt.__version===void 0||j===!0,Nt=et.dataReady,L=v(b,rt);if(b.isDepthTexture)gt=r.DEPTH_COMPONENT16,b.type===nr?gt=r.DEPTH_COMPONENT32F:b.type===ks?gt=r.DEPTH_COMPONENT24:b.type===Ua&&(gt=r.DEPTH24_STENCIL8),ue&&(Ht?e.texStorage2D(r.TEXTURE_2D,1,gt,rt.width,rt.height):e.texImage2D(r.TEXTURE_2D,0,gt,rt.width,rt.height,0,Mt,Yt,null));else if(b.isDataTexture)if(Ut.length>0){Ht&&ue&&e.texStorage2D(r.TEXTURE_2D,L,gt,Ut[0].width,Ut[0].height);for(let Y=0,$=Ut.length;Y<$;Y++)xt=Ut[Y],Ht?Nt&&e.texSubImage2D(r.TEXTURE_2D,Y,0,0,xt.width,xt.height,Mt,Yt,xt.data):e.texImage2D(r.TEXTURE_2D,Y,gt,xt.width,xt.height,0,Mt,Yt,xt.data);b.generateMipmaps=!1}else Ht?(ue&&e.texStorage2D(r.TEXTURE_2D,L,gt,rt.width,rt.height),Nt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,rt.width,rt.height,Mt,Yt,rt.data)):e.texImage2D(r.TEXTURE_2D,0,gt,rt.width,rt.height,0,Mt,Yt,rt.data);else if(b.isCompressedTexture)if(b.isCompressedArrayTexture){Ht&&ue&&e.texStorage3D(r.TEXTURE_2D_ARRAY,L,gt,Ut[0].width,Ut[0].height,rt.depth);for(let Y=0,$=Ut.length;Y<$;Y++)xt=Ut[Y],b.format!==pi?Mt!==null?Ht?Nt&&e.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Y,0,0,0,xt.width,xt.height,rt.depth,Mt,xt.data,0,0):e.compressedTexImage3D(r.TEXTURE_2D_ARRAY,Y,gt,xt.width,xt.height,rt.depth,0,xt.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ht?Nt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,Y,0,0,0,xt.width,xt.height,rt.depth,Mt,Yt,xt.data):e.texImage3D(r.TEXTURE_2D_ARRAY,Y,gt,xt.width,xt.height,rt.depth,0,Mt,Yt,xt.data)}else{Ht&&ue&&e.texStorage2D(r.TEXTURE_2D,L,gt,Ut[0].width,Ut[0].height);for(let Y=0,$=Ut.length;Y<$;Y++)xt=Ut[Y],b.format!==pi?Mt!==null?Ht?Nt&&e.compressedTexSubImage2D(r.TEXTURE_2D,Y,0,0,xt.width,xt.height,Mt,xt.data):e.compressedTexImage2D(r.TEXTURE_2D,Y,gt,xt.width,xt.height,0,xt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ht?Nt&&e.texSubImage2D(r.TEXTURE_2D,Y,0,0,xt.width,xt.height,Mt,Yt,xt.data):e.texImage2D(r.TEXTURE_2D,Y,gt,xt.width,xt.height,0,Mt,Yt,xt.data)}else if(b.isDataArrayTexture)Ht?(ue&&e.texStorage3D(r.TEXTURE_2D_ARRAY,L,gt,rt.width,rt.height,rt.depth),Nt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,rt.width,rt.height,rt.depth,Mt,Yt,rt.data)):e.texImage3D(r.TEXTURE_2D_ARRAY,0,gt,rt.width,rt.height,rt.depth,0,Mt,Yt,rt.data);else if(b.isData3DTexture)Ht?(ue&&e.texStorage3D(r.TEXTURE_3D,L,gt,rt.width,rt.height,rt.depth),Nt&&e.texSubImage3D(r.TEXTURE_3D,0,0,0,0,rt.width,rt.height,rt.depth,Mt,Yt,rt.data)):e.texImage3D(r.TEXTURE_3D,0,gt,rt.width,rt.height,rt.depth,0,Mt,Yt,rt.data);else if(b.isFramebufferTexture){if(ue)if(Ht)e.texStorage2D(r.TEXTURE_2D,L,gt,rt.width,rt.height);else{let Y=rt.width,$=rt.height;for(let ot=0;ot<L;ot++)e.texImage2D(r.TEXTURE_2D,ot,gt,Y,$,0,Mt,Yt,null),Y>>=1,$>>=1}}else if(Ut.length>0){if(Ht&&ue){let Y=jt(Ut[0]);e.texStorage2D(r.TEXTURE_2D,L,gt,Y.width,Y.height)}for(let Y=0,$=Ut.length;Y<$;Y++)xt=Ut[Y],Ht?Nt&&e.texSubImage2D(r.TEXTURE_2D,Y,0,0,Mt,Yt,xt):e.texImage2D(r.TEXTURE_2D,Y,gt,Mt,Yt,xt);b.generateMipmaps=!1}else if(Ht){if(ue){let Y=jt(rt);e.texStorage2D(r.TEXTURE_2D,L,gt,Y.width,Y.height)}Nt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,Mt,Yt,rt)}else e.texImage2D(r.TEXTURE_2D,0,gt,Mt,Yt,rt);p(b)&&m(K),mt.__version=et.version,b.onUpdate&&b.onUpdate(b)}C.__version=b.version}function Zt(C,b,W){if(b.image.length!==6)return;let K=at(C,b),j=b.source;e.bindTexture(r.TEXTURE_CUBE_MAP,C.__webglTexture,r.TEXTURE0+W);let et=n.get(j);if(j.version!==et.__version||K===!0){e.activeTexture(r.TEXTURE0+W);let mt=he.getPrimaries(he.workingColorSpace),lt=b.colorSpace===er?null:he.getPrimaries(b.colorSpace),it=b.colorSpace===er||mt===lt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,b.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,it);let Lt=b.isCompressedTexture||b.image[0].isCompressedTexture,rt=b.image[0]&&b.image[0].isDataTexture,Mt=[];for(let $=0;$<6;$++)!Lt&&!rt?Mt[$]=g(b.image[$],!0,i.maxCubemapSize):Mt[$]=rt?b.image[$].image:b.image[$],Mt[$]=z(b,Mt[$]);let Yt=Mt[0],gt=s.convert(b.format,b.colorSpace),xt=s.convert(b.type),Ut=S(b.internalFormat,gt,xt,b.colorSpace),Ht=b.isVideoTexture!==!0,ue=et.__version===void 0||K===!0,Nt=j.dataReady,L=v(b,Yt);A(r.TEXTURE_CUBE_MAP,b);let Y;if(Lt){Ht&&ue&&e.texStorage2D(r.TEXTURE_CUBE_MAP,L,Ut,Yt.width,Yt.height);for(let $=0;$<6;$++){Y=Mt[$].mipmaps;for(let ot=0;ot<Y.length;ot++){let ct=Y[ot];b.format!==pi?gt!==null?Ht?Nt&&e.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,ot,0,0,ct.width,ct.height,gt,ct.data):e.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,ot,Ut,ct.width,ct.height,0,ct.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Ht?Nt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,ot,0,0,ct.width,ct.height,gt,xt,ct.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,ot,Ut,ct.width,ct.height,0,gt,xt,ct.data)}}}else{if(Y=b.mipmaps,Ht&&ue){Y.length>0&&L++;let $=jt(Mt[0]);e.texStorage2D(r.TEXTURE_CUBE_MAP,L,Ut,$.width,$.height)}for(let $=0;$<6;$++)if(rt){Ht?Nt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,0,0,0,Mt[$].width,Mt[$].height,gt,xt,Mt[$].data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,0,Ut,Mt[$].width,Mt[$].height,0,gt,xt,Mt[$].data);for(let ot=0;ot<Y.length;ot++){let Vt=Y[ot].image[$].image;Ht?Nt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,ot+1,0,0,Vt.width,Vt.height,gt,xt,Vt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,ot+1,Ut,Vt.width,Vt.height,0,gt,xt,Vt.data)}}else{Ht?Nt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,0,0,0,gt,xt,Mt[$]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,0,Ut,gt,xt,Mt[$]);for(let ot=0;ot<Y.length;ot++){let ct=Y[ot];Ht?Nt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,ot+1,0,0,gt,xt,ct.image[$]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+$,ot+1,Ut,gt,xt,ct.image[$])}}}p(b)&&m(r.TEXTURE_CUBE_MAP),et.__version=j.version,b.onUpdate&&b.onUpdate(b)}C.__version=b.version}function X(C,b,W,K,j,et){let mt=s.convert(W.format,W.colorSpace),lt=s.convert(W.type),it=S(W.internalFormat,mt,lt,W.colorSpace);if(!n.get(b).__hasExternalTextures){let rt=Math.max(1,b.width>>et),Mt=Math.max(1,b.height>>et);j===r.TEXTURE_3D||j===r.TEXTURE_2D_ARRAY?e.texImage3D(j,et,it,rt,Mt,b.depth,0,mt,lt,null):e.texImage2D(j,et,it,rt,Mt,0,mt,lt,null)}e.bindFramebuffer(r.FRAMEBUFFER,C),Ft(b)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,K,j,n.get(W).__webglTexture,0,_t(b)):(j===r.TEXTURE_2D||j>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&j<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,K,j,n.get(W).__webglTexture,et),e.bindFramebuffer(r.FRAMEBUFFER,null)}function tt(C,b,W){if(r.bindRenderbuffer(r.RENDERBUFFER,C),b.depthBuffer&&!b.stencilBuffer){let K=r.DEPTH_COMPONENT24;if(W||Ft(b)){let j=b.depthTexture;j&&j.isDepthTexture&&(j.type===nr?K=r.DEPTH_COMPONENT32F:j.type===ks&&(K=r.DEPTH_COMPONENT24));let et=_t(b);Ft(b)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,et,K,b.width,b.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,et,K,b.width,b.height)}else r.renderbufferStorage(r.RENDERBUFFER,K,b.width,b.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,C)}else if(b.depthBuffer&&b.stencilBuffer){let K=_t(b);W&&Ft(b)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,K,r.DEPTH24_STENCIL8,b.width,b.height):Ft(b)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,K,r.DEPTH24_STENCIL8,b.width,b.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,C)}else{let K=b.textures;for(let j=0;j<K.length;j++){let et=K[j],mt=s.convert(et.format,et.colorSpace),lt=s.convert(et.type),it=S(et.internalFormat,mt,lt,et.colorSpace),Lt=_t(b);W&&Ft(b)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Lt,it,b.width,b.height):Ft(b)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Lt,it,b.width,b.height):r.renderbufferStorage(r.RENDERBUFFER,it,b.width,b.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function ft(C,b){if(b&&b.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(r.FRAMEBUFFER,C),!(b.depthTexture&&b.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(b.depthTexture).__webglTexture||b.depthTexture.image.width!==b.width||b.depthTexture.image.height!==b.height)&&(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0),R(b.depthTexture,0);let K=n.get(b.depthTexture).__webglTexture,j=_t(b);if(b.depthTexture.format===Us)Ft(b)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,K,0,j):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,K,0);else if(b.depthTexture.format===Pa)Ft(b)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,K,0,j):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,K,0);else throw new Error("Unknown depthTexture format")}function nt(C){let b=n.get(C),W=C.isWebGLCubeRenderTarget===!0;if(C.depthTexture&&!b.__autoAllocateDepthBuffer){if(W)throw new Error("target.depthTexture not supported in Cube render targets");ft(b.__webglFramebuffer,C)}else if(W){b.__webglDepthbuffer=[];for(let K=0;K<6;K++)e.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer[K]),b.__webglDepthbuffer[K]=r.createRenderbuffer(),tt(b.__webglDepthbuffer[K],C,!1)}else e.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer=r.createRenderbuffer(),tt(b.__webglDepthbuffer,C,!1);e.bindFramebuffer(r.FRAMEBUFFER,null)}function It(C,b,W){let K=n.get(C);b!==void 0&&X(K.__webglFramebuffer,C,C.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),W!==void 0&&nt(C)}function Rt(C){let b=C.texture,W=n.get(C),K=n.get(b);C.addEventListener("dispose",D);let j=C.textures,et=C.isWebGLCubeRenderTarget===!0,mt=j.length>1;if(mt||(K.__webglTexture===void 0&&(K.__webglTexture=r.createTexture()),K.__version=b.version,a.memory.textures++),et){W.__webglFramebuffer=[];for(let lt=0;lt<6;lt++)if(b.mipmaps&&b.mipmaps.length>0){W.__webglFramebuffer[lt]=[];for(let it=0;it<b.mipmaps.length;it++)W.__webglFramebuffer[lt][it]=r.createFramebuffer()}else W.__webglFramebuffer[lt]=r.createFramebuffer()}else{if(b.mipmaps&&b.mipmaps.length>0){W.__webglFramebuffer=[];for(let lt=0;lt<b.mipmaps.length;lt++)W.__webglFramebuffer[lt]=r.createFramebuffer()}else W.__webglFramebuffer=r.createFramebuffer();if(mt)for(let lt=0,it=j.length;lt<it;lt++){let Lt=n.get(j[lt]);Lt.__webglTexture===void 0&&(Lt.__webglTexture=r.createTexture(),a.memory.textures++)}if(C.samples>0&&Ft(C)===!1){W.__webglMultisampledFramebuffer=r.createFramebuffer(),W.__webglColorRenderbuffer=[],e.bindFramebuffer(r.FRAMEBUFFER,W.__webglMultisampledFramebuffer);for(let lt=0;lt<j.length;lt++){let it=j[lt];W.__webglColorRenderbuffer[lt]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,W.__webglColorRenderbuffer[lt]);let Lt=s.convert(it.format,it.colorSpace),rt=s.convert(it.type),Mt=S(it.internalFormat,Lt,rt,it.colorSpace,C.isXRRenderTarget===!0),Yt=_t(C);r.renderbufferStorageMultisample(r.RENDERBUFFER,Yt,Mt,C.width,C.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.RENDERBUFFER,W.__webglColorRenderbuffer[lt])}r.bindRenderbuffer(r.RENDERBUFFER,null),C.depthBuffer&&(W.__webglDepthRenderbuffer=r.createRenderbuffer(),tt(W.__webglDepthRenderbuffer,C,!0)),e.bindFramebuffer(r.FRAMEBUFFER,null)}}if(et){e.bindTexture(r.TEXTURE_CUBE_MAP,K.__webglTexture),A(r.TEXTURE_CUBE_MAP,b);for(let lt=0;lt<6;lt++)if(b.mipmaps&&b.mipmaps.length>0)for(let it=0;it<b.mipmaps.length;it++)X(W.__webglFramebuffer[lt][it],C,b,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+lt,it);else X(W.__webglFramebuffer[lt],C,b,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0);p(b)&&m(r.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(mt){for(let lt=0,it=j.length;lt<it;lt++){let Lt=j[lt],rt=n.get(Lt);e.bindTexture(r.TEXTURE_2D,rt.__webglTexture),A(r.TEXTURE_2D,Lt),X(W.__webglFramebuffer,C,Lt,r.COLOR_ATTACHMENT0+lt,r.TEXTURE_2D,0),p(Lt)&&m(r.TEXTURE_2D)}e.unbindTexture()}else{let lt=r.TEXTURE_2D;if((C.isWebGL3DRenderTarget||C.isWebGLArrayRenderTarget)&&(lt=C.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),e.bindTexture(lt,K.__webglTexture),A(lt,b),b.mipmaps&&b.mipmaps.length>0)for(let it=0;it<b.mipmaps.length;it++)X(W.__webglFramebuffer[it],C,b,r.COLOR_ATTACHMENT0,lt,it);else X(W.__webglFramebuffer,C,b,r.COLOR_ATTACHMENT0,lt,0);p(b)&&m(lt),e.unbindTexture()}C.depthBuffer&&nt(C)}function O(C){let b=C.textures;for(let W=0,K=b.length;W<K;W++){let j=b[W];if(p(j)){let et=C.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,mt=n.get(j).__webglTexture;e.bindTexture(et,mt),m(et),e.unbindTexture()}}}let Gt=[],St=[];function Et(C){if(C.samples>0){if(Ft(C)===!1){let b=C.textures,W=C.width,K=C.height,j=r.COLOR_BUFFER_BIT,et=C.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,mt=n.get(C),lt=b.length>1;if(lt)for(let it=0;it<b.length;it++)e.bindFramebuffer(r.FRAMEBUFFER,mt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+it,r.RENDERBUFFER,null),e.bindFramebuffer(r.FRAMEBUFFER,mt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+it,r.TEXTURE_2D,null,0);e.bindFramebuffer(r.READ_FRAMEBUFFER,mt.__webglMultisampledFramebuffer),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,mt.__webglFramebuffer);for(let it=0;it<b.length;it++){if(C.resolveDepthBuffer&&(C.depthBuffer&&(j|=r.DEPTH_BUFFER_BIT),C.stencilBuffer&&C.resolveStencilBuffer&&(j|=r.STENCIL_BUFFER_BIT)),lt){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,mt.__webglColorRenderbuffer[it]);let Lt=n.get(b[it]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Lt,0)}r.blitFramebuffer(0,0,W,K,0,0,W,K,j,r.NEAREST),l===!0&&(Gt.length=0,St.length=0,Gt.push(r.COLOR_ATTACHMENT0+it),C.depthBuffer&&C.resolveDepthBuffer===!1&&(Gt.push(et),St.push(et),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,St)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Gt))}if(e.bindFramebuffer(r.READ_FRAMEBUFFER,null),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),lt)for(let it=0;it<b.length;it++){e.bindFramebuffer(r.FRAMEBUFFER,mt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+it,r.RENDERBUFFER,mt.__webglColorRenderbuffer[it]);let Lt=n.get(b[it]).__webglTexture;e.bindFramebuffer(r.FRAMEBUFFER,mt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+it,r.TEXTURE_2D,Lt,0)}e.bindFramebuffer(r.DRAW_FRAMEBUFFER,mt.__webglMultisampledFramebuffer)}else if(C.depthBuffer&&C.resolveDepthBuffer===!1&&l){let b=C.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[b])}}}function _t(C){return Math.min(i.maxSamples,C.samples)}function Ft(C){let b=n.get(C);return C.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function Pt(C){let b=a.render.frame;u.get(C)!==b&&(u.set(C,b),C.update())}function z(C,b){let W=C.colorSpace,K=C.format,j=C.type;return C.isCompressedTexture===!0||C.isVideoTexture===!0||W!==hr&&W!==er&&(he.getTransfer(W)===_e?(K!==pi||j!==lr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",W)),b}function jt(C){return typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement?(c.width=C.naturalWidth||C.width,c.height=C.naturalHeight||C.height):typeof VideoFrame<"u"&&C instanceof VideoFrame?(c.width=C.displayWidth,c.height=C.displayHeight):(c.width=C.width,c.height=C.height),c}this.allocateTextureUnit=F,this.resetTextureUnits=x,this.setTexture2D=R,this.setTexture2DArray=B,this.setTexture3D=G,this.setTextureCube=Z,this.rebindTextures=It,this.setupRenderTarget=Rt,this.updateRenderTargetMipmap=O,this.updateMultisampleRenderTarget=Et,this.setupDepthRenderbuffer=nt,this.setupFrameBufferTexture=X,this.useMultisampledRTT=Ft}function mS(r,t){function e(n,i=er){let s,a=he.getTransfer(i);if(n===lr)return r.UNSIGNED_BYTE;if(n===am)return r.UNSIGNED_SHORT_4_4_4_4;if(n===om)return r.UNSIGNED_SHORT_5_5_5_1;if(n===c0)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===o0)return r.BYTE;if(n===l0)return r.SHORT;if(n===rm)return r.UNSIGNED_SHORT;if(n===sm)return r.INT;if(n===ks)return r.UNSIGNED_INT;if(n===nr)return r.FLOAT;if(n===Al)return r.HALF_FLOAT;if(n===u0)return r.ALPHA;if(n===h0)return r.RGB;if(n===pi)return r.RGBA;if(n===f0)return r.LUMINANCE;if(n===d0)return r.LUMINANCE_ALPHA;if(n===Us)return r.DEPTH_COMPONENT;if(n===Pa)return r.DEPTH_STENCIL;if(n===p0)return r.RED;if(n===lm)return r.RED_INTEGER;if(n===m0)return r.RG;if(n===cm)return r.RG_INTEGER;if(n===um)return r.RGBA_INTEGER;if(n===Kc||n===Qc||n===jc||n===tu)if(a===_e)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Kc)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Qc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===jc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===tu)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Kc)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Qc)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===jc)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===tu)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Ld||n===Fd||n===Ud||n===Nd)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===Ld)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Fd)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ud)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Nd)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Od||n===Bd||n===zd)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Od||n===Bd)return a===_e?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===zd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===kd||n===Vd||n===Hd||n===Gd||n===Wd||n===Xd||n===qd||n===Yd||n===Zd||n===Jd||n===$d||n===Kd||n===Qd||n===jd)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===kd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Vd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Hd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Gd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Wd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Xd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===qd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Yd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Zd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Jd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===$d)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Kd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Qd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===jd)return a===_e?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===eu||n===tp||n===ep)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===eu)return a===_e?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===tp)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===ep)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===g0||n===np||n===ip||n===rp)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===eu)return s.COMPRESSED_RED_RGTC1_EXT;if(n===np)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ip)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===rp)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Ua?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:e}}var $u=class extends _n{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},ir=class extends sn{constructor(){super(),this.isGroup=!0,this.type="Group"}},gS={type:"move"},Ra=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ir,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 ir,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ir,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new q),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,s=null,a=null,o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(let g of t.hand.values()){let p=e.getJointPose(g,n),m=this._getHandJoint(c,g);p!==null&&(m.matrix.fromArray(p.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=p.radius),m.visible=p!==null}let u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=u.position.distanceTo(f.position),d=.02,_=.005;c.inputState.pinching&&h>d+_?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&h<=d-_&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(gS)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new ir;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},_S=`
3797
+ }`;function IS(r,t,e){let n=new Bo,i=new oe,s=new oe,o=new Xe,a=new th({depthPacking:B0}),l=new eh,c={},u=e.maxTextureSize,h={[lr]:Tn,[Tn]:lr,[Fi]:Fi},f=new Zn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new oe},radius:{value:4}},vertexShader:RS,fragmentShader:PS}),d=f.clone();d.defines.HORIZONTAL_PASS=1;let _=new mi;_.setAttribute("position",new Xn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new ii(_,f),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=fm;let m=this.type;this.render=function(T,E,R){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||T.length===0)return;let y=r.getRenderTarget(),x=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),F=r.state;F.setBlending(sr),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);let P=m!==Ii&&this.type===Ii,B=m===Ii&&this.type!==Ii;for(let X=0,G=T.length;X<G;X++){let J=T[X],U=J.shadow;if(U===void 0){console.warn("THREE.WebGLShadowMap:",J,"has no shadow.");continue}if(U.autoUpdate===!1&&U.needsUpdate===!1)continue;i.copy(U.mapSize);let I=U.getFrameExtents();if(i.multiply(I),s.copy(U.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/I.x),i.x=s.x*I.x,U.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/I.y),i.y=s.y*I.y,U.mapSize.y=s.y)),U.map===null||P===!0||B===!0){let it=this.type!==Ii?{minFilter:Wn,magFilter:Wn}:{};U.map!==null&&U.map.dispose(),U.map=new Ui(i.x,i.y,it),U.map.texture.name=J.name+".shadowMap",U.camera.updateProjectionMatrix()}r.setRenderTarget(U.map),r.clear();let A=U.getViewportCount();for(let it=0;it<A;it++){let vt=U.getViewport(it);o.set(s.x*vt.x,s.y*vt.y,s.x*vt.z,s.y*vt.w),F.viewport(o),U.updateMatrices(J,it),n=U.getFrustum(),M(E,R,U.camera,J,this.type)}U.isPointLightShadow!==!0&&this.type===Ii&&S(U,R),U.needsUpdate=!1}m=this.type,p.needsUpdate=!1,r.setRenderTarget(y,x,L)};function S(T,E){let R=t.update(g);f.defines.VSM_SAMPLES!==T.blurSamples&&(f.defines.VSM_SAMPLES=T.blurSamples,d.defines.VSM_SAMPLES=T.blurSamples,f.needsUpdate=!0,d.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new Ui(i.x,i.y)),f.uniforms.shadow_pass.value=T.map.texture,f.uniforms.resolution.value=T.mapSize,f.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(E,null,R,f,g,null),d.uniforms.shadow_pass.value=T.mapPass.texture,d.uniforms.resolution.value=T.mapSize,d.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(E,null,R,d,g,null)}function v(T,E,R,y){let x=null,L=R.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(L!==void 0)x=L;else if(x=R.isPointLight===!0?l:a,r.localClippingEnabled&&E.clipShadows===!0&&Array.isArray(E.clippingPlanes)&&E.clippingPlanes.length!==0||E.displacementMap&&E.displacementScale!==0||E.alphaMap&&E.alphaTest>0||E.map&&E.alphaTest>0){let F=x.uuid,P=E.uuid,B=c[F];B===void 0&&(B={},c[F]=B);let X=B[P];X===void 0&&(X=x.clone(),B[P]=X,E.addEventListener("dispose",D)),x=X}if(x.visible=E.visible,x.wireframe=E.wireframe,y===Ii?x.side=E.shadowSide!==null?E.shadowSide:E.side:x.side=E.shadowSide!==null?E.shadowSide:h[E.side],x.alphaMap=E.alphaMap,x.alphaTest=E.alphaTest,x.map=E.map,x.clipShadows=E.clipShadows,x.clippingPlanes=E.clippingPlanes,x.clipIntersection=E.clipIntersection,x.displacementMap=E.displacementMap,x.displacementScale=E.displacementScale,x.displacementBias=E.displacementBias,x.wireframeLinewidth=E.wireframeLinewidth,x.linewidth=E.linewidth,R.isPointLight===!0&&x.isMeshDistanceMaterial===!0){let F=r.properties.get(x);F.light=R}return x}function M(T,E,R,y,x){if(T.visible===!1)return;if(T.layers.test(E.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&x===Ii)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,T.matrixWorld);let P=t.update(T),B=T.material;if(Array.isArray(B)){let X=P.groups;for(let G=0,J=X.length;G<J;G++){let U=X[G],I=B[U.materialIndex];if(I&&I.visible){let A=v(T,I,y,x);T.onBeforeShadow(r,T,E,R,P,A,U),r.renderBufferDirect(R,null,P,A,T,U),T.onAfterShadow(r,T,E,R,P,A,U)}}}else if(B.visible){let X=v(T,B,y,x);T.onBeforeShadow(r,T,E,R,P,X,null),r.renderBufferDirect(R,null,P,X,T,null),T.onAfterShadow(r,T,E,R,P,X,null)}}let F=T.children;for(let P=0,B=F.length;P<B;P++)M(F[P],E,R,y,x)}function D(T){T.target.removeEventListener("dispose",D);for(let R in c){let y=c[R],x=T.target.uuid;x in y&&(y[x].dispose(),delete y[x])}}}function LS(r){function t(){let N=!1,$=new Xe,K=null,at=new Xe(0,0,0,0);return{setMask:function(ut){K!==ut&&!N&&(r.colorMask(ut,ut,ut,ut),K=ut)},setLocked:function(ut){N=ut},setClear:function(ut,Vt,se,ce,pe){pe===!0&&(ut*=ce,Vt*=ce,se*=ce),$.set(ut,Vt,se,ce),at.equals($)===!1&&(r.clearColor(ut,Vt,se,ce),at.copy($))},reset:function(){N=!1,K=null,at.set(-1,0,0,0)}}}function e(){let N=!1,$=null,K=null,at=null;return{setTest:function(ut){ut?ct(r.DEPTH_TEST):tt(r.DEPTH_TEST)},setMask:function(ut){$!==ut&&!N&&(r.depthMask(ut),$=ut)},setFunc:function(ut){if(K!==ut){switch(ut){case u0:r.depthFunc(r.NEVER);break;case h0:r.depthFunc(r.ALWAYS);break;case f0:r.depthFunc(r.LESS);break;case il:r.depthFunc(r.LEQUAL);break;case d0:r.depthFunc(r.EQUAL);break;case p0:r.depthFunc(r.GEQUAL);break;case m0:r.depthFunc(r.GREATER);break;case g0:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}K=ut}},setLocked:function(ut){N=ut},setClear:function(ut){at!==ut&&(r.clearDepth(ut),at=ut)},reset:function(){N=!1,$=null,K=null,at=null}}}function n(){let N=!1,$=null,K=null,at=null,ut=null,Vt=null,se=null,ce=null,pe=null;return{setTest:function(te){N||(te?ct(r.STENCIL_TEST):tt(r.STENCIL_TEST))},setMask:function(te){$!==te&&!N&&(r.stencilMask(te),$=te)},setFunc:function(te,Ct,yt){(K!==te||at!==Ct||ut!==yt)&&(r.stencilFunc(te,Ct,yt),K=te,at=Ct,ut=yt)},setOp:function(te,Ct,yt){(Vt!==te||se!==Ct||ce!==yt)&&(r.stencilOp(te,Ct,yt),Vt=te,se=Ct,ce=yt)},setLocked:function(te){N=te},setClear:function(te){pe!==te&&(r.clearStencil(te),pe=te)},reset:function(){N=!1,$=null,K=null,at=null,ut=null,Vt=null,se=null,ce=null,pe=null}}}let i=new t,s=new e,o=new n,a=new WeakMap,l=new WeakMap,c={},u={},h=new WeakMap,f=[],d=null,_=!1,g=null,p=null,m=null,S=null,v=null,M=null,D=null,T=new re(0,0,0),E=0,R=!1,y=null,x=null,L=null,F=null,P=null,B=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS),X=!1,G=0,J=r.getParameter(r.VERSION);J.indexOf("WebGL")!==-1?(G=parseFloat(/^WebGL (\d)/.exec(J)[1]),X=G>=1):J.indexOf("OpenGL ES")!==-1&&(G=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),X=G>=2);let U=null,I={},A=r.getParameter(r.SCISSOR_BOX),it=r.getParameter(r.VIEWPORT),vt=new Xe().fromArray(A),Wt=new Xe().fromArray(it);function q(N,$,K,at){let ut=new Uint8Array(4),Vt=r.createTexture();r.bindTexture(N,Vt),r.texParameteri(N,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(N,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let se=0;se<K;se++)N===r.TEXTURE_3D||N===r.TEXTURE_2D_ARRAY?r.texImage3D($,0,r.RGBA,1,1,at,0,r.RGBA,r.UNSIGNED_BYTE,ut):r.texImage2D($+se,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,ut);return Vt}let Q={};Q[r.TEXTURE_2D]=q(r.TEXTURE_2D,r.TEXTURE_2D,1),Q[r.TEXTURE_CUBE_MAP]=q(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),Q[r.TEXTURE_2D_ARRAY]=q(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),Q[r.TEXTURE_3D]=q(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),ct(r.DEPTH_TEST),s.setFunc(il),Ft(!1),Pt(kd),ct(r.CULL_FACE),wt(sr);function ct(N){c[N]!==!0&&(r.enable(N),c[N]=!0)}function tt(N){c[N]!==!1&&(r.disable(N),c[N]=!1)}function It(N,$){return u[N]!==$?(r.bindFramebuffer(N,$),u[N]=$,N===r.DRAW_FRAMEBUFFER&&(u[r.FRAMEBUFFER]=$),N===r.FRAMEBUFFER&&(u[r.DRAW_FRAMEBUFFER]=$),!0):!1}function Rt(N,$){let K=f,at=!1;if(N){K=h.get($),K===void 0&&(K=[],h.set($,K));let ut=N.textures;if(K.length!==ut.length||K[0]!==r.COLOR_ATTACHMENT0){for(let Vt=0,se=ut.length;Vt<se;Vt++)K[Vt]=r.COLOR_ATTACHMENT0+Vt;K.length=ut.length,at=!0}}else K[0]!==r.BACK&&(K[0]=r.BACK,at=!0);at&&r.drawBuffers(K)}function z(N){return d!==N?(r.useProgram(N),d=N,!0):!1}let Xt={[Gr]:r.FUNC_ADD,[Y_]:r.FUNC_SUBTRACT,[Z_]:r.FUNC_REVERSE_SUBTRACT};Xt[J_]=r.MIN,Xt[$_]=r.MAX;let bt={[K_]:r.ZERO,[Q_]:r.ONE,[j_]:r.SRC_COLOR,[Uu]:r.SRC_ALPHA,[s0]:r.SRC_ALPHA_SATURATE,[i0]:r.DST_COLOR,[e0]:r.DST_ALPHA,[t0]:r.ONE_MINUS_SRC_COLOR,[Ou]:r.ONE_MINUS_SRC_ALPHA,[r0]:r.ONE_MINUS_DST_COLOR,[n0]:r.ONE_MINUS_DST_ALPHA,[o0]:r.CONSTANT_COLOR,[a0]:r.ONE_MINUS_CONSTANT_COLOR,[l0]:r.CONSTANT_ALPHA,[c0]:r.ONE_MINUS_CONSTANT_ALPHA};function wt(N,$,K,at,ut,Vt,se,ce,pe,te){if(N===sr){_===!0&&(tt(r.BLEND),_=!1);return}if(_===!1&&(ct(r.BLEND),_=!0),N!==q_){if(N!==g||te!==R){if((p!==Gr||v!==Gr)&&(r.blendEquation(r.FUNC_ADD),p=Gr,v=Gr),te)switch(N){case or:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Vd:r.blendFunc(r.ONE,r.ONE);break;case Hd:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Gd:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",N);break}else switch(N){case or:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Vd:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Hd:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Gd:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",N);break}m=null,S=null,M=null,D=null,T.set(0,0,0),E=0,g=N,R=te}return}ut=ut||$,Vt=Vt||K,se=se||at,($!==p||ut!==v)&&(r.blendEquationSeparate(Xt[$],Xt[ut]),p=$,v=ut),(K!==m||at!==S||Vt!==M||se!==D)&&(r.blendFuncSeparate(bt[K],bt[at],bt[Vt],bt[se]),m=K,S=at,M=Vt,D=se),(ce.equals(T)===!1||pe!==E)&&(r.blendColor(ce.r,ce.g,ce.b,pe),T.copy(ce),E=pe),g=N,R=!1}function _t(N,$){N.side===Fi?tt(r.CULL_FACE):ct(r.CULL_FACE);let K=N.side===Tn;$&&(K=!K),Ft(K),N.blending===or&&N.transparent===!1?wt(sr):wt(N.blending,N.blendEquation,N.blendSrc,N.blendDst,N.blendEquationAlpha,N.blendSrcAlpha,N.blendDstAlpha,N.blendColor,N.blendAlpha,N.premultipliedAlpha),s.setFunc(N.depthFunc),s.setTest(N.depthTest),s.setMask(N.depthWrite),i.setMask(N.colorWrite);let at=N.stencilWrite;o.setTest(at),at&&(o.setMask(N.stencilWriteMask),o.setFunc(N.stencilFunc,N.stencilRef,N.stencilFuncMask),o.setOp(N.stencilFail,N.stencilZFail,N.stencilZPass)),jt(N.polygonOffset,N.polygonOffsetFactor,N.polygonOffsetUnits),N.alphaToCoverage===!0?ct(r.SAMPLE_ALPHA_TO_COVERAGE):tt(r.SAMPLE_ALPHA_TO_COVERAGE)}function Ft(N){y!==N&&(N?r.frontFace(r.CW):r.frontFace(r.CCW),y=N)}function Pt(N){N!==W_?(ct(r.CULL_FACE),N!==x&&(N===kd?r.cullFace(r.BACK):N===X_?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):tt(r.CULL_FACE),x=N}function k(N){N!==L&&(X&&r.lineWidth(N),L=N)}function jt(N,$,K){N?(ct(r.POLYGON_OFFSET_FILL),(F!==$||P!==K)&&(r.polygonOffset($,K),F=$,P=K)):tt(r.POLYGON_OFFSET_FILL)}function C(N){N?ct(r.SCISSOR_TEST):tt(r.SCISSOR_TEST)}function b(N){N===void 0&&(N=r.TEXTURE0+B-1),U!==N&&(r.activeTexture(N),U=N)}function Y(N,$,K){K===void 0&&(U===null?K=r.TEXTURE0+B-1:K=U);let at=I[K];at===void 0&&(at={type:void 0,texture:void 0},I[K]=at),(at.type!==N||at.texture!==$)&&(U!==K&&(r.activeTexture(K),U=K),r.bindTexture(N,$||Q[N]),at.type=N,at.texture=$)}function j(){let N=I[U];N!==void 0&&N.type!==void 0&&(r.bindTexture(N.type,null),N.type=void 0,N.texture=void 0)}function et(){try{r.compressedTexImage2D.apply(r,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function nt(){try{r.compressedTexImage3D.apply(r,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function mt(){try{r.texSubImage2D.apply(r,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function lt(){try{r.texSubImage3D.apply(r,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function rt(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function Lt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function st(){try{r.texStorage2D.apply(r,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function St(){try{r.texStorage3D.apply(r,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function Jt(){try{r.texImage2D.apply(r,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function gt(){try{r.texImage3D.apply(r,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function xt(N){vt.equals(N)===!1&&(r.scissor(N.x,N.y,N.z,N.w),vt.copy(N))}function Nt(N){Wt.equals(N)===!1&&(r.viewport(N.x,N.y,N.z,N.w),Wt.copy(N))}function Gt(N,$){let K=l.get($);K===void 0&&(K=new WeakMap,l.set($,K));let at=K.get(N);at===void 0&&(at=r.getUniformBlockIndex($,N.name),K.set(N,at))}function ue(N,$){let at=l.get($).get(N);a.get($)!==at&&(r.uniformBlockBinding($,at,N.__bindingPointIndex),a.set($,at))}function Ut(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),c={},U=null,I={},u={},h=new WeakMap,f=[],d=null,_=!1,g=null,p=null,m=null,S=null,v=null,M=null,D=null,T=new re(0,0,0),E=0,R=!1,y=null,x=null,L=null,F=null,P=null,vt.set(0,0,r.canvas.width,r.canvas.height),Wt.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:ct,disable:tt,bindFramebuffer:It,drawBuffers:Rt,useProgram:z,setBlending:wt,setMaterial:_t,setFlipSided:Ft,setCullFace:Pt,setLineWidth:k,setPolygonOffset:jt,setScissorTest:C,activeTexture:b,bindTexture:Y,unbindTexture:j,compressedTexImage2D:et,compressedTexImage3D:nt,texImage2D:Jt,texImage3D:gt,updateUBOMapping:Gt,uniformBlockBinding:ue,texStorage2D:st,texStorage3D:St,texSubImage2D:mt,texSubImage3D:lt,compressedTexSubImage2D:rt,compressedTexSubImage3D:Lt,scissor:xt,viewport:Nt,reset:Ut}}function FS(r,t,e,n,i,s,o){let a=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new oe,u=new WeakMap,h,f=new WeakMap,d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(C,b){return d?new OffscreenCanvas(C,b):ul("canvas")}function g(C,b,Y){let j=1,et=jt(C);if((et.width>Y||et.height>Y)&&(j=Y/Math.max(et.width,et.height)),j<1)if(typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&C instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&C instanceof ImageBitmap||typeof VideoFrame<"u"&&C instanceof VideoFrame){let nt=Math.floor(j*et.width),mt=Math.floor(j*et.height);h===void 0&&(h=_(nt,mt));let lt=b?_(nt,mt):h;return lt.width=nt,lt.height=mt,lt.getContext("2d").drawImage(C,0,0,nt,mt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+et.width+"x"+et.height+") to ("+nt+"x"+mt+")."),lt}else return"data"in C&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+et.width+"x"+et.height+")."),C;return C}function p(C){return C.generateMipmaps&&C.minFilter!==Wn&&C.minFilter!==ni}function m(C){r.generateMipmap(C)}function S(C,b,Y,j,et=!1){if(C!==null){if(r[C]!==void 0)return r[C];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+C+"'")}let nt=b;if(b===r.RED&&(Y===r.FLOAT&&(nt=r.R32F),Y===r.HALF_FLOAT&&(nt=r.R16F),Y===r.UNSIGNED_BYTE&&(nt=r.R8)),b===r.RED_INTEGER&&(Y===r.UNSIGNED_BYTE&&(nt=r.R8UI),Y===r.UNSIGNED_SHORT&&(nt=r.R16UI),Y===r.UNSIGNED_INT&&(nt=r.R32UI),Y===r.BYTE&&(nt=r.R8I),Y===r.SHORT&&(nt=r.R16I),Y===r.INT&&(nt=r.R32I)),b===r.RG&&(Y===r.FLOAT&&(nt=r.RG32F),Y===r.HALF_FLOAT&&(nt=r.RG16F),Y===r.UNSIGNED_BYTE&&(nt=r.RG8)),b===r.RG_INTEGER&&(Y===r.UNSIGNED_BYTE&&(nt=r.RG8UI),Y===r.UNSIGNED_SHORT&&(nt=r.RG16UI),Y===r.UNSIGNED_INT&&(nt=r.RG32UI),Y===r.BYTE&&(nt=r.RG8I),Y===r.SHORT&&(nt=r.RG16I),Y===r.INT&&(nt=r.RG32I)),b===r.RGB&&Y===r.UNSIGNED_INT_5_9_9_9_REV&&(nt=r.RGB9_E5),b===r.RGBA){let mt=et?ol:fe.getTransfer(j);Y===r.FLOAT&&(nt=r.RGBA32F),Y===r.HALF_FLOAT&&(nt=r.RGBA16F),Y===r.UNSIGNED_BYTE&&(nt=mt===xe?r.SRGB8_ALPHA8:r.RGBA8),Y===r.UNSIGNED_SHORT_4_4_4_4&&(nt=r.RGBA4),Y===r.UNSIGNED_SHORT_5_5_5_1&&(nt=r.RGB5_A1)}return(nt===r.R16F||nt===r.R32F||nt===r.RG16F||nt===r.RG32F||nt===r.RGBA16F||nt===r.RGBA32F)&&t.get("EXT_color_buffer_float"),nt}function v(C,b){return p(C)===!0||C.isFramebufferTexture&&C.minFilter!==Wn&&C.minFilter!==ni?Math.log2(Math.max(b.width,b.height))+1:C.mipmaps!==void 0&&C.mipmaps.length>0?C.mipmaps.length:C.isCompressedTexture&&Array.isArray(C.image)?b.mipmaps.length:1}function M(C){let b=C.target;b.removeEventListener("dispose",M),T(b),b.isVideoTexture&&u.delete(b)}function D(C){let b=C.target;b.removeEventListener("dispose",D),R(b)}function T(C){let b=n.get(C);if(b.__webglInit===void 0)return;let Y=C.source,j=f.get(Y);if(j){let et=j[b.__cacheKey];et.usedTimes--,et.usedTimes===0&&E(C),Object.keys(j).length===0&&f.delete(Y)}n.remove(C)}function E(C){let b=n.get(C);r.deleteTexture(b.__webglTexture);let Y=C.source,j=f.get(Y);delete j[b.__cacheKey],o.memory.textures--}function R(C){let b=n.get(C);if(C.depthTexture&&C.depthTexture.dispose(),C.isWebGLCubeRenderTarget)for(let j=0;j<6;j++){if(Array.isArray(b.__webglFramebuffer[j]))for(let et=0;et<b.__webglFramebuffer[j].length;et++)r.deleteFramebuffer(b.__webglFramebuffer[j][et]);else r.deleteFramebuffer(b.__webglFramebuffer[j]);b.__webglDepthbuffer&&r.deleteRenderbuffer(b.__webglDepthbuffer[j])}else{if(Array.isArray(b.__webglFramebuffer))for(let j=0;j<b.__webglFramebuffer.length;j++)r.deleteFramebuffer(b.__webglFramebuffer[j]);else r.deleteFramebuffer(b.__webglFramebuffer);if(b.__webglDepthbuffer&&r.deleteRenderbuffer(b.__webglDepthbuffer),b.__webglMultisampledFramebuffer&&r.deleteFramebuffer(b.__webglMultisampledFramebuffer),b.__webglColorRenderbuffer)for(let j=0;j<b.__webglColorRenderbuffer.length;j++)b.__webglColorRenderbuffer[j]&&r.deleteRenderbuffer(b.__webglColorRenderbuffer[j]);b.__webglDepthRenderbuffer&&r.deleteRenderbuffer(b.__webglDepthRenderbuffer)}let Y=C.textures;for(let j=0,et=Y.length;j<et;j++){let nt=n.get(Y[j]);nt.__webglTexture&&(r.deleteTexture(nt.__webglTexture),o.memory.textures--),n.remove(Y[j])}n.remove(C)}let y=0;function x(){y=0}function L(){let C=y;return C>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+C+" texture units while this GPU supports only "+i.maxTextures),y+=1,C}function F(C){let b=[];return b.push(C.wrapS),b.push(C.wrapT),b.push(C.wrapR||0),b.push(C.magFilter),b.push(C.minFilter),b.push(C.anisotropy),b.push(C.internalFormat),b.push(C.format),b.push(C.type),b.push(C.generateMipmaps),b.push(C.premultiplyAlpha),b.push(C.flipY),b.push(C.unpackAlignment),b.push(C.colorSpace),b.join()}function P(C,b){let Y=n.get(C);if(C.isVideoTexture&&Pt(C),C.isRenderTargetTexture===!1&&C.version>0&&Y.__version!==C.version){let j=C.image;if(j===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(j.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{vt(Y,C,b);return}}e.bindTexture(r.TEXTURE_2D,Y.__webglTexture,r.TEXTURE0+b)}function B(C,b){let Y=n.get(C);if(C.version>0&&Y.__version!==C.version){vt(Y,C,b);return}e.bindTexture(r.TEXTURE_2D_ARRAY,Y.__webglTexture,r.TEXTURE0+b)}function X(C,b){let Y=n.get(C);if(C.version>0&&Y.__version!==C.version){vt(Y,C,b);return}e.bindTexture(r.TEXTURE_3D,Y.__webglTexture,r.TEXTURE0+b)}function G(C,b){let Y=n.get(C);if(C.version>0&&Y.__version!==C.version){Wt(Y,C,b);return}e.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture,r.TEXTURE0+b)}let J={[ku]:r.REPEAT,[Xr]:r.CLAMP_TO_EDGE,[Vu]:r.MIRRORED_REPEAT},U={[Wn]:r.NEAREST,[T0]:r.NEAREST_MIPMAP_NEAREST,[Ia]:r.NEAREST_MIPMAP_LINEAR,[ni]:r.LINEAR,[nu]:r.LINEAR_MIPMAP_NEAREST,[qr]:r.LINEAR_MIPMAP_LINEAR},I={[V0]:r.NEVER,[Y0]:r.ALWAYS,[H0]:r.LESS,[Sm]:r.LEQUAL,[G0]:r.EQUAL,[q0]:r.GEQUAL,[W0]:r.GREATER,[X0]:r.NOTEQUAL};function A(C,b){if(b.type===ir&&t.has("OES_texture_float_linear")===!1&&(b.magFilter===ni||b.magFilter===nu||b.magFilter===Ia||b.magFilter===qr||b.minFilter===ni||b.minFilter===nu||b.minFilter===Ia||b.minFilter===qr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(C,r.TEXTURE_WRAP_S,J[b.wrapS]),r.texParameteri(C,r.TEXTURE_WRAP_T,J[b.wrapT]),(C===r.TEXTURE_3D||C===r.TEXTURE_2D_ARRAY)&&r.texParameteri(C,r.TEXTURE_WRAP_R,J[b.wrapR]),r.texParameteri(C,r.TEXTURE_MAG_FILTER,U[b.magFilter]),r.texParameteri(C,r.TEXTURE_MIN_FILTER,U[b.minFilter]),b.compareFunction&&(r.texParameteri(C,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(C,r.TEXTURE_COMPARE_FUNC,I[b.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Wn||b.minFilter!==Ia&&b.minFilter!==qr||b.type===ir&&t.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||n.get(b).__currentAnisotropy){let Y=t.get("EXT_texture_filter_anisotropic");r.texParameterf(C,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,i.getMaxAnisotropy())),n.get(b).__currentAnisotropy=b.anisotropy}}}function it(C,b){let Y=!1;C.__webglInit===void 0&&(C.__webglInit=!0,b.addEventListener("dispose",M));let j=b.source,et=f.get(j);et===void 0&&(et={},f.set(j,et));let nt=F(b);if(nt!==C.__cacheKey){et[nt]===void 0&&(et[nt]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,Y=!0),et[nt].usedTimes++;let mt=et[C.__cacheKey];mt!==void 0&&(et[C.__cacheKey].usedTimes--,mt.usedTimes===0&&E(b)),C.__cacheKey=nt,C.__webglTexture=et[nt].texture}return Y}function vt(C,b,Y){let j=r.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(j=r.TEXTURE_2D_ARRAY),b.isData3DTexture&&(j=r.TEXTURE_3D);let et=it(C,b),nt=b.source;e.bindTexture(j,C.__webglTexture,r.TEXTURE0+Y);let mt=n.get(nt);if(nt.version!==mt.__version||et===!0){e.activeTexture(r.TEXTURE0+Y);let lt=fe.getPrimaries(fe.workingColorSpace),rt=b.colorSpace===nr?null:fe.getPrimaries(b.colorSpace),Lt=b.colorSpace===nr||lt===rt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,b.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Lt);let st=g(b.image,!1,i.maxTextureSize);st=k(b,st);let St=s.convert(b.format,b.colorSpace),Jt=s.convert(b.type),gt=S(b.internalFormat,St,Jt,b.colorSpace,b.isVideoTexture);A(j,b);let xt,Nt=b.mipmaps,Gt=b.isVideoTexture!==!0,ue=mt.__version===void 0||et===!0,Ut=nt.dataReady,N=v(b,st);if(b.isDepthTexture)gt=r.DEPTH_COMPONENT16,b.type===ir?gt=r.DEPTH_COMPONENT32F:b.type===Hs?gt=r.DEPTH_COMPONENT24:b.type===ko&&(gt=r.DEPTH24_STENCIL8),ue&&(Gt?e.texStorage2D(r.TEXTURE_2D,1,gt,st.width,st.height):e.texImage2D(r.TEXTURE_2D,0,gt,st.width,st.height,0,St,Jt,null));else if(b.isDataTexture)if(Nt.length>0){Gt&&ue&&e.texStorage2D(r.TEXTURE_2D,N,gt,Nt[0].width,Nt[0].height);for(let $=0,K=Nt.length;$<K;$++)xt=Nt[$],Gt?Ut&&e.texSubImage2D(r.TEXTURE_2D,$,0,0,xt.width,xt.height,St,Jt,xt.data):e.texImage2D(r.TEXTURE_2D,$,gt,xt.width,xt.height,0,St,Jt,xt.data);b.generateMipmaps=!1}else Gt?(ue&&e.texStorage2D(r.TEXTURE_2D,N,gt,st.width,st.height),Ut&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,st.width,st.height,St,Jt,st.data)):e.texImage2D(r.TEXTURE_2D,0,gt,st.width,st.height,0,St,Jt,st.data);else if(b.isCompressedTexture)if(b.isCompressedArrayTexture){Gt&&ue&&e.texStorage3D(r.TEXTURE_2D_ARRAY,N,gt,Nt[0].width,Nt[0].height,st.depth);for(let $=0,K=Nt.length;$<K;$++)xt=Nt[$],b.format!==pi?St!==null?Gt?Ut&&e.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,$,0,0,0,xt.width,xt.height,st.depth,St,xt.data,0,0):e.compressedTexImage3D(r.TEXTURE_2D_ARRAY,$,gt,xt.width,xt.height,st.depth,0,xt.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Gt?Ut&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,$,0,0,0,xt.width,xt.height,st.depth,St,Jt,xt.data):e.texImage3D(r.TEXTURE_2D_ARRAY,$,gt,xt.width,xt.height,st.depth,0,St,Jt,xt.data)}else{Gt&&ue&&e.texStorage2D(r.TEXTURE_2D,N,gt,Nt[0].width,Nt[0].height);for(let $=0,K=Nt.length;$<K;$++)xt=Nt[$],b.format!==pi?St!==null?Gt?Ut&&e.compressedTexSubImage2D(r.TEXTURE_2D,$,0,0,xt.width,xt.height,St,xt.data):e.compressedTexImage2D(r.TEXTURE_2D,$,gt,xt.width,xt.height,0,xt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Gt?Ut&&e.texSubImage2D(r.TEXTURE_2D,$,0,0,xt.width,xt.height,St,Jt,xt.data):e.texImage2D(r.TEXTURE_2D,$,gt,xt.width,xt.height,0,St,Jt,xt.data)}else if(b.isDataArrayTexture)Gt?(ue&&e.texStorage3D(r.TEXTURE_2D_ARRAY,N,gt,st.width,st.height,st.depth),Ut&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,st.width,st.height,st.depth,St,Jt,st.data)):e.texImage3D(r.TEXTURE_2D_ARRAY,0,gt,st.width,st.height,st.depth,0,St,Jt,st.data);else if(b.isData3DTexture)Gt?(ue&&e.texStorage3D(r.TEXTURE_3D,N,gt,st.width,st.height,st.depth),Ut&&e.texSubImage3D(r.TEXTURE_3D,0,0,0,0,st.width,st.height,st.depth,St,Jt,st.data)):e.texImage3D(r.TEXTURE_3D,0,gt,st.width,st.height,st.depth,0,St,Jt,st.data);else if(b.isFramebufferTexture){if(ue)if(Gt)e.texStorage2D(r.TEXTURE_2D,N,gt,st.width,st.height);else{let $=st.width,K=st.height;for(let at=0;at<N;at++)e.texImage2D(r.TEXTURE_2D,at,gt,$,K,0,St,Jt,null),$>>=1,K>>=1}}else if(Nt.length>0){if(Gt&&ue){let $=jt(Nt[0]);e.texStorage2D(r.TEXTURE_2D,N,gt,$.width,$.height)}for(let $=0,K=Nt.length;$<K;$++)xt=Nt[$],Gt?Ut&&e.texSubImage2D(r.TEXTURE_2D,$,0,0,St,Jt,xt):e.texImage2D(r.TEXTURE_2D,$,gt,St,Jt,xt);b.generateMipmaps=!1}else if(Gt){if(ue){let $=jt(st);e.texStorage2D(r.TEXTURE_2D,N,gt,$.width,$.height)}Ut&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,St,Jt,st)}else e.texImage2D(r.TEXTURE_2D,0,gt,St,Jt,st);p(b)&&m(j),mt.__version=nt.version,b.onUpdate&&b.onUpdate(b)}C.__version=b.version}function Wt(C,b,Y){if(b.image.length!==6)return;let j=it(C,b),et=b.source;e.bindTexture(r.TEXTURE_CUBE_MAP,C.__webglTexture,r.TEXTURE0+Y);let nt=n.get(et);if(et.version!==nt.__version||j===!0){e.activeTexture(r.TEXTURE0+Y);let mt=fe.getPrimaries(fe.workingColorSpace),lt=b.colorSpace===nr?null:fe.getPrimaries(b.colorSpace),rt=b.colorSpace===nr||mt===lt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,b.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,rt);let Lt=b.isCompressedTexture||b.image[0].isCompressedTexture,st=b.image[0]&&b.image[0].isDataTexture,St=[];for(let K=0;K<6;K++)!Lt&&!st?St[K]=g(b.image[K],!0,i.maxCubemapSize):St[K]=st?b.image[K].image:b.image[K],St[K]=k(b,St[K]);let Jt=St[0],gt=s.convert(b.format,b.colorSpace),xt=s.convert(b.type),Nt=S(b.internalFormat,gt,xt,b.colorSpace),Gt=b.isVideoTexture!==!0,ue=nt.__version===void 0||j===!0,Ut=et.dataReady,N=v(b,Jt);A(r.TEXTURE_CUBE_MAP,b);let $;if(Lt){Gt&&ue&&e.texStorage2D(r.TEXTURE_CUBE_MAP,N,Nt,Jt.width,Jt.height);for(let K=0;K<6;K++){$=St[K].mipmaps;for(let at=0;at<$.length;at++){let ut=$[at];b.format!==pi?gt!==null?Gt?Ut&&e.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,at,0,0,ut.width,ut.height,gt,ut.data):e.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,at,Nt,ut.width,ut.height,0,ut.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Gt?Ut&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,at,0,0,ut.width,ut.height,gt,xt,ut.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,at,Nt,ut.width,ut.height,0,gt,xt,ut.data)}}}else{if($=b.mipmaps,Gt&&ue){$.length>0&&N++;let K=jt(St[0]);e.texStorage2D(r.TEXTURE_CUBE_MAP,N,Nt,K.width,K.height)}for(let K=0;K<6;K++)if(st){Gt?Ut&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,0,0,0,St[K].width,St[K].height,gt,xt,St[K].data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,0,Nt,St[K].width,St[K].height,0,gt,xt,St[K].data);for(let at=0;at<$.length;at++){let Vt=$[at].image[K].image;Gt?Ut&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,at+1,0,0,Vt.width,Vt.height,gt,xt,Vt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,at+1,Nt,Vt.width,Vt.height,0,gt,xt,Vt.data)}}else{Gt?Ut&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,0,0,0,gt,xt,St[K]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,0,Nt,gt,xt,St[K]);for(let at=0;at<$.length;at++){let ut=$[at];Gt?Ut&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,at+1,0,0,gt,xt,ut.image[K]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+K,at+1,Nt,gt,xt,ut.image[K])}}}p(b)&&m(r.TEXTURE_CUBE_MAP),nt.__version=et.version,b.onUpdate&&b.onUpdate(b)}C.__version=b.version}function q(C,b,Y,j,et,nt){let mt=s.convert(Y.format,Y.colorSpace),lt=s.convert(Y.type),rt=S(Y.internalFormat,mt,lt,Y.colorSpace);if(!n.get(b).__hasExternalTextures){let st=Math.max(1,b.width>>nt),St=Math.max(1,b.height>>nt);et===r.TEXTURE_3D||et===r.TEXTURE_2D_ARRAY?e.texImage3D(et,nt,rt,st,St,b.depth,0,mt,lt,null):e.texImage2D(et,nt,rt,st,St,0,mt,lt,null)}e.bindFramebuffer(r.FRAMEBUFFER,C),Ft(b)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,j,et,n.get(Y).__webglTexture,0,_t(b)):(et===r.TEXTURE_2D||et>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&et<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,j,et,n.get(Y).__webglTexture,nt),e.bindFramebuffer(r.FRAMEBUFFER,null)}function Q(C,b,Y){if(r.bindRenderbuffer(r.RENDERBUFFER,C),b.depthBuffer&&!b.stencilBuffer){let j=r.DEPTH_COMPONENT24;if(Y||Ft(b)){let et=b.depthTexture;et&&et.isDepthTexture&&(et.type===ir?j=r.DEPTH_COMPONENT32F:et.type===Hs&&(j=r.DEPTH_COMPONENT24));let nt=_t(b);Ft(b)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,nt,j,b.width,b.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,nt,j,b.width,b.height)}else r.renderbufferStorage(r.RENDERBUFFER,j,b.width,b.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,C)}else if(b.depthBuffer&&b.stencilBuffer){let j=_t(b);Y&&Ft(b)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,j,r.DEPTH24_STENCIL8,b.width,b.height):Ft(b)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,j,r.DEPTH24_STENCIL8,b.width,b.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,C)}else{let j=b.textures;for(let et=0;et<j.length;et++){let nt=j[et],mt=s.convert(nt.format,nt.colorSpace),lt=s.convert(nt.type),rt=S(nt.internalFormat,mt,lt,nt.colorSpace),Lt=_t(b);Y&&Ft(b)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Lt,rt,b.width,b.height):Ft(b)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Lt,rt,b.width,b.height):r.renderbufferStorage(r.RENDERBUFFER,rt,b.width,b.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function ct(C,b){if(b&&b.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(r.FRAMEBUFFER,C),!(b.depthTexture&&b.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(b.depthTexture).__webglTexture||b.depthTexture.image.width!==b.width||b.depthTexture.image.height!==b.height)&&(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0),P(b.depthTexture,0);let j=n.get(b.depthTexture).__webglTexture,et=_t(b);if(b.depthTexture.format===Os)Ft(b)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,j,0,et):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,j,0);else if(b.depthTexture.format===Uo)Ft(b)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,j,0,et):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,j,0);else throw new Error("Unknown depthTexture format")}function tt(C){let b=n.get(C),Y=C.isWebGLCubeRenderTarget===!0;if(C.depthTexture&&!b.__autoAllocateDepthBuffer){if(Y)throw new Error("target.depthTexture not supported in Cube render targets");ct(b.__webglFramebuffer,C)}else if(Y){b.__webglDepthbuffer=[];for(let j=0;j<6;j++)e.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer[j]),b.__webglDepthbuffer[j]=r.createRenderbuffer(),Q(b.__webglDepthbuffer[j],C,!1)}else e.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer=r.createRenderbuffer(),Q(b.__webglDepthbuffer,C,!1);e.bindFramebuffer(r.FRAMEBUFFER,null)}function It(C,b,Y){let j=n.get(C);b!==void 0&&q(j.__webglFramebuffer,C,C.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),Y!==void 0&&tt(C)}function Rt(C){let b=C.texture,Y=n.get(C),j=n.get(b);C.addEventListener("dispose",D);let et=C.textures,nt=C.isWebGLCubeRenderTarget===!0,mt=et.length>1;if(mt||(j.__webglTexture===void 0&&(j.__webglTexture=r.createTexture()),j.__version=b.version,o.memory.textures++),nt){Y.__webglFramebuffer=[];for(let lt=0;lt<6;lt++)if(b.mipmaps&&b.mipmaps.length>0){Y.__webglFramebuffer[lt]=[];for(let rt=0;rt<b.mipmaps.length;rt++)Y.__webglFramebuffer[lt][rt]=r.createFramebuffer()}else Y.__webglFramebuffer[lt]=r.createFramebuffer()}else{if(b.mipmaps&&b.mipmaps.length>0){Y.__webglFramebuffer=[];for(let lt=0;lt<b.mipmaps.length;lt++)Y.__webglFramebuffer[lt]=r.createFramebuffer()}else Y.__webglFramebuffer=r.createFramebuffer();if(mt)for(let lt=0,rt=et.length;lt<rt;lt++){let Lt=n.get(et[lt]);Lt.__webglTexture===void 0&&(Lt.__webglTexture=r.createTexture(),o.memory.textures++)}if(C.samples>0&&Ft(C)===!1){Y.__webglMultisampledFramebuffer=r.createFramebuffer(),Y.__webglColorRenderbuffer=[],e.bindFramebuffer(r.FRAMEBUFFER,Y.__webglMultisampledFramebuffer);for(let lt=0;lt<et.length;lt++){let rt=et[lt];Y.__webglColorRenderbuffer[lt]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,Y.__webglColorRenderbuffer[lt]);let Lt=s.convert(rt.format,rt.colorSpace),st=s.convert(rt.type),St=S(rt.internalFormat,Lt,st,rt.colorSpace,C.isXRRenderTarget===!0),Jt=_t(C);r.renderbufferStorageMultisample(r.RENDERBUFFER,Jt,St,C.width,C.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.RENDERBUFFER,Y.__webglColorRenderbuffer[lt])}r.bindRenderbuffer(r.RENDERBUFFER,null),C.depthBuffer&&(Y.__webglDepthRenderbuffer=r.createRenderbuffer(),Q(Y.__webglDepthRenderbuffer,C,!0)),e.bindFramebuffer(r.FRAMEBUFFER,null)}}if(nt){e.bindTexture(r.TEXTURE_CUBE_MAP,j.__webglTexture),A(r.TEXTURE_CUBE_MAP,b);for(let lt=0;lt<6;lt++)if(b.mipmaps&&b.mipmaps.length>0)for(let rt=0;rt<b.mipmaps.length;rt++)q(Y.__webglFramebuffer[lt][rt],C,b,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+lt,rt);else q(Y.__webglFramebuffer[lt],C,b,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0);p(b)&&m(r.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(mt){for(let lt=0,rt=et.length;lt<rt;lt++){let Lt=et[lt],st=n.get(Lt);e.bindTexture(r.TEXTURE_2D,st.__webglTexture),A(r.TEXTURE_2D,Lt),q(Y.__webglFramebuffer,C,Lt,r.COLOR_ATTACHMENT0+lt,r.TEXTURE_2D,0),p(Lt)&&m(r.TEXTURE_2D)}e.unbindTexture()}else{let lt=r.TEXTURE_2D;if((C.isWebGL3DRenderTarget||C.isWebGLArrayRenderTarget)&&(lt=C.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),e.bindTexture(lt,j.__webglTexture),A(lt,b),b.mipmaps&&b.mipmaps.length>0)for(let rt=0;rt<b.mipmaps.length;rt++)q(Y.__webglFramebuffer[rt],C,b,r.COLOR_ATTACHMENT0,lt,rt);else q(Y.__webglFramebuffer,C,b,r.COLOR_ATTACHMENT0,lt,0);p(b)&&m(lt),e.unbindTexture()}C.depthBuffer&&tt(C)}function z(C){let b=C.textures;for(let Y=0,j=b.length;Y<j;Y++){let et=b[Y];if(p(et)){let nt=C.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,mt=n.get(et).__webglTexture;e.bindTexture(nt,mt),m(nt),e.unbindTexture()}}}let Xt=[],bt=[];function wt(C){if(C.samples>0){if(Ft(C)===!1){let b=C.textures,Y=C.width,j=C.height,et=r.COLOR_BUFFER_BIT,nt=C.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,mt=n.get(C),lt=b.length>1;if(lt)for(let rt=0;rt<b.length;rt++)e.bindFramebuffer(r.FRAMEBUFFER,mt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+rt,r.RENDERBUFFER,null),e.bindFramebuffer(r.FRAMEBUFFER,mt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+rt,r.TEXTURE_2D,null,0);e.bindFramebuffer(r.READ_FRAMEBUFFER,mt.__webglMultisampledFramebuffer),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,mt.__webglFramebuffer);for(let rt=0;rt<b.length;rt++){if(C.resolveDepthBuffer&&(C.depthBuffer&&(et|=r.DEPTH_BUFFER_BIT),C.stencilBuffer&&C.resolveStencilBuffer&&(et|=r.STENCIL_BUFFER_BIT)),lt){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,mt.__webglColorRenderbuffer[rt]);let Lt=n.get(b[rt]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Lt,0)}r.blitFramebuffer(0,0,Y,j,0,0,Y,j,et,r.NEAREST),l===!0&&(Xt.length=0,bt.length=0,Xt.push(r.COLOR_ATTACHMENT0+rt),C.depthBuffer&&C.resolveDepthBuffer===!1&&(Xt.push(nt),bt.push(nt),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,bt)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Xt))}if(e.bindFramebuffer(r.READ_FRAMEBUFFER,null),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),lt)for(let rt=0;rt<b.length;rt++){e.bindFramebuffer(r.FRAMEBUFFER,mt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+rt,r.RENDERBUFFER,mt.__webglColorRenderbuffer[rt]);let Lt=n.get(b[rt]).__webglTexture;e.bindFramebuffer(r.FRAMEBUFFER,mt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+rt,r.TEXTURE_2D,Lt,0)}e.bindFramebuffer(r.DRAW_FRAMEBUFFER,mt.__webglMultisampledFramebuffer)}else if(C.depthBuffer&&C.resolveDepthBuffer===!1&&l){let b=C.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[b])}}}function _t(C){return Math.min(i.maxSamples,C.samples)}function Ft(C){let b=n.get(C);return C.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function Pt(C){let b=o.render.frame;u.get(C)!==b&&(u.set(C,b),C.update())}function k(C,b){let Y=C.colorSpace,j=C.format,et=C.type;return C.isCompressedTexture===!0||C.isVideoTexture===!0||Y!==fr&&Y!==nr&&(fe.getTransfer(Y)===xe?(j!==pi||et!==cr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Y)),b}function jt(C){return typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement?(c.width=C.naturalWidth||C.width,c.height=C.naturalHeight||C.height):typeof VideoFrame<"u"&&C instanceof VideoFrame?(c.width=C.displayWidth,c.height=C.displayHeight):(c.width=C.width,c.height=C.height),c}this.allocateTextureUnit=L,this.resetTextureUnits=x,this.setTexture2D=P,this.setTexture2DArray=B,this.setTexture3D=X,this.setTextureCube=G,this.rebindTextures=It,this.setupRenderTarget=Rt,this.updateRenderTargetMipmap=z,this.updateMultisampleRenderTarget=wt,this.setupDepthRenderbuffer=tt,this.setupFrameBufferTexture=q,this.useMultisampledRTT=Ft}function NS(r,t){function e(n,i=nr){let s,o=fe.getTransfer(i);if(n===cr)return r.UNSIGNED_BYTE;if(n===_m)return r.UNSIGNED_SHORT_4_4_4_4;if(n===xm)return r.UNSIGNED_SHORT_5_5_5_1;if(n===C0)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===A0)return r.BYTE;if(n===D0)return r.SHORT;if(n===mm)return r.UNSIGNED_SHORT;if(n===gm)return r.INT;if(n===Hs)return r.UNSIGNED_INT;if(n===ir)return r.FLOAT;if(n===Pl)return r.HALF_FLOAT;if(n===R0)return r.ALPHA;if(n===P0)return r.RGB;if(n===pi)return r.RGBA;if(n===I0)return r.LUMINANCE;if(n===L0)return r.LUMINANCE_ALPHA;if(n===Os)return r.DEPTH_COMPONENT;if(n===Uo)return r.DEPTH_STENCIL;if(n===F0)return r.RED;if(n===vm)return r.RED_INTEGER;if(n===N0)return r.RG;if(n===ym)return r.RG_INTEGER;if(n===Mm)return r.RGBA_INTEGER;if(n===iu||n===ru||n===su||n===ou)if(o===xe)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===iu)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===ru)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===su)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===ou)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===iu)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===ru)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===su)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===ou)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Wd||n===Xd||n===qd||n===Yd)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===Wd)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Xd)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===qd)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Yd)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Zd||n===Jd||n===$d)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Zd||n===Jd)return o===xe?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===$d)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Kd||n===Qd||n===jd||n===tp||n===ep||n===np||n===ip||n===rp||n===sp||n===op||n===ap||n===lp||n===cp||n===up)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Kd)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Qd)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===jd)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===tp)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===ep)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===np)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===ip)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===rp)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===sp)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===op)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ap)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===lp)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===cp)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===up)return o===xe?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===au||n===hp||n===fp)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===au)return o===xe?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===hp)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===fp)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===U0||n===dp||n===pp||n===mp)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===au)return s.COMPRESSED_RED_RGTC1_EXT;if(n===dp)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===pp)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===mp)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===ko?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:e}}var nh=class extends xn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},rr=class extends on{constructor(){super(),this.isGroup=!0,this.type="Group"}},US={type:"move"},No=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new rr,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 rr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new rr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Z),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,s=null,o=null,a=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){o=!0;for(let g of t.hand.values()){let p=e.getJointPose(g,n),m=this._getHandJoint(c,g);p!==null&&(m.matrix.fromArray(p.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=p.radius),m.visible=p!==null}let u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],f=u.position.distanceTo(h.position),d=.02,_=.005;c.inputState.pinching&&f>d+_?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=d-_&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(US)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new rr;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},OS=`
3798
3798
  void main() {
3799
3799
 
3800
3800
  gl_Position = vec4( position, 1.0 );
3801
3801
 
3802
- }`,xS=`
3802
+ }`,BS=`
3803
3803
  uniform sampler2DArray depthColor;
3804
3804
  uniform float depthWidth;
3805
3805
  uniform float depthHeight;
@@ -3818,32 +3818,28 @@ void main() {
3818
3818
 
3819
3819
  }
3820
3820
 
3821
- }`,Ku=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){let i=new Yn,s=t.properties.get(i);s.__webglTexture=e.texture,(e.depthNear!=n.depthNear||e.depthFar!=n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}render(t,e){if(this.texture!==null){if(this.mesh===null){let n=e.cameras[0].viewport,i=new Zn({vertexShader:_S,fragmentShader:xS,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new ii(new gl(20,20),i)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},Qu=class extends cr{constructor(t,e){super();let n=this,i=null,s=1,a=null,o="local-floor",l=1,c=null,u=null,f=null,h=null,d=null,_=null,g=new Ku,p=e.getContextAttributes(),m=null,S=null,v=[],M=[],D=new ae,T=null,w=new _n;w.layers.enable(1),w.viewport=new We;let P=new _n;P.layers.enable(2),P.viewport=new We;let y=[w,P],x=new $u;x.layers.enable(1),x.layers.enable(2);let F=null,I=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let tt=v[X];return tt===void 0&&(tt=new Ra,v[X]=tt),tt.getTargetRaySpace()},this.getControllerGrip=function(X){let tt=v[X];return tt===void 0&&(tt=new Ra,v[X]=tt),tt.getGripSpace()},this.getHand=function(X){let tt=v[X];return tt===void 0&&(tt=new Ra,v[X]=tt),tt.getHandSpace()};function R(X){let tt=M.indexOf(X.inputSource);if(tt===-1)return;let ft=v[tt];ft!==void 0&&(ft.update(X.inputSource,X.frame,c||a),ft.dispatchEvent({type:X.type,data:X.inputSource}))}function B(){i.removeEventListener("select",R),i.removeEventListener("selectstart",R),i.removeEventListener("selectend",R),i.removeEventListener("squeeze",R),i.removeEventListener("squeezestart",R),i.removeEventListener("squeezeend",R),i.removeEventListener("end",B),i.removeEventListener("inputsourceschange",G);for(let X=0;X<v.length;X++){let tt=M[X];tt!==null&&(M[X]=null,v[X].disconnect(tt))}F=null,I=null,g.reset(),t.setRenderTarget(m),d=null,h=null,f=null,i=null,S=null,Zt.stop(),n.isPresenting=!1,t.setPixelRatio(T),t.setSize(D.width,D.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(X){s=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(X){o=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(X){c=X},this.getBaseLayer=function(){return h!==null?h:d},this.getBinding=function(){return f},this.getFrame=function(){return _},this.getSession=function(){return i},this.setSession=async function(X){if(i=X,i!==null){if(m=t.getRenderTarget(),i.addEventListener("select",R),i.addEventListener("selectstart",R),i.addEventListener("selectend",R),i.addEventListener("squeeze",R),i.addEventListener("squeezestart",R),i.addEventListener("squeezeend",R),i.addEventListener("end",B),i.addEventListener("inputsourceschange",G),p.xrCompatible!==!0&&await e.makeXRCompatible(),T=t.getPixelRatio(),t.getSize(D),i.renderState.layers===void 0){let tt={antialias:p.antialias,alpha:!0,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,e,tt),i.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),S=new Ui(d.framebufferWidth,d.framebufferHeight,{format:pi,type:lr,colorSpace:t.outputColorSpace,stencilBuffer:p.stencil})}else{let tt=null,ft=null,nt=null;p.depth&&(nt=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,tt=p.stencil?Pa:Us,ft=p.stencil?Ua:ks);let It={colorFormat:e.RGBA8,depthFormat:nt,scaleFactor:s};f=new XRWebGLBinding(i,e),h=f.createProjectionLayer(It),i.updateRenderState({layers:[h]}),t.setPixelRatio(1),t.setSize(h.textureWidth,h.textureHeight,!1),S=new Ui(h.textureWidth,h.textureHeight,{format:pi,type:lr,depthTexture:new vl(h.textureWidth,h.textureHeight,ft,void 0,void 0,void 0,void 0,void 0,void 0,tt),stencilBuffer:p.stencil,colorSpace:t.outputColorSpace,samples:p.antialias?4:0,resolveDepthBuffer:h.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Zt.setContext(i),Zt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function G(X){for(let tt=0;tt<X.removed.length;tt++){let ft=X.removed[tt],nt=M.indexOf(ft);nt>=0&&(M[nt]=null,v[nt].disconnect(ft))}for(let tt=0;tt<X.added.length;tt++){let ft=X.added[tt],nt=M.indexOf(ft);if(nt===-1){for(let Rt=0;Rt<v.length;Rt++)if(Rt>=M.length){M.push(ft),nt=Rt;break}else if(M[Rt]===null){M[Rt]=ft,nt=Rt;break}if(nt===-1)break}let It=v[nt];It&&It.connect(ft)}}let Z=new q,J=new q;function N(X,tt,ft){Z.setFromMatrixPosition(tt.matrixWorld),J.setFromMatrixPosition(ft.matrixWorld);let nt=Z.distanceTo(J),It=tt.projectionMatrix.elements,Rt=ft.projectionMatrix.elements,O=It[14]/(It[10]-1),Gt=It[14]/(It[10]+1),St=(It[9]+1)/It[5],Et=(It[9]-1)/It[5],_t=(It[8]-1)/It[0],Ft=(Rt[8]+1)/Rt[0],Pt=O*_t,z=O*Ft,jt=nt/(-_t+Ft),C=jt*-_t;tt.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(C),X.translateZ(jt),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert();let b=O+jt,W=Gt+jt,K=Pt-C,j=z+(nt-C),et=St*Gt/W*b,mt=Et*Gt/W*b;X.projectionMatrix.makePerspective(K,j,et,mt,b,W),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}function Q(X,tt){tt===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(tt.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(i===null)return;g.texture!==null&&(X.near=g.depthNear,X.far=g.depthFar),x.near=P.near=w.near=X.near,x.far=P.far=w.far=X.far,(F!==x.near||I!==x.far)&&(i.updateRenderState({depthNear:x.near,depthFar:x.far}),F=x.near,I=x.far,w.near=F,w.far=I,P.near=F,P.far=I,w.updateProjectionMatrix(),P.updateProjectionMatrix(),X.updateProjectionMatrix());let tt=X.parent,ft=x.cameras;Q(x,tt);for(let nt=0;nt<ft.length;nt++)Q(ft[nt],tt);ft.length===2?N(x,w,P):x.projectionMatrix.copy(w.projectionMatrix),A(X,x,tt)};function A(X,tt,ft){ft===null?X.matrix.copy(tt.matrixWorld):(X.matrix.copy(ft.matrixWorld),X.matrix.invert(),X.matrix.multiply(tt.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(tt.projectionMatrix),X.projectionMatrixInverse.copy(tt.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=Nu*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return x},this.getFoveation=function(){if(!(h===null&&d===null))return l},this.setFoveation=function(X){l=X,h!==null&&(h.fixedFoveation=X),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=X)},this.hasDepthSensing=function(){return g.texture!==null};let at=null;function bt(X,tt){if(u=tt.getViewerPose(c||a),_=tt,u!==null){let ft=u.views;d!==null&&(t.setRenderTargetFramebuffer(S,d.framebuffer),t.setRenderTarget(S));let nt=!1;ft.length!==x.cameras.length&&(x.cameras.length=0,nt=!0);for(let Rt=0;Rt<ft.length;Rt++){let O=ft[Rt],Gt=null;if(d!==null)Gt=d.getViewport(O);else{let Et=f.getViewSubImage(h,O);Gt=Et.viewport,Rt===0&&(t.setRenderTargetTextures(S,Et.colorTexture,h.ignoreDepthValues?void 0:Et.depthStencilTexture),t.setRenderTarget(S))}let St=y[Rt];St===void 0&&(St=new _n,St.layers.enable(Rt),St.viewport=new We,y[Rt]=St),St.matrix.fromArray(O.transform.matrix),St.matrix.decompose(St.position,St.quaternion,St.scale),St.projectionMatrix.fromArray(O.projectionMatrix),St.projectionMatrixInverse.copy(St.projectionMatrix).invert(),St.viewport.set(Gt.x,Gt.y,Gt.width,Gt.height),Rt===0&&(x.matrix.copy(St.matrix),x.matrix.decompose(x.position,x.quaternion,x.scale)),nt===!0&&x.cameras.push(St)}let It=i.enabledFeatures;if(It&&It.includes("depth-sensing")){let Rt=f.getDepthInformation(ft[0]);Rt&&Rt.isValid&&Rt.texture&&g.init(t,Rt,i.renderState)}}for(let ft=0;ft<v.length;ft++){let nt=M[ft],It=v[ft];nt!==null&&It!==void 0&&It.update(nt,tt,c||a)}g.render(t,x),at&&at(X,tt),tt.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:tt}),_=null}let Zt=new mm;Zt.setAnimationLoop(bt),this.setAnimationLoop=function(X){at=X},this.dispose=function(){}}},kr=new Ni,vS=new Re;function yS(r,t){function e(p,m){p.matrixAutoUpdate===!0&&p.updateMatrix(),m.value.copy(p.matrix)}function n(p,m){m.color.getRGB(p.fogColor.value,pm(r)),m.isFog?(p.fogNear.value=m.near,p.fogFar.value=m.far):m.isFogExp2&&(p.fogDensity.value=m.density)}function i(p,m,S,v,M){m.isMeshBasicMaterial||m.isMeshLambertMaterial?s(p,m):m.isMeshToonMaterial?(s(p,m),f(p,m)):m.isMeshPhongMaterial?(s(p,m),u(p,m)):m.isMeshStandardMaterial?(s(p,m),h(p,m),m.isMeshPhysicalMaterial&&d(p,m,M)):m.isMeshMatcapMaterial?(s(p,m),_(p,m)):m.isMeshDepthMaterial?s(p,m):m.isMeshDistanceMaterial?(s(p,m),g(p,m)):m.isMeshNormalMaterial?s(p,m):m.isLineBasicMaterial?(a(p,m),m.isLineDashedMaterial&&o(p,m)):m.isPointsMaterial?l(p,m,S,v):m.isSpriteMaterial?c(p,m):m.isShadowMaterial?(p.color.value.copy(m.color),p.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function s(p,m){p.opacity.value=m.opacity,m.color&&p.diffuse.value.copy(m.color),m.emissive&&p.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(p.map.value=m.map,e(m.map,p.mapTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,e(m.alphaMap,p.alphaMapTransform)),m.bumpMap&&(p.bumpMap.value=m.bumpMap,e(m.bumpMap,p.bumpMapTransform),p.bumpScale.value=m.bumpScale,m.side===Tn&&(p.bumpScale.value*=-1)),m.normalMap&&(p.normalMap.value=m.normalMap,e(m.normalMap,p.normalMapTransform),p.normalScale.value.copy(m.normalScale),m.side===Tn&&p.normalScale.value.negate()),m.displacementMap&&(p.displacementMap.value=m.displacementMap,e(m.displacementMap,p.displacementMapTransform),p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias),m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap,e(m.emissiveMap,p.emissiveMapTransform)),m.specularMap&&(p.specularMap.value=m.specularMap,e(m.specularMap,p.specularMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let S=t.get(m),v=S.envMap,M=S.envMapRotation;if(v&&(p.envMap.value=v,kr.copy(M),kr.x*=-1,kr.y*=-1,kr.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(kr.y*=-1,kr.z*=-1),p.envMapRotation.value.setFromMatrix4(vS.makeRotationFromEuler(kr)),p.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=m.reflectivity,p.ior.value=m.ior,p.refractionRatio.value=m.refractionRatio),m.lightMap){p.lightMap.value=m.lightMap;let D=r._useLegacyLights===!0?Math.PI:1;p.lightMapIntensity.value=m.lightMapIntensity*D,e(m.lightMap,p.lightMapTransform)}m.aoMap&&(p.aoMap.value=m.aoMap,p.aoMapIntensity.value=m.aoMapIntensity,e(m.aoMap,p.aoMapTransform))}function a(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,m.map&&(p.map.value=m.map,e(m.map,p.mapTransform))}function o(p,m){p.dashSize.value=m.dashSize,p.totalSize.value=m.dashSize+m.gapSize,p.scale.value=m.scale}function l(p,m,S,v){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.size.value=m.size*S,p.scale.value=v*.5,m.map&&(p.map.value=m.map,e(m.map,p.uvTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,e(m.alphaMap,p.alphaMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest)}function c(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.rotation.value=m.rotation,m.map&&(p.map.value=m.map,e(m.map,p.mapTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,e(m.alphaMap,p.alphaMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest)}function u(p,m){p.specular.value.copy(m.specular),p.shininess.value=Math.max(m.shininess,1e-4)}function f(p,m){m.gradientMap&&(p.gradientMap.value=m.gradientMap)}function h(p,m){p.metalness.value=m.metalness,m.metalnessMap&&(p.metalnessMap.value=m.metalnessMap,e(m.metalnessMap,p.metalnessMapTransform)),p.roughness.value=m.roughness,m.roughnessMap&&(p.roughnessMap.value=m.roughnessMap,e(m.roughnessMap,p.roughnessMapTransform)),m.envMap&&(p.envMapIntensity.value=m.envMapIntensity)}function d(p,m,S){p.ior.value=m.ior,m.sheen>0&&(p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(p.sheenColorMap.value=m.sheenColorMap,e(m.sheenColorMap,p.sheenColorMapTransform)),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap,e(m.sheenRoughnessMap,p.sheenRoughnessMapTransform))),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap,e(m.clearcoatMap,p.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,e(m.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(p.clearcoatNormalMap.value=m.clearcoatNormalMap,e(m.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Tn&&p.clearcoatNormalScale.value.negate())),m.dispersion>0&&(p.dispersion.value=m.dispersion),m.iridescence>0&&(p.iridescence.value=m.iridescence,p.iridescenceIOR.value=m.iridescenceIOR,p.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(p.iridescenceMap.value=m.iridescenceMap,e(m.iridescenceMap,p.iridescenceMapTransform)),m.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=m.iridescenceThicknessMap,e(m.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=S.texture,p.transmissionSamplerSize.value.set(S.width,S.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap,e(m.transmissionMap,p.transmissionMapTransform)),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap,e(m.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=m.attenuationDistance,p.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(p.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(p.anisotropyMap.value=m.anisotropyMap,e(m.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap,e(m.specularColorMap,p.specularColorMapTransform)),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap,e(m.specularIntensityMap,p.specularIntensityMapTransform))}function _(p,m){m.matcap&&(p.matcap.value=m.matcap)}function g(p,m){let S=t.get(m).light;p.referencePosition.value.setFromMatrixPosition(S.matrixWorld),p.nearDistance.value=S.shadow.camera.near,p.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function MS(r,t,e,n){let i={},s={},a=[],o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,v){let M=v.program;n.uniformBlockBinding(S,M)}function c(S,v){let M=i[S.id];M===void 0&&(_(S),M=u(S),i[S.id]=M,S.addEventListener("dispose",p));let D=v.program;n.updateUBOMapping(S,D);let T=t.render.frame;s[S.id]!==T&&(h(S),s[S.id]=T)}function u(S){let v=f();S.__bindingPointIndex=v;let M=r.createBuffer(),D=S.__size,T=S.usage;return r.bindBuffer(r.UNIFORM_BUFFER,M),r.bufferData(r.UNIFORM_BUFFER,D,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,M),M}function f(){for(let S=0;S<o;S++)if(a.indexOf(S)===-1)return a.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function h(S){let v=i[S.id],M=S.uniforms,D=S.__cache;r.bindBuffer(r.UNIFORM_BUFFER,v);for(let T=0,w=M.length;T<w;T++){let P=Array.isArray(M[T])?M[T]:[M[T]];for(let y=0,x=P.length;y<x;y++){let F=P[y];if(d(F,T,y,D)===!0){let I=F.__offset,R=Array.isArray(F.value)?F.value:[F.value],B=0;for(let G=0;G<R.length;G++){let Z=R[G],J=g(Z);typeof Z=="number"||typeof Z=="boolean"?(F.__data[0]=Z,r.bufferSubData(r.UNIFORM_BUFFER,I+B,F.__data)):Z.isMatrix3?(F.__data[0]=Z.elements[0],F.__data[1]=Z.elements[1],F.__data[2]=Z.elements[2],F.__data[3]=0,F.__data[4]=Z.elements[3],F.__data[5]=Z.elements[4],F.__data[6]=Z.elements[5],F.__data[7]=0,F.__data[8]=Z.elements[6],F.__data[9]=Z.elements[7],F.__data[10]=Z.elements[8],F.__data[11]=0):(Z.toArray(F.__data,B),B+=J.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,I,F.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function d(S,v,M,D){let T=S.value,w=v+"_"+M;if(D[w]===void 0)return typeof T=="number"||typeof T=="boolean"?D[w]=T:D[w]=T.clone(),!0;{let P=D[w];if(typeof T=="number"||typeof T=="boolean"){if(P!==T)return D[w]=T,!0}else if(P.equals(T)===!1)return P.copy(T),!0}return!1}function _(S){let v=S.uniforms,M=0,D=16;for(let w=0,P=v.length;w<P;w++){let y=Array.isArray(v[w])?v[w]:[v[w]];for(let x=0,F=y.length;x<F;x++){let I=y[x],R=Array.isArray(I.value)?I.value:[I.value];for(let B=0,G=R.length;B<G;B++){let Z=R[B],J=g(Z),N=M%D;N!==0&&D-N<J.boundary&&(M+=D-N),I.__data=new Float32Array(J.storage/Float32Array.BYTES_PER_ELEMENT),I.__offset=M,M+=J.storage}}}let T=M%D;return T>0&&(M+=D-T),S.__size=M,S.__cache={},this}function g(S){let v={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(v.boundary=4,v.storage=4):S.isVector2?(v.boundary=8,v.storage=8):S.isVector3||S.isColor?(v.boundary=16,v.storage=12):S.isVector4?(v.boundary=16,v.storage=16):S.isMatrix3?(v.boundary=48,v.storage=48):S.isMatrix4?(v.boundary=64,v.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),v}function p(S){let v=S.target;v.removeEventListener("dispose",p);let M=a.indexOf(v.__bindingPointIndex);a.splice(M,1),r.deleteBuffer(i[v.id]),delete i[v.id],delete s[v.id]}function m(){for(let S in i)r.deleteBuffer(i[S]);a=[],i={},s={}}return{bind:l,update:c,dispose:m}}var yl=class{constructor(t={}){let{canvas:e=C0(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1}=t;this.isWebGLRenderer=!0;let h;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=n.getContextAttributes().alpha}else h=a;let d=new Uint32Array(4),_=new Int32Array(4),g=null,p=null,m=[],S=[];this.domElement=e,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._outputColorSpace=Gn,this._useLegacyLights=!1,this.toneMapping=ar,this.toneMappingExposure=1;let v=this,M=!1,D=0,T=0,w=null,P=-1,y=null,x=new We,F=new We,I=null,R=new re(0),B=0,G=e.width,Z=e.height,J=1,N=null,Q=null,A=new We(0,0,G,Z),at=new We(0,0,G,Z),bt=!1,Zt=new La,X=!1,tt=!1,ft=new Re,nt=new q,It={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Rt(){return w===null?J:1}let O=n;function Gt(E,U){return e.getContext(E,U)}try{let E={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${dh}`),e.addEventListener("webglcontextlost",L,!1),e.addEventListener("webglcontextrestored",Y,!1),e.addEventListener("webglcontextcreationerror",$,!1),O===null){let U="webgl2";if(O=Gt(U,E),O===null)throw Gt(U)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let St,Et,_t,Ft,Pt,z,jt,C,b,W,K,j,et,mt,lt,it,Lt,rt,Mt,Yt,gt,xt,Ut,Ht;function ue(){St=new ky(O),St.init(),xt=new mS(O,St),Et=new Fy(O,St,t,xt),_t=new dS(O),Ft=new Gy(O),Pt=new eS,z=new pS(O,St,_t,Pt,Et,xt,Ft),jt=new Ny(v),C=new zy(v),b=new $0(O),Ut=new Iy(O,b),W=new Vy(O,b,Ft,Ut),K=new Xy(O,W,b,Ft),Mt=new Wy(O,Et,z),it=new Uy(Pt),j=new tS(v,jt,C,St,Et,Ut,it),et=new yS(v,Pt),mt=new iS,lt=new cS(St),rt=new Py(v,jt,C,_t,K,h,l),Lt=new fS(v,K,Et),Ht=new MS(O,Ft,Et,_t),Yt=new Ly(O,St,Ft),gt=new Hy(O,St,Ft),Ft.programs=j.programs,v.capabilities=Et,v.extensions=St,v.properties=Pt,v.renderLists=mt,v.shadowMap=Lt,v.state=_t,v.info=Ft}ue();let Nt=new Qu(v,O);this.xr=Nt,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){let E=St.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){let E=St.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return J},this.setPixelRatio=function(E){E!==void 0&&(J=E,this.setSize(G,Z,!1))},this.getSize=function(E){return E.set(G,Z)},this.setSize=function(E,U,k=!0){if(Nt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}G=E,Z=U,e.width=Math.floor(E*J),e.height=Math.floor(U*J),k===!0&&(e.style.width=E+"px",e.style.height=U+"px"),this.setViewport(0,0,E,U)},this.getDrawingBufferSize=function(E){return E.set(G*J,Z*J).floor()},this.setDrawingBufferSize=function(E,U,k){G=E,Z=U,J=k,e.width=Math.floor(E*k),e.height=Math.floor(U*k),this.setViewport(0,0,E,U)},this.getCurrentViewport=function(E){return E.copy(x)},this.getViewport=function(E){return E.copy(A)},this.setViewport=function(E,U,k,V){E.isVector4?A.set(E.x,E.y,E.z,E.w):A.set(E,U,k,V),_t.viewport(x.copy(A).multiplyScalar(J).round())},this.getScissor=function(E){return E.copy(at)},this.setScissor=function(E,U,k,V){E.isVector4?at.set(E.x,E.y,E.z,E.w):at.set(E,U,k,V),_t.scissor(F.copy(at).multiplyScalar(J).round())},this.getScissorTest=function(){return bt},this.setScissorTest=function(E){_t.setScissorTest(bt=E)},this.setOpaqueSort=function(E){N=E},this.setTransparentSort=function(E){Q=E},this.getClearColor=function(E){return E.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor.apply(rt,arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha.apply(rt,arguments)},this.clear=function(E=!0,U=!0,k=!0){let V=0;if(E){let H=!1;if(w!==null){let st=w.texture.format;H=st===um||st===cm||st===lm}if(H){let st=w.texture.type,ht=st===lr||st===ks||st===rm||st===Ua||st===am||st===om,pt=rt.getClearColor(),Dt=rt.getClearAlpha(),Bt=pt.r,Tt=pt.g,wt=pt.b;ht?(d[0]=Bt,d[1]=Tt,d[2]=wt,d[3]=Dt,O.clearBufferuiv(O.COLOR,0,d)):(_[0]=Bt,_[1]=Tt,_[2]=wt,_[3]=Dt,O.clearBufferiv(O.COLOR,0,_))}else V|=O.COLOR_BUFFER_BIT}U&&(V|=O.DEPTH_BUFFER_BIT),k&&(V|=O.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),O.clear(V)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",L,!1),e.removeEventListener("webglcontextrestored",Y,!1),e.removeEventListener("webglcontextcreationerror",$,!1),mt.dispose(),lt.dispose(),Pt.dispose(),jt.dispose(),C.dispose(),K.dispose(),Ut.dispose(),Ht.dispose(),j.dispose(),Nt.dispose(),Nt.removeEventListener("sessionstart",te),Nt.removeEventListener("sessionend",Ct),vt.stop()};function L(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function Y(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;let E=Ft.autoReset,U=Lt.enabled,k=Lt.autoUpdate,V=Lt.needsUpdate,H=Lt.type;ue(),Ft.autoReset=E,Lt.enabled=U,Lt.autoUpdate=k,Lt.needsUpdate=V,Lt.type=H}function $(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function ot(E){let U=E.target;U.removeEventListener("dispose",ot),ct(U)}function ct(E){Vt(E),Pt.remove(E)}function Vt(E){let U=Pt.get(E).programs;U!==void 0&&(U.forEach(function(k){j.releaseProgram(k)}),E.isShaderMaterial&&j.releaseShaderCache(E))}this.renderBufferDirect=function(E,U,k,V,H,st){U===null&&(U=It);let ht=H.isMesh&&H.matrixWorld.determinant()<0,pt=ze(E,U,k,V,H);_t.setMaterial(V,ht);let Dt=k.index,Bt=1;if(V.wireframe===!0){if(Dt=W.getWireframeAttribute(k),Dt===void 0)return;Bt=2}let Tt=k.drawRange,wt=k.attributes.position,oe=Tt.start*Bt,Pe=(Tt.start+Tt.count)*Bt;st!==null&&(oe=Math.max(oe,st.start*Bt),Pe=Math.min(Pe,(st.start+st.count)*Bt)),Dt!==null?(oe=Math.max(oe,0),Pe=Math.min(Pe,Dt.count)):wt!=null&&(oe=Math.max(oe,0),Pe=Math.min(Pe,wt.count));let Ze=Pe-oe;if(Ze<0||Ze===1/0)return;Ut.setup(H,V,pt,k,Dt);let an,Wt=Yt;if(Dt!==null&&(an=b.get(Dt),Wt=gt,Wt.setIndex(an)),H.isMesh)V.wireframe===!0?(_t.setLineWidth(V.wireframeLinewidth*Rt()),Wt.setMode(O.LINES)):Wt.setMode(O.TRIANGLES);else if(H.isLine){let Ot=V.linewidth;Ot===void 0&&(Ot=1),_t.setLineWidth(Ot*Rt()),H.isLineSegments?Wt.setMode(O.LINES):H.isLineLoop?Wt.setMode(O.LINE_LOOP):Wt.setMode(O.LINE_STRIP)}else H.isPoints?Wt.setMode(O.POINTS):H.isSprite&&Wt.setMode(O.TRIANGLES);if(H.isBatchedMesh)H._multiDrawInstances!==null?Wt.renderMultiDrawInstances(H._multiDrawStarts,H._multiDrawCounts,H._multiDrawCount,H._multiDrawInstances):Wt.renderMultiDraw(H._multiDrawStarts,H._multiDrawCounts,H._multiDrawCount);else if(H.isInstancedMesh)Wt.renderInstances(oe,Ze,H.count);else if(k.isInstancedBufferGeometry){let Ot=k._maxInstanceCount!==void 0?k._maxInstanceCount:1/0,si=Math.min(k.instanceCount,Ot);Wt.renderInstances(oe,Ze,si)}else Wt.render(oe,Ze)};function se(E,U,k){E.transparent===!0&&E.side===Li&&E.forceSinglePass===!1?(E.side=Tn,E.needsUpdate=!0,Se(E,U,k),E.side=or,E.needsUpdate=!0,Se(E,U,k),E.side=Li):Se(E,U,k)}this.compile=function(E,U,k=null){k===null&&(k=E),p=lt.get(k),p.init(U),S.push(p),k.traverseVisible(function(H){H.isLight&&H.layers.test(U.layers)&&(p.pushLight(H),H.castShadow&&p.pushShadow(H))}),E!==k&&E.traverseVisible(function(H){H.isLight&&H.layers.test(U.layers)&&(p.pushLight(H),H.castShadow&&p.pushShadow(H))}),p.setupLights(v._useLegacyLights);let V=new Set;return E.traverse(function(H){let st=H.material;if(st)if(Array.isArray(st))for(let ht=0;ht<st.length;ht++){let pt=st[ht];se(pt,k,H),V.add(pt)}else se(st,k,H),V.add(st)}),S.pop(),p=null,V},this.compileAsync=function(E,U,k=null){let V=this.compile(E,U,k);return new Promise(H=>{function st(){if(V.forEach(function(ht){Pt.get(ht).currentProgram.isReady()&&V.delete(ht)}),V.size===0){H(E);return}setTimeout(st,10)}St.get("KHR_parallel_shader_compile")!==null?st():setTimeout(st,10)})};let ce=null;function de(E){ce&&ce(E)}function te(){vt.stop()}function Ct(){vt.start()}let vt=new mm;vt.setAnimationLoop(de),typeof self<"u"&&vt.setContext(self),this.setAnimationLoop=function(E){ce=E,Nt.setAnimationLoop(E),E===null?vt.stop():vt.start()},Nt.addEventListener("sessionstart",te),Nt.addEventListener("sessionend",Ct),this.render=function(E,U){if(U!==void 0&&U.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),U.parent===null&&U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),Nt.enabled===!0&&Nt.isPresenting===!0&&(Nt.cameraAutoUpdate===!0&&Nt.updateCamera(U),U=Nt.getCamera()),E.isScene===!0&&E.onBeforeRender(v,E,U,w),p=lt.get(E,S.length),p.init(U),S.push(p),ft.multiplyMatrices(U.projectionMatrix,U.matrixWorldInverse),Zt.setFromProjectionMatrix(ft),tt=this.localClippingEnabled,X=it.init(this.clippingPlanes,tt),g=mt.get(E,m.length),g.init(),m.push(g),ie(E,U,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(N,Q);let k=Nt.enabled===!1||Nt.isPresenting===!1||Nt.hasDepthSensing()===!1;k&&rt.addToRenderList(g,E),this.info.render.frame++,X===!0&&it.beginShadows();let V=p.state.shadowsArray;Lt.render(V,E,U),X===!0&&it.endShadows(),this.info.autoReset===!0&&this.info.reset();let H=g.opaque,st=g.transmissive;if(p.setupLights(v._useLegacyLights),U.isArrayCamera){let ht=U.cameras;if(st.length>0)for(let pt=0,Dt=ht.length;pt<Dt;pt++){let Bt=ht[pt];kt(H,st,E,Bt)}k&&rt.render(E);for(let pt=0,Dt=ht.length;pt<Dt;pt++){let Bt=ht[pt];ut(g,E,Bt,Bt.viewport)}}else st.length>0&&kt(H,st,E,U),k&&rt.render(E),ut(g,E,U);w!==null&&(z.updateMultisampleRenderTarget(w),z.updateRenderTargetMipmap(w)),E.isScene===!0&&E.onAfterRender(v,E,U),Ut.resetDefaultState(),P=-1,y=null,S.pop(),S.length>0?(p=S[S.length-1],X===!0&&it.setGlobalState(v.clippingPlanes,p.state.camera)):p=null,m.pop(),m.length>0?g=m[m.length-1]:g=null};function ie(E,U,k,V){if(E.visible===!1)return;if(E.layers.test(U.layers)){if(E.isGroup)k=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(U);else if(E.isLight)p.pushLight(E),E.castShadow&&p.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||Zt.intersectsSprite(E)){V&&nt.setFromMatrixPosition(E.matrixWorld).applyMatrix4(ft);let ht=K.update(E),pt=E.material;pt.visible&&g.push(E,ht,pt,k,nt.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||Zt.intersectsObject(E))){let ht=K.update(E),pt=E.material;if(V&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),nt.copy(E.boundingSphere.center)):(ht.boundingSphere===null&&ht.computeBoundingSphere(),nt.copy(ht.boundingSphere.center)),nt.applyMatrix4(E.matrixWorld).applyMatrix4(ft)),Array.isArray(pt)){let Dt=ht.groups;for(let Bt=0,Tt=Dt.length;Bt<Tt;Bt++){let wt=Dt[Bt],oe=pt[wt.materialIndex];oe&&oe.visible&&g.push(E,ht,oe,k,nt.z,wt)}}else pt.visible&&g.push(E,ht,pt,k,nt.z,null)}}let st=E.children;for(let ht=0,pt=st.length;ht<pt;ht++)ie(st[ht],U,k,V)}function ut(E,U,k,V){let H=E.opaque,st=E.transmissive,ht=E.transparent;p.setupLightsView(k),X===!0&&it.setGlobalState(v.clippingPlanes,k),V&&_t.viewport(x.copy(V)),H.length>0&&At(H,U,k),st.length>0&&At(st,U,k),ht.length>0&&At(ht,U,k),_t.buffers.depth.setTest(!0),_t.buffers.depth.setMask(!0),_t.buffers.color.setMask(!0),_t.setPolygonOffset(!1)}function kt(E,U,k,V){if((k.isScene===!0?k.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[V.id]===void 0&&(p.state.transmissionRenderTarget[V.id]=new Ui(1,1,{generateMipmaps:!0,type:St.has("EXT_color_buffer_half_float")||St.has("EXT_color_buffer_float")?Al:lr,minFilter:Xr,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));let st=p.state.transmissionRenderTarget[V.id],ht=V.viewport||x;st.setSize(ht.z,ht.w);let pt=v.getRenderTarget();v.setRenderTarget(st),v.getClearColor(R),B=v.getClearAlpha(),B<1&&v.setClearColor(16777215,.5),v.clear();let Dt=v.toneMapping;v.toneMapping=ar;let Bt=V.viewport;if(V.viewport!==void 0&&(V.viewport=void 0),p.setupLightsView(V),X===!0&&it.setGlobalState(v.clippingPlanes,V),At(E,k,V),z.updateMultisampleRenderTarget(st),z.updateRenderTargetMipmap(st),St.has("WEBGL_multisampled_render_to_texture")===!1){let Tt=!1;for(let wt=0,oe=U.length;wt<oe;wt++){let Pe=U[wt],Ze=Pe.object,an=Pe.geometry,Wt=Pe.material,Ot=Pe.group;if(Wt.side===Li&&Ze.layers.test(V.layers)){let si=Wt.side;Wt.side=Tn,Wt.needsUpdate=!0,zt(Ze,k,V,an,Wt,Ot),Wt.side=si,Wt.needsUpdate=!0,Tt=!0}}Tt===!0&&(z.updateMultisampleRenderTarget(st),z.updateRenderTargetMipmap(st))}v.setRenderTarget(pt),v.setClearColor(R,B),Bt!==void 0&&(V.viewport=Bt),v.toneMapping=Dt}function At(E,U,k){let V=U.isScene===!0?U.overrideMaterial:null;for(let H=0,st=E.length;H<st;H++){let ht=E[H],pt=ht.object,Dt=ht.geometry,Bt=V===null?ht.material:V,Tt=ht.group;pt.layers.test(k.layers)&&zt(pt,U,k,Dt,Bt,Tt)}}function zt(E,U,k,V,H,st){E.onBeforeRender(v,U,k,V,H,st),E.modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),H.onBeforeRender(v,U,k,V,E,st),H.transparent===!0&&H.side===Li&&H.forceSinglePass===!1?(H.side=Tn,H.needsUpdate=!0,v.renderBufferDirect(k,U,V,H,E,st),H.side=or,H.needsUpdate=!0,v.renderBufferDirect(k,U,V,H,E,st),H.side=Li):v.renderBufferDirect(k,U,V,H,E,st),E.onAfterRender(v,U,k,V,H,st)}function Se(E,U,k){U.isScene!==!0&&(U=It);let V=Pt.get(E),H=p.state.lights,st=p.state.shadowsArray,ht=H.state.version,pt=j.getParameters(E,H.state,st,U,k),Dt=j.getProgramCacheKey(pt),Bt=V.programs;V.environment=E.isMeshStandardMaterial?U.environment:null,V.fog=U.fog,V.envMap=(E.isMeshStandardMaterial?C:jt).get(E.envMap||V.environment),V.envMapRotation=V.environment!==null&&E.envMap===null?U.environmentRotation:E.envMapRotation,Bt===void 0&&(E.addEventListener("dispose",ot),Bt=new Map,V.programs=Bt);let Tt=Bt.get(Dt);if(Tt!==void 0){if(V.currentProgram===Tt&&V.lightsStateVersion===ht)return xe(E,pt),Tt}else pt.uniforms=j.getUniforms(E),E.onBuild(k,pt,v),E.onBeforeCompile(pt,v),Tt=j.acquireProgram(pt,Dt),Bt.set(Dt,Tt),V.uniforms=pt.uniforms;let wt=V.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(wt.clippingPlanes=it.uniform),xe(E,pt),V.needsLights=pe(E),V.lightsStateVersion=ht,V.needsLights&&(wt.ambientLightColor.value=H.state.ambient,wt.lightProbe.value=H.state.probe,wt.directionalLights.value=H.state.directional,wt.directionalLightShadows.value=H.state.directionalShadow,wt.spotLights.value=H.state.spot,wt.spotLightShadows.value=H.state.spotShadow,wt.rectAreaLights.value=H.state.rectArea,wt.ltc_1.value=H.state.rectAreaLTC1,wt.ltc_2.value=H.state.rectAreaLTC2,wt.pointLights.value=H.state.point,wt.pointLightShadows.value=H.state.pointShadow,wt.hemisphereLights.value=H.state.hemi,wt.directionalShadowMap.value=H.state.directionalShadowMap,wt.directionalShadowMatrix.value=H.state.directionalShadowMatrix,wt.spotShadowMap.value=H.state.spotShadowMap,wt.spotLightMatrix.value=H.state.spotLightMatrix,wt.spotLightMap.value=H.state.spotLightMap,wt.pointShadowMap.value=H.state.pointShadowMap,wt.pointShadowMatrix.value=H.state.pointShadowMatrix),V.currentProgram=Tt,V.uniformsList=null,Tt}function Jt(E){if(E.uniformsList===null){let U=E.currentProgram.getUniforms();E.uniformsList=Os.seqWithValue(U.seq,E.uniforms)}return E.uniformsList}function xe(E,U){let k=Pt.get(E);k.outputColorSpace=U.outputColorSpace,k.batching=U.batching,k.instancing=U.instancing,k.instancingColor=U.instancingColor,k.instancingMorph=U.instancingMorph,k.skinning=U.skinning,k.morphTargets=U.morphTargets,k.morphNormals=U.morphNormals,k.morphColors=U.morphColors,k.morphTargetsCount=U.morphTargetsCount,k.numClippingPlanes=U.numClippingPlanes,k.numIntersection=U.numClipIntersection,k.vertexAlphas=U.vertexAlphas,k.vertexTangents=U.vertexTangents,k.toneMapping=U.toneMapping}function ze(E,U,k,V,H){U.isScene!==!0&&(U=It),z.resetTextureUnits();let st=U.fog,ht=V.isMeshStandardMaterial?U.environment:null,pt=w===null?v.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:hr,Dt=(V.isMeshStandardMaterial?C:jt).get(V.envMap||ht),Bt=V.vertexColors===!0&&!!k.attributes.color&&k.attributes.color.itemSize===4,Tt=!!k.attributes.tangent&&(!!V.normalMap||V.anisotropy>0),wt=!!k.morphAttributes.position,oe=!!k.morphAttributes.normal,Pe=!!k.morphAttributes.color,Ze=ar;V.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(Ze=v.toneMapping);let an=k.morphAttributes.position||k.morphAttributes.normal||k.morphAttributes.color,Wt=an!==void 0?an.length:0,Ot=Pt.get(V),si=p.state.lights;if(X===!0&&(tt===!0||E!==y)){let Fn=E===y&&V.id===P;it.setState(V,E,Fn)}let le=!1;V.version===Ot.__version?(Ot.needsLights&&Ot.lightsStateVersion!==si.state.version||Ot.outputColorSpace!==pt||H.isBatchedMesh&&Ot.batching===!1||!H.isBatchedMesh&&Ot.batching===!0||H.isInstancedMesh&&Ot.instancing===!1||!H.isInstancedMesh&&Ot.instancing===!0||H.isSkinnedMesh&&Ot.skinning===!1||!H.isSkinnedMesh&&Ot.skinning===!0||H.isInstancedMesh&&Ot.instancingColor===!0&&H.instanceColor===null||H.isInstancedMesh&&Ot.instancingColor===!1&&H.instanceColor!==null||H.isInstancedMesh&&Ot.instancingMorph===!0&&H.morphTexture===null||H.isInstancedMesh&&Ot.instancingMorph===!1&&H.morphTexture!==null||Ot.envMap!==Dt||V.fog===!0&&Ot.fog!==st||Ot.numClippingPlanes!==void 0&&(Ot.numClippingPlanes!==it.numPlanes||Ot.numIntersection!==it.numIntersection)||Ot.vertexAlphas!==Bt||Ot.vertexTangents!==Tt||Ot.morphTargets!==wt||Ot.morphNormals!==oe||Ot.morphColors!==Pe||Ot.toneMapping!==Ze||Ot.morphTargetsCount!==Wt)&&(le=!0):(le=!0,Ot.__version=V.version);let fr=Ot.currentProgram;le===!0&&(fr=Se(V,U,H));let vh=!1,Xs=!1,Rl=!1,Je=fr.getUniforms(),Oi=Ot.uniforms;if(_t.useProgram(fr.program)&&(vh=!0,Xs=!0,Rl=!0),V.id!==P&&(P=V.id,Xs=!0),vh||y!==E){Je.setValue(O,"projectionMatrix",E.projectionMatrix),Je.setValue(O,"viewMatrix",E.matrixWorldInverse);let Fn=Je.map.cameraPosition;Fn!==void 0&&Fn.setValue(O,nt.setFromMatrixPosition(E.matrixWorld)),Et.logarithmicDepthBuffer&&Je.setValue(O,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(V.isMeshPhongMaterial||V.isMeshToonMaterial||V.isMeshLambertMaterial||V.isMeshBasicMaterial||V.isMeshStandardMaterial||V.isShaderMaterial)&&Je.setValue(O,"isOrthographic",E.isOrthographicCamera===!0),y!==E&&(y=E,Xs=!0,Rl=!0)}if(H.isSkinnedMesh){Je.setOptional(O,H,"bindMatrix"),Je.setOptional(O,H,"bindMatrixInverse");let Fn=H.skeleton;Fn&&(Fn.boneTexture===null&&Fn.computeBoneTexture(),Je.setValue(O,"boneTexture",Fn.boneTexture,z))}H.isBatchedMesh&&(Je.setOptional(O,H,"batchingTexture"),Je.setValue(O,"batchingTexture",H._matricesTexture,z));let Pl=k.morphAttributes;if((Pl.position!==void 0||Pl.normal!==void 0||Pl.color!==void 0)&&Mt.update(H,k,fr),(Xs||Ot.receiveShadow!==H.receiveShadow)&&(Ot.receiveShadow=H.receiveShadow,Je.setValue(O,"receiveShadow",H.receiveShadow)),V.isMeshGouraudMaterial&&V.envMap!==null&&(Oi.envMap.value=Dt,Oi.flipEnvMap.value=Dt.isCubeTexture&&Dt.isRenderTargetTexture===!1?-1:1),V.isMeshStandardMaterial&&V.envMap===null&&U.environment!==null&&(Oi.envMapIntensity.value=U.environmentIntensity),Xs&&(Je.setValue(O,"toneMappingExposure",v.toneMappingExposure),Ot.needsLights&&ve(Oi,Rl),st&&V.fog===!0&&et.refreshFogUniforms(Oi,st),et.refreshMaterialUniforms(Oi,V,J,Z,p.state.transmissionRenderTarget[E.id]),Os.upload(O,Jt(Ot),Oi,z)),V.isShaderMaterial&&V.uniformsNeedUpdate===!0&&(Os.upload(O,Jt(Ot),Oi,z),V.uniformsNeedUpdate=!1),V.isSpriteMaterial&&Je.setValue(O,"center",H.center),Je.setValue(O,"modelViewMatrix",H.modelViewMatrix),Je.setValue(O,"normalMatrix",H.normalMatrix),Je.setValue(O,"modelMatrix",H.matrixWorld),V.isShaderMaterial||V.isRawShaderMaterial){let Fn=V.uniformsGroups;for(let Il=0,Sm=Fn.length;Il<Sm;Il++){let yh=Fn[Il];Ht.update(yh,fr),Ht.bind(yh,fr)}}return fr}function ve(E,U){E.ambientLightColor.needsUpdate=U,E.lightProbe.needsUpdate=U,E.directionalLights.needsUpdate=U,E.directionalLightShadows.needsUpdate=U,E.pointLights.needsUpdate=U,E.pointLightShadows.needsUpdate=U,E.spotLights.needsUpdate=U,E.spotLightShadows.needsUpdate=U,E.rectAreaLights.needsUpdate=U,E.hemisphereLights.needsUpdate=U}function pe(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(E,U,k){Pt.get(E.texture).__webglTexture=U,Pt.get(E.depthTexture).__webglTexture=k;let V=Pt.get(E);V.__hasExternalTextures=!0,V.__autoAllocateDepthBuffer=k===void 0,V.__autoAllocateDepthBuffer||St.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),V.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(E,U){let k=Pt.get(E);k.__webglFramebuffer=U,k.__useDefaultFramebuffer=U===void 0},this.setRenderTarget=function(E,U=0,k=0){w=E,D=U,T=k;let V=!0,H=null,st=!1,ht=!1;if(E){let Dt=Pt.get(E);Dt.__useDefaultFramebuffer!==void 0?(_t.bindFramebuffer(O.FRAMEBUFFER,null),V=!1):Dt.__webglFramebuffer===void 0?z.setupRenderTarget(E):Dt.__hasExternalTextures&&z.rebindTextures(E,Pt.get(E.texture).__webglTexture,Pt.get(E.depthTexture).__webglTexture);let Bt=E.texture;(Bt.isData3DTexture||Bt.isDataArrayTexture||Bt.isCompressedArrayTexture)&&(ht=!0);let Tt=Pt.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(Tt[U])?H=Tt[U][k]:H=Tt[U],st=!0):E.samples>0&&z.useMultisampledRTT(E)===!1?H=Pt.get(E).__webglMultisampledFramebuffer:Array.isArray(Tt)?H=Tt[k]:H=Tt,x.copy(E.viewport),F.copy(E.scissor),I=E.scissorTest}else x.copy(A).multiplyScalar(J).floor(),F.copy(at).multiplyScalar(J).floor(),I=bt;if(_t.bindFramebuffer(O.FRAMEBUFFER,H)&&V&&_t.drawBuffers(E,H),_t.viewport(x),_t.scissor(F),_t.setScissorTest(I),st){let Dt=Pt.get(E.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+U,Dt.__webglTexture,k)}else if(ht){let Dt=Pt.get(E.texture),Bt=U||0;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,Dt.__webglTexture,k||0,Bt)}P=-1},this.readRenderTargetPixels=function(E,U,k,V,H,st,ht){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let pt=Pt.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&ht!==void 0&&(pt=pt[ht]),pt){_t.bindFramebuffer(O.FRAMEBUFFER,pt);try{let Dt=E.texture,Bt=Dt.format,Tt=Dt.type;if(!Et.textureFormatReadable(Bt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Et.textureTypeReadable(Tt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}U>=0&&U<=E.width-V&&k>=0&&k<=E.height-H&&O.readPixels(U,k,V,H,xt.convert(Bt),xt.convert(Tt),st)}finally{let Dt=w!==null?Pt.get(w).__webglFramebuffer:null;_t.bindFramebuffer(O.FRAMEBUFFER,Dt)}}},this.copyFramebufferToTexture=function(E,U,k=0){let V=Math.pow(2,-k),H=Math.floor(U.image.width*V),st=Math.floor(U.image.height*V);z.setTexture2D(U,0),O.copyTexSubImage2D(O.TEXTURE_2D,k,0,0,E.x,E.y,H,st),_t.unbindTexture()},this.copyTextureToTexture=function(E,U,k,V=0){let H=U.image.width,st=U.image.height,ht=xt.convert(k.format),pt=xt.convert(k.type);z.setTexture2D(k,0),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,k.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,k.unpackAlignment),U.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,V,E.x,E.y,H,st,ht,pt,U.image.data):U.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,V,E.x,E.y,U.mipmaps[0].width,U.mipmaps[0].height,ht,U.mipmaps[0].data):O.texSubImage2D(O.TEXTURE_2D,V,E.x,E.y,ht,pt,U.image),V===0&&k.generateMipmaps&&O.generateMipmap(O.TEXTURE_2D),_t.unbindTexture()},this.copyTextureToTexture3D=function(E,U,k,V,H=0){let st=E.max.x-E.min.x,ht=E.max.y-E.min.y,pt=E.max.z-E.min.z,Dt=xt.convert(V.format),Bt=xt.convert(V.type),Tt;if(V.isData3DTexture)z.setTexture3D(V,0),Tt=O.TEXTURE_3D;else if(V.isDataArrayTexture||V.isCompressedArrayTexture)z.setTexture2DArray(V,0),Tt=O.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,V.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,V.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,V.unpackAlignment);let wt=O.getParameter(O.UNPACK_ROW_LENGTH),oe=O.getParameter(O.UNPACK_IMAGE_HEIGHT),Pe=O.getParameter(O.UNPACK_SKIP_PIXELS),Ze=O.getParameter(O.UNPACK_SKIP_ROWS),an=O.getParameter(O.UNPACK_SKIP_IMAGES),Wt=k.isCompressedTexture?k.mipmaps[H]:k.image;O.pixelStorei(O.UNPACK_ROW_LENGTH,Wt.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,Wt.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,E.min.x),O.pixelStorei(O.UNPACK_SKIP_ROWS,E.min.y),O.pixelStorei(O.UNPACK_SKIP_IMAGES,E.min.z),k.isDataTexture||k.isData3DTexture?O.texSubImage3D(Tt,H,U.x,U.y,U.z,st,ht,pt,Dt,Bt,Wt.data):V.isCompressedArrayTexture?O.compressedTexSubImage3D(Tt,H,U.x,U.y,U.z,st,ht,pt,Dt,Wt.data):O.texSubImage3D(Tt,H,U.x,U.y,U.z,st,ht,pt,Dt,Bt,Wt),O.pixelStorei(O.UNPACK_ROW_LENGTH,wt),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,oe),O.pixelStorei(O.UNPACK_SKIP_PIXELS,Pe),O.pixelStorei(O.UNPACK_SKIP_ROWS,Ze),O.pixelStorei(O.UNPACK_SKIP_IMAGES,an),H===0&&V.generateMipmaps&&O.generateMipmap(Tt),_t.unbindTexture()},this.initTexture=function(E){E.isCubeTexture?z.setTextureCube(E,0):E.isData3DTexture?z.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?z.setTexture2DArray(E,0):z.setTexture2D(E,0),_t.unbindTexture()},this.resetState=function(){D=0,T=0,w=null,_t.reset(),Ut.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Fi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===mh?"display-p3":"srgb",e.unpackColorSpace=he.workingColorSpace===Dl?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}};var Ml=class r{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new re(t),this.near=e,this.far=n}clone(){return new r(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},Sl=class extends sn{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 Ni,this.environmentIntensity=1,this.environmentRotation=new Ni,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var ju=class extends Yr{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new re(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},Kp=new Re,th=new cl,$o=new Vs,Ko=new q,bl=class extends sn{constructor(t=new mi,e=new ju){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){let n=this.geometry,i=this.matrixWorld,s=t.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),$o.copy(n.boundingSphere),$o.applyMatrix4(i),$o.radius+=s,t.ray.intersectsSphere($o)===!1)return;Kp.copy(i).invert(),th.copy(t.ray).applyMatrix4(Kp);let o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,f=n.attributes.position;if(c!==null){let h=Math.max(0,a.start),d=Math.min(c.count,a.start+a.count);for(let _=h,g=d;_<g;_++){let p=c.getX(_);Ko.fromBufferAttribute(f,p),Qp(Ko,p,l,i,t,e,this)}}else{let h=Math.max(0,a.start),d=Math.min(f.count,a.start+a.count);for(let _=h,g=d;_<g;_++)Ko.fromBufferAttribute(f,_),Qp(Ko,_,l,i,t,e,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){let o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}};function Qp(r,t,e,n,i,s,a){let o=th.distanceSqToPoint(r);if(o<e){let l=new q;th.closestPointToPoint(r,l),l.applyMatrix4(n);let c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,object:a})}}function Qo(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function SS(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var Gs=class{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,n=this._cachedIndex,i=e[n],s=e[n-1];n:{t:{let a;e:{i:if(!(t<i)){for(let o=n+2;;){if(i===void 0){if(t<s)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(s=i,i=e[++n],t<i)break t}a=e.length;break e}if(!(t>=s)){let o=e[1];t<o&&(n=2,s=o);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=s,s=e[--n-1],t>=s)break t}a=n,n=0;break e}break n}for(;n<a;){let o=n+a>>>1;t<e[o]?a=o:n=o+1}if(i=e[n],s=e[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=t*i;for(let a=0;a!==i;++a)e[a]=n[s+a];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},eh=class extends Gs{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:sp,endingEnd:sp}}intervalChanged_(t,e,n){let i=this.parameterPositions,s=t-2,a=t+1,o=i[s],l=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case ap:s=t,o=2*e-n;break;case op:s=i.length-2,o=e+i[s]-i[s+1];break;default:s=t,o=n}if(l===void 0)switch(this.getSettings_().endingEnd){case ap:a=t,l=2*n-e;break;case op:a=1,l=n+i[1]-i[0];break;default:a=t-1,l=e}let c=(n-e)*.5,u=this.valueSize;this._weightPrev=c/(e-o),this._weightNext=c/(l-n),this._offsetPrev=s*u,this._offsetNext=a*u}interpolate_(t,e,n,i){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=t*o,c=l-o,u=this._offsetPrev,f=this._offsetNext,h=this._weightPrev,d=this._weightNext,_=(n-e)/(i-e),g=_*_,p=g*_,m=-h*p+2*h*g-h*_,S=(1+h)*p+(-1.5-2*h)*g+(-.5+h)*_+1,v=(-1-d)*p+(1.5+d)*g+.5*_,M=d*p-d*g;for(let D=0;D!==o;++D)s[D]=m*a[u+D]+S*a[c+D]+v*a[l+D]+M*a[f+D];return s}},nh=class extends Gs{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=t*o,c=l-o,u=(n-e)/(i-e),f=1-u;for(let h=0;h!==o;++h)s[h]=a[c+h]*f+a[l+h]*u;return s}},ih=class extends Gs{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},ri=class{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Qo(e,this.TimeBufferType),this.values=Qo(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:Qo(t.times,Array),values:Qo(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new ih(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new nh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new eh(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case tl:e=this.InterpolantFactoryMethodDiscrete;break;case el:e=this.InterpolantFactoryMethodLinear;break;case nu:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return tl;case this.InterpolantFactoryMethodLinear:return el;case this.InterpolantFactoryMethodSmooth:return nu}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){let n=this.times,i=n.length,s=0,a=i-1;for(;s!==i&&n[s]<t;)++s;for(;a!==-1&&n[a]>e;)--a;if(++a,s!==0||a!==i){s>=a&&(a=Math.max(a,1),s=a-1);let o=this.getValueSize();this.times=n.slice(s,a),this.values=this.values.slice(s*o,a*o)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==s;o++){let l=n[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),t=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),t=!1;break}a=l}if(i!==void 0&&SS(i))for(let o=0,l=i.length;o!==l;++o){let c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===nu,s=t.length-1,a=1;for(let o=1;o<s;++o){let l=!1,c=t[o],u=t[o+1];if(c!==u&&(o!==1||c!==t[0]))if(i)l=!0;else{let f=o*n,h=f-n,d=f+n;for(let _=0;_!==n;++_){let g=e[f+_];if(g!==e[h+_]||g!==e[d+_]){l=!0;break}}}if(l){if(o!==a){t[a]=t[o];let f=o*n,h=a*n;for(let d=0;d!==n;++d)e[h+d]=e[f+d]}++a}}if(s>0){t[a]=t[s];for(let o=s*n,l=a*n,c=0;c!==n;++c)e[l+c]=e[o+c];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};ri.prototype.TimeBufferType=Float32Array;ri.prototype.ValueBufferType=Float32Array;ri.prototype.DefaultInterpolation=el;var Zr=class extends ri{};Zr.prototype.ValueTypeName="bool";Zr.prototype.ValueBufferType=Array;Zr.prototype.DefaultInterpolation=tl;Zr.prototype.InterpolantFactoryMethodLinear=void 0;Zr.prototype.InterpolantFactoryMethodSmooth=void 0;var rh=class extends ri{};rh.prototype.ValueTypeName="color";var sh=class extends ri{};sh.prototype.ValueTypeName="number";var ah=class extends Gs{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-e)/(i-e),c=t*o;for(let u=c+o;c!==u;c+=4)ur.slerpFlat(s,0,a,c-o,a,c,l);return s}},Fa=class extends ri{InterpolantFactoryMethodLinear(t){return new ah(this.times,this.values,this.getValueSize(),t)}};Fa.prototype.ValueTypeName="quaternion";Fa.prototype.DefaultInterpolation=el;Fa.prototype.InterpolantFactoryMethodSmooth=void 0;var Jr=class extends ri{};Jr.prototype.ValueTypeName="string";Jr.prototype.ValueBufferType=Array;Jr.prototype.DefaultInterpolation=tl;Jr.prototype.InterpolantFactoryMethodLinear=void 0;Jr.prototype.InterpolantFactoryMethodSmooth=void 0;var oh=class extends ri{};oh.prototype.ValueTypeName="vector";var lh=class{constructor(t,e,n){let i=this,s=!1,a=0,o=0,l,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(u){o++,s===!1&&i.onStart!==void 0&&i.onStart(u,a,o),s=!0},this.itemEnd=function(u){a++,i.onProgress!==void 0&&i.onProgress(u,a,o),a===o&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(u){i.onError!==void 0&&i.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,f){return c.push(u,f),this},this.removeHandler=function(u){let f=c.indexOf(u);return f!==-1&&c.splice(f,2),this},this.getHandler=function(u){for(let f=0,h=c.length;f<h;f+=2){let d=c[f],_=c[f+1];if(d.global&&(d.lastIndex=0),d.test(u))return _}return null}}},bS=new lh,ch=class{constructor(t){this.manager=t!==void 0?t:bS,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let n=this;return new Promise(function(i,s){n.load(t,i,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};ch.DEFAULT_MATERIAL_NAME="__DEFAULT";var El=class extends sn{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new re(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}},wl=class extends El{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(sn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new re(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}},Cu=new Re,jp=new q,tm=new q,uh=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ae(512,512),this.map=null,this.mapPass=null,this.matrix=new Re,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new La,this._frameExtents=new ae(1,1),this._viewportCount=1,this._viewports=[new We(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;jp.setFromMatrixPosition(t.matrixWorld),e.position.copy(jp),tm.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(tm),e.updateMatrixWorld(),Cu.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Cu),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Cu)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}};var hh=class extends uh{constructor(){super(new _l(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},$r=class extends El{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(sn.DEFAULT_UP),this.updateMatrix(),this.target=new sn,this.shadow=new hh}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}};var _h="\\[\\]\\.:\\/",ES=new RegExp("["+_h+"]","g"),xh="[^"+_h+"]",wS="[^"+_h.replace("\\.","")+"]",TS=/((?:WC+[\/:])*)/.source.replace("WC",xh),AS=/(WCOD+)?/.source.replace("WCOD",wS),DS=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xh),CS=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xh),RS=new RegExp("^"+TS+AS+DS+CS+"$"),PS=["material","materials","bones","map"],fh=class{constructor(t,e,n){let i=n||Me.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},Me=class r{constructor(t,e,n){this.path=e,this.parsedPath=n||r.parseTrackName(e),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new r.Composite(t,e,n):new r(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(ES,"")}static parseTrackName(t){let e=RS.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);PS.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){let n=function(s){for(let a=0;a<s.length;a++){let o=s[a];if(o.name===e||o.uuid===e)return o;let l=n(o.children);if(l)return l}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)t[e++]=n[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,s=e.propertyIndex;if(t||(t=r.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let c=e.objectIndex;switch(n){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.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){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let u=0;u<t.length;u++)if(t[u].name===c){c=u;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.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[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[n]}if(c!==void 0){if(t[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[c]}}let a=t[i];if(a===void 0){let c=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",t);return}let o=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?o=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=s}else a.fromArray!==void 0&&a.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(l=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Me.Composite=fh;Me.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Me.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Me.prototype.GetterByBindingType=[Me.prototype._getValue_direct,Me.prototype._getValue_array,Me.prototype._getValue_arrayElement,Me.prototype._getValue_toArray];Me.prototype.SetterByBindingTypeAndVersioning=[[Me.prototype._setValue_direct,Me.prototype._setValue_direct_setNeedsUpdate,Me.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Me.prototype._setValue_array,Me.prototype._setValue_array_setNeedsUpdate,Me.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Me.prototype._setValue_arrayElement,Me.prototype._setValue_arrayElement_setNeedsUpdate,Me.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Me.prototype._setValue_fromArray,Me.prototype._setValue_fromArray_setNeedsUpdate,Me.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var hb=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:dh}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=dh);var Mm=()=>{var r=new ir;function t(){let e=document.querySelector("#canvas"),n=new yl({canvas:e,antialias:!0,alpha:!0}),i=new Sl,s=new _n(18);s.near=1,s.far=2e3,s.position.z=-10,n.outputColorSpace=Gn,n.shadowMap.enabled=!0,n.shadowMap.type=ph,i.fog=new Ml(3741705,9,15),i.add(r);function a(){let u=new wl(16777215,41378,1),f=new $r(3355443,4);f.position.set(5,5,5),f.lookAt(0,0,0),f.castShadow=!0,f.shadow.mapSize.width=512,f.shadow.mapSize.height=512,f.shadow.camera.near=.5,f.shadow.camera.far=500,i.add(f),i.add(u);let h=[];h[0]=new $r(16777215,1),h[0].position.set(1,0,0),h[1]=new $r(11460838,1),h[1].position.set(.75,1,.5),h[2]=new $r(14277490,1),h[2].position.set(-.75,-1,.5),i.add(h[0]),i.add(h[1]),i.add(h[2])}function o(u,f){let h=new mi,d=[],_=[],g=f||25,p=g/2;for(let v=0;v<(u||7e3);v++){let M=Math.random()*g-p,D=Math.random()*g-p,T=Math.random()*g-p;d.push(M,D,T),_.push(Math.random()*.9+.1)}h.setAttribute("position",new qn(d,3)),h.setAttribute("opacity",new qn(_,1)),h.computeBoundingSphere();let m=new Zn({vertexShader:`
3822
- attribute float opacity; // Custom attribute for opacity
3823
- varying float vOpacity; // Varying to pass opacity to fragment shader
3824
- varying float distanceToCamera; // Varying to pass distance to camera
3825
- void main() {
3821
+ }`,ih=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){let i=new Yn,s=t.properties.get(i);s.__webglTexture=e.texture,(e.depthNear!=n.depthNear||e.depthFar!=n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}render(t,e){if(this.texture!==null){if(this.mesh===null){let n=e.cameras[0].viewport,i=new Zn({vertexShader:OS,fragmentShader:BS,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new ii(new yl(20,20),i)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},rh=class extends ur{constructor(t,e){super();let n=this,i=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,f=null,d=null,_=null,g=new ih,p=e.getContextAttributes(),m=null,S=null,v=[],M=[],D=new oe,T=null,E=new xn;E.layers.enable(1),E.viewport=new Xe;let R=new xn;R.layers.enable(2),R.viewport=new Xe;let y=[E,R],x=new nh;x.layers.enable(1),x.layers.enable(2);let L=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let Q=v[q];return Q===void 0&&(Q=new No,v[q]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(q){let Q=v[q];return Q===void 0&&(Q=new No,v[q]=Q),Q.getGripSpace()},this.getHand=function(q){let Q=v[q];return Q===void 0&&(Q=new No,v[q]=Q),Q.getHandSpace()};function P(q){let Q=M.indexOf(q.inputSource);if(Q===-1)return;let ct=v[Q];ct!==void 0&&(ct.update(q.inputSource,q.frame,c||o),ct.dispatchEvent({type:q.type,data:q.inputSource}))}function B(){i.removeEventListener("select",P),i.removeEventListener("selectstart",P),i.removeEventListener("selectend",P),i.removeEventListener("squeeze",P),i.removeEventListener("squeezestart",P),i.removeEventListener("squeezeend",P),i.removeEventListener("end",B),i.removeEventListener("inputsourceschange",X);for(let q=0;q<v.length;q++){let Q=M[q];Q!==null&&(M[q]=null,v[q].disconnect(Q))}L=null,F=null,g.reset(),t.setRenderTarget(m),d=null,f=null,h=null,i=null,S=null,Wt.stop(),n.isPresenting=!1,t.setPixelRatio(T),t.setSize(D.width,D.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(q){s=q,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(q){a=q,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(q){c=q},this.getBaseLayer=function(){return f!==null?f:d},this.getBinding=function(){return h},this.getFrame=function(){return _},this.getSession=function(){return i},this.setSession=async function(q){if(i=q,i!==null){if(m=t.getRenderTarget(),i.addEventListener("select",P),i.addEventListener("selectstart",P),i.addEventListener("selectend",P),i.addEventListener("squeeze",P),i.addEventListener("squeezestart",P),i.addEventListener("squeezeend",P),i.addEventListener("end",B),i.addEventListener("inputsourceschange",X),p.xrCompatible!==!0&&await e.makeXRCompatible(),T=t.getPixelRatio(),t.getSize(D),i.renderState.layers===void 0){let Q={antialias:p.antialias,alpha:!0,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,e,Q),i.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),S=new Ui(d.framebufferWidth,d.framebufferHeight,{format:pi,type:cr,colorSpace:t.outputColorSpace,stencilBuffer:p.stencil})}else{let Q=null,ct=null,tt=null;p.depth&&(tt=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Q=p.stencil?Uo:Os,ct=p.stencil?ko:Hs);let It={colorFormat:e.RGBA8,depthFormat:tt,scaleFactor:s};h=new XRWebGLBinding(i,e),f=h.createProjectionLayer(It),i.updateRenderState({layers:[f]}),t.setPixelRatio(1),t.setSize(f.textureWidth,f.textureHeight,!1),S=new Ui(f.textureWidth,f.textureHeight,{format:pi,type:cr,depthTexture:new bl(f.textureWidth,f.textureHeight,ct,void 0,void 0,void 0,void 0,void 0,void 0,Q),stencilBuffer:p.stencil,colorSpace:t.outputColorSpace,samples:p.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await i.requestReferenceSpace(a),Wt.setContext(i),Wt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function X(q){for(let Q=0;Q<q.removed.length;Q++){let ct=q.removed[Q],tt=M.indexOf(ct);tt>=0&&(M[tt]=null,v[tt].disconnect(ct))}for(let Q=0;Q<q.added.length;Q++){let ct=q.added[Q],tt=M.indexOf(ct);if(tt===-1){for(let Rt=0;Rt<v.length;Rt++)if(Rt>=M.length){M.push(ct),tt=Rt;break}else if(M[Rt]===null){M[Rt]=ct,tt=Rt;break}if(tt===-1)break}let It=v[tt];It&&It.connect(ct)}}let G=new Z,J=new Z;function U(q,Q,ct){G.setFromMatrixPosition(Q.matrixWorld),J.setFromMatrixPosition(ct.matrixWorld);let tt=G.distanceTo(J),It=Q.projectionMatrix.elements,Rt=ct.projectionMatrix.elements,z=It[14]/(It[10]-1),Xt=It[14]/(It[10]+1),bt=(It[9]+1)/It[5],wt=(It[9]-1)/It[5],_t=(It[8]-1)/It[0],Ft=(Rt[8]+1)/Rt[0],Pt=z*_t,k=z*Ft,jt=tt/(-_t+Ft),C=jt*-_t;Q.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(C),q.translateZ(jt),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert();let b=z+jt,Y=Xt+jt,j=Pt-C,et=k+(tt-C),nt=bt*Xt/Y*b,mt=wt*Xt/Y*b;q.projectionMatrix.makePerspective(j,et,nt,mt,b,Y),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}function I(q,Q){Q===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(Q.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(i===null)return;g.texture!==null&&(q.near=g.depthNear,q.far=g.depthFar),x.near=R.near=E.near=q.near,x.far=R.far=E.far=q.far,(L!==x.near||F!==x.far)&&(i.updateRenderState({depthNear:x.near,depthFar:x.far}),L=x.near,F=x.far,E.near=L,E.far=F,R.near=L,R.far=F,E.updateProjectionMatrix(),R.updateProjectionMatrix(),q.updateProjectionMatrix());let Q=q.parent,ct=x.cameras;I(x,Q);for(let tt=0;tt<ct.length;tt++)I(ct[tt],Q);ct.length===2?U(x,E,R):x.projectionMatrix.copy(E.projectionMatrix),A(q,x,Q)};function A(q,Q,ct){ct===null?q.matrix.copy(Q.matrixWorld):(q.matrix.copy(ct.matrixWorld),q.matrix.invert(),q.matrix.multiply(Q.matrixWorld)),q.matrix.decompose(q.position,q.quaternion,q.scale),q.updateMatrixWorld(!0),q.projectionMatrix.copy(Q.projectionMatrix),q.projectionMatrixInverse.copy(Q.projectionMatrixInverse),q.isPerspectiveCamera&&(q.fov=Hu*2*Math.atan(1/q.projectionMatrix.elements[5]),q.zoom=1)}this.getCamera=function(){return x},this.getFoveation=function(){if(!(f===null&&d===null))return l},this.setFoveation=function(q){l=q,f!==null&&(f.fixedFoveation=q),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=q)},this.hasDepthSensing=function(){return g.texture!==null};let it=null;function vt(q,Q){if(u=Q.getViewerPose(c||o),_=Q,u!==null){let ct=u.views;d!==null&&(t.setRenderTargetFramebuffer(S,d.framebuffer),t.setRenderTarget(S));let tt=!1;ct.length!==x.cameras.length&&(x.cameras.length=0,tt=!0);for(let Rt=0;Rt<ct.length;Rt++){let z=ct[Rt],Xt=null;if(d!==null)Xt=d.getViewport(z);else{let wt=h.getViewSubImage(f,z);Xt=wt.viewport,Rt===0&&(t.setRenderTargetTextures(S,wt.colorTexture,f.ignoreDepthValues?void 0:wt.depthStencilTexture),t.setRenderTarget(S))}let bt=y[Rt];bt===void 0&&(bt=new xn,bt.layers.enable(Rt),bt.viewport=new Xe,y[Rt]=bt),bt.matrix.fromArray(z.transform.matrix),bt.matrix.decompose(bt.position,bt.quaternion,bt.scale),bt.projectionMatrix.fromArray(z.projectionMatrix),bt.projectionMatrixInverse.copy(bt.projectionMatrix).invert(),bt.viewport.set(Xt.x,Xt.y,Xt.width,Xt.height),Rt===0&&(x.matrix.copy(bt.matrix),x.matrix.decompose(x.position,x.quaternion,x.scale)),tt===!0&&x.cameras.push(bt)}let It=i.enabledFeatures;if(It&&It.includes("depth-sensing")){let Rt=h.getDepthInformation(ct[0]);Rt&&Rt.isValid&&Rt.texture&&g.init(t,Rt,i.renderState)}}for(let ct=0;ct<v.length;ct++){let tt=M[ct],It=v[ct];tt!==null&&It!==void 0&&It.update(tt,Q,c||o)}g.render(t,x),it&&it(q,Q),Q.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Q}),_=null}let Wt=new Tm;Wt.setAnimationLoop(vt),this.setAnimationLoop=function(q){it=q},this.dispose=function(){}}},Vr=new Oi,zS=new Pe;function kS(r,t){function e(p,m){p.matrixAutoUpdate===!0&&p.updateMatrix(),m.value.copy(p.matrix)}function n(p,m){m.color.getRGB(p.fogColor.value,Em(r)),m.isFog?(p.fogNear.value=m.near,p.fogFar.value=m.far):m.isFogExp2&&(p.fogDensity.value=m.density)}function i(p,m,S,v,M){m.isMeshBasicMaterial||m.isMeshLambertMaterial?s(p,m):m.isMeshToonMaterial?(s(p,m),h(p,m)):m.isMeshPhongMaterial?(s(p,m),u(p,m)):m.isMeshStandardMaterial?(s(p,m),f(p,m),m.isMeshPhysicalMaterial&&d(p,m,M)):m.isMeshMatcapMaterial?(s(p,m),_(p,m)):m.isMeshDepthMaterial?s(p,m):m.isMeshDistanceMaterial?(s(p,m),g(p,m)):m.isMeshNormalMaterial?s(p,m):m.isLineBasicMaterial?(o(p,m),m.isLineDashedMaterial&&a(p,m)):m.isPointsMaterial?l(p,m,S,v):m.isSpriteMaterial?c(p,m):m.isShadowMaterial?(p.color.value.copy(m.color),p.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function s(p,m){p.opacity.value=m.opacity,m.color&&p.diffuse.value.copy(m.color),m.emissive&&p.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(p.map.value=m.map,e(m.map,p.mapTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,e(m.alphaMap,p.alphaMapTransform)),m.bumpMap&&(p.bumpMap.value=m.bumpMap,e(m.bumpMap,p.bumpMapTransform),p.bumpScale.value=m.bumpScale,m.side===Tn&&(p.bumpScale.value*=-1)),m.normalMap&&(p.normalMap.value=m.normalMap,e(m.normalMap,p.normalMapTransform),p.normalScale.value.copy(m.normalScale),m.side===Tn&&p.normalScale.value.negate()),m.displacementMap&&(p.displacementMap.value=m.displacementMap,e(m.displacementMap,p.displacementMapTransform),p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias),m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap,e(m.emissiveMap,p.emissiveMapTransform)),m.specularMap&&(p.specularMap.value=m.specularMap,e(m.specularMap,p.specularMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let S=t.get(m),v=S.envMap,M=S.envMapRotation;if(v&&(p.envMap.value=v,Vr.copy(M),Vr.x*=-1,Vr.y*=-1,Vr.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(Vr.y*=-1,Vr.z*=-1),p.envMapRotation.value.setFromMatrix4(zS.makeRotationFromEuler(Vr)),p.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=m.reflectivity,p.ior.value=m.ior,p.refractionRatio.value=m.refractionRatio),m.lightMap){p.lightMap.value=m.lightMap;let D=r._useLegacyLights===!0?Math.PI:1;p.lightMapIntensity.value=m.lightMapIntensity*D,e(m.lightMap,p.lightMapTransform)}m.aoMap&&(p.aoMap.value=m.aoMap,p.aoMapIntensity.value=m.aoMapIntensity,e(m.aoMap,p.aoMapTransform))}function o(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,m.map&&(p.map.value=m.map,e(m.map,p.mapTransform))}function a(p,m){p.dashSize.value=m.dashSize,p.totalSize.value=m.dashSize+m.gapSize,p.scale.value=m.scale}function l(p,m,S,v){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.size.value=m.size*S,p.scale.value=v*.5,m.map&&(p.map.value=m.map,e(m.map,p.uvTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,e(m.alphaMap,p.alphaMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest)}function c(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.rotation.value=m.rotation,m.map&&(p.map.value=m.map,e(m.map,p.mapTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,e(m.alphaMap,p.alphaMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest)}function u(p,m){p.specular.value.copy(m.specular),p.shininess.value=Math.max(m.shininess,1e-4)}function h(p,m){m.gradientMap&&(p.gradientMap.value=m.gradientMap)}function f(p,m){p.metalness.value=m.metalness,m.metalnessMap&&(p.metalnessMap.value=m.metalnessMap,e(m.metalnessMap,p.metalnessMapTransform)),p.roughness.value=m.roughness,m.roughnessMap&&(p.roughnessMap.value=m.roughnessMap,e(m.roughnessMap,p.roughnessMapTransform)),m.envMap&&(p.envMapIntensity.value=m.envMapIntensity)}function d(p,m,S){p.ior.value=m.ior,m.sheen>0&&(p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(p.sheenColorMap.value=m.sheenColorMap,e(m.sheenColorMap,p.sheenColorMapTransform)),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap,e(m.sheenRoughnessMap,p.sheenRoughnessMapTransform))),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap,e(m.clearcoatMap,p.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,e(m.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(p.clearcoatNormalMap.value=m.clearcoatNormalMap,e(m.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Tn&&p.clearcoatNormalScale.value.negate())),m.dispersion>0&&(p.dispersion.value=m.dispersion),m.iridescence>0&&(p.iridescence.value=m.iridescence,p.iridescenceIOR.value=m.iridescenceIOR,p.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(p.iridescenceMap.value=m.iridescenceMap,e(m.iridescenceMap,p.iridescenceMapTransform)),m.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=m.iridescenceThicknessMap,e(m.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=S.texture,p.transmissionSamplerSize.value.set(S.width,S.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap,e(m.transmissionMap,p.transmissionMapTransform)),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap,e(m.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=m.attenuationDistance,p.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(p.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(p.anisotropyMap.value=m.anisotropyMap,e(m.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap,e(m.specularColorMap,p.specularColorMapTransform)),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap,e(m.specularIntensityMap,p.specularIntensityMapTransform))}function _(p,m){m.matcap&&(p.matcap.value=m.matcap)}function g(p,m){let S=t.get(m).light;p.referencePosition.value.setFromMatrixPosition(S.matrixWorld),p.nearDistance.value=S.shadow.camera.near,p.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function VS(r,t,e,n){let i={},s={},o=[],a=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,v){let M=v.program;n.uniformBlockBinding(S,M)}function c(S,v){let M=i[S.id];M===void 0&&(_(S),M=u(S),i[S.id]=M,S.addEventListener("dispose",p));let D=v.program;n.updateUBOMapping(S,D);let T=t.render.frame;s[S.id]!==T&&(f(S),s[S.id]=T)}function u(S){let v=h();S.__bindingPointIndex=v;let M=r.createBuffer(),D=S.__size,T=S.usage;return r.bindBuffer(r.UNIFORM_BUFFER,M),r.bufferData(r.UNIFORM_BUFFER,D,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,M),M}function h(){for(let S=0;S<a;S++)if(o.indexOf(S)===-1)return o.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(S){let v=i[S.id],M=S.uniforms,D=S.__cache;r.bindBuffer(r.UNIFORM_BUFFER,v);for(let T=0,E=M.length;T<E;T++){let R=Array.isArray(M[T])?M[T]:[M[T]];for(let y=0,x=R.length;y<x;y++){let L=R[y];if(d(L,T,y,D)===!0){let F=L.__offset,P=Array.isArray(L.value)?L.value:[L.value],B=0;for(let X=0;X<P.length;X++){let G=P[X],J=g(G);typeof G=="number"||typeof G=="boolean"?(L.__data[0]=G,r.bufferSubData(r.UNIFORM_BUFFER,F+B,L.__data)):G.isMatrix3?(L.__data[0]=G.elements[0],L.__data[1]=G.elements[1],L.__data[2]=G.elements[2],L.__data[3]=0,L.__data[4]=G.elements[3],L.__data[5]=G.elements[4],L.__data[6]=G.elements[5],L.__data[7]=0,L.__data[8]=G.elements[6],L.__data[9]=G.elements[7],L.__data[10]=G.elements[8],L.__data[11]=0):(G.toArray(L.__data,B),B+=J.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,F,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function d(S,v,M,D){let T=S.value,E=v+"_"+M;if(D[E]===void 0)return typeof T=="number"||typeof T=="boolean"?D[E]=T:D[E]=T.clone(),!0;{let R=D[E];if(typeof T=="number"||typeof T=="boolean"){if(R!==T)return D[E]=T,!0}else if(R.equals(T)===!1)return R.copy(T),!0}return!1}function _(S){let v=S.uniforms,M=0,D=16;for(let E=0,R=v.length;E<R;E++){let y=Array.isArray(v[E])?v[E]:[v[E]];for(let x=0,L=y.length;x<L;x++){let F=y[x],P=Array.isArray(F.value)?F.value:[F.value];for(let B=0,X=P.length;B<X;B++){let G=P[B],J=g(G),U=M%D;U!==0&&D-U<J.boundary&&(M+=D-U),F.__data=new Float32Array(J.storage/Float32Array.BYTES_PER_ELEMENT),F.__offset=M,M+=J.storage}}}let T=M%D;return T>0&&(M+=D-T),S.__size=M,S.__cache={},this}function g(S){let v={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(v.boundary=4,v.storage=4):S.isVector2?(v.boundary=8,v.storage=8):S.isVector3||S.isColor?(v.boundary=16,v.storage=12):S.isVector4?(v.boundary=16,v.storage=16):S.isMatrix3?(v.boundary=48,v.storage=48):S.isMatrix4?(v.boundary=64,v.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),v}function p(S){let v=S.target;v.removeEventListener("dispose",p);let M=o.indexOf(v.__bindingPointIndex);o.splice(M,1),r.deleteBuffer(i[v.id]),delete i[v.id],delete s[v.id]}function m(){for(let S in i)r.deleteBuffer(i[S]);o=[],i={},s={}}return{bind:l,update:c,dispose:m}}var wl=class{constructor(t={}){let{canvas:e=J0(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1}=t;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=o;let d=new Uint32Array(4),_=new Int32Array(4),g=null,p=null,m=[],S=[];this.domElement=e,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._outputColorSpace=Gn,this._useLegacyLights=!1,this.toneMapping=ar,this.toneMappingExposure=1;let v=this,M=!1,D=0,T=0,E=null,R=-1,y=null,x=new Xe,L=new Xe,F=null,P=new re(0),B=0,X=e.width,G=e.height,J=1,U=null,I=null,A=new Xe(0,0,X,G),it=new Xe(0,0,X,G),vt=!1,Wt=new Bo,q=!1,Q=!1,ct=new Pe,tt=new Z,It={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Rt(){return E===null?J:1}let z=n;function Xt(w,O){return e.getContext(w,O)}try{let w={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${vh}`),e.addEventListener("webglcontextlost",N,!1),e.addEventListener("webglcontextrestored",$,!1),e.addEventListener("webglcontextcreationerror",K,!1),z===null){let O="webgl2";if(z=Xt(O,w),z===null)throw Xt(O)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(w){throw console.error("THREE.WebGLRenderer: "+w.message),w}let bt,wt,_t,Ft,Pt,k,jt,C,b,Y,j,et,nt,mt,lt,rt,Lt,st,St,Jt,gt,xt,Nt,Gt;function ue(){bt=new oM(z),bt.init(),xt=new NS(z,bt),wt=new tM(z,bt,t,xt),_t=new LS(z),Ft=new cM(z),Pt=new MS,k=new FS(z,bt,_t,Pt,wt,xt,Ft),jt=new nM(v),C=new sM(v),b=new gx(z),Nt=new Qy(z,b),Y=new aM(z,b,Ft,Nt),j=new hM(z,Y,b,Ft),St=new uM(z,wt,k),rt=new eM(Pt),et=new yS(v,jt,C,bt,wt,Nt,rt),nt=new kS(v,Pt),mt=new bS,lt=new CS(bt),st=new Ky(v,jt,C,_t,j,f,l),Lt=new IS(v,j,wt),Gt=new VS(z,Ft,wt,_t),Jt=new jy(z,bt,Ft),gt=new lM(z,bt,Ft),Ft.programs=et.programs,v.capabilities=wt,v.extensions=bt,v.properties=Pt,v.renderLists=mt,v.shadowMap=Lt,v.state=_t,v.info=Ft}ue();let Ut=new rh(v,z);this.xr=Ut,this.getContext=function(){return z},this.getContextAttributes=function(){return z.getContextAttributes()},this.forceContextLoss=function(){let w=bt.get("WEBGL_lose_context");w&&w.loseContext()},this.forceContextRestore=function(){let w=bt.get("WEBGL_lose_context");w&&w.restoreContext()},this.getPixelRatio=function(){return J},this.setPixelRatio=function(w){w!==void 0&&(J=w,this.setSize(X,G,!1))},this.getSize=function(w){return w.set(X,G)},this.setSize=function(w,O,V=!0){if(Ut.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=w,G=O,e.width=Math.floor(w*J),e.height=Math.floor(O*J),V===!0&&(e.style.width=w+"px",e.style.height=O+"px"),this.setViewport(0,0,w,O)},this.getDrawingBufferSize=function(w){return w.set(X*J,G*J).floor()},this.setDrawingBufferSize=function(w,O,V){X=w,G=O,J=V,e.width=Math.floor(w*V),e.height=Math.floor(O*V),this.setViewport(0,0,w,O)},this.getCurrentViewport=function(w){return w.copy(x)},this.getViewport=function(w){return w.copy(A)},this.setViewport=function(w,O,V,H){w.isVector4?A.set(w.x,w.y,w.z,w.w):A.set(w,O,V,H),_t.viewport(x.copy(A).multiplyScalar(J).round())},this.getScissor=function(w){return w.copy(it)},this.setScissor=function(w,O,V,H){w.isVector4?it.set(w.x,w.y,w.z,w.w):it.set(w,O,V,H),_t.scissor(L.copy(it).multiplyScalar(J).round())},this.getScissorTest=function(){return vt},this.setScissorTest=function(w){_t.setScissorTest(vt=w)},this.setOpaqueSort=function(w){U=w},this.setTransparentSort=function(w){I=w},this.getClearColor=function(w){return w.copy(st.getClearColor())},this.setClearColor=function(){st.setClearColor.apply(st,arguments)},this.getClearAlpha=function(){return st.getClearAlpha()},this.setClearAlpha=function(){st.setClearAlpha.apply(st,arguments)},this.clear=function(w=!0,O=!0,V=!0){let H=0;if(w){let W=!1;if(E!==null){let ot=E.texture.format;W=ot===Mm||ot===ym||ot===vm}if(W){let ot=E.texture.type,ft=ot===cr||ot===Hs||ot===mm||ot===ko||ot===_m||ot===xm,pt=st.getClearColor(),Dt=st.getClearAlpha(),Bt=pt.r,Tt=pt.g,Et=pt.b;ft?(d[0]=Bt,d[1]=Tt,d[2]=Et,d[3]=Dt,z.clearBufferuiv(z.COLOR,0,d)):(_[0]=Bt,_[1]=Tt,_[2]=Et,_[3]=Dt,z.clearBufferiv(z.COLOR,0,_))}else H|=z.COLOR_BUFFER_BIT}O&&(H|=z.DEPTH_BUFFER_BIT),V&&(H|=z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),z.clear(H)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",N,!1),e.removeEventListener("webglcontextrestored",$,!1),e.removeEventListener("webglcontextcreationerror",K,!1),mt.dispose(),lt.dispose(),Pt.dispose(),jt.dispose(),C.dispose(),j.dispose(),Nt.dispose(),Gt.dispose(),et.dispose(),Ut.dispose(),Ut.removeEventListener("sessionstart",te),Ut.removeEventListener("sessionend",Ct),yt.stop()};function N(w){w.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function $(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;let w=Ft.autoReset,O=Lt.enabled,V=Lt.autoUpdate,H=Lt.needsUpdate,W=Lt.type;ue(),Ft.autoReset=w,Lt.enabled=O,Lt.autoUpdate=V,Lt.needsUpdate=H,Lt.type=W}function K(w){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",w.statusMessage)}function at(w){let O=w.target;O.removeEventListener("dispose",at),ut(O)}function ut(w){Vt(w),Pt.remove(w)}function Vt(w){let O=Pt.get(w).programs;O!==void 0&&(O.forEach(function(V){et.releaseProgram(V)}),w.isShaderMaterial&&et.releaseShaderCache(w))}this.renderBufferDirect=function(w,O,V,H,W,ot){O===null&&(O=It);let ft=W.isMesh&&W.matrixWorld.determinant()<0,pt=ke(w,O,V,H,W);_t.setMaterial(H,ft);let Dt=V.index,Bt=1;if(H.wireframe===!0){if(Dt=Y.getWireframeAttribute(V),Dt===void 0)return;Bt=2}let Tt=V.drawRange,Et=V.attributes.position,ae=Tt.start*Bt,Ie=(Tt.start+Tt.count)*Bt;ot!==null&&(ae=Math.max(ae,ot.start*Bt),Ie=Math.min(Ie,(ot.start+ot.count)*Bt)),Dt!==null?(ae=Math.max(ae,0),Ie=Math.min(Ie,Dt.count)):Et!=null&&(ae=Math.max(ae,0),Ie=Math.min(Ie,Et.count));let Je=Ie-ae;if(Je<0||Je===1/0)return;Nt.setup(W,H,pt,V,Dt);let an,qt=Jt;if(Dt!==null&&(an=b.get(Dt),qt=gt,qt.setIndex(an)),W.isMesh)H.wireframe===!0?(_t.setLineWidth(H.wireframeLinewidth*Rt()),qt.setMode(z.LINES)):qt.setMode(z.TRIANGLES);else if(W.isLine){let Ot=H.linewidth;Ot===void 0&&(Ot=1),_t.setLineWidth(Ot*Rt()),W.isLineSegments?qt.setMode(z.LINES):W.isLineLoop?qt.setMode(z.LINE_LOOP):qt.setMode(z.LINE_STRIP)}else W.isPoints?qt.setMode(z.POINTS):W.isSprite&&qt.setMode(z.TRIANGLES);if(W.isBatchedMesh)W._multiDrawInstances!==null?qt.renderMultiDrawInstances(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount,W._multiDrawInstances):qt.renderMultiDraw(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount);else if(W.isInstancedMesh)qt.renderInstances(ae,Je,W.count);else if(V.isInstancedBufferGeometry){let Ot=V._maxInstanceCount!==void 0?V._maxInstanceCount:1/0,si=Math.min(V.instanceCount,Ot);qt.renderInstances(ae,Je,si)}else qt.render(ae,Je)};function se(w,O,V){w.transparent===!0&&w.side===Fi&&w.forceSinglePass===!1?(w.side=Tn,w.needsUpdate=!0,be(w,O,V),w.side=lr,w.needsUpdate=!0,be(w,O,V),w.side=Fi):be(w,O,V)}this.compile=function(w,O,V=null){V===null&&(V=w),p=lt.get(V),p.init(O),S.push(p),V.traverseVisible(function(W){W.isLight&&W.layers.test(O.layers)&&(p.pushLight(W),W.castShadow&&p.pushShadow(W))}),w!==V&&w.traverseVisible(function(W){W.isLight&&W.layers.test(O.layers)&&(p.pushLight(W),W.castShadow&&p.pushShadow(W))}),p.setupLights(v._useLegacyLights);let H=new Set;return w.traverse(function(W){let ot=W.material;if(ot)if(Array.isArray(ot))for(let ft=0;ft<ot.length;ft++){let pt=ot[ft];se(pt,V,W),H.add(pt)}else se(ot,V,W),H.add(ot)}),S.pop(),p=null,H},this.compileAsync=function(w,O,V=null){let H=this.compile(w,O,V);return new Promise(W=>{function ot(){if(H.forEach(function(ft){Pt.get(ft).currentProgram.isReady()&&H.delete(ft)}),H.size===0){W(w);return}setTimeout(ot,10)}bt.get("KHR_parallel_shader_compile")!==null?ot():setTimeout(ot,10)})};let ce=null;function pe(w){ce&&ce(w)}function te(){yt.stop()}function Ct(){yt.start()}let yt=new Tm;yt.setAnimationLoop(pe),typeof self<"u"&&yt.setContext(self),this.setAnimationLoop=function(w){ce=w,Ut.setAnimationLoop(w),w===null?yt.stop():yt.start()},Ut.addEventListener("sessionstart",te),Ut.addEventListener("sessionend",Ct),this.render=function(w,O){if(O!==void 0&&O.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;w.matrixWorldAutoUpdate===!0&&w.updateMatrixWorld(),O.parent===null&&O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),Ut.enabled===!0&&Ut.isPresenting===!0&&(Ut.cameraAutoUpdate===!0&&Ut.updateCamera(O),O=Ut.getCamera()),w.isScene===!0&&w.onBeforeRender(v,w,O,E),p=lt.get(w,S.length),p.init(O),S.push(p),ct.multiplyMatrices(O.projectionMatrix,O.matrixWorldInverse),Wt.setFromProjectionMatrix(ct),Q=this.localClippingEnabled,q=rt.init(this.clippingPlanes,Q),g=mt.get(w,m.length),g.init(),m.push(g),ie(w,O,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(U,I);let V=Ut.enabled===!1||Ut.isPresenting===!1||Ut.hasDepthSensing()===!1;V&&st.addToRenderList(g,w),this.info.render.frame++,q===!0&&rt.beginShadows();let H=p.state.shadowsArray;Lt.render(H,w,O),q===!0&&rt.endShadows(),this.info.autoReset===!0&&this.info.reset();let W=g.opaque,ot=g.transmissive;if(p.setupLights(v._useLegacyLights),O.isArrayCamera){let ft=O.cameras;if(ot.length>0)for(let pt=0,Dt=ft.length;pt<Dt;pt++){let Bt=ft[pt];kt(W,ot,w,Bt)}V&&st.render(w);for(let pt=0,Dt=ft.length;pt<Dt;pt++){let Bt=ft[pt];ht(g,w,Bt,Bt.viewport)}}else ot.length>0&&kt(W,ot,w,O),V&&st.render(w),ht(g,w,O);E!==null&&(k.updateMultisampleRenderTarget(E),k.updateRenderTargetMipmap(E)),w.isScene===!0&&w.onAfterRender(v,w,O),Nt.resetDefaultState(),R=-1,y=null,S.pop(),S.length>0?(p=S[S.length-1],q===!0&&rt.setGlobalState(v.clippingPlanes,p.state.camera)):p=null,m.pop(),m.length>0?g=m[m.length-1]:g=null};function ie(w,O,V,H){if(w.visible===!1)return;if(w.layers.test(O.layers)){if(w.isGroup)V=w.renderOrder;else if(w.isLOD)w.autoUpdate===!0&&w.update(O);else if(w.isLight)p.pushLight(w),w.castShadow&&p.pushShadow(w);else if(w.isSprite){if(!w.frustumCulled||Wt.intersectsSprite(w)){H&&tt.setFromMatrixPosition(w.matrixWorld).applyMatrix4(ct);let ft=j.update(w),pt=w.material;pt.visible&&g.push(w,ft,pt,V,tt.z,null)}}else if((w.isMesh||w.isLine||w.isPoints)&&(!w.frustumCulled||Wt.intersectsObject(w))){let ft=j.update(w),pt=w.material;if(H&&(w.boundingSphere!==void 0?(w.boundingSphere===null&&w.computeBoundingSphere(),tt.copy(w.boundingSphere.center)):(ft.boundingSphere===null&&ft.computeBoundingSphere(),tt.copy(ft.boundingSphere.center)),tt.applyMatrix4(w.matrixWorld).applyMatrix4(ct)),Array.isArray(pt)){let Dt=ft.groups;for(let Bt=0,Tt=Dt.length;Bt<Tt;Bt++){let Et=Dt[Bt],ae=pt[Et.materialIndex];ae&&ae.visible&&g.push(w,ft,ae,V,tt.z,Et)}}else pt.visible&&g.push(w,ft,pt,V,tt.z,null)}}let ot=w.children;for(let ft=0,pt=ot.length;ft<pt;ft++)ie(ot[ft],O,V,H)}function ht(w,O,V,H){let W=w.opaque,ot=w.transmissive,ft=w.transparent;p.setupLightsView(V),q===!0&&rt.setGlobalState(v.clippingPlanes,V),H&&_t.viewport(x.copy(H)),W.length>0&&At(W,O,V),ot.length>0&&At(ot,O,V),ft.length>0&&At(ft,O,V),_t.buffers.depth.setTest(!0),_t.buffers.depth.setMask(!0),_t.buffers.color.setMask(!0),_t.setPolygonOffset(!1)}function kt(w,O,V,H){if((V.isScene===!0?V.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[H.id]===void 0&&(p.state.transmissionRenderTarget[H.id]=new Ui(1,1,{generateMipmaps:!0,type:bt.has("EXT_color_buffer_half_float")||bt.has("EXT_color_buffer_float")?Pl:cr,minFilter:qr,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));let ot=p.state.transmissionRenderTarget[H.id],ft=H.viewport||x;ot.setSize(ft.z,ft.w);let pt=v.getRenderTarget();v.setRenderTarget(ot),v.getClearColor(P),B=v.getClearAlpha(),B<1&&v.setClearColor(16777215,.5),v.clear();let Dt=v.toneMapping;v.toneMapping=ar;let Bt=H.viewport;if(H.viewport!==void 0&&(H.viewport=void 0),p.setupLightsView(H),q===!0&&rt.setGlobalState(v.clippingPlanes,H),At(w,V,H),k.updateMultisampleRenderTarget(ot),k.updateRenderTargetMipmap(ot),bt.has("WEBGL_multisampled_render_to_texture")===!1){let Tt=!1;for(let Et=0,ae=O.length;Et<ae;Et++){let Ie=O[Et],Je=Ie.object,an=Ie.geometry,qt=Ie.material,Ot=Ie.group;if(qt.side===Fi&&Je.layers.test(H.layers)){let si=qt.side;qt.side=Tn,qt.needsUpdate=!0,zt(Je,V,H,an,qt,Ot),qt.side=si,qt.needsUpdate=!0,Tt=!0}}Tt===!0&&(k.updateMultisampleRenderTarget(ot),k.updateRenderTargetMipmap(ot))}v.setRenderTarget(pt),v.setClearColor(P,B),Bt!==void 0&&(H.viewport=Bt),v.toneMapping=Dt}function At(w,O,V){let H=O.isScene===!0?O.overrideMaterial:null;for(let W=0,ot=w.length;W<ot;W++){let ft=w[W],pt=ft.object,Dt=ft.geometry,Bt=H===null?ft.material:H,Tt=ft.group;pt.layers.test(V.layers)&&zt(pt,O,V,Dt,Bt,Tt)}}function zt(w,O,V,H,W,ot){w.onBeforeRender(v,O,V,H,W,ot),w.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,w.matrixWorld),w.normalMatrix.getNormalMatrix(w.modelViewMatrix),W.onBeforeRender(v,O,V,H,w,ot),W.transparent===!0&&W.side===Fi&&W.forceSinglePass===!1?(W.side=Tn,W.needsUpdate=!0,v.renderBufferDirect(V,O,H,W,w,ot),W.side=lr,W.needsUpdate=!0,v.renderBufferDirect(V,O,H,W,w,ot),W.side=Fi):v.renderBufferDirect(V,O,H,W,w,ot),w.onAfterRender(v,O,V,H,W,ot)}function be(w,O,V){O.isScene!==!0&&(O=It);let H=Pt.get(w),W=p.state.lights,ot=p.state.shadowsArray,ft=W.state.version,pt=et.getParameters(w,W.state,ot,O,V),Dt=et.getProgramCacheKey(pt),Bt=H.programs;H.environment=w.isMeshStandardMaterial?O.environment:null,H.fog=O.fog,H.envMap=(w.isMeshStandardMaterial?C:jt).get(w.envMap||H.environment),H.envMapRotation=H.environment!==null&&w.envMap===null?O.environmentRotation:w.envMapRotation,Bt===void 0&&(w.addEventListener("dispose",at),Bt=new Map,H.programs=Bt);let Tt=Bt.get(Dt);if(Tt!==void 0){if(H.currentProgram===Tt&&H.lightsStateVersion===ft)return ve(w,pt),Tt}else pt.uniforms=et.getUniforms(w),w.onBuild(V,pt,v),w.onBeforeCompile(pt,v),Tt=et.acquireProgram(pt,Dt),Bt.set(Dt,Tt),H.uniforms=pt.uniforms;let Et=H.uniforms;return(!w.isShaderMaterial&&!w.isRawShaderMaterial||w.clipping===!0)&&(Et.clippingPlanes=rt.uniform),ve(w,pt),H.needsLights=me(w),H.lightsStateVersion=ft,H.needsLights&&(Et.ambientLightColor.value=W.state.ambient,Et.lightProbe.value=W.state.probe,Et.directionalLights.value=W.state.directional,Et.directionalLightShadows.value=W.state.directionalShadow,Et.spotLights.value=W.state.spot,Et.spotLightShadows.value=W.state.spotShadow,Et.rectAreaLights.value=W.state.rectArea,Et.ltc_1.value=W.state.rectAreaLTC1,Et.ltc_2.value=W.state.rectAreaLTC2,Et.pointLights.value=W.state.point,Et.pointLightShadows.value=W.state.pointShadow,Et.hemisphereLights.value=W.state.hemi,Et.directionalShadowMap.value=W.state.directionalShadowMap,Et.directionalShadowMatrix.value=W.state.directionalShadowMatrix,Et.spotShadowMap.value=W.state.spotShadowMap,Et.spotLightMatrix.value=W.state.spotLightMatrix,Et.spotLightMap.value=W.state.spotLightMap,Et.pointShadowMap.value=W.state.pointShadowMap,Et.pointShadowMatrix.value=W.state.pointShadowMatrix),H.currentProgram=Tt,H.uniformsList=null,Tt}function $t(w){if(w.uniformsList===null){let O=w.currentProgram.getUniforms();w.uniformsList=zs.seqWithValue(O.seq,w.uniforms)}return w.uniformsList}function ve(w,O){let V=Pt.get(w);V.outputColorSpace=O.outputColorSpace,V.batching=O.batching,V.instancing=O.instancing,V.instancingColor=O.instancingColor,V.instancingMorph=O.instancingMorph,V.skinning=O.skinning,V.morphTargets=O.morphTargets,V.morphNormals=O.morphNormals,V.morphColors=O.morphColors,V.morphTargetsCount=O.morphTargetsCount,V.numClippingPlanes=O.numClippingPlanes,V.numIntersection=O.numClipIntersection,V.vertexAlphas=O.vertexAlphas,V.vertexTangents=O.vertexTangents,V.toneMapping=O.toneMapping}function ke(w,O,V,H,W){O.isScene!==!0&&(O=It),k.resetTextureUnits();let ot=O.fog,ft=H.isMeshStandardMaterial?O.environment:null,pt=E===null?v.outputColorSpace:E.isXRRenderTarget===!0?E.texture.colorSpace:fr,Dt=(H.isMeshStandardMaterial?C:jt).get(H.envMap||ft),Bt=H.vertexColors===!0&&!!V.attributes.color&&V.attributes.color.itemSize===4,Tt=!!V.attributes.tangent&&(!!H.normalMap||H.anisotropy>0),Et=!!V.morphAttributes.position,ae=!!V.morphAttributes.normal,Ie=!!V.morphAttributes.color,Je=ar;H.toneMapped&&(E===null||E.isXRRenderTarget===!0)&&(Je=v.toneMapping);let an=V.morphAttributes.position||V.morphAttributes.normal||V.morphAttributes.color,qt=an!==void 0?an.length:0,Ot=Pt.get(H),si=p.state.lights;if(q===!0&&(Q===!0||w!==y)){let Fn=w===y&&H.id===R;rt.setState(H,w,Fn)}let le=!1;H.version===Ot.__version?(Ot.needsLights&&Ot.lightsStateVersion!==si.state.version||Ot.outputColorSpace!==pt||W.isBatchedMesh&&Ot.batching===!1||!W.isBatchedMesh&&Ot.batching===!0||W.isInstancedMesh&&Ot.instancing===!1||!W.isInstancedMesh&&Ot.instancing===!0||W.isSkinnedMesh&&Ot.skinning===!1||!W.isSkinnedMesh&&Ot.skinning===!0||W.isInstancedMesh&&Ot.instancingColor===!0&&W.instanceColor===null||W.isInstancedMesh&&Ot.instancingColor===!1&&W.instanceColor!==null||W.isInstancedMesh&&Ot.instancingMorph===!0&&W.morphTexture===null||W.isInstancedMesh&&Ot.instancingMorph===!1&&W.morphTexture!==null||Ot.envMap!==Dt||H.fog===!0&&Ot.fog!==ot||Ot.numClippingPlanes!==void 0&&(Ot.numClippingPlanes!==rt.numPlanes||Ot.numIntersection!==rt.numIntersection)||Ot.vertexAlphas!==Bt||Ot.vertexTangents!==Tt||Ot.morphTargets!==Et||Ot.morphNormals!==ae||Ot.morphColors!==Ie||Ot.toneMapping!==Je||Ot.morphTargetsCount!==qt)&&(le=!0):(le=!0,Ot.__version=H.version);let dr=Ot.currentProgram;le===!0&&(dr=be(H,O,W));let Dh=!1,Js=!1,Nl=!1,$e=dr.getUniforms(),Bi=Ot.uniforms;if(_t.useProgram(dr.program)&&(Dh=!0,Js=!0,Nl=!0),H.id!==R&&(R=H.id,Js=!0),Dh||y!==w){$e.setValue(z,"projectionMatrix",w.projectionMatrix),$e.setValue(z,"viewMatrix",w.matrixWorldInverse);let Fn=$e.map.cameraPosition;Fn!==void 0&&Fn.setValue(z,tt.setFromMatrixPosition(w.matrixWorld)),wt.logarithmicDepthBuffer&&$e.setValue(z,"logDepthBufFC",2/(Math.log(w.far+1)/Math.LN2)),(H.isMeshPhongMaterial||H.isMeshToonMaterial||H.isMeshLambertMaterial||H.isMeshBasicMaterial||H.isMeshStandardMaterial||H.isShaderMaterial)&&$e.setValue(z,"isOrthographic",w.isOrthographicCamera===!0),y!==w&&(y=w,Js=!0,Nl=!0)}if(W.isSkinnedMesh){$e.setOptional(z,W,"bindMatrix"),$e.setOptional(z,W,"bindMatrixInverse");let Fn=W.skeleton;Fn&&(Fn.boneTexture===null&&Fn.computeBoneTexture(),$e.setValue(z,"boneTexture",Fn.boneTexture,k))}W.isBatchedMesh&&($e.setOptional(z,W,"batchingTexture"),$e.setValue(z,"batchingTexture",W._matricesTexture,k));let Ul=V.morphAttributes;if((Ul.position!==void 0||Ul.normal!==void 0||Ul.color!==void 0)&&St.update(W,V,dr),(Js||Ot.receiveShadow!==W.receiveShadow)&&(Ot.receiveShadow=W.receiveShadow,$e.setValue(z,"receiveShadow",W.receiveShadow)),H.isMeshGouraudMaterial&&H.envMap!==null&&(Bi.envMap.value=Dt,Bi.flipEnvMap.value=Dt.isCubeTexture&&Dt.isRenderTargetTexture===!1?-1:1),H.isMeshStandardMaterial&&H.envMap===null&&O.environment!==null&&(Bi.envMapIntensity.value=O.environmentIntensity),Js&&($e.setValue(z,"toneMappingExposure",v.toneMappingExposure),Ot.needsLights&&ye(Bi,Nl),ot&&H.fog===!0&&nt.refreshFogUniforms(Bi,ot),nt.refreshMaterialUniforms(Bi,H,J,G,p.state.transmissionRenderTarget[w.id]),zs.upload(z,$t(Ot),Bi,k)),H.isShaderMaterial&&H.uniformsNeedUpdate===!0&&(zs.upload(z,$t(Ot),Bi,k),H.uniformsNeedUpdate=!1),H.isSpriteMaterial&&$e.setValue(z,"center",W.center),$e.setValue(z,"modelViewMatrix",W.modelViewMatrix),$e.setValue(z,"normalMatrix",W.normalMatrix),$e.setValue(z,"modelMatrix",W.matrixWorld),H.isShaderMaterial||H.isRawShaderMaterial){let Fn=H.uniformsGroups;for(let Ol=0,Gm=Fn.length;Ol<Gm;Ol++){let Ch=Fn[Ol];Gt.update(Ch,dr),Gt.bind(Ch,dr)}}return dr}function ye(w,O){w.ambientLightColor.needsUpdate=O,w.lightProbe.needsUpdate=O,w.directionalLights.needsUpdate=O,w.directionalLightShadows.needsUpdate=O,w.pointLights.needsUpdate=O,w.pointLightShadows.needsUpdate=O,w.spotLights.needsUpdate=O,w.spotLightShadows.needsUpdate=O,w.rectAreaLights.needsUpdate=O,w.hemisphereLights.needsUpdate=O}function me(w){return w.isMeshLambertMaterial||w.isMeshToonMaterial||w.isMeshPhongMaterial||w.isMeshStandardMaterial||w.isShadowMaterial||w.isShaderMaterial&&w.lights===!0}this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return E},this.setRenderTargetTextures=function(w,O,V){Pt.get(w.texture).__webglTexture=O,Pt.get(w.depthTexture).__webglTexture=V;let H=Pt.get(w);H.__hasExternalTextures=!0,H.__autoAllocateDepthBuffer=V===void 0,H.__autoAllocateDepthBuffer||bt.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),H.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(w,O){let V=Pt.get(w);V.__webglFramebuffer=O,V.__useDefaultFramebuffer=O===void 0},this.setRenderTarget=function(w,O=0,V=0){E=w,D=O,T=V;let H=!0,W=null,ot=!1,ft=!1;if(w){let Dt=Pt.get(w);Dt.__useDefaultFramebuffer!==void 0?(_t.bindFramebuffer(z.FRAMEBUFFER,null),H=!1):Dt.__webglFramebuffer===void 0?k.setupRenderTarget(w):Dt.__hasExternalTextures&&k.rebindTextures(w,Pt.get(w.texture).__webglTexture,Pt.get(w.depthTexture).__webglTexture);let Bt=w.texture;(Bt.isData3DTexture||Bt.isDataArrayTexture||Bt.isCompressedArrayTexture)&&(ft=!0);let Tt=Pt.get(w).__webglFramebuffer;w.isWebGLCubeRenderTarget?(Array.isArray(Tt[O])?W=Tt[O][V]:W=Tt[O],ot=!0):w.samples>0&&k.useMultisampledRTT(w)===!1?W=Pt.get(w).__webglMultisampledFramebuffer:Array.isArray(Tt)?W=Tt[V]:W=Tt,x.copy(w.viewport),L.copy(w.scissor),F=w.scissorTest}else x.copy(A).multiplyScalar(J).floor(),L.copy(it).multiplyScalar(J).floor(),F=vt;if(_t.bindFramebuffer(z.FRAMEBUFFER,W)&&H&&_t.drawBuffers(w,W),_t.viewport(x),_t.scissor(L),_t.setScissorTest(F),ot){let Dt=Pt.get(w.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+O,Dt.__webglTexture,V)}else if(ft){let Dt=Pt.get(w.texture),Bt=O||0;z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,Dt.__webglTexture,V||0,Bt)}R=-1},this.readRenderTargetPixels=function(w,O,V,H,W,ot,ft){if(!(w&&w.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let pt=Pt.get(w).__webglFramebuffer;if(w.isWebGLCubeRenderTarget&&ft!==void 0&&(pt=pt[ft]),pt){_t.bindFramebuffer(z.FRAMEBUFFER,pt);try{let Dt=w.texture,Bt=Dt.format,Tt=Dt.type;if(!wt.textureFormatReadable(Bt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!wt.textureTypeReadable(Tt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}O>=0&&O<=w.width-H&&V>=0&&V<=w.height-W&&z.readPixels(O,V,H,W,xt.convert(Bt),xt.convert(Tt),ot)}finally{let Dt=E!==null?Pt.get(E).__webglFramebuffer:null;_t.bindFramebuffer(z.FRAMEBUFFER,Dt)}}},this.copyFramebufferToTexture=function(w,O,V=0){let H=Math.pow(2,-V),W=Math.floor(O.image.width*H),ot=Math.floor(O.image.height*H);k.setTexture2D(O,0),z.copyTexSubImage2D(z.TEXTURE_2D,V,0,0,w.x,w.y,W,ot),_t.unbindTexture()},this.copyTextureToTexture=function(w,O,V,H=0){let W=O.image.width,ot=O.image.height,ft=xt.convert(V.format),pt=xt.convert(V.type);k.setTexture2D(V,0),z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,V.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,V.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,V.unpackAlignment),O.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,H,w.x,w.y,W,ot,ft,pt,O.image.data):O.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,H,w.x,w.y,O.mipmaps[0].width,O.mipmaps[0].height,ft,O.mipmaps[0].data):z.texSubImage2D(z.TEXTURE_2D,H,w.x,w.y,ft,pt,O.image),H===0&&V.generateMipmaps&&z.generateMipmap(z.TEXTURE_2D),_t.unbindTexture()},this.copyTextureToTexture3D=function(w,O,V,H,W=0){let ot=w.max.x-w.min.x,ft=w.max.y-w.min.y,pt=w.max.z-w.min.z,Dt=xt.convert(H.format),Bt=xt.convert(H.type),Tt;if(H.isData3DTexture)k.setTexture3D(H,0),Tt=z.TEXTURE_3D;else if(H.isDataArrayTexture||H.isCompressedArrayTexture)k.setTexture2DArray(H,0),Tt=z.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,H.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,H.unpackAlignment);let Et=z.getParameter(z.UNPACK_ROW_LENGTH),ae=z.getParameter(z.UNPACK_IMAGE_HEIGHT),Ie=z.getParameter(z.UNPACK_SKIP_PIXELS),Je=z.getParameter(z.UNPACK_SKIP_ROWS),an=z.getParameter(z.UNPACK_SKIP_IMAGES),qt=V.isCompressedTexture?V.mipmaps[W]:V.image;z.pixelStorei(z.UNPACK_ROW_LENGTH,qt.width),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,qt.height),z.pixelStorei(z.UNPACK_SKIP_PIXELS,w.min.x),z.pixelStorei(z.UNPACK_SKIP_ROWS,w.min.y),z.pixelStorei(z.UNPACK_SKIP_IMAGES,w.min.z),V.isDataTexture||V.isData3DTexture?z.texSubImage3D(Tt,W,O.x,O.y,O.z,ot,ft,pt,Dt,Bt,qt.data):H.isCompressedArrayTexture?z.compressedTexSubImage3D(Tt,W,O.x,O.y,O.z,ot,ft,pt,Dt,qt.data):z.texSubImage3D(Tt,W,O.x,O.y,O.z,ot,ft,pt,Dt,Bt,qt),z.pixelStorei(z.UNPACK_ROW_LENGTH,Et),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,ae),z.pixelStorei(z.UNPACK_SKIP_PIXELS,Ie),z.pixelStorei(z.UNPACK_SKIP_ROWS,Je),z.pixelStorei(z.UNPACK_SKIP_IMAGES,an),W===0&&H.generateMipmaps&&z.generateMipmap(Tt),_t.unbindTexture()},this.initTexture=function(w){w.isCubeTexture?k.setTextureCube(w,0):w.isData3DTexture?k.setTexture3D(w,0):w.isDataArrayTexture||w.isCompressedArrayTexture?k.setTexture2DArray(w,0):k.setTexture2D(w,0),_t.unbindTexture()},this.resetState=function(){D=0,T=0,E=null,_t.reset(),Nt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ni}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Mh?"display-p3":"srgb",e.unpackColorSpace=fe.workingColorSpace===Il?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}};var El=class r{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new re(t),this.near=e,this.far=n}clone(){return new r(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},Tl=class extends on{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 Oi,this.environmentIntensity=1,this.environmentRotation=new Oi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var sh=class extends Zr{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new re(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},lm=new Pe,oh=new dl,tl=new Gs,el=new Z,Al=class extends on{constructor(t=new mi,e=new sh){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){let n=this.geometry,i=this.matrixWorld,s=t.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),tl.copy(n.boundingSphere),tl.applyMatrix4(i),tl.radius+=s,t.ray.intersectsSphere(tl)===!1)return;lm.copy(i).invert(),oh.copy(t.ray).applyMatrix4(lm);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=n.index,h=n.attributes.position;if(c!==null){let f=Math.max(0,o.start),d=Math.min(c.count,o.start+o.count);for(let _=f,g=d;_<g;_++){let p=c.getX(_);el.fromBufferAttribute(h,p),cm(el,p,l,i,t,e,this)}}else{let f=Math.max(0,o.start),d=Math.min(h.count,o.start+o.count);for(let _=f,g=d;_<g;_++)el.fromBufferAttribute(h,_),cm(el,_,l,i,t,e,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}};function cm(r,t,e,n,i,s,o){let a=oh.distanceSqToPoint(r);if(a<e){let l=new Z;oh.closestPointToPoint(r,l),l.applyMatrix4(n);let c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,object:o})}}function nl(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function HS(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var Xs=class{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,n=this._cachedIndex,i=e[n],s=e[n-1];n:{t:{let o;e:{i:if(!(t<i)){for(let a=n+2;;){if(i===void 0){if(t<s)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(s=i,i=e[++n],t<i)break t}o=e.length;break e}if(!(t>=s)){let a=e[1];t<a&&(n=2,s=a);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=s,s=e[--n-1],t>=s)break t}o=n,n=0;break e}break n}for(;n<o;){let a=n+o>>>1;t<e[a]?o=a:n=a+1}if(i=e[n],s=e[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=t*i;for(let o=0;o!==i;++o)e[o]=n[s+o];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},ah=class extends Xs{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:gp,endingEnd:gp}}intervalChanged_(t,e,n){let i=this.parameterPositions,s=t-2,o=t+1,a=i[s],l=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case _p:s=t,a=2*e-n;break;case xp:s=i.length-2,a=e+i[s]-i[s+1];break;default:s=t,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case _p:o=t,l=2*n-e;break;case xp:o=1,l=n+i[1]-i[0];break;default:o=t-1,l=e}let c=(n-e)*.5,u=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(l-n),this._offsetPrev=s*u,this._offsetNext=o*u}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,u=this._offsetPrev,h=this._offsetNext,f=this._weightPrev,d=this._weightNext,_=(n-e)/(i-e),g=_*_,p=g*_,m=-f*p+2*f*g-f*_,S=(1+f)*p+(-1.5-2*f)*g+(-.5+f)*_+1,v=(-1-d)*p+(1.5+d)*g+.5*_,M=d*p-d*g;for(let D=0;D!==a;++D)s[D]=m*o[u+D]+S*o[c+D]+v*o[l+D]+M*o[h+D];return s}},lh=class extends Xs{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,u=(n-e)/(i-e),h=1-u;for(let f=0;f!==a;++f)s[f]=o[c+f]*h+o[l+f]*u;return s}},ch=class extends Xs{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},ri=class{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=nl(e,this.TimeBufferType),this.values=nl(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:nl(t.times,Array),values:nl(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new ch(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new lh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new ah(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case rl:e=this.InterpolantFactoryMethodDiscrete;break;case sl:e=this.InterpolantFactoryMethodLinear;break;case lu:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return rl;case this.InterpolantFactoryMethodLinear:return sl;case this.InterpolantFactoryMethodSmooth:return lu}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){let n=this.times,i=n.length,s=0,o=i-1;for(;s!==i&&n[s]<t;)++s;for(;o!==-1&&n[o]>e;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),t=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),t=!1;break}o=l}if(i!==void 0&&HS(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===lu,s=t.length-1,o=1;for(let a=1;a<s;++a){let l=!1,c=t[a],u=t[a+1];if(c!==u&&(a!==1||c!==t[0]))if(i)l=!0;else{let h=a*n,f=h-n,d=h+n;for(let _=0;_!==n;++_){let g=e[h+_];if(g!==e[f+_]||g!==e[d+_]){l=!0;break}}}if(l){if(a!==o){t[o]=t[a];let h=a*n,f=o*n;for(let d=0;d!==n;++d)e[f+d]=e[h+d]}++o}}if(s>0){t[o]=t[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)e[l+c]=e[a+c];++o}return o!==t.length?(this.times=t.slice(0,o),this.values=e.slice(0,o*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};ri.prototype.TimeBufferType=Float32Array;ri.prototype.ValueBufferType=Float32Array;ri.prototype.DefaultInterpolation=sl;var Jr=class extends ri{};Jr.prototype.ValueTypeName="bool";Jr.prototype.ValueBufferType=Array;Jr.prototype.DefaultInterpolation=rl;Jr.prototype.InterpolantFactoryMethodLinear=void 0;Jr.prototype.InterpolantFactoryMethodSmooth=void 0;var uh=class extends ri{};uh.prototype.ValueTypeName="color";var hh=class extends ri{};hh.prototype.ValueTypeName="number";var fh=class extends Xs{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-e)/(i-e),c=t*a;for(let u=c+a;c!==u;c+=4)hr.slerpFlat(s,0,o,c-a,o,c,l);return s}},zo=class extends ri{InterpolantFactoryMethodLinear(t){return new fh(this.times,this.values,this.getValueSize(),t)}};zo.prototype.ValueTypeName="quaternion";zo.prototype.DefaultInterpolation=sl;zo.prototype.InterpolantFactoryMethodSmooth=void 0;var $r=class extends ri{};$r.prototype.ValueTypeName="string";$r.prototype.ValueBufferType=Array;$r.prototype.DefaultInterpolation=rl;$r.prototype.InterpolantFactoryMethodLinear=void 0;$r.prototype.InterpolantFactoryMethodSmooth=void 0;var dh=class extends ri{};dh.prototype.ValueTypeName="vector";var ph=class{constructor(t,e,n){let i=this,s=!1,o=0,a=0,l,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(u){a++,s===!1&&i.onStart!==void 0&&i.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,i.onProgress!==void 0&&i.onProgress(u,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(u){i.onError!==void 0&&i.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,h){return c.push(u,h),this},this.removeHandler=function(u){let h=c.indexOf(u);return h!==-1&&c.splice(h,2),this},this.getHandler=function(u){for(let h=0,f=c.length;h<f;h+=2){let d=c[h],_=c[h+1];if(d.global&&(d.lastIndex=0),d.test(u))return _}return null}}},GS=new ph,mh=class{constructor(t){this.manager=t!==void 0?t:GS,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let n=this;return new Promise(function(i,s){n.load(t,i,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};mh.DEFAULT_MATERIAL_NAME="__DEFAULT";var Dl=class extends on{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new re(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}},Cl=class extends Dl{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(on.DEFAULT_UP),this.updateMatrix(),this.groundColor=new re(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}},Nu=new Pe,um=new Z,hm=new Z,gh=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new oe(512,512),this.map=null,this.mapPass=null,this.matrix=new Pe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Bo,this._frameExtents=new oe(1,1),this._viewportCount=1,this._viewports=[new Xe(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;um.setFromMatrixPosition(t.matrixWorld),e.position.copy(um),hm.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(hm),e.updateMatrixWorld(),Nu.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Nu),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Nu)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}};var _h=class extends gh{constructor(){super(new Ml(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},Kr=class extends Dl{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(on.DEFAULT_UP),this.updateMatrix(),this.target=new on,this.shadow=new _h}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}};var bh="\\[\\]\\.:\\/",WS=new RegExp("["+bh+"]","g"),wh="[^"+bh+"]",XS="[^"+bh.replace("\\.","")+"]",qS=/((?:WC+[\/:])*)/.source.replace("WC",wh),YS=/(WCOD+)?/.source.replace("WCOD",XS),ZS=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",wh),JS=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",wh),$S=new RegExp("^"+qS+YS+ZS+JS+"$"),KS=["material","materials","bones","map"],xh=class{constructor(t,e,n){let i=n||Se.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},Se=class r{constructor(t,e,n){this.path=e,this.parsedPath=n||r.parseTrackName(e),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new r.Composite(t,e,n):new r(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(WS,"")}static parseTrackName(t){let e=$S.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);KS.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){let n=function(s){for(let o=0;o<s.length;o++){let a=s[o];if(a.name===e||a.uuid===e)return a;let l=n(a.children);if(l)return l}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)t[e++]=n[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,s=e.propertyIndex;if(t||(t=r.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let c=e.objectIndex;switch(n){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.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){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let u=0;u<t.length;u++)if(t[u].name===c){c=u;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.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[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[n]}if(c!==void 0){if(t[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[c]}}let o=t[i];if(o===void 0){let c=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",t);return}let a=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Se.Composite=xh;Se.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Se.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Se.prototype.GetterByBindingType=[Se.prototype._getValue_direct,Se.prototype._getValue_array,Se.prototype._getValue_arrayElement,Se.prototype._getValue_toArray];Se.prototype.SetterByBindingTypeAndVersioning=[[Se.prototype._setValue_direct,Se.prototype._setValue_direct_setNeedsUpdate,Se.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Se.prototype._setValue_array,Se.prototype._setValue_array_setNeedsUpdate,Se.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Se.prototype._setValue_arrayElement,Se.prototype._setValue_arrayElement_setNeedsUpdate,Se.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Se.prototype._setValue_fromArray,Se.prototype._setValue_fromArray_setNeedsUpdate,Se.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Jb=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:vh}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=vh);var Im=(r,t,e=7e3,n=25)=>{let i=new rr,s=new wl({canvas:r,antialias:!0,alpha:!0}),o=new Tl,a=new xn(18);a.near=1,a.far=2e3,a.position.z=-10,s.outputColorSpace=Gn,s.shadowMap.enabled=!0,s.shadowMap.type=yh,o.fog=new El(3741705,9,15),o.add(i);let l=new Cl(16777215,41378,1),c=new Kr(3355443,4);c.position.set(5,5,5),c.lookAt(0,0,0),c.castShadow=!0,c.shadow.mapSize.width=512,c.shadow.mapSize.height=512,c.shadow.camera.near=.5,c.shadow.camera.far=500,o.add(c),o.add(l);let u=[new Kr(16777215,1),new Kr(11460838,1),new Kr(14277490,1)];u[0].position.set(1,0,0),u[1].position.set(.75,1,.5),u[2].position.set(-.75,-1,.5),u.forEach(S=>o.add(S));let h=new mi,f=[],d=[],_=n/2;for(let S=0;S<e;S++)f.push(Math.random()*n-_,Math.random()*n-_,Math.random()*n-_),d.push(Math.random()*.9+.1);h.setAttribute("position",new qn(f,3)),h.setAttribute("opacity",new qn(d,1)),h.computeBoundingSphere();let g=new Zn({vertexShader:`
3822
+ attribute float opacity;
3823
+ varying float vOpacity;
3824
+ varying float distanceToCamera;
3825
+ void main() {
3826
3826
  vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
3827
3827
  gl_Position = projectionMatrix * mvPosition;
3828
- vOpacity = opacity; // Pass opacity to fragment shader
3828
+ vOpacity = opacity;
3829
3829
  distanceToCamera = length(mvPosition.xyz);
3830
- gl_PointSize = 40.0 / distanceToCamera; // Adjust divisor as needed for size
3830
+ gl_PointSize = 40.0 / distanceToCamera;
3831
3831
  }
3832
3832
  `,fragmentShader:`
3833
- varying float vOpacity; // Varying received from vertex shader
3834
- varying float distanceToCamera; // Varying received from vertex shader
3833
+ varying float vOpacity;
3834
+ varying float distanceToCamera;
3835
3835
  void main() {
3836
- float distance = length(gl_PointCoord - vec2(0.5, 0.5));
3837
- if (distance > 0.5) discard;
3838
-
3839
- // Calculate a gradient for the alpha value
3840
- float alpha = 1.0 - smoothstep(0.3, 0.5, distance);
3841
- float opacityFactor = distanceToCamera / 15.0; // Adjust divisor as needed for opacity
3842
-
3843
- // Combine alpha with opacity and distance factor
3844
- gl_FragColor = vec4(1.0, 1.0, 1.0, alpha * vOpacity * opacityFactor);
3836
+ float distance = length(gl_PointCoord - vec2(0.5, 0.5));
3837
+ if (distance > 0.5) discard;
3838
+ float alpha = 1.0 - smoothstep(0.3, 0.5, distance);
3839
+ float opacityFactor = distanceToCamera / 15.0;
3840
+ gl_FragColor = vec4(1.0, 1.0, 1.0, alpha * vOpacity * opacityFactor);
3845
3841
  }
3846
- `,blending:sr,transparent:!0});m.needsUpdate=!0;let S=new bl(h,m);r.add(S)}function l(){requestAnimationFrame(l);let u=Date.now()*.003;r.rotation.z+=.001/4,r.rotation.y+=5e-4/4,r.position.y=Math.sin(u*.05)*.05,s.lookAt(i.position),s.updateMatrixWorld(),n.render(i,s)}function c(){let u=window.innerWidth,f=window.innerHeight;s.aspect=u/f,s.updateProjectionMatrix(),n.setSize(u,f)}o(),a(),c(),n.compile(i,s),l(),window.addEventListener("resize",c,!1)}window.addEventListener("load",t,!1)};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{Rf(),Df(),Dd(),Mm(),Md(),Cf()});})();
3842
+ `,blending:or,transparent:!0});g.needsUpdate=!0,i.add(new Al(h,g));let p=()=>{let{w:S,h:v}=t();a.aspect=S/v,a.updateProjectionMatrix(),s.setSize(S,v)},m=()=>{requestAnimationFrame(m);let S=Date.now()*.003;i.rotation.z+=.001/4,i.rotation.y+=5e-4/4,i.position.y=Math.sin(S*.05)*.05,a.lookAt(o.position),a.updateMatrixWorld(),s.render(o,a)};p(),s.compile(o,a),m(),window.addEventListener("resize",p,!1)},Lm=()=>{let r=document.querySelector("#canvas");r&&window.addEventListener("load",()=>Im(r,()=>({w:window.innerWidth,h:window.innerHeight})),!1)},Fm=()=>{let r=document.querySelector(".prx-nav_menu");if(!r)return;let t=document.createElement("canvas");Object.assign(t.style,{position:"fixed",inset:"0",width:"100%",height:"100%",pointerEvents:"none",zIndex:"0"}),r.prepend(t),Im(t,()=>({w:window.innerWidth,h:window.innerHeight}),3e3,20)};var Ys,Th,Om,Ho,Bm,Fl,jS=/(?:\r|\n|\t\t)/g,tb=/(?:\s\s+)/g,eb="\xA0",zm=function(t){Ys=document,Th=window,Ho=Ho||t||Th.gsap||console.warn("Please gsap.registerPlugin(SplitText)"),Ho&&(Fl=Ho.utils.toArray,Bm=Ho.core.context||function(){},Om=1)},nb=1,km=function(t){return Th.getComputedStyle(t)},Ah=function(t){return t.position==="absolute"||t.absolute===!0},ib=function(t,e){for(var n=e.length,i;--n>-1;)if(i=e[n],t.substr(0,i.length)===i)return i.length},rb=" style='position:relative;display:inline-block;'",Nm=function(t,e){t===void 0&&(t="");var n=~t.indexOf("++"),i=1;return n&&(t=t.split("++").join("")),function(){return"<"+e+rb+(t?" class='"+t+(n?i++:"")+"'>":">")}},Vm=function r(t,e,n){var i=t.nodeType;if(i===1||i===9||i===11)for(t=t.firstChild;t;t=t.nextSibling)r(t,e,n);else(i===3||i===4)&&(t.nodeValue=t.nodeValue.split(e).join(n))},Eh=function(t,e){for(var n=e.length;--n>-1;)t.push(e[n])},Um=function(t,e,n){for(var i;t&&t!==e;){if(i=t._next||t.nextSibling,i)return i.textContent.charAt(0)===n;t=t.parentNode||t._parent}},sb=function r(t){var e=Fl(t.childNodes),n=e.length,i,s;for(i=0;i<n;i++)s=e[i],s._isSplit?r(s):i&&s.previousSibling&&s.previousSibling.nodeType===3?(s.previousSibling.nodeValue+=s.nodeType===3?s.nodeValue:s.firstChild.nodeValue,t.removeChild(s)):s.nodeType!==3&&(t.insertBefore(s.firstChild,s),t.removeChild(s))},gi=function(t,e){return parseFloat(e[t])||0},ob=function(t,e,n,i,s,o,a){var l=km(t),c=gi("paddingLeft",l),u=-999,h=gi("borderBottomWidth",l)+gi("borderTopWidth",l),f=gi("borderLeftWidth",l)+gi("borderRightWidth",l),d=gi("paddingTop",l)+gi("paddingBottom",l),_=gi("paddingLeft",l)+gi("paddingRight",l),g=gi("fontSize",l)*(e.lineThreshold||.2),p=l.textAlign,m=[],S=[],v=[],M=e.wordDelimiter||" ",D=e.tag?e.tag:e.span?"span":"div",T=e.type||e.split||"chars,words,lines",E=s&&~T.indexOf("lines")?[]:null,R=~T.indexOf("words"),y=~T.indexOf("chars"),x=Ah(e),L=e.linesClass,F=~(L||"").indexOf("++"),P=[],B=l.display==="flex",X=t.style.display,G,J,U,I,A,it,vt,Wt,q,Q,ct,tt;for(F&&(L=L.split("++").join("")),B&&(t.style.display="block"),J=t.getElementsByTagName("*"),U=J.length,A=[],G=0;G<U;G++)A[G]=J[G];if(E||x)for(G=0;G<U;G++)I=A[G],it=I.parentNode===t,(it||x||y&&!R)&&(tt=I.offsetTop,E&&it&&Math.abs(tt-u)>g&&(I.nodeName!=="BR"||G===0)&&(vt=[],E.push(vt),u=tt),x&&(I._x=I.offsetLeft,I._y=tt,I._w=I.offsetWidth,I._h=I.offsetHeight),E&&((I._isSplit&&it||!y&&it||R&&it||!R&&I.parentNode.parentNode===t&&!I.parentNode._isSplit)&&(vt.push(I),I._x-=c,Um(I,t,M)&&(I._wordEnd=!0)),I.nodeName==="BR"&&(I.nextSibling&&I.nextSibling.nodeName==="BR"||G===0)&&E.push([])));for(G=0;G<U;G++){if(I=A[G],it=I.parentNode===t,I.nodeName==="BR"){E||x?(I.parentNode&&I.parentNode.removeChild(I),A.splice(G--,1),U--):R||t.appendChild(I);continue}if(x&&(q=I.style,!R&&!it&&(I._x+=I.parentNode._x,I._y+=I.parentNode._y),q.left=I._x+"px",q.top=I._y+"px",q.position="absolute",q.display="block",q.width=I._w+1+"px",q.height=I._h+"px"),!R&&y)if(I._isSplit)for(I._next=J=I.nextSibling,I.parentNode.appendChild(I);J&&J.nodeType===3&&J.textContent===" ";)I._next=J.nextSibling,I.parentNode.appendChild(J),J=J.nextSibling;else I.parentNode._isSplit?(I._parent=I.parentNode,!I.previousSibling&&I.firstChild&&(I.firstChild._isFirst=!0),I.nextSibling&&I.nextSibling.textContent===" "&&!I.nextSibling.nextSibling&&P.push(I.nextSibling),I._next=I.nextSibling&&I.nextSibling._isFirst?null:I.nextSibling,I.parentNode.removeChild(I),A.splice(G--,1),U--):it||(tt=!I.nextSibling&&Um(I.parentNode,t,M),I.parentNode._parent&&I.parentNode._parent.appendChild(I),tt&&I.parentNode.appendChild(Ys.createTextNode(" ")),D==="span"&&(I.style.display="inline"),m.push(I));else I.parentNode._isSplit&&!I._isSplit&&I.innerHTML!==""?S.push(I):y&&!I._isSplit&&(D==="span"&&(I.style.display="inline"),m.push(I))}for(G=P.length;--G>-1;)P[G].parentNode.removeChild(P[G]);if(E){for(x&&(Q=Ys.createElement(D),t.appendChild(Q),ct=Q.offsetWidth+"px",tt=Q.offsetParent===t?0:t.offsetLeft,t.removeChild(Q)),q=t.style.cssText,t.style.cssText="display:none;";t.firstChild;)t.removeChild(t.firstChild);for(Wt=M===" "&&(!x||!R&&!y),G=0;G<E.length;G++){for(vt=E[G],Q=Ys.createElement(D),Q.style.cssText="display:block;text-align:"+p+";position:"+(x?"absolute;":"relative;"),L&&(Q.className=L+(F?G+1:"")),v.push(Q),U=vt.length,J=0;J<U;J++)vt[J].nodeName!=="BR"&&(I=vt[J],Q.appendChild(I),Wt&&I._wordEnd&&Q.appendChild(Ys.createTextNode(" ")),x&&(J===0&&(Q.style.top=I._y+"px",Q.style.left=c+tt+"px"),I.style.top="0px",tt&&(I.style.left=I._x-tt+"px")));U===0?Q.innerHTML="&nbsp;":!R&&!y&&(sb(Q),Vm(Q,"\xA0"," ")),x&&(Q.style.width=ct,Q.style.height=I._h+"px"),t.appendChild(Q)}t.style.cssText=q}x&&(a>t.clientHeight&&(t.style.height=a-d+"px",t.clientHeight<a&&(t.style.height=a+h+"px")),o>t.clientWidth&&(t.style.width=o-_+"px",t.clientWidth<o&&(t.style.width=o+f+"px"))),B&&(X?t.style.display=X:t.style.removeProperty("display")),Eh(n,m),R&&Eh(i,S),Eh(s,v)},ab=function(t,e,n,i){var s=e.tag?e.tag:e.span?"span":"div",o=e.type||e.split||"chars,words,lines",a=~o.indexOf("chars"),l=Ah(e),c=e.wordDelimiter||" ",u=function(x){return x===c||x===eb&&c===" "},h=c!==" "?"":l?"&#173; ":" ",f="</"+s+">",d=1,_=e.specialChars?typeof e.specialChars=="function"?e.specialChars:ib:null,g,p,m,S,v,M,D,T,E=Ys.createElement("div"),R=t.parentNode;for(R.insertBefore(E,t),E.textContent=t.nodeValue,R.removeChild(t),t=E,g=_s(t),D=g.indexOf("<")!==-1,e.reduceWhiteSpace!==!1&&(g=g.replace(tb," ").replace(jS,"")),D&&(g=g.split("<").join("{{LT}}")),v=g.length,p=(g.charAt(0)===" "?h:"")+n(),m=0;m<v;m++)if(M=g.charAt(m),_&&(T=_(g.substr(m),e.specialChars)))M=g.substr(m,T||1),p+=a&&M!==" "?i()+M+"</"+s+">":M,m+=T-1;else if(u(M)&&!u(g.charAt(m-1))&&m){for(p+=d?f:"",d=0;u(g.charAt(m+1));)p+=h,m++;m===v-1?p+=h:g.charAt(m+1)!==")"&&(p+=h+n(),d=1)}else M==="{"&&g.substr(m,6)==="{{LT}}"?(p+=a?i()+"{{LT}}</"+s+">":"{{LT}}",m+=5):M.charCodeAt(0)>=55296&&M.charCodeAt(0)<=56319||g.charCodeAt(m+1)>=65024&&g.charCodeAt(m+1)<=65039?(S=((g.substr(m,12).split(tu)||[])[1]||"").length||2,p+=a&&M!==" "?i()+g.substr(m,S)+"</"+s+">":g.substr(m,S),m+=S-1):p+=a&&M!==" "?i()+M+"</"+s+">":M;t.outerHTML=p+(d?f:""),D&&Vm(R,"{{LT}}","<")},lb=function r(t,e,n,i){var s=Fl(t.childNodes),o=s.length,a=Ah(e),l,c;if(t.nodeType!==3||o>1){for(e.absolute=!1,l=0;l<o;l++)c=s[l],c._next=c._isFirst=c._parent=c._wordEnd=null,(c.nodeType!==3||/\S+/.test(c.nodeValue))&&(a&&c.nodeType!==3&&km(c).display==="inline"&&(c.style.display="inline-block",c.style.position="relative"),c._isSplit=!0,r(c,e,n,i));e.absolute=a,t._isSplit=!0;return}ab(t,e,n,i)},Zs=function(){function r(e,n){Om||zm(),this.elements=Fl(e),this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=n||{},Bm(this),nb&&this.split(n)}var t=r.prototype;return t.split=function(n){this.isSplit&&this.revert(),this.vars=n=n||this.vars,this._originals.length=this.chars.length=this.words.length=this.lines.length=0;for(var i=this.elements.length,s=n.tag?n.tag:n.span?"span":"div",o=Nm(n.wordsClass,s),a=Nm(n.charsClass,s),l,c,u;--i>-1;)u=this.elements[i],this._originals[i]={html:u.innerHTML,style:u.getAttribute("style")},l=u.clientHeight,c=u.clientWidth,lb(u,n,o,a),ob(u,n,this.chars,this.words,this.lines,c,l);return this.chars.reverse(),this.words.reverse(),this.lines.reverse(),this.isSplit=!0,this},t.revert=function(){var n=this._originals;if(!n)throw"revert() call wasn't scoped properly.";return this.elements.forEach(function(i,s){i.innerHTML=n[s].html,i.setAttribute("style",n[s].style)}),this.chars=[],this.words=[],this.lines=[],this.isSplit=!1,this},r.create=function(n,i){return new r(n,i)},r}();Zs.version="3.12.5";Zs.register=zm;var Hm=()=>{he.registerPlugin(Ht,Zs),document.querySelectorAll("[data-header-animation]").forEach(t=>{let e=t.querySelector("h2");if(!e||(e.classList.contains("is-all-strong")&&(e=e.querySelector("strong")),!e))return;let n=new Zs(e,{type:"lines",tag:"span"}),i=new Zs(e,{type:"lines",linesClass:"header_line"});n.lines=i.chars.concat(n.lines);let s=he.timeline({scrollTrigger:{trigger:t,start:"top bottom",toggleActions:"play none none reset"}});s.fromTo(n.lines,{y:100},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"+=0.25");let o=t.querySelector(".hero_holo");o&&s.fromTo(o,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25");let a=t.querySelector(".button");a&&s.fromTo(a,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"-=0.75")})};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{zf(),Rh(),Od(),Lm(),Fm(),Rd(),zd(),Bd(),Ph(),Hm()});})();
3847
3843
  /*! Bundled license information:
3848
3844
 
3849
3845
  gsap/gsap-core.js:
@@ -3918,4 +3914,15 @@ three/build/three.module.js:
3918
3914
  * Copyright 2010-2024 Three.js Authors
3919
3915
  * SPDX-License-Identifier: MIT
3920
3916
  *)
3917
+
3918
+ gsap/SplitText.js:
3919
+ (*!
3920
+ * SplitText: 3.12.5
3921
+ * https://gsap.com
3922
+ *
3923
+ * @license Copyright 2008-2024, GreenSock. All rights reserved.
3924
+ * Subject to the terms at https://gsap.com/standard-license or for
3925
+ * Club GSAP members, the agreement issued with that membership.
3926
+ * @author: Jack Doyle, jack@greensock.com
3927
+ *)
3921
3928
  */