@widelab-development/pirxey-webflow-dev 0.0.8 → 0.0.10
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/blog.js +157 -157
- package/package.json +1 -1
package/dist/blog.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(()=>{function Oi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Fd(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var Pn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},ks={duration:.5,overwrite:!1,delay:0},Au,an,Ae,Yn=1e8,we=1/Yn,gu=Math.PI*2,W0=gu/4,X0=0,Nd=Math.sqrt,Y0=Math.cos,q0=Math.sin,Ge=function(t){return typeof t=="string"},Ie=function(t){return typeof t=="function"},ki=function(t){return typeof t=="number"},cl=function(t){return typeof t>"u"},Ti=function(t){return typeof t=="object"},Rn=function(t){return t!==!1},Du=function(){return typeof window<"u"},tl=function(t){return Ie(t)||Ge(t)},Ud=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ln=Array.isArray,_u=/(?:-?\.?\d|\.)+/gi,Cu=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,$r=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,cu=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ru=/[+-]=-?[.\d]+/,Od=/[^,'"\[\]\s]+/gi,Z0=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ce,wi,xu,Pu,On={},rl={},Bd,kd=function(t){return(rl=Jr(t,On))&&cn},ul=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},jo=function(t,e){return!e&&console.warn(t)},zd=function(t,e){return t&&(On[t]=e)&&rl&&(rl[t]=e)||On},Qo=function(){return 0},J0={suppressEvents:!0,isStart:!0,kill:!1},el={suppressEvents:!0,kill:!1},$0={suppressEvents:!0},Iu={},ur=[],vu={},Vd,Dn={},uu={},Ad=30,nl=[],Lu="",Fu=function(t){var e=t[0],n,i;if(Ti(e)||Ie(e)||(t=[t]),!(n=(e._gsap||{}).harness)){for(i=nl.length;i--&&!nl[i].targetTest(e););n=nl[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new Ou(t[i],n)))||t.splice(i,1);return t},hr=function(t){return t._gsap||Fu(qn(t))[0]._gsap},Nu=function(t,e,n){return(n=t[e])&&Ie(n)?t[e]():cl(n)&&t.getAttribute&&t.getAttribute(e)||n},_n=function(t,e){return(t=t.split(",")).forEach(e)||t},Le=function(t){return Math.round(t*1e5)/1e5||0},Je=function(t){return Math.round(t*1e7)/1e7||0},Kr=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},K0=function(t,e){for(var n=e.length,i=0;t.indexOf(e[i])<0&&++i<n;);return i<n},sl=function(){var t=ur.length,e=ur.slice(0),n,i;for(vu={},ur.length=0,n=0;n<t;n++)i=e[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},Hd=function(t,e,n,i){ur.length&&!an&&sl(),t.render(e,n,i||an&&e<0&&(t._initted||t._startAt)),ur.length&&!an&&sl()},Gd=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Od).length<2?e:Ge(t)?t.trim():t},Wd=function(t){return t},Zn=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},j0=function(t){return function(e,n){for(var i in n)i in e||i==="duration"&&t||i==="ease"||(e[i]=n[i])}},Jr=function(t,e){for(var n in e)t[n]=e[n];return t},Dd=function r(t,e){for(var n in e)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=Ti(e[n])?r(t[n]||(t[n]={}),e[n]):e[n]);return t},ol=function(t,e){var n={},i;for(i in t)i in e||(n[i]=t[i]);return n},Jo=function(t){var e=t.parent||Ce,n=t.keyframes?j0(ln(t.keyframes)):Zn;if(Rn(t.inherit))for(;e;)n(t,e.vars.defaults),e=e.parent||e._dp;return t},Q0=function(t,e){for(var n=t.length,i=n===e.length;i&&n--&&t[n]===e[n];);return n<0},Xd=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},hl=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},fr=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Yr=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},tx=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},yu=function(t,e,n,i){return t._startAt&&(an?t._startAt.revert(el):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},ex=function r(t){return!t||t._ts&&r(t.parent)},Cd=function(t){return t._repeat?zs(t._tTime,t=t.duration()+t._rDelay)*t:0},zs=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},al=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},fl=function(t){return t._end=Je(t._start+(t._tDur/Math.abs(t._ts||t._rts||we)||0))},dl=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=Je(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),fl(t),n._dirty||Yr(n,t)),t},Yd=function(t,e){var n;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(n=al(t.rawTime(),e),(!e._dur||na(0,e.totalDuration(),n)-e._tTime>we)&&e.render(n,!0)),Yr(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=-we}},Ei=function(t,e,n,i){return e.parent&&fr(e),e._start=Je((ki(n)?n:n||t!==Ce?Xn(t,n,e):t._time)+e._delay),e._end=Je(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Xd(t,e,"_first","_last",t._sort?"_start":0),Su(e)||(t._recent=e),i||Yd(t,e),t._ts<0&&dl(t,t._tTime),t},qd=function(t,e){return(On.ScrollTrigger||ul("scrollTrigger",e))&&On.ScrollTrigger.create(e,t)},Zd=function(t,e,n,i,s){if(zu(t,e,s),!t._initted)return 1;if(!n&&t._pt&&!an&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Vd!==Cn.frame)return ur.push(t),t._lazy=[s,i],1},nx=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},Su=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},ix=function(t,e,n,i){var s=t.ratio,o=e<0||!e&&(!t._start&&nx(t)&&!(!t._initted&&Su(t))||(t._ts<0||t._dp._ts<0)&&!Su(t))?0:1,a=t._rDelay,l=0,c,h,f;if(a&&t._repeat&&(l=na(0,t._tDur,e),h=zs(l,a),t._yoyo&&h&1&&(o=1-o),h!==zs(t._tTime,a)&&(s=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==s||an||i||t._zTime===we||!e&&t._zTime){if(!t._initted&&Zd(t,e,i,n,l))return;for(f=t._zTime,t._zTime=e||(n?we:0),n||(n=e&&!f),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&&yu(t,e,n,!0),t._onUpdate&&!n&&Un(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&Un(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&fr(t,1),!n&&!an&&(Un(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},rx=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}},Vs=function(t,e,n,i){var s=t._repeat,o=Je(e)||0,a=t._tTime/t._tDur;return a&&!i&&(t._time*=o/t._dur),t._dur=o,t._tDur=s?s<0?1e10:Je(o*(s+1)+t._rDelay*s):o,a>0&&!i&&dl(t,t._tTime=t._tDur*a),t.parent&&fl(t),n||Yr(t.parent,t),t},Rd=function(t){return t instanceof tn?Yr(t):Vs(t,t._dur)},sx={_start:0,endTime:Qo,totalDuration:Qo},Xn=function r(t,e,n){var i=t.labels,s=t._recent||sx,o=t.duration()>=Yn?s.endTime(!1):t._dur,a,l,c;return Ge(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*(ln(n)?n[0]:n).totalDuration()),a>1?r(t,e.substr(0,a-1),n)+l:o+l)):e==null?o:+e},$o=function(t,e,n){var i=ki(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=Rn(l.vars.inherit)&&l.parent;o.immediateRender=Rn(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[s-1]}return new Ne(e[0],o,e[s+1])},dr=function(t,e){return t||t===0?e(t):e},na=function(t,e,n){return n<t?t:n>e?e:n},en=function(t,e){return!Ge(t)||!(e=Z0.exec(t))?"":e[1]},ox=function(t,e,n){return dr(n,function(i){return na(t,e,i)})},Mu=[].slice,Jd=function(t,e){return t&&Ti(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&Ti(t[0]))&&!t.nodeType&&t!==wi},ax=function(t,e,n){return n===void 0&&(n=[]),t.forEach(function(i){var s;return Ge(i)&&!e||Jd(i,1)?(s=n).push.apply(s,qn(i)):n.push(i)})||n},qn=function(t,e,n){return Ae&&!e&&Ae.selector?Ae.selector(t):Ge(t)&&!n&&(xu||!Hs())?Mu.call((e||Pu).querySelectorAll(t),0):ln(t)?ax(t,n):Jd(t)?Mu.call(t,0):t?[t]:[]},bu=function(t){return t=qn(t)[0]||jo("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return qn(e,n.querySelectorAll?n:n===t?jo("Invalid scope")||Pu.createElement("div"):t)}},$d=function(t){return t.sort(function(){return .5-Math.random()})},Kd=function(t){if(Ie(t))return t;var e=Ti(t)?t:{each:t},n=qr(e.ease),i=e.from||0,s=parseFloat(e.base)||0,o={},a=i>0&&i<1,l=isNaN(i)||a,c=e.axis,h=i,f=i;return Ge(i)?h=f={center:.5,edges:.5,end:1}[i]||0:!a&&l&&(h=i[0],f=i[1]),function(d,u,_){var p=(_||e).length,m=o[p],g,b,y,S,D,T,w,P,M;if(!m){if(M=e.grid==="auto"?0:(e.grid||[1,Yn])[1],!M){for(w=-Yn;w<(w=_[M++].getBoundingClientRect().left)&&M<p;);M<p&&M--}for(m=o[p]=[],g=l?Math.min(M,p)*h-.5:i%M,b=M===Yn?0:l?p*f/M-.5:i/M|0,w=0,P=Yn,T=0;T<p;T++)y=T%M-g,S=b-(T/M|0),m[T]=D=c?Math.abs(c==="y"?S:y):Nd(y*y+S*S),D>w&&(w=D),D<P&&(P=D);i==="random"&&$d(m),m.max=w-P,m.min=P,m.v=p=(parseFloat(e.amount)||parseFloat(e.each)*(M>p?p-1:c?c==="y"?p/M:M:Math.max(M,p/M))||0)*(i==="edges"?-1:1),m.b=p<0?s-p:s,m.u=en(e.amount||e.each)||0,n=n&&p<0?op(n):n}return p=(m[d]-m.min)/m.max||0,Je(m.b+(n?n(p):p)*m.v)+m.u}},wu=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var i=Je(Math.round(parseFloat(n)/t)*t*e);return(i-i%1)/e+(ki(n)?0:en(n))}},jd=function(t,e){var n=ln(t),i,s;return!n&&Ti(t)&&(i=n=t.radius||Yn,t.values?(t=qn(t.values),(s=!ki(t[0]))&&(i*=i)):t=wu(t.increment)),dr(e,n?Ie(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=Yn,h=0,f=t.length,d,u;f--;)s?(d=t[f].x-a,u=t[f].y-l,d=d*d+u*u):d=Math.abs(t[f]-a),d<c&&(c=d,h=f);return h=!i||c<=i?t[h]:o,s||h===o||ki(o)?h:h+en(o)}:wu(t))},Qd=function(t,e,n,i){return dr(ln(t)?!e:n===!0?!!(n=0):!i,function(){return ln(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})},lx=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)}},cx=function(t,e){return function(n){return t(parseFloat(n))+(e||en(n))}},ux=function(t,e,n){return ep(t,e,0,1,n)},tp=function(t,e,n){return dr(n,function(i){return t[~~e(i)]})},hx=function r(t,e,n){var i=e-t;return ln(t)?tp(t,r(0,t.length),e):dr(n,function(s){return(i+(s-t)%i)%i+t})},fx=function r(t,e,n){var i=e-t,s=i*2;return ln(t)?tp(t,r(0,t.length-1),e):dr(n,function(o){return o=(s+(o-t)%s)%s||0,t+(o>i?s-o:o)})},Gs=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?Od:_u),n+=t.substr(e,i-e)+Qd(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),e=o+1;return n+t.substr(e,t.length-e)},ep=function(t,e,n,i,s){var o=e-t,a=i-n;return dr(s,function(l){return n+((l-t)/o*a||0)})},dx=function r(t,e,n,i){var s=isNaN(t+e)?0:function(u){return(1-u)*t+u*e};if(!s){var o=Ge(t),a={},l,c,h,f,d;if(n===!0&&(i=1)&&(n=null),o)t={p:t},e={p:e};else if(ln(t)&&!ln(e)){for(h=[],f=t.length,d=f-2,c=1;c<f;c++)h.push(r(t[c-1],t[c]));f--,s=function(_){_*=f;var p=Math.min(d,~~_);return h[p](_-p)},n=e}else i||(t=Jr(ln(t)?[]:{},t));if(!h){for(l in e)Bu.call(a,t,l,"get",e[l]);s=function(_){return Gu(_,a)||(o?t.p:t)}}}return dr(n,s)},Pd=function(t,e,n){var i=t.labels,s=Yn,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},Un=function(t,e,n){var i=t.vars,s=i[e],o=Ae,a=t._ctx,l,c,h;if(s)return l=i[e+"Params"],c=i.callbackScope||t,n&&ur.length&&sl(),a&&(Ae=a),h=l?s.apply(c,l):s.call(c),Ae=o,h},qo=function(t){return fr(t),t.scrollTrigger&&t.scrollTrigger.kill(!!an),t.progress()<1&&Un(t,"onInterrupt"),t},Bs,np=[],ip=function(t){if(t)if(t=!t.name&&t.default||t,Du()||t.headless){var e=t.name,n=Ie(t),i=e&&!n&&t.init?function(){this._props=[]}:t,s={init:Qo,render:Gu,add:Bu,kill:Cx,modifier:Dx,rawVars:0},o={targetTest:0,get:0,getSetter:pl,aliases:{},register:0};if(Hs(),t!==i){if(Dn[e])return;Zn(i,Zn(ol(t,s),o)),Jr(i.prototype,Jr(s,ol(t,o))),Dn[i.prop=e]=i,t.targetTest&&(nl.push(i),Iu[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}zd(e,i),t.register&&t.register(cn,i,xn)}else np.push(t)},Me=255,Zo={aqua:[0,Me,Me],lime:[0,Me,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Me],navy:[0,0,128],white:[Me,Me,Me],olive:[128,128,0],yellow:[Me,Me,0],orange:[Me,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Me,0,0],pink:[Me,192,203],cyan:[0,Me,Me],transparent:[Me,Me,Me,0]},hu=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)*Me+.5|0},rp=function(t,e,n){var i=t?ki(t)?[t>>16,t>>8&Me,t&Me]:0:Zo.black,s,o,a,l,c,h,f,d,u,_;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Zo[t])i=Zo[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&Me,i&Me,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&Me,t&Me]}else if(t.substr(0,3)==="hsl"){if(i=_=t.match(_u),!e)l=+i[0]%360/360,c=+i[1]/100,h=+i[2]/100,o=h<=.5?h*(c+1):h+c-h*c,s=h*2-o,i.length>3&&(i[3]*=1),i[0]=hu(l+1/3,s,o),i[1]=hu(l,s,o),i[2]=hu(l-1/3,s,o);else if(~t.indexOf("="))return i=t.match(Cu),n&&i.length<4&&(i[3]=1),i}else i=t.match(_u)||Zo.transparent;i=i.map(Number)}return e&&!_&&(s=i[0]/Me,o=i[1]/Me,a=i[2]/Me,f=Math.max(s,o,a),d=Math.min(s,o,a),h=(f+d)/2,f===d?l=c=0:(u=f-d,c=h>.5?u/(2-f-d):u/(f+d),l=f===s?(o-a)/u+(o<a?6:0):f===o?(a-s)/u+2:(s-o)/u+4,l*=60),i[0]=~~(l+.5),i[1]=~~(c*100+.5),i[2]=~~(h*100+.5)),n&&i.length<4&&(i[3]=1),i},sp=function(t){var e=[],n=[],i=-1;return t.split(Bi).forEach(function(s){var o=s.match($r)||[];e.push.apply(e,o),n.push(i+=o.length+1)}),e.c=n,e},Id=function(t,e,n){var i="",s=(t+i).match(Bi),o=e?"hsla(":"rgba(",a=0,l,c,h,f;if(!s)return t;if(s=s.map(function(d){return(d=rp(d,e,1))&&o+(e?d[0]+","+d[1]+"%,"+d[2]+"%,"+d[3]:d.join(","))+")"}),n&&(h=sp(t),l=n.c,l.join(i)!==h.c.join(i)))for(c=t.replace(Bi,"1").split($r),f=c.length-1;a<f;a++)i+=c[a]+(~l.indexOf(a)?s.shift()||o+"0,0,0,0)":(h.length?h:s.length?s:n).shift());if(!c)for(c=t.split(Bi),f=c.length-1;a<f;a++)i+=c[a]+s[a];return i+c[f]},Bi=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Zo)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),px=/hsl[a]?\(/,Uu=function(t){var e=t.join(" "),n;if(Bi.lastIndex=0,Bi.test(e))return n=px.test(e),t[1]=Id(t[1],n),t[0]=Id(t[0],n,sp(t[1])),!0},ta,Cn=function(){var r=Date.now,t=500,e=33,n=r(),i=n,s=1e3/240,o=s,a=[],l,c,h,f,d,u,_=function p(m){var g=r()-i,b=m===!0,y,S,D,T;if((g>t||g<0)&&(n+=g-e),i+=g,D=i-n,y=D-o,(y>0||b)&&(T=++f.frame,d=D-f.time*1e3,f.time=D=D/1e3,o+=y+(y>=s?4:s-y),S=1),b||(l=c(p)),S)for(u=0;u<a.length;u++)a[u](D,d,T,m)};return f={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(m){return d/(1e3/(m||60))},wake:function(){Bd&&(!xu&&Du()&&(wi=xu=window,Pu=wi.document||{},On.gsap=cn,(wi.gsapVersions||(wi.gsapVersions=[])).push(cn.version),kd(rl||wi.GreenSockGlobals||!wi.gsap&&wi||{}),np.forEach(ip)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&f.sleep(),c=h||function(m){return setTimeout(m,o-f.time*1e3+1|0)},ta=1,_(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(l),ta=0,c=Qo},lagSmoothing:function(m,g){t=m||1/0,e=Math.min(g||33,t)},fps:function(m){s=1e3/(m||240),o=f.time*1e3+s},add:function(m,g,b){var y=g?function(S,D,T,w){m(S,D,T,w),f.remove(y)}:m;return f.remove(m),a[b?"unshift":"push"](y),Hs(),y},remove:function(m,g){~(g=a.indexOf(m))&&a.splice(g,1)&&u>=g&&u--},_listeners:a},f}(),Hs=function(){return!ta&&Cn.wake()},fe={},mx=/^[\d.\-M][\d.\-,\s]/,gx=/["']/g,_x=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(gx,"").trim():+c,i=l.substr(a+1).trim();return e},xx=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)},vx=function(t){var e=(t+"").split("("),n=fe[e[0]];return n&&e.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[_x(e[1])]:xx(t).split(",").map(Gd)):fe._CE&&mx.test(t)?fe._CE("",t):n},op=function(t){return function(e){return 1-t(1-e)}},ap=function r(t,e){for(var n=t._first,i;n;)n instanceof tn?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},qr=function(t,e){return t&&(Ie(t)?t:fe[t]||vx(t))||e},jr=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 _n(t,function(a){fe[a]=On[a]=s,fe[o=a.toLowerCase()]=n;for(var l in s)fe[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=fe[a+"."+l]=s[l]}),s},lp=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},fu=function r(t,e,n){var i=e>=1?e:1,s=(n||(t?.3:.45))/(e<1?e:1),o=s/gu*(Math.asin(1/i)||0),a=function(h){return h===1?1:i*Math.pow(2,-10*h)*q0((h-o)*s)+1},l=t==="out"?a:t==="in"?function(c){return 1-a(1-c)}:lp(a);return s=gu/s,l.config=function(c,h){return r(t,c,h)},l},du=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)}:lp(n);return i.config=function(s){return r(t,s)},i};_n("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;jr(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})});fe.Linear.easeNone=fe.none=fe.Linear.easeIn;jr("Elastic",fu("in"),fu("out"),fu());(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};jr("Bounce",function(o){return 1-s(1-o)},s)})(7.5625,2.75);jr("Expo",function(r){return r?Math.pow(2,10*(r-1)):0});jr("Circ",function(r){return-(Nd(1-r*r)-1)});jr("Sine",function(r){return r===1?1:-Y0(r*W0)+1});jr("Back",du("in"),du("out"),du());fe.SteppedEase=fe.steps=On.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-we;return function(a){return((i*na(0,o,a)|0)+s)*n}}};ks.ease=fe["quad.out"];_n("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return Lu+=r+","+r+"Params,"});var Ou=function(t,e){this.id=X0++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:Nu,this.set=e?e.getSetter:pl},ea=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,Vs(this,+e.duration,1,1),this.data=e.data,Ae&&(this._ctx=Ae,Ae.data.push(this)),ta||Cn.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,Vs(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,i){if(Hs(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(dl(this,n),!s._dp||s.parent||Yd(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)&&Ei(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===we||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Hd(this,n,i)),this},t.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+Cd(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)+Cd(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?zs(this._tTime,s)+1:1},t.timeScale=function(n,i){if(!arguments.length)return this._rts===-we?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?al(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-we?0:this._rts,this.totalTime(na(-Math.abs(this._delay),this._tDur,s),i!==!1),fl(this),tx(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):(Hs(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==we&&(this._tTime-=we)))),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)&&Ei(i,this,n-this._delay),this}return this._start},t.endTime=function(n){return this._start+(Rn(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?al(i.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=$0);var i=an;return an=n,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),an=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,Rd(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,Rd(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(Xn(this,n),Rn(i))},t.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,Rn(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?-we:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-we,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)-we)},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=Ie(n)?n:Wd,a=function(){var c=i.then;i.then=null,Ie(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(){qo(this)},r}();Zn(ea.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:-we,_prom:0,_ps:!1,_rts:1});var tn=function(r){Fd(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=Rn(n.sortChildren),Ce&&Ei(n.parent||Ce,Oi(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&qd(Oi(s),n.scrollTrigger),s}var e=t.prototype;return e.to=function(i,s,o){return $o(0,arguments,this),this},e.from=function(i,s,o){return $o(1,arguments,this),this},e.fromTo=function(i,s,o,a){return $o(2,arguments,this),this},e.set=function(i,s,o){return s.duration=0,s.parent=this,Jo(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Ne(i,s,Xn(this,o),1),this},e.call=function(i,s,o){return Ei(this,Ne.delayedCall(0,i,s),o)},e.staggerTo=function(i,s,o,a,l,c,h){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=c,o.onCompleteParams=h,o.parent=this,new Ne(i,o,Xn(this,l)),this},e.staggerFrom=function(i,s,o,a,l,c,h){return o.runBackwards=1,Jo(o).immediateRender=Rn(o.immediateRender),this.staggerTo(i,s,o,a,l,c,h)},e.staggerFromTo=function(i,s,o,a,l,c,h,f){return a.startAt=o,Jo(a).immediateRender=Rn(a.immediateRender),this.staggerTo(i,s,a,l,c,h,f)},e.render=function(i,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,h=i<=0?0:Je(i),f=this._zTime<0!=i<0&&(this._initted||!c),d,u,_,p,m,g,b,y,S,D,T,w;if(this!==Ce&&h>l&&i>=0&&(h=l),h!==this._tTime||o||f){if(a!==this._time&&c&&(h+=this._time-a,i+=this._time-a),d=h,S=this._start,y=this._ts,g=!y,f&&(c||(a=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(T=this._yoyo,m=c+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(m*100+i,s,o);if(d=Je(h%m),h===l?(p=this._repeat,d=c):(p=~~(h/m),p&&p===h/m&&(d=c,p--),d>c&&(d=c)),D=zs(this._tTime,m),!a&&this._tTime&&D!==p&&this._tTime-D*m-this._dur<=0&&(D=p),T&&p&1&&(d=c-d,w=1),p!==D&&!this._lock){var P=T&&D&1,M=P===(T&&p&1);if(p<D&&(P=!P),a=P?0:h%c?c:h,this._lock=1,this.render(a||(w?0:Je(p*m)),s,!c)._lock=0,this._tTime=h,!s&&this.parent&&Un(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),a&&a!==this._time||g!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,M&&(this._lock=2,a=P?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!g)return this;ap(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=rx(this,Je(a),Je(d)),b&&(h-=d-(d=b._start))),this._tTime=h,this._time=d,this._act=!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,a=0),!a&&d&&!s&&!p&&(Un(this,"onStart"),this._tTime!==h))return this;if(d>=a&&i>=0)for(u=this._first;u;){if(_=u._next,(u._act||d>=u._start)&&u._ts&&b!==u){if(u.parent!==this)return this.render(i,s,o);if(u.render(u._ts>0?(d-u._start)*u._ts:(u._dirty?u.totalDuration():u._tDur)+(d-u._start)*u._ts,s,o),d!==this._time||!this._ts&&!g){b=0,_&&(h+=this._zTime=-we);break}}u=_}else{u=this._last;for(var v=i<0?i:d;u;){if(_=u._prev,(u._act||v<=u._end)&&u._ts&&b!==u){if(u.parent!==this)return this.render(i,s,o);if(u.render(u._ts>0?(v-u._start)*u._ts:(u._dirty?u.totalDuration():u._tDur)+(v-u._start)*u._ts,s,o||an&&(u._initted||u._startAt)),d!==this._time||!this._ts&&!g){b=0,_&&(h+=this._zTime=v?-we:we);break}}u=_}}if(b&&!s&&(this.pause(),b.render(d>=a?0:-we)._zTime=d>=a?1:-1,this._ts))return this._start=S,fl(this),this.render(i,s,o);this._onUpdate&&!s&&Un(this,"onUpdate",!0),(h===l&&this._tTime>=this.totalDuration()||!h&&a)&&(S===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((i||!c)&&(h===l&&this._ts>0||!h&&this._ts<0)&&fr(this,1),!s&&!(i<0&&!a)&&(h||a||!l)&&(Un(this,h===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(i,s){var o=this;if(ki(s)||(s=Xn(this,s,i)),!(i instanceof ea)){if(ln(i))return i.forEach(function(a){return o.add(a,s)}),this;if(Ge(i))return this.addLabel(i,s);if(Ie(i))i=Ne.delayedCall(0,i);else return this}return this!==i?Ei(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=-Yn);for(var l=[],c=this._first;c;)c._start>=a&&(c instanceof Ne?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 Ge(i)?this.removeLabel(i):Ie(i)?this.killTweensOf(i):(hl(this,i),i===this._recent&&(this._recent=this._last),Yr(this))},e.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Je(Cn.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]=Xn(this,s),this},e.removeLabel=function(i){return delete this.labels[i],this},e.addPause=function(i,s,o){var a=Ne.delayedCall(0,s||Qo,o);return a.data="isPause",this._hasPause=1,Ei(this,a,Xn(this,i))},e.removePause=function(i){var s=this._first;for(i=Xn(this,i);s;)s._start===i&&s.data==="isPause"&&fr(s),s=s._next},e.killTweensOf=function(i,s,o){for(var a=this.getTweensOf(i,o),l=a.length;l--;)cr!==a[l]&&a[l].kill(i,s);return this},e.getTweensOf=function(i,s){for(var o=[],a=qn(i),l=this._first,c=ki(s),h;l;)l instanceof Ne?K0(l._targets,a)&&(c?(!cr||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&o.push(l):(h=l.getTweensOf(a,s)).length&&o.push.apply(o,h),l=l._next;return o},e.tweenTo=function(i,s){s=s||{};var o=this,a=Xn(o,i),l=s,c=l.startAt,h=l.onStart,f=l.onStartParams,d=l.immediateRender,u,_=Ne.to(o,Zn({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())||we,onStart:function(){if(o.pause(),!u){var m=s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());_._dur!==m&&Vs(_,m,0,1).render(_._time,!0,!0),u=1}h&&h.apply(_,f||[])}},s));return d?_.render(0):_},e.tweenFromTo=function(i,s,o){return this.tweenTo(s,Zn({startAt:{time:Xn(this,i)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(i){return i===void 0&&(i=this._time),Pd(this,Xn(this,i))},e.previousLabel=function(i){return i===void 0&&(i=this._time),Pd(this,Xn(this,i),1)},e.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+we)},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 Yr(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={}),Yr(this)},e.totalDuration=function(i){var s=0,o=this,a=o._last,l=Yn,c,h,f;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));if(o._dirty){for(f=o.parent;a;)c=a._prev,a._dirty&&a.totalDuration(),h=a._start,h>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,Ei(o,a,h-a._delay,1)._lock=0):l=h,h<0&&a._ts&&(s-=h,(!f&&!o._dp||f&&f.smoothChildTiming)&&(o._start+=h/o._ts,o._time-=h,o._tTime-=h),o.shiftChildren(-h,!1,-1/0),l=0),a._end>s&&a._ts&&(s=a._end),a=c;Vs(o,o===Ce&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(i){if(Ce._ts&&(Hd(Ce,al(i,Ce)),Vd=Cn.frame),Cn.frame>=Ad){Ad+=Pn.autoSleep||120;var s=Ce._first;if((!s||!s._ts)&&Pn.autoSleep&&Cn._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||Cn.sleep()}}},t}(ea);Zn(tn.prototype,{_lock:0,_hasPause:0,_forcing:0});var yx=function(t,e,n,i,s,o,a){var l=new xn(this._pt,t,e,0,1,Hu,null,s),c=0,h=0,f,d,u,_,p,m,g,b;for(l.b=n,l.e=i,n+="",i+="",(g=~i.indexOf("random("))&&(i=Gs(i)),o&&(b=[n,i],o(b,t,e),n=b[0],i=b[1]),d=n.match(cu)||[];f=cu.exec(i);)_=f[0],p=i.substring(c,f.index),u?u=(u+1)%5:p.substr(-5)==="rgba("&&(u=1),_!==d[h++]&&(m=parseFloat(d[h-1])||0,l._pt={_next:l._pt,p:p||h===1?p:",",s:m,c:_.charAt(1)==="="?Kr(m,_)-m:parseFloat(_)-m,m:u&&u<4?Math.round:0},c=cu.lastIndex);return l.c=c<i.length?i.substring(c,i.length):"",l.fp=a,(Ru.test(i)||g)&&(l.e=0),this._pt=l,l},Bu=function(t,e,n,i,s,o,a,l,c,h){Ie(i)&&(i=i(s||0,t,o));var f=t[e],d=n!=="get"?n:Ie(f)?c?t[e.indexOf("set")||!Ie(t["get"+e.substr(3)])?e:"get"+e.substr(3)](c):t[e]():f,u=Ie(f)?c?Ex:hp:Vu,_;if(Ge(i)&&(~i.indexOf("random(")&&(i=Gs(i)),i.charAt(1)==="="&&(_=Kr(d,i)+(en(d)||0),(_||_===0)&&(i=_))),!h||d!==i||Eu)return!isNaN(d*i)&&i!==""?(_=new xn(this._pt,t,e,+d||0,i-(d||0),typeof f=="boolean"?Ax:fp,0,u),c&&(_.fp=c),a&&_.modifier(a,this,t),this._pt=_):(!f&&!(e in t)&&ul(e,i),yx.call(this,t,e,d,i,u,l||Pn.stringFilter,c))},Sx=function(t,e,n,i,s){if(Ie(t)&&(t=Ko(t,s,e,n,i)),!Ti(t)||t.style&&t.nodeType||ln(t)||Ud(t))return Ge(t)?Ko(t,s,e,n,i):t;var o={},a;for(a in t)o[a]=Ko(t[a],s,e,n,i);return o},ku=function(t,e,n,i,s,o){var a,l,c,h;if(Dn[t]&&(a=new Dn[t]).init(s,a.rawVars?e[t]:Sx(e[t],i,s,o,n),n,i,o)!==!1&&(n._pt=l=new xn(n._pt,s,t,0,1,a.render,a,0,a.priority),n!==Bs))for(c=n._ptLookup[n._targets.indexOf(s)],h=a._props.length;h--;)c[a._props[h]]=l;return a},cr,Eu,zu=function r(t,e,n){var i=t.vars,s=i.ease,o=i.startAt,a=i.immediateRender,l=i.lazy,c=i.onUpdate,h=i.runBackwards,f=i.yoyoEase,d=i.keyframes,u=i.autoRevert,_=t._dur,p=t._startAt,m=t._targets,g=t.parent,b=g&&g.data==="nested"?g.vars.targets:m,y=t._overwrite==="auto"&&!Au,S=t.timeline,D,T,w,P,M,v,I,N,C,V,$,W,Z;if(S&&(!d||!s)&&(s="none"),t._ease=qr(s,ks.ease),t._yEase=f?op(qr(f===!0?s:f,ks.ease)):0,f&&t._yoyo&&!t._repeat&&(f=t._yEase,t._yEase=t._ease,t._ease=f),t._from=!S&&!!i.runBackwards,!S||d&&!i.stagger){if(N=m[0]?hr(m[0]).harness:0,W=N&&i[N.prop],D=ol(i,Iu),p&&(p._zTime<0&&p.progress(1),e<0&&h&&a&&!u?p.render(-1,!0):p.revert(h&&_?el:J0),p._lazy=0),o){if(fr(t._startAt=Ne.set(m,Zn({data:"isStart",overwrite:!1,parent:g,immediateRender:!0,lazy:!p&&Rn(l),startAt:null,delay:0,onUpdate:c&&function(){return Un(t,"onUpdate")},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(an||!a&&!u)&&t._startAt.revert(el),a&&_&&e<=0&&n<=0){e&&(t._zTime=e);return}}else if(h&&_&&!p){if(e&&(a=!1),w=Zn({overwrite:!1,data:"isFromStart",lazy:a&&!p&&Rn(l),immediateRender:a,stagger:0,parent:g},D),W&&(w[N.prop]=W),fr(t._startAt=Ne.set(m,w)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(an?t._startAt.revert(el):t._startAt.render(-1,!0)),t._zTime=e,!a)r(t._startAt,we,we);else if(!e)return}for(t._pt=t._ptCache=0,l=_&&Rn(l)||l&&!_,T=0;T<m.length;T++){if(M=m[T],I=M._gsap||Fu(m)[T]._gsap,t._ptLookup[T]=V={},vu[I.id]&&ur.length&&sl(),$=b===m?T:b.indexOf(M),N&&(C=new N).init(M,W||D,t,$,b)!==!1&&(t._pt=P=new xn(t._pt,M,C.name,0,1,C.render,C,0,C.priority),C._props.forEach(function(z){V[z]=P}),C.priority&&(v=1)),!N||W)for(w in D)Dn[w]&&(C=ku(w,D,t,$,M,b))?C.priority&&(v=1):V[w]=P=Bu.call(t,M,w,"get",D[w],$,b,0,i.stringFilter);t._op&&t._op[T]&&t.kill(M,t._op[T]),y&&t._pt&&(cr=t,Ce.killTweensOf(M,V,t.globalTime(e)),Z=!t.parent,cr=0),t._pt&&l&&(vu[I.id]=1)}v&&Wu(t),t._onInit&&t._onInit(t)}t._onUpdate=c,t._initted=(!t._op||t._pt)&&!Z,d&&e<=0&&S.render(Yn,!0,!0)},Mx=function(t,e,n,i,s,o,a,l){var c=(t._pt&&t._ptCache||(t._ptCache={}))[e],h,f,d,u;if(!c)for(c=t._ptCache[e]=[],d=t._ptLookup,u=t._targets.length;u--;){if(h=d[u][e],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==e&&h.fp!==e;)h=h._next;if(!h)return Eu=1,t.vars[e]="+=0",zu(t,a),Eu=0,l?jo(e+" not eligible for reset"):1;c.push(h)}for(u=c.length;u--;)f=c[u],h=f._pt||f,h.s=(i||i===0)&&!s?i:h.s+(i||0)+o*h.c,h.c=n-h.s,f.e&&(f.e=Le(n)+en(f.e)),f.b&&(f.b=h.s+en(f.b))},bx=function(t,e){var n=t[0]?hr(t[0]).harness:0,i=n&&n.aliases,s,o,a,l;if(!i)return e;s=Jr({},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},wx=function(t,e,n,i){var s=e.ease||i||"power1.inOut",o,a;if(ln(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})},Ko=function(t,e,n,i,s){return Ie(t)?t.call(e,n,i,s):Ge(t)&&~t.indexOf("random(")?Gs(t):t},cp=Lu+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",up={};_n(cp+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return up[r]=1});var Ne=function(r){Fd(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:Jo(i))||this;var l=a.vars,c=l.duration,h=l.delay,f=l.immediateRender,d=l.stagger,u=l.overwrite,_=l.keyframes,p=l.defaults,m=l.scrollTrigger,g=l.yoyoEase,b=i.parent||Ce,y=(ln(n)||Ud(n)?ki(n[0]):"length"in i)?[n]:qn(n),S,D,T,w,P,M,v,I;if(a._targets=y.length?Fu(y):jo("GSAP target "+n+" not found. https://gsap.com",!Pn.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=u,_||d||tl(c)||tl(h)){if(i=a.vars,S=a.timeline=new tn({data:"nested",defaults:p||{},targets:b&&b.data==="nested"?b.vars.targets:y}),S.kill(),S.parent=S._dp=Oi(a),S._start=0,d||tl(c)||tl(h)){if(w=y.length,v=d&&Kd(d),Ti(d))for(P in d)~cp.indexOf(P)&&(I||(I={}),I[P]=d[P]);for(D=0;D<w;D++)T=ol(i,up),T.stagger=0,g&&(T.yoyoEase=g),I&&Jr(T,I),M=y[D],T.duration=+Ko(c,Oi(a),D,M,y),T.delay=(+Ko(h,Oi(a),D,M,y)||0)-a._delay,!d&&w===1&&T.delay&&(a._delay=h=T.delay,a._start+=h,T.delay=0),S.to(M,T,v?v(D,M,y):0),S._ease=fe.none;S.duration()?c=h=0:a.timeline=0}else if(_){Jo(Zn(S.vars.defaults,{ease:"none"})),S._ease=qr(_.ease||i.ease||"none");var N=0,C,V,$;if(ln(_))_.forEach(function(W){return S.to(y,W,">")}),S.duration();else{T={};for(P in _)P==="ease"||P==="easeEach"||wx(P,_[P],T,_.easeEach);for(P in T)for(C=T[P].sort(function(W,Z){return W.t-Z.t}),N=0,D=0;D<C.length;D++)V=C[D],$={ease:V.e,duration:(V.t-(D?C[D-1].t:0))/100*c},$[P]=V.v,S.to(y,$,N),N+=$.duration;S.duration()<c&&S.to({},{duration:c-S.duration()})}}c||a.duration(c=S.duration())}else a.timeline=0;return u===!0&&!Au&&(cr=Oi(a),Ce.killTweensOf(y),cr=0),Ei(b,Oi(a),s),i.reversed&&a.reverse(),i.paused&&a.paused(!0),(f||!c&&!_&&a._start===Je(b._time)&&Rn(f)&&ex(Oi(a))&&b.data!=="nested")&&(a._tTime=-we,a.render(Math.max(0,-h)||0)),m&&qd(Oi(a),m),a}var e=t.prototype;return e.render=function(i,s,o){var a=this._time,l=this._tDur,c=this._dur,h=i<0,f=i>l-we&&!h?l:i<we?0:i,d,u,_,p,m,g,b,y,S;if(!c)ix(this,i,s,o);else if(f!==this._tTime||!i||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h){if(d=f,y=this.timeline,this._repeat){if(p=c+this._rDelay,this._repeat<-1&&h)return this.totalTime(p*100+i,s,o);if(d=Je(f%p),f===l?(_=this._repeat,d=c):(_=~~(f/p),_&&_===Je(f/p)&&(d=c,_--),d>c&&(d=c)),g=this._yoyo&&_&1,g&&(S=this._yEase,d=c-d),m=zs(this._tTime,p),d===a&&!o&&this._initted&&_===m)return this._tTime=f,this;_!==m&&(y&&this._yEase&&ap(y,g),this.vars.repeatRefresh&&!g&&!this._lock&&this._time!==p&&this._initted&&(this._lock=o=1,this.render(Je(p*_),!0).invalidate()._lock=0))}if(!this._initted){if(Zd(this,h?i:d,o,s,f))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&_!==m))return this;if(c!==this._dur)return this.render(i,s,o)}if(this._tTime=f,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=b=(S||this._ease)(d/c),this._from&&(this.ratio=b=1-b),d&&!a&&!s&&!_&&(Un(this,"onStart"),this._tTime!==f))return this;for(u=this._pt;u;)u.r(b,u.d),u=u._next;y&&y.render(i<0?i:y._dur*y._ease(d/this._dur),s,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(h&&yu(this,i,s,o),Un(this,"onUpdate")),this._repeat&&_!==m&&this.vars.onRepeat&&!s&&this.parent&&Un(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(h&&!this._onUpdate&&yu(this,i,!0,!0),(i||!c)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&fr(this,1),!s&&!(h&&!a)&&(f||a||g)&&(Un(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,o,a,l){ta||Cn.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||zu(this,c),h=this._ease(c/this._dur),Mx(this,i,s,o,a,h,c,l)?this.resetTo(i,s,o,a,1):(dl(this,0),this.parent||Xd(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?qo(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,s,cr&&cr.vars.overwrite!==!0)._first||qo(this),this.parent&&o!==this.timeline.totalDuration()&&Vs(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=i?qn(i):a,c=this._ptLookup,h=this._pt,f,d,u,_,p,m,g;if((!s||s==="all")&&Q0(a,l))return s==="all"&&(this._pt=0),qo(this);for(f=this._op=this._op||[],s!=="all"&&(Ge(s)&&(p={},_n(s,function(b){return p[b]=1}),s=p),s=bx(a,s)),g=a.length;g--;)if(~l.indexOf(a[g])){d=c[g],s==="all"?(f[g]=s,_=d,u={}):(u=f[g]=f[g]||{},_=s);for(p in _)m=d&&d[p],m&&((!("kill"in m.d)||m.d.kill(p)===!0)&&hl(this,m,"_pt"),delete d[p]),u!=="all"&&(u[p]=1)}return this._initted&&!this._pt&&h&&qo(this),this},t.to=function(i,s){return new t(i,s,arguments[2])},t.from=function(i,s){return $o(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 $o(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 Ce.killTweensOf(i,s,o)},t}(ea);Zn(Ne.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});_n("staggerTo,staggerFrom,staggerFromTo",function(r){Ne[r]=function(){var t=new tn,e=Mu.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var Vu=function(t,e,n){return t[e]=n},hp=function(t,e,n){return t[e](n)},Ex=function(t,e,n,i){return t[e](i.fp,n)},Tx=function(t,e,n){return t.setAttribute(e,n)},pl=function(t,e){return Ie(t[e])?hp:cl(t[e])&&t.setAttribute?Tx:Vu},fp=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},Ax=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},Hu=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)},Gu=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},Dx=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},Cx=function(t){for(var e=this._pt,n,i;e;)i=e._next,e.p===t&&!e.op||e.op===t?hl(this,e,"_pt"):e.dep||(n=1),e=i;return!n},Rx=function(t,e,n,i){i.mSet(t,e,i.m.call(i.tween,n,i.mt),i)},Wu=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},xn=function(){function r(e,n,i,s,o,a,l,c,h){this.t=n,this.s=s,this.c=o,this.p=i,this.r=a||fp,this.d=l||this,this.set=c||Vu,this.pr=h||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=Rx,this.m=n,this.mt=s,this.tween=i},r}();_n(Lu+"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 Iu[r]=1});On.TweenMax=On.TweenLite=Ne;On.TimelineLite=On.TimelineMax=tn;Ce=new tn({sortChildren:!1,defaults:ks,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Pn.stringFilter=Uu;var Zr=[],il={},Px=[],Ld=0,Ix=0,pu=function(t){return(il[t]||Px).map(function(e){return e()})},Tu=function(){var t=Date.now(),e=[];t-Ld>2&&(pu("matchMediaInit"),Zr.forEach(function(n){var i=n.queries,s=n.conditions,o,a,l,c;for(a in i)o=wi.matchMedia(i[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,c=1);c&&(n.revert(),l&&e.push(n))}),pu("matchMediaRevert"),e.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),Ld=t,pu("matchMedia"))},dp=function(){function r(e,n){this.selector=n&&bu(n),this.data=[],this._r=[],this.isReverted=!1,this.id=Ix++,e&&this.add(e)}var t=r.prototype;return t.add=function(n,i,s){Ie(n)&&(s=i,i=n,n=Ie);var o=this,a=function(){var c=Ae,h=o.selector,f;return c&&c!==o&&c.data.push(o),s&&(o.selector=bu(s)),Ae=o,f=i.apply(o,arguments),Ie(f)&&o._r.push(f),Ae=c,o.selector=h,o.isReverted=!1,f};return o.last=a,n===Ie?a(o,function(l){return o.add(null,l)}):n?o[n]=a:a},t.ignore=function(n){var i=Ae;Ae=null,n(this),Ae=i},t.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof Ne&&!(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(h){return a.splice(a.indexOf(h),1)}));for(a.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,f){return f.g-h.g||-1/0}).forEach(function(h){return h.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof tn?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof Ne)&&c.revert&&c.revert(n);s._r.forEach(function(h){return h(n,s)}),s.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),i)for(var o=Zr.length;o--;)Zr[o].id===this.id&&Zr.splice(o,1)},t.revert=function(n){this.kill(n||{})},r}(),Lx=function(){function r(e){this.contexts=[],this.scope=e,Ae&&Ae.data.push(this)}var t=r.prototype;return t.add=function(n,i,s){Ti(n)||(n={matches:n});var o=new dp(0,s||this.scope),a=o.conditions={},l,c,h;Ae&&!o.selector&&(o.selector=Ae.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=n;for(c in n)c==="all"?h=1:(l=wi.matchMedia(n[c]),l&&(Zr.indexOf(o)<0&&Zr.push(o),(a[c]=l.matches)&&(h=1),l.addListener?l.addListener(Tu):l.addEventListener("change",Tu)));return h&&i(o,function(f){return o.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}(),ll={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 ip(i)})},timeline:function(t){return new tn(t)},getTweensOf:function(t,e){return Ce.getTweensOf(t,e)},getProperty:function(t,e,n,i){Ge(t)&&(t=qn(t)[0]);var s=hr(t||{}).get,o=n?Wd:Gd;return n==="native"&&(n=""),t&&(e?o((Dn[e]&&Dn[e].get||s)(t,e,n,i)):function(a,l,c){return o((Dn[a]&&Dn[a].get||s)(t,a,l,c))})},quickSetter:function(t,e,n){if(t=qn(t),t.length>1){var i=t.map(function(h){return cn.quickSetter(h,e,n)}),s=i.length;return function(h){for(var f=s;f--;)i[f](h)}}t=t[0]||{};var o=Dn[e],a=hr(t),l=a.harness&&(a.harness.aliases||{})[e]||e,c=o?function(h){var f=new o;Bs._pt=0,f.init(t,n?h+n:h,Bs,0,[t]),f.render(1,f),Bs._pt&&Gu(1,Bs)}:a.set(t,l);return o?c:function(h){return c(t,l,n?h+n:h,a,1)}},quickTo:function(t,e,n){var i,s=cn.to(t,Jr((i={},i[e]="+=0.1",i.paused=!0,i),n||{})),o=function(l,c,h){return s.resetTo(e,l,c,h)};return o.tween=s,o},isTweening:function(t){return Ce.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=qr(t.ease,ks.ease)),Dd(ks,t||{})},config:function(t){return Dd(Pn,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&&!Dn[a]&&!On[a]&&jo(e+" effect requires "+a+" plugin.")}),uu[e]=function(a,l,c){return n(qn(a),Zn(l||{},s),c)},o&&(tn.prototype[e]=function(a,l,c){return this.add(uu[e](a,Ti(l)?l:(c=l)&&{},this),c)})},registerEase:function(t,e){fe[t]=qr(e)},parseEase:function(t,e){return arguments.length?qr(t,e):fe},getById:function(t){return Ce.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var n=new tn(t),i,s;for(n.smoothChildTiming=Rn(t.smoothChildTiming),Ce.remove(n),n._dp=0,n._time=n._tTime=Ce._time,i=Ce._first;i;)s=i._next,(e||!(!i._dur&&i instanceof Ne&&i.vars.onComplete===i._targets[0]))&&Ei(n,i,i._start-i._delay),i=s;return Ei(Ce,n,0),n},context:function(t,e){return t?new dp(t,e):Ae},matchMedia:function(t){return new Lx(t)},matchMediaRefresh:function(){return Zr.forEach(function(t){var e=t.conditions,n,i;for(i in e)e[i]&&(e[i]=!1,n=1);n&&t.revert()})||Tu()},addEventListener:function(t,e){var n=il[t]||(il[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=il[t],i=n&&n.indexOf(e);i>=0&&n.splice(i,1)},utils:{wrap:hx,wrapYoyo:fx,distribute:Kd,random:Qd,snap:jd,normalize:ux,getUnit:en,clamp:ox,splitColor:rp,toArray:qn,selector:bu,mapRange:ep,pipe:lx,unitize:cx,interpolate:dx,shuffle:$d},install:kd,effects:uu,ticker:Cn,updateRoot:tn.updateRoot,plugins:Dn,globalTimeline:Ce,core:{PropTween:xn,globals:zd,Tween:Ne,Timeline:tn,Animation:ea,getCache:hr,_removeLinkedListItem:hl,reverting:function(){return an},context:function(t){return t&&Ae&&(Ae.data.push(t),t._ctx=Ae),Ae},suppressOverwrites:function(t){return Au=t}}};_n("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return ll[r]=Ne[r]});Cn.add(tn.updateRoot);Bs=ll.to({},{duration:0});var Fx=function(t,e){for(var n=t._pt;n&&n.p!==e&&n.op!==e&&n.fp!==e;)n=n._next;return n},Nx=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=Fx(o,i)),o&&o.modifier&&o.modifier(e[i],t,n[s],i))},mu=function(t,e){return{name:t,rawVars:1,init:function(i,s,o){o._onInit=function(a){var l,c;if(Ge(s)&&(l={},_n(s,function(h){return l[h]=1}),s=l),e){l={};for(c in s)l[c]=e(s[c]);s=l}Nx(a,s)}}}},cn=ll.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;)an?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)}},mu("roundProps",wu),mu("modifiers"),mu("snap",jd))||ll;Ne.version=tn.version=cn.version="3.12.5";Bd=1;Du()&&Hs();var Ux=fe.Power0,Ox=fe.Power1,Bx=fe.Power2,kx=fe.Power3,zx=fe.Power4,Vx=fe.Linear,Hx=fe.Quad,Gx=fe.Cubic,Wx=fe.Quart,Xx=fe.Quint,Yx=fe.Strong,qx=fe.Elastic,Zx=fe.Back,Jx=fe.SteppedEase,$x=fe.Bounce,Kx=fe.Sine,jx=fe.Expo,Qx=fe.Circ;var pp,pr,Xs,Ku,ns,tv,mp,ju,ev=function(){return typeof window<"u"},Vi={},es=180/Math.PI,Ys=Math.PI/180,Ws=Math.atan2,gp=1e8,Qu=/([A-Z])/g,nv=/(left|right|width|margin|padding|x)/i,iv=/[\s,\(]\S/,Ai={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},qu=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},rv=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)},sv=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)},ov=function(t,e){var n=e.s+e.c*t;e.set(e.t,e.p,~~(n+(n<0?-.5:.5))+e.u,e)},bp=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},wp=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},av=function(t,e,n){return t.style[e]=n},lv=function(t,e,n){return t.style.setProperty(e,n)},cv=function(t,e,n){return t._gsap[e]=n},uv=function(t,e,n){return t._gsap.scaleX=t._gsap.scaleY=n},hv=function(t,e,n,i,s){var o=t._gsap;o.scaleX=o.scaleY=n,o.renderTransform(s,o)},fv=function(t,e,n,i,s){var o=t._gsap;o[e]=n,o.renderTransform(s,o)},Re="transform",In=Re+"Origin",dv=function r(t,e){var n=this,i=this.target,s=i.style,o=i._gsap;if(t in Vi&&s){if(this.tfm=this.tfm||{},t!=="transform")t=Ai[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return n.tfm[a]=zi(i,a)}):this.tfm[t]=o.x?o[t]:zi(i,t),t===In&&(this.tfm.zOrigin=o.zOrigin);else return Ai.transform.split(",").forEach(function(a){return r.call(n,a,e)});if(this.props.indexOf(Re)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(In,e,"")),t=Re}(s||e)&&this.props.push(t,e,s[t])},Ep=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},pv=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(Qu,"-$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=ju(),(!s||!s.isStart)&&!n[Re]&&(Ep(n),i.zOrigin&&n[In]&&(n[In]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},Tp=function(t,e){var n={target:t,props:[],revert:pv,save:dv};return t._gsap||cn.core.getCache(t),e&&e.split(",").forEach(function(i){return n.save(i)}),n},Ap,Zu=function(t,e){var n=pr.createElementNS?pr.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):pr.createElement(t);return n&&n.style?n:pr.createElement(t)},Di=function r(t,e,n){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(Qu,"-$1").toLowerCase())||i.getPropertyValue(e)||!n&&r(t,qs(e)||e,1)||""},_p="O,Moz,ms,Ms,Webkit".split(","),qs=function(t,e,n){var i=e||ns,s=i.style,o=5;if(t in s&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(_p[o]+t in s););return o<0?null:(o===3?"ms":o>=0?_p[o]:"")+t},Ju=function(){ev()&&window.document&&(pp=window,pr=pp.document,Xs=pr.documentElement,ns=Zu("div")||{style:{}},tv=Zu("div"),Re=qs(Re),In=Re+"Origin",ns.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ap=!!qs("perspective"),ju=cn.core.reverting,Ku=1)},Xu=function r(t){var e=Zu("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(Xs.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)),Xs.removeChild(e),this.style.cssText=s,o},xp=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},Dp=function(t){var e;try{e=t.getBBox()}catch{e=Xu.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Xu||(e=Xu.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+xp(t,["x","cx","x1"])||0,y:+xp(t,["y","cy","y1"])||0,width:0,height:0}:e},Cp=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&Dp(t))},is=function(t,e){if(e){var n=t.style,i;e in Vi&&e!==In&&(e=Re),n.removeProperty?(i=e.substr(0,2),(i==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),n.removeProperty(i==="--"?e:e.replace(Qu,"-$1").toLowerCase())):n.removeAttribute(e)}},mr=function(t,e,n,i,s,o){var a=new xn(t._pt,e,n,0,1,o?wp:bp);return t._pt=a,a.b=i,a.e=s,t._props.push(n),a},vp={deg:1,rad:1,turn:1},mv={grid:1,flex:1},gr=function r(t,e,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",a=ns.style,l=nv.test(e),c=t.tagName.toLowerCase()==="svg",h=(c?"client":"offset")+(l?"Width":"Height"),f=100,d=i==="px",u=i==="%",_,p,m,g;if(i===o||!s||vp[i]||vp[o])return s;if(o!=="px"&&!d&&(s=r(t,e,n,"px")),g=t.getCTM&&Cp(t),(u||o==="%")&&(Vi[e]||~e.indexOf("adius")))return _=g?t.getBBox()[l?"width":"height"]:t[h],Le(u?s/_*f:s/100*_);if(a[l?"width":"height"]=f+(d?o:i),p=~e.indexOf("adius")||i==="em"&&t.appendChild&&!c?t:t.parentNode,g&&(p=(t.ownerSVGElement||{}).parentNode),(!p||p===pr||!p.appendChild)&&(p=pr.body),m=p._gsap,m&&u&&m.width&&l&&m.time===Cn.time&&!m.uncache)return Le(s/m.width*f);if(u&&(e==="height"||e==="width")){var b=t.style[e];t.style[e]=f+i,_=t[h],b?t.style[e]=b:is(t,e)}else(u||o==="%")&&!mv[Di(p,"display")]&&(a.position=Di(t,"position")),p===t&&(a.position="static"),p.appendChild(ns),_=ns[h],p.removeChild(ns),a.position="absolute";return l&&u&&(m=hr(p),m.time=Cn.time,m.width=p[h]),Le(d?_*s/f:_&&s?f/_*s:0)},zi=function(t,e,n,i){var s;return Ku||Ju(),e in Ai&&e!=="transform"&&(e=Ai[e],~e.indexOf(",")&&(e=e.split(",")[0])),Vi[e]&&e!=="transform"?(s=sa(t,i),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:gl(Di(t,In))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=ml[e]&&ml[e](t,e,n)||Di(t,e)||Nu(t,e)||(e==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?gr(t,e,s,n)+n:s},gv=function(t,e,n,i){if(!n||n==="none"){var s=qs(e,t,1),o=s&&Di(t,s,1);o&&o!==n?(e=s,n=o):e==="borderColor"&&(n=Di(t,"borderTopColor"))}var a=new xn(this._pt,t.style,e,0,1,Hu),l=0,c=0,h,f,d,u,_,p,m,g,b,y,S,D;if(a.b=n,a.e=i,n+="",i+="",i==="auto"&&(p=t.style[e],t.style[e]=i,i=Di(t,e)||i,p?t.style[e]=p:is(t,e)),h=[n,i],Uu(h),n=h[0],i=h[1],d=n.match($r)||[],D=i.match($r)||[],D.length){for(;f=$r.exec(i);)m=f[0],b=i.substring(l,f.index),_?_=(_+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(_=1),m!==(p=d[c++]||"")&&(u=parseFloat(p)||0,S=p.substr((u+"").length),m.charAt(1)==="="&&(m=Kr(u,m)+S),g=parseFloat(m),y=m.substr((g+"").length),l=$r.lastIndex-y.length,y||(y=y||Pn.units[e]||S,l===i.length&&(i+=y,a.e+=y)),S!==y&&(u=gr(t,e,p,y)||0),a._pt={_next:a._pt,p:b||c===1?b:",",s:u,c:g-u,m:_&&_<4||e==="zIndex"?Math.round:0});a.c=l<i.length?i.substring(l,i.length):""}else a.r=e==="display"&&i==="none"?wp:bp;return Ru.test(i)&&(a.e=0),this._pt=a,a},yp={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},_v=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]=yp[n]||n,e[1]=yp[i]||i,e.join(" ")},xv=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],Vi[a]&&(l=1,a=a==="transformOrigin"?In:Re),is(n,a);l&&(is(n,Re),o&&(o.svg&&n.removeAttribute("transform"),sa(n,1),o.uncache=1,Ep(i)))}},ml={clearProps:function(t,e,n,i,s){if(s.data!=="isFromStart"){var o=t._pt=new xn(t._pt,e,n,0,0,xv);return o.u=i,o.pr=-10,o.tween=s,t._props.push(n),1}}},ra=[1,0,0,1,0,0],Rp={},Pp=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Sp=function(t){var e=Di(t,Re);return Pp(e)?ra:e.substr(7).match(Cu).map(Le)},th=function(t,e){var n=t._gsap||hr(t),i=t.style,s=Sp(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"?ra:s):(s===ra&&!t.offsetParent&&t!==Xs&&!n.svg&&(l=i.display,i.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(c=1,a=t.nextElementSibling,Xs.appendChild(t)),s=Sp(t),l?i.display=l:is(t,"display"),c&&(a?o.insertBefore(t,a):o?o.appendChild(t):Xs.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},$u=function(t,e,n,i,s,o){var a=t._gsap,l=s||th(t,!0),c=a.xOrigin||0,h=a.yOrigin||0,f=a.xOffset||0,d=a.yOffset||0,u=l[0],_=l[1],p=l[2],m=l[3],g=l[4],b=l[5],y=e.split(" "),S=parseFloat(y[0])||0,D=parseFloat(y[1])||0,T,w,P,M;n?l!==ra&&(w=u*m-_*p)&&(P=S*(m/w)+D*(-p/w)+(p*b-m*g)/w,M=S*(-_/w)+D*(u/w)-(u*b-_*g)/w,S=P,D=M):(T=Dp(t),S=T.x+(~y[0].indexOf("%")?S/100*T.width:S),D=T.y+(~(y[1]||y[0]).indexOf("%")?D/100*T.height:D)),i||i!==!1&&a.smooth?(g=S-c,b=D-h,a.xOffset=f+(g*u+b*p)-g,a.yOffset=d+(g*_+b*m)-b):a.xOffset=a.yOffset=0,a.xOrigin=S,a.yOrigin=D,a.smooth=!!i,a.origin=e,a.originIsAbsolute=!!n,t.style[In]="0px 0px",o&&(mr(o,a,"xOrigin",c,S),mr(o,a,"yOrigin",h,D),mr(o,a,"xOffset",f,a.xOffset),mr(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",S+" "+D)},sa=function(t,e){var n=t._gsap||new Ou(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=Di(t,In)||"0",h,f,d,u,_,p,m,g,b,y,S,D,T,w,P,M,v,I,N,C,V,$,W,Z,z,U,R,at,_t,Ut,X,ot;return h=f=d=p=m=g=b=y=S=0,u=_=1,n.svg=!!(t.getCTM&&Cp(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Re]=(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[Re]!=="none"?l[Re]:"")),i.scale=i.rotate=i.translate="none"),w=th(t,n.svg),n.svg&&(n.uncache?(z=t.getBBox(),c=n.xOrigin-z.x+"px "+(n.yOrigin-z.y)+"px",Z=""):Z=!e&&t.getAttribute("data-svg-origin"),$u(t,Z||c,!!Z||n.originIsAbsolute,n.smooth!==!1,w)),D=n.xOrigin||0,T=n.yOrigin||0,w!==ra&&(I=w[0],N=w[1],C=w[2],V=w[3],h=$=w[4],f=W=w[5],w.length===6?(u=Math.sqrt(I*I+N*N),_=Math.sqrt(V*V+C*C),p=I||N?Ws(N,I)*es:0,b=C||V?Ws(C,V)*es+p:0,b&&(_*=Math.abs(Math.cos(b*Ys))),n.svg&&(h-=D-(D*I+T*C),f-=T-(D*N+T*V))):(ot=w[6],Ut=w[7],R=w[8],at=w[9],_t=w[10],X=w[11],h=w[12],f=w[13],d=w[14],P=Ws(ot,_t),m=P*es,P&&(M=Math.cos(-P),v=Math.sin(-P),Z=$*M+R*v,z=W*M+at*v,U=ot*M+_t*v,R=$*-v+R*M,at=W*-v+at*M,_t=ot*-v+_t*M,X=Ut*-v+X*M,$=Z,W=z,ot=U),P=Ws(-C,_t),g=P*es,P&&(M=Math.cos(-P),v=Math.sin(-P),Z=I*M-R*v,z=N*M-at*v,U=C*M-_t*v,X=V*v+X*M,I=Z,N=z,C=U),P=Ws(N,I),p=P*es,P&&(M=Math.cos(P),v=Math.sin(P),Z=I*M+N*v,z=$*M+W*v,N=N*M-I*v,W=W*M-$*v,I=Z,$=z),m&&Math.abs(m)+Math.abs(p)>359.9&&(m=p=0,g=180-g),u=Le(Math.sqrt(I*I+N*N+C*C)),_=Le(Math.sqrt(W*W+ot*ot)),P=Ws($,W),b=Math.abs(P)>2e-4?P*es:0,S=X?1/(X<0?-X:X):0),n.svg&&(Z=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Pp(Di(t,Re)),Z&&t.setAttribute("transform",Z))),Math.abs(b)>90&&Math.abs(b)<270&&(s?(u*=-1,b+=p<=0?180:-180,p+=p<=0?180:-180):(_*=-1,b+=b<=0?180:-180)),e=e||n.uncache,n.x=h-((n.xPercent=h&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-h)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+o,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)+o,n.z=d+o,n.scaleX=Le(u),n.scaleY=Le(_),n.rotation=Le(p)+a,n.rotationX=Le(m)+a,n.rotationY=Le(g)+a,n.skewX=b+a,n.skewY=y+a,n.transformPerspective=S+o,(n.zOrigin=parseFloat(c.split(" ")[2])||!e&&n.zOrigin||0)&&(i[In]=gl(c)),n.xOffset=n.yOffset=0,n.force3D=Pn.force3D,n.renderTransform=n.svg?yv:Ap?Ip:vv,n.uncache=0,n},gl=function(t){return(t=t.split(" "))[0]+" "+t[1]},Yu=function(t,e,n){var i=en(e);return Le(parseFloat(e)+parseFloat(gr(t,"x",n+"px",i)))+i},vv=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Ip(t,e)},Qr="0deg",ia="0px",ts=") ",Ip=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,h=n.rotationY,f=n.rotationX,d=n.skewX,u=n.skewY,_=n.scaleX,p=n.scaleY,m=n.transformPerspective,g=n.force3D,b=n.target,y=n.zOrigin,S="",D=g==="auto"&&t&&t!==1||g===!0;if(y&&(f!==Qr||h!==Qr)){var T=parseFloat(h)*Ys,w=Math.sin(T),P=Math.cos(T),M;T=parseFloat(f)*Ys,M=Math.cos(T),o=Yu(b,o,w*M*-y),a=Yu(b,a,-Math.sin(T)*-y),l=Yu(b,l,P*M*-y+y)}m!==ia&&(S+="perspective("+m+ts),(i||s)&&(S+="translate("+i+"%, "+s+"%) "),(D||o!==ia||a!==ia||l!==ia)&&(S+=l!==ia||D?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+ts),c!==Qr&&(S+="rotate("+c+ts),h!==Qr&&(S+="rotateY("+h+ts),f!==Qr&&(S+="rotateX("+f+ts),(d!==Qr||u!==Qr)&&(S+="skew("+d+", "+u+ts),(_!==1||p!==1)&&(S+="scale("+_+", "+p+ts),b.style[Re]=S||"translate(0, 0)"},yv=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,h=n.skewY,f=n.scaleX,d=n.scaleY,u=n.target,_=n.xOrigin,p=n.yOrigin,m=n.xOffset,g=n.yOffset,b=n.forceCSS,y=parseFloat(o),S=parseFloat(a),D,T,w,P,M;l=parseFloat(l),c=parseFloat(c),h=parseFloat(h),h&&(h=parseFloat(h),c+=h,l+=h),l||c?(l*=Ys,c*=Ys,D=Math.cos(l)*f,T=Math.sin(l)*f,w=Math.sin(l-c)*-d,P=Math.cos(l-c)*d,c&&(h*=Ys,M=Math.tan(c-h),M=Math.sqrt(1+M*M),w*=M,P*=M,h&&(M=Math.tan(h),M=Math.sqrt(1+M*M),D*=M,T*=M)),D=Le(D),T=Le(T),w=Le(w),P=Le(P)):(D=f,P=d,T=w=0),(y&&!~(o+"").indexOf("px")||S&&!~(a+"").indexOf("px"))&&(y=gr(u,"x",o,"px"),S=gr(u,"y",a,"px")),(_||p||m||g)&&(y=Le(y+_-(_*D+p*w)+m),S=Le(S+p-(_*T+p*P)+g)),(i||s)&&(M=u.getBBox(),y=Le(y+i/100*M.width),S=Le(S+s/100*M.height)),M="matrix("+D+","+T+","+w+","+P+","+y+","+S+")",u.setAttribute("transform",M),b&&(u.style[Re]=M)},Sv=function(t,e,n,i,s){var o=360,a=Ge(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?es:1),c=l-i,h=i+c+"deg",f,d;return a&&(f=s.split("_")[1],f==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-o)),f==="cw"&&c<0?c=(c+o*gp)%o-~~(c/o)*o:f==="ccw"&&c>0&&(c=(c-o*gp)%o-~~(c/o)*o)),t._pt=d=new xn(t._pt,e,n,i,c,rv),d.e=h,d.u="deg",t._props.push(n),d},Mp=function(t,e){for(var n in e)t[n]=e[n];return t},Mv=function(t,e,n){var i=Mp({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=n.style,a,l,c,h,f,d,u,_;i.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),o[Re]=e,a=sa(n,1),is(n,Re),n.setAttribute("transform",c)):(c=getComputedStyle(n)[Re],o[Re]=e,a=sa(n,1),o[Re]=c);for(l in Vi)c=i[l],h=a[l],c!==h&&s.indexOf(l)<0&&(u=en(c),_=en(h),f=u!==_?gr(n,l,c,_):parseFloat(c),d=parseFloat(h),t._pt=new xn(t._pt,a,l,f,d-f,qu),t._pt.u=_||0,t._props.push(l));Mp(a,i)};_n("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});ml[t>1?"border"+r:r]=function(a,l,c,h,f){var d,u;if(arguments.length<4)return d=o.map(function(_){return zi(a,_,c)}),u=d.join(" "),u.split(d[0]).length===5?d[0]:u;d=(h+"").split(" "),u={},o.forEach(function(_,p){return u[_]=d[p]=d[p]||d[(p-1)/2|0]}),a.init(l,u,f)}});var eh={name:"css",register:Ju,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,h,f,d,u,_,p,m,g,b,y,S,D,T,w,P;Ku||Ju(),this.styles=this.styles||Tp(t),P=this.styles.props,this.tween=n;for(p in e)if(p!=="autoRound"&&(h=e[p],!(Dn[p]&&ku(p,e,n,i,t,s)))){if(u=typeof h,_=ml[p],u==="function"&&(h=h.call(n,i,t,s),u=typeof h),u==="string"&&~h.indexOf("random(")&&(h=Gs(h)),_)_(this,t,p,h,n)&&(w=1);else if(p.substr(0,2)==="--")c=(getComputedStyle(t).getPropertyValue(p)+"").trim(),h+="",Bi.lastIndex=0,Bi.test(c)||(m=en(c),g=en(h)),g?m!==g&&(c=gr(t,p,c,g)+g):m&&(h+=m),this.add(a,"setProperty",c,h,i,s,0,0,p),o.push(p),P.push(p,0,a[p]);else if(u!=="undefined"){if(l&&p in l?(c=typeof l[p]=="function"?l[p].call(n,i,t,s):l[p],Ge(c)&&~c.indexOf("random(")&&(c=Gs(c)),en(c+"")||c==="auto"||(c+=Pn.units[p]||en(zi(t,p))||""),(c+"").charAt(1)==="="&&(c=zi(t,p))):c=zi(t,p),d=parseFloat(c),b=u==="string"&&h.charAt(1)==="="&&h.substr(0,2),b&&(h=h.substr(2)),f=parseFloat(h),p in Ai&&(p==="autoAlpha"&&(d===1&&zi(t,"visibility")==="hidden"&&f&&(d=0),P.push("visibility",0,a.visibility),mr(this,a,"visibility",d?"inherit":"hidden",f?"inherit":"hidden",!f)),p!=="scale"&&p!=="transform"&&(p=Ai[p],~p.indexOf(",")&&(p=p.split(",")[0]))),y=p in Vi,y){if(this.styles.save(p),S||(D=t._gsap,D.renderTransform&&!e.parseTransform||sa(t,e.parseTransform),T=e.smoothOrigin!==!1&&D.smooth,S=this._pt=new xn(this._pt,a,Re,0,1,D.renderTransform,D,0,-1),S.dep=1),p==="scale")this._pt=new xn(this._pt,D,"scaleY",D.scaleY,(b?Kr(D.scaleY,b+f):f)-D.scaleY||0,qu),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){P.push(In,0,a[In]),h=_v(h),D.svg?$u(t,h,0,T,0,this):(g=parseFloat(h.split(" ")[2])||0,g!==D.zOrigin&&mr(this,D,"zOrigin",D.zOrigin,g),mr(this,a,p,gl(c),gl(h)));continue}else if(p==="svgOrigin"){$u(t,h,1,T,0,this);continue}else if(p in Rp){Sv(this,D,p,d,b?Kr(d,b+h):h);continue}else if(p==="smoothOrigin"){mr(this,D,"smooth",D.smooth,h);continue}else if(p==="force3D"){D[p]=h;continue}else if(p==="transform"){Mv(this,h,t);continue}}else p in a||(p=qs(p)||p);if(y||(f||f===0)&&(d||d===0)&&!iv.test(h)&&p in a)m=(c+"").substr((d+"").length),f||(f=0),g=en(h)||(p in Pn.units?Pn.units[p]:m),m!==g&&(d=gr(t,p,c,g)),this._pt=new xn(this._pt,y?D:a,p,d,(b?Kr(d,b+f):f)-d,!y&&(g==="px"||p==="zIndex")&&e.autoRound!==!1?ov:qu),this._pt.u=g||0,m!==g&&g!=="%"&&(this._pt.b=c,this._pt.r=sv);else if(p in a)gv.call(this,t,p,c,b?b+h:h);else if(p in t)this.add(t,p,c||t[p],b?b+h:h,i,s);else if(p!=="parseTransform"){ul(p,h);continue}y||(p in a?P.push(p,0,a[p]):P.push(p,1,c||t[p])),o.push(p)}}w&&Wu(this)},render:function(t,e){if(e.tween._time||!ju())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:zi,aliases:Ai,getSetter:function(t,e,n){var i=Ai[e];return i&&i.indexOf(",")<0&&(e=i),e in Vi&&e!==In&&(t._gsap.x||zi(t,"x"))?n&&mp===n?e==="scale"?uv:cv:(mp=n||{})&&(e==="scale"?hv:fv):t.style&&!cl(t.style[e])?av:~e.indexOf("-")?lv:pl(t,e)},core:{_removeProperty:is,_getMatrix:th}};cn.utils.checkPrefix=qs;cn.core.getStyleSaver=Tp;(function(r,t,e,n){var i=_n(r+","+t+","+e,function(s){Vi[s]=1});_n(t,function(s){Pn.units[s]="deg",Rp[s]=1}),Ai[i[13]]=r+","+t,_n(n,function(s){var o=s.split(":");Ai[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");_n("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Pn.units[r]="px"});cn.registerPlugin(eh);var ue=cn.registerPlugin(eh)||cn,_T=ue.core.Tween;function Lp(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 bv(r,t,e){return t&&Lp(r.prototype,t),e&&Lp(r,e),r}var ve,_l,nn,ss,Zs,ai,wv,rs,Fp,ie,Ci,xl,Np,Up,Op,Bp,kp=function(){return typeof window<"u"},zp=function(){return ve||kp()&&(ve=window.gsap)&&ve.registerPlugin&&ve};var Ev=function(t){return Math.round(t*1e5)/1e5||0},_r=function(t){return ie.maxScroll(t||nn)},Tv=function(t,e){var n=t.parentNode||Zs,i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),o=s.top-i.top,a=s.bottom-i.bottom,l=(Math.abs(o)>Math.abs(a)?o:a)/(1-e),c=-l*e,h,f;return l>0&&(h=s.height/(nn.innerHeight+s.height),f=h===.5?s.height*2:Math.min(s.height,Math.abs(-l*h/(2*h-1)))*2*(e||1),c+=e?-f*e:-f/2,l+=f),{change:l,offset:c}},Av=function(t){var e=ss.querySelector(".ScrollSmoother-wrapper");return e||(e=ss.createElement("div"),e.classList.add("ScrollSmoother-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t)),e},li=function(){function r(t){var e=this;_l||r.register(ve)||console.warn("Please gsap.registerPlugin(ScrollSmoother)"),t=this.vars=t||{},Ci&&Ci.kill(),Ci=this,Op(this);var n=t,i=n.smoothTouch,s=n.onUpdate,o=n.onStop,a=n.smooth,l=n.onFocusIn,c=n.normalizeScroll,h=n.wholePixels,f,d,u,_,p,m,g,b,y,S,D,T,w,P,M=this,v=t.effectsPrefix||"",I=ie.getScrollFunc(nn),N=ie.isTouch===1?i===!0?.8:parseFloat(i)||0:a===0||a===!1?0:parseFloat(a)||.8,C=N&&+t.speed||1,V=0,$=0,W=1,Z=Np(0),z=function(){return Z.update(-V)},U={y:0},R=function(){return f.style.overflow="visible"},at,_t=function(x){x.update();var F=x.getTween();F&&(F.pause(),F._time=F._dur,F._tTime=F._tDur),at=!1,x.animation.progress(x.progress,!0)},Ut=function(x,F){(x!==V&&!S||F)&&(h&&(x=Math.round(x)),N&&(f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+x+", 0, 1)",f._gsap.y=x+"px"),$=x-V,V=x,ie.isUpdating||r.isRefreshing||ie.update())},X=function(x){return arguments.length?(x<0&&(x=0),U.y=-x,at=!0,S?V=-x:Ut(-x),ie.isRefreshing?_.update():I(x/C),this):-V},ot=typeof ResizeObserver<"u"&&t.autoResize!==!1&&new ResizeObserver(function(){if(!ie.isRefreshing){var A=_r(d)*C;A<-V&&X(A),Bp.restart(!0)}}),xt,ct=function(x){d.scrollTop=0,!(x.target.contains&&x.target.contains(d)||l&&l(e,x)===!1)&&(ie.isInViewport(x.target)||x.target===xt||e.scrollTo(x.target,!1,"center center"),xt=x.target)},Rt=function(x,F){if(x<F.start)return x;var Y=isNaN(F.ratio)?1:F.ratio,tt=F.end-F.start,it=x-F.start,yt=F.offset||0,pt=F.pins||[],lt=pt.offset||0,Lt=F._startClamp&&F.start<=0||F.pins&&F.pins.offset?0:F._endClamp&&F.end===_r()?1:.5;return pt.forEach(function(ht){tt-=ht.distance,ht.nativeStart<=x&&(it-=ht.distance)}),lt&&(it*=(tt-lt/Y)/tt),x+(it-yt*Lt)/Y-it},kt=function A(x,F,Y){Y||(x.pins.length=x.pins.offset=0);var tt=x.pins,it=x.markers,yt,pt,lt,Lt,ht,vt,Yt,ut;for(Yt=0;Yt<F.length;Yt++)if(ut=F[Yt],x.trigger&&ut.trigger&&x!==ut&&(ut.trigger===x.trigger||ut.pinnedContainer===x.trigger||x.trigger.contains(ut.trigger))&&(ht=ut._startNative||ut._startClamp||ut.start,vt=ut._endNative||ut._endClamp||ut.end,lt=Rt(ht,x),Lt=ut.pin&&vt>0?lt+(vt-ht):Rt(vt,x),ut.setPositions(lt,Lt,!0,(ut._startClamp?Math.max(0,lt):lt)-ht),ut.markerStart&&it.push(ve.quickSetter([ut.markerStart,ut.markerEnd],"y","px")),ut.pin&&ut.end>0&&!Y)){if(yt=ut.end-ut.start,pt=x._startClamp&&ut.start<0,pt){if(x.start>0){x.setPositions(0,x.end+(x._startNative-x.start),!0),A(x,F);return}yt+=ut.start,tt.offset=-ut.start}tt.push({start:ut.start,nativeStart:ht,end:ut.end,distance:yt,trig:ut}),x.setPositions(x.start,x.end+(pt?-ut.start:yt),!0)}},q=function(x,F){p.forEach(function(Y){return kt(Y,x,F)})},Jt=function(){R(),requestAnimationFrame(R),p&&(ie.getAll().forEach(function(x){x._startNative=x.start,x._endNative=x.end}),p.forEach(function(x){var F=x._startClamp||x.start,Y=x.autoSpeed?Math.min(_r(),x.end):F+Math.abs((x.end-F)/x.ratio),tt=Y-x.end;if(F-=tt/2,Y-=tt/2,F>Y){var it=F;F=Y,Y=it}x._startClamp&&F<0?(Y=x.ratio<0?_r():x.end/x.ratio,tt=Y-x.end,F=0):(x.ratio<0||x._endClamp&&Y>=_r())&&(Y=_r(),F=x.ratio<0||x.ratio>1?0:Y-(Y-x.start)/x.ratio,tt=(Y-F)*x.ratio-(x.end-x.start)),x.offset=tt||1e-4,x.pins.length=x.pins.offset=0,x.setPositions(F,Y,!0)}),q(ie.sort())),Z.reset()},It=function(){return ie.addEventListener("refresh",Jt)},Ft=function(){return p&&p.forEach(function(x){return x.vars.onRefresh(x)})},bt=function(){return p&&p.forEach(function(x){return x.vars.onRefreshInit(x)}),Ft},Et=function(x,F,Y,tt){return function(){var it=typeof F=="function"?F(Y,tt):F;it||it===0||(it=tt.getAttribute("data-"+v+x)||(x==="speed"?1:0)),tt.setAttribute("data-"+v+x,it);var yt=(it+"").substr(0,6)==="clamp(";return{clamp:yt,value:yt?it.substr(6,it.length-7):it}}},Ht=function(x,F,Y,tt,it){it=(typeof it=="function"?it(tt,x):it)||0;var yt=Et("speed",F,tt,x),pt=Et("lag",Y,tt,x),lt=ve.getProperty(x,"y"),Lt=x._gsap,ht,vt,Yt,ut,Tt,Wt,qt=[],ce=function(){F=yt(),Y=parseFloat(pt().value),ht=parseFloat(F.value)||1,Yt=F.value==="auto",Tt=Yt||vt&&vt._startClamp&&vt.start<=0||qt.offset?0:vt&&vt._endClamp&&vt.end===_r()?1:.5,ut&&ut.kill(),ut=Y&&ve.to(x,{ease:xl,overwrite:!1,y:"+=0",duration:Y}),vt&&(vt.ratio=ht,vt.autoSpeed=Yt)},Zt=function(){Lt.y=lt+"px",Lt.renderTransform(1),ce()},k=[],Q=0,st=function(gt){if(Yt){Zt();var Bt=Tv(x,Fp(0,1,-gt.start/(gt.end-gt.start)));Q=Bt.change,Wt=Bt.offset}else Wt=qt.offset||0,Q=(gt.end-gt.start-Wt)*(1-ht);qt.forEach(function(ee){return Q-=ee.distance*(1-ht)}),gt.offset=Q||.001,gt.vars.onUpdate(gt),ut&&ut.progress(1)};return ce(),(ht!==1||Yt||ut)&&(vt=ie.create({trigger:Yt?x.parentNode:x,start:function(){return F.clamp?"clamp(top bottom+="+it+")":"top bottom+="+it},end:function(){return F.value<0?"max":F.clamp?"clamp(bottom top-="+it+")":"bottom top-="+it},scroller:d,scrub:!0,refreshPriority:-999,onRefreshInit:Zt,onRefresh:st,onKill:function(gt){var Bt=p.indexOf(gt);Bt>=0&&p.splice(Bt,1),Zt()},onUpdate:function(gt){var Bt=lt+Q*(gt.progress-Tt),ee=qt.length,Mt=0,L,rt,O;if(gt.offset){if(ee){for(rt=-V,O=gt.end;ee--;){if(L=qt[ee],L.trig.isActive||rt>=L.start&&rt<=L.end){ut&&(L.trig.progress+=L.trig.direction<0?.001:-.001,L.trig.update(0,0,1),ut.resetTo("y",parseFloat(Lt.y),-$,!0),W&&ut.progress(1));return}rt>L.end&&(Mt+=L.distance),O-=L.distance}Bt=lt+Mt+Q*((ve.utils.clamp(gt.start,gt.end,rt)-gt.start-Mt)/(O-gt.start)-Tt)}k.length&&!Yt&&k.forEach(function(j){return j(Bt-Mt)}),Bt=Ev(Bt+Wt),ut?(ut.resetTo("y",Bt,-$,!0),W&&ut.progress(1)):(Lt.y=Bt+"px",Lt.renderTransform(1))}}}),st(vt),ve.core.getCache(vt.trigger).stRevert=bt,vt.startY=lt,vt.pins=qt,vt.markers=k,vt.ratio=ht,vt.autoSpeed=Yt,x.style.willChange="transform"),vt};It(),ie.addEventListener("killAll",It),ve.delayedCall(.5,function(){return W=0}),this.scrollTop=X,this.scrollTo=function(A,x,F){var Y=ve.utils.clamp(0,_r(),isNaN(A)?e.offset(A,F,!!x&&!S):+A);x?S?ve.to(e,{duration:N,scrollTop:Y,overwrite:"auto",ease:xl}):I(Y):X(Y)},this.offset=function(A,x,F){A=rs(A)[0];var Y=A.style.cssText,tt=ie.create({trigger:A,start:x||"top top"}),it;return p&&(W?ie.refresh():q([tt],!0)),it=tt.start/(F?C:1),tt.kill(!1),A.style.cssText=Y,ve.core.getCache(A).uncache=1,it};function G(){return u=f.clientHeight,f.style.overflow="visible",ai.style.height=nn.innerHeight+(u-nn.innerHeight)/C+"px",u-nn.innerHeight}this.content=function(A){if(arguments.length){var x=rs(A||"#smooth-content")[0]||console.warn("ScrollSmoother needs a valid content element.")||ai.children[0];return x!==f&&(f=x,y=f.getAttribute("style")||"",ot&&ot.observe(f),ve.set(f,{overflow:"visible",width:"100%",boxSizing:"border-box",y:"+=0"}),N||ve.set(f,{clearProps:"transform"})),this}return f},this.wrapper=function(A){return arguments.length?(d=rs(A||"#smooth-wrapper")[0]||Av(f),b=d.getAttribute("style")||"",G(),ve.set(d,N?{overflow:"hidden",position:"fixed",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0}:{overflow:"visible",position:"relative",width:"100%",height:"auto",top:"auto",bottom:"auto",left:"auto",right:"auto"}),this):d},this.effects=function(A,x){var F;if(p||(p=[]),!A)return p.slice(0);A=rs(A),A.forEach(function(ht){for(var vt=p.length;vt--;)p[vt].trigger===ht&&p[vt].kill()}),x=x||{};var Y=x,tt=Y.speed,it=Y.lag,yt=Y.effectsPadding,pt=[],lt,Lt;for(lt=0;lt<A.length;lt++)Lt=Ht(A[lt],tt,it,lt,yt),Lt&&pt.push(Lt);return(F=p).push.apply(F,pt),x.refresh!==!1&&ie.refresh(),pt},this.sections=function(A,x){var F;if(m||(m=[]),!A)return m.slice(0);var Y=rs(A).map(function(tt){return ie.create({trigger:tt,start:"top 120%",end:"bottom -20%",onToggle:function(yt){tt.style.opacity=yt.isActive?"1":"0",tt.style.pointerEvents=yt.isActive?"all":"none"}})});return x&&x.add?(F=m).push.apply(F,Y):m=Y.slice(0),Y},this.content(t.content),this.wrapper(t.wrapper),this.render=function(A){return Ut(A||A===0?A:V)},this.getVelocity=function(){return Z.getVelocity(-V)},ie.scrollerProxy(d,{scrollTop:X,scrollHeight:function(){return G()&&ai.scrollHeight},fixedMarkers:t.fixedMarkers!==!1&&!!N,content:f,getBoundingClientRect:function(){return{top:0,left:0,width:nn.innerWidth,height:nn.innerHeight}}}),ie.defaults({scroller:d});var $t=ie.getAll().filter(function(A){return A.scroller===nn||A.scroller===d});$t.forEach(function(A){return A.revert(!0,!0)}),_=ie.create({animation:ve.fromTo(U,{y:function(){return P=0,0}},{y:function(){return P=1,-G()},immediateRender:!1,ease:"none",data:"ScrollSmoother",duration:100,onUpdate:function(){if(P){var x=at;x&&(_t(_),U.y=V),Ut(U.y,x),z(),s&&!S&&s(M)}}}),onRefreshInit:function(x){if(!r.isRefreshing){if(r.isRefreshing=!0,p){var F=ie.getAll().filter(function(tt){return!!tt.pin});p.forEach(function(tt){tt.vars.pinnedContainer||F.forEach(function(it){if(it.pin.contains(tt.trigger)){var yt=tt.vars;yt.pinnedContainer=it.pin,tt.vars=null,tt.init(yt,tt.animation)}})})}var Y=x.getTween();w=Y&&Y._end>Y._dp._time,T=V,U.y=0,N&&(ie.isTouch===1&&(d.style.position="absolute"),d.scrollTop=0,ie.isTouch===1&&(d.style.position="fixed"))}},onRefresh:function(x){x.animation.invalidate(),x.setPositions(x.start,G()/C),w||_t(x),U.y=-I()*C,Ut(U.y),W||(w&&(at=!1),x.animation.progress(ve.utils.clamp(0,1,T/C/-x.end))),w&&(x.progress-=.001,x.update()),r.isRefreshing=!1},id:"ScrollSmoother",scroller:nn,invalidateOnRefresh:!0,start:0,refreshPriority:-9999,end:function(){return G()/C},onScrubComplete:function(){Z.reset(),o&&o(e)},scrub:N||!0}),this.smooth=function(A){return arguments.length&&(N=A||0,C=N&&+t.speed||1,_.scrubDuration(A)),_.getTween()?_.getTween().duration():0},_.getTween()&&(_.getTween().vars.ease=t.ease||xl),this.scrollTrigger=_,t.effects&&this.effects(t.effects===!0?"[data-"+v+"speed], [data-"+v+"lag]":t.effects,{effectsPadding:t.effectsPadding,refresh:!1}),t.sections&&this.sections(t.sections===!0?"[data-section]":t.sections),$t.forEach(function(A){A.vars.scroller=d,A.revert(!1,!0),A.init(A.vars,A.animation)}),this.paused=function(A,x){return arguments.length?(!!S!==A&&(A?(_.getTween()&&_.getTween().pause(),I(-V/C),Z.reset(),D=ie.normalizeScroll(),D&&D.disable(),S=ie.observe({preventDefault:!0,type:"wheel,touch,scroll",debounce:!1,allowClicks:!0,onChangeY:function(){return X(-V)}}),S.nested=Up(Zs,"wheel,touch,scroll",!0,x!==!1)):(S.nested.kill(),S.kill(),S=0,D&&D.enable(),_.progress=(-V/C-_.start)/(_.end-_.start),_t(_))),this):!!S},this.kill=this.revert=function(){e.paused(!1),_t(_),_.kill();for(var A=(p||[]).concat(m||[]),x=A.length;x--;)A[x].kill();ie.scrollerProxy(d),ie.removeEventListener("killAll",It),ie.removeEventListener("refresh",Jt),d.style.cssText=b,f.style.cssText=y;var F=ie.defaults({});F&&F.scroller===d&&ie.defaults({scroller:nn}),e.normalizer&&ie.normalizeScroll(!1),clearInterval(g),Ci=null,ot&&ot.disconnect(),ai.style.removeProperty("height"),nn.removeEventListener("focusin",ct)},this.refresh=function(A,x){return _.refresh(A,x)},c&&(this.normalizer=ie.normalizeScroll(c===!0?{debounce:!0,content:!N&&f}:c)),ie.config(t),"overscrollBehavior"in nn.getComputedStyle(ai)&&ve.set([ai,Zs],{overscrollBehavior:"none"}),"scrollBehavior"in nn.getComputedStyle(ai)&&ve.set([ai,Zs],{scrollBehavior:"auto"}),nn.addEventListener("focusin",ct),g=setInterval(z,250),ss.readyState==="loading"||requestAnimationFrame(function(){return ie.refresh()})}return r.register=function(e){return _l||(ve=e||zp(),kp()&&window.document&&(nn=window,ss=document,Zs=ss.documentElement,ai=ss.body),ve&&(rs=ve.utils.toArray,Fp=ve.utils.clamp,xl=ve.parseEase("expo"),Op=ve.core.context||function(){},ie=ve.core.globals().ScrollTrigger,ve.core.globals("ScrollSmoother",r),ai&&ie&&(Bp=ve.delayedCall(.2,function(){return ie.isRefreshing||Ci&&Ci.refresh()}).pause(),wv=[nn,ss,Zs,ai],Np=ie.core._getVelocityProp,Up=ie.core._inputObserver,r.refresh=ie.refresh,_l=1))),_l},bv(r,[{key:"progress",get:function(){return this.scrollTrigger?this.scrollTrigger.animation._time/100:0}}]),r}();li.version="3.12.5";li.create=function(r){return Ci&&r&&Ci.content()===rs(r.content)[0]?Ci:new li(r)};li.get=function(){return Ci};zp()&&ve.registerPlugin(li);function Vp(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 Dv(r,t,e){return t&&Vp(r.prototype,t),e&&Vp(r,e),r}var rn,Sl,Cv,Bn,xr,vr,$s,Gp,os,aa,Wp,Hi,ci,Xp,Yp=function(){return rn||typeof window<"u"&&(rn=window.gsap)&&rn.registerPlugin&&rn},qp=1,Js=[],ae=[],ui=[],la=Date.now,nh=function(t,e){return e},Rv=function(){var t=aa.core,e=t.bridge||{},n=t._scrollers,i=t._proxies;n.push.apply(n,ae),i.push.apply(i,ui),ae=n,ui=i,nh=function(o,a){return e[o](a)}},Wi=function(t,e){return~ui.indexOf(t)&&ui[ui.indexOf(t)+1][e]},ca=function(t){return!!~Wp.indexOf(t)},yn=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:i!==!1,capture:!!s})},vn=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},vl="scrollLeft",yl="scrollTop",ih=function(){return Hi&&Hi.isPressed||ae.cache++},Ml=function(t,e){var n=function i(s){if(s||s===0){qp&&(Bn.history.scrollRestoration="manual");var o=Hi&&Hi.isPressed;s=i.v=Math.round(s)||(Hi&&Hi.iOS?1:0),t(s),i.cacheID=ae.cache,o&&nh("ss",s)}else(e||ae.cache!==i.cacheID||nh("ref"))&&(i.cacheID=ae.cache,i.v=t());return i.v+i.offset};return n.offset=0,t&&n},un={s:vl,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:Ml(function(r){return arguments.length?Bn.scrollTo(r,ke.sc()):Bn.pageXOffset||xr[vl]||vr[vl]||$s[vl]||0})},ke={s:yl,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:un,sc:Ml(function(r){return arguments.length?Bn.scrollTo(un.sc(),r):Bn.pageYOffset||xr[yl]||vr[yl]||$s[yl]||0})},Sn=function(t,e){return(e&&e._ctx&&e._ctx.selector||rn.utils.toArray)(t)[0]||(typeof t=="string"&&rn.config().nullTargetWarn!==!1?console.warn("Element not found:",t):null)},Gi=function(t,e){var n=e.s,i=e.sc;ca(t)&&(t=xr.scrollingElement||vr);var s=ae.indexOf(t),o=i===ke.sc?1:2;!~s&&(s=ae.push(t)-1),ae[s+o]||yn(t,"scroll",ih);var a=ae[s+o],l=a||(ae[s+o]=Ml(Wi(t,n),!0)||(ca(t)?i:Ml(function(c){return arguments.length?t[n]=c:t[n]})));return l.target=t,a||(l.smooth=rn.getProperty(t,"scrollBehavior")==="smooth"),l},bl=function(t,e,n){var i=t,s=t,o=la(),a=o,l=e||50,c=Math.max(500,l*3),h=function(_,p){var m=la();p||m-o>l?(s=i,i=_,a=o,o=m):n?i+=_:i=s+(_-s)/(m-a)*(o-a)},f=function(){s=i=n?0:i,a=o=0},d=function(_){var p=a,m=s,g=la();return(_||_===0)&&_!==i&&h(_),o===a||g-a>c?0:(i+(n?m:-m))/((n?g:o)-p)*1e3};return{update:h,reset:f,getVelocity:d}},oa=function(t,e){return e&&!t._gsapAllow&&t.preventDefault(),t.changedTouches?t.changedTouches[0]:t},Hp=function(t){var e=Math.max.apply(Math,t),n=Math.min.apply(Math,t);return Math.abs(e)>=Math.abs(n)?e:n},Zp=function(){aa=rn.core.globals().ScrollTrigger,aa&&aa.core&&Rv()},Jp=function(t){return rn=t||Yp(),!Sl&&rn&&typeof document<"u"&&document.body&&(Bn=window,xr=document,vr=xr.documentElement,$s=xr.body,Wp=[Bn,xr,vr,$s],Cv=rn.utils.clamp,Xp=rn.core.context||function(){},os="onpointerenter"in $s?"pointer":"mouse",Gp=Fe.isTouch=Bn.matchMedia&&Bn.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in Bn||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,ci=Fe.eventTypes=("ontouchstart"in vr?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in vr?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return qp=0},500),Zp(),Sl=1),Sl};un.op=ke;ae.cache=0;var Fe=function(){function r(e){this.init(e)}var t=r.prototype;return t.init=function(n){Sl||Jp(rn)||console.warn("Please gsap.registerPlugin(Observer)"),aa||Zp();var i=n.tolerance,s=n.dragMinimum,o=n.type,a=n.target,l=n.lineHeight,c=n.debounce,h=n.preventDefault,f=n.onStop,d=n.onStopDelay,u=n.ignore,_=n.wheelSpeed,p=n.event,m=n.onDragStart,g=n.onDragEnd,b=n.onDrag,y=n.onPress,S=n.onRelease,D=n.onRight,T=n.onLeft,w=n.onUp,P=n.onDown,M=n.onChangeX,v=n.onChangeY,I=n.onChange,N=n.onToggleX,C=n.onToggleY,V=n.onHover,$=n.onHoverEnd,W=n.onMove,Z=n.ignoreCheck,z=n.isNormalizer,U=n.onGestureStart,R=n.onGestureEnd,at=n.onWheel,_t=n.onEnable,Ut=n.onDisable,X=n.onClick,ot=n.scrollSpeed,xt=n.capture,ct=n.allowClicks,Rt=n.lockAxis,kt=n.onLockAxis;this.target=a=Sn(a)||vr,this.vars=n,u&&(u=rn.utils.toArray(u)),i=i||1e-9,s=s||0,_=_||1,ot=ot||1,o=o||"wheel,touch,pointer",c=c!==!1,l||(l=parseFloat(Bn.getComputedStyle($s).lineHeight)||22);var q,Jt,It,Ft,bt,Et,Ht,G=this,$t=0,A=0,x=n.passive||!h,F=Gi(a,un),Y=Gi(a,ke),tt=F(),it=Y(),yt=~o.indexOf("touch")&&!~o.indexOf("pointer")&&ci[0]==="pointerdown",pt=ca(a),lt=a.ownerDocument||xr,Lt=[0,0,0],ht=[0,0,0],vt=0,Yt=function(){return vt=la()},ut=function(j,dt){return(G.event=j)&&u&&~u.indexOf(j.target)||dt&&yt&&j.pointerType!=="touch"||Z&&Z(j,dt)},Tt=function(){G._vx.reset(),G._vy.reset(),Jt.pause(),f&&f(G)},Wt=function(){var j=G.deltaX=Hp(Lt),dt=G.deltaY=Hp(ht),et=Math.abs(j)>=i,wt=Math.abs(dt)>=i;I&&(et||wt)&&I(G,j,dt,Lt,ht),et&&(D&&G.deltaX>0&&D(G),T&&G.deltaX<0&&T(G),M&&M(G),N&&G.deltaX<0!=$t<0&&N(G),$t=G.deltaX,Lt[0]=Lt[1]=Lt[2]=0),wt&&(P&&G.deltaY>0&&P(G),w&&G.deltaY<0&&w(G),v&&v(G),C&&G.deltaY<0!=A<0&&C(G),A=G.deltaY,ht[0]=ht[1]=ht[2]=0),(Ft||It)&&(W&&W(G),It&&(b(G),It=!1),Ft=!1),Et&&!(Et=!1)&&kt&&kt(G),bt&&(at(G),bt=!1),q=0},qt=function(j,dt,et){Lt[et]+=j,ht[et]+=dt,G._vx.update(j),G._vy.update(dt),c?q||(q=requestAnimationFrame(Wt)):Wt()},ce=function(j,dt){Rt&&!Ht&&(G.axis=Ht=Math.abs(j)>Math.abs(dt)?"x":"y",Et=!0),Ht!=="y"&&(Lt[2]+=j,G._vx.update(j,!0)),Ht!=="x"&&(ht[2]+=dt,G._vy.update(dt,!0)),c?q||(q=requestAnimationFrame(Wt)):Wt()},Zt=function(j){if(!ut(j,1)){j=oa(j,h);var dt=j.clientX,et=j.clientY,wt=dt-G.x,ft=et-G.y,Dt=G.isDragging;G.x=dt,G.y=et,(Dt||Math.abs(G.startX-dt)>=s||Math.abs(G.startY-et)>=s)&&(b&&(It=!0),Dt||(G.isDragging=!0),ce(wt,ft),Dt||m&&m(G))}},k=G.onPress=function(O){ut(O,1)||O&&O.button||(G.axis=Ht=null,Jt.pause(),G.isPressed=!0,O=oa(O),$t=A=0,G.startX=G.x=O.clientX,G.startY=G.y=O.clientY,G._vx.reset(),G._vy.reset(),yn(z?a:lt,ci[1],Zt,x,!0),G.deltaX=G.deltaY=0,y&&y(G))},Q=G.onRelease=function(O){if(!ut(O,1)){vn(z?a:lt,ci[1],Zt,!0);var j=!isNaN(G.y-G.startY),dt=G.isDragging,et=dt&&(Math.abs(G.x-G.startX)>3||Math.abs(G.y-G.startY)>3),wt=oa(O);!et&&j&&(G._vx.reset(),G._vy.reset(),h&&ct&&rn.delayedCall(.08,function(){if(la()-vt>300&&!O.defaultPrevented){if(O.target.click)O.target.click();else if(lt.createEvent){var ft=lt.createEvent("MouseEvents");ft.initMouseEvent("click",!0,!0,Bn,1,wt.screenX,wt.screenY,wt.clientX,wt.clientY,!1,!1,!1,!1,0,null),O.target.dispatchEvent(ft)}}})),G.isDragging=G.isGesturing=G.isPressed=!1,f&&dt&&!z&&Jt.restart(!0),g&&dt&&g(G),S&&S(G,et)}},st=function(j){return j.touches&&j.touches.length>1&&(G.isGesturing=!0)&&U(j,G.isDragging)},mt=function(){return(G.isGesturing=!1)||R(G)},gt=function(j){if(!ut(j)){var dt=F(),et=Y();qt((dt-tt)*ot,(et-it)*ot,1),tt=dt,it=et,f&&Jt.restart(!0)}},Bt=function(j){if(!ut(j)){j=oa(j,h),at&&(bt=!0);var dt=(j.deltaMode===1?l:j.deltaMode===2?Bn.innerHeight:1)*_;qt(j.deltaX*dt,j.deltaY*dt,0),f&&!z&&Jt.restart(!0)}},ee=function(j){if(!ut(j)){var dt=j.clientX,et=j.clientY,wt=dt-G.x,ft=et-G.y;G.x=dt,G.y=et,Ft=!0,f&&Jt.restart(!0),(wt||ft)&&ce(wt,ft)}},Mt=function(j){G.event=j,V(G)},L=function(j){G.event=j,$(G)},rt=function(j){return ut(j)||oa(j,h)&&X(G)};Jt=G._dc=rn.delayedCall(d||.25,Tt).pause(),G.deltaX=G.deltaY=0,G._vx=bl(0,50,!0),G._vy=bl(0,50,!0),G.scrollX=F,G.scrollY=Y,G.isDragging=G.isGesturing=G.isPressed=!1,Xp(this),G.enable=function(O){return G.isEnabled||(yn(pt?lt:a,"scroll",ih),o.indexOf("scroll")>=0&&yn(pt?lt:a,"scroll",gt,x,xt),o.indexOf("wheel")>=0&&yn(a,"wheel",Bt,x,xt),(o.indexOf("touch")>=0&&Gp||o.indexOf("pointer")>=0)&&(yn(a,ci[0],k,x,xt),yn(lt,ci[2],Q),yn(lt,ci[3],Q),ct&&yn(a,"click",Yt,!0,!0),X&&yn(a,"click",rt),U&&yn(lt,"gesturestart",st),R&&yn(lt,"gestureend",mt),V&&yn(a,os+"enter",Mt),$&&yn(a,os+"leave",L),W&&yn(a,os+"move",ee)),G.isEnabled=!0,O&&O.type&&k(O),_t&&_t(G)),G},G.disable=function(){G.isEnabled&&(Js.filter(function(O){return O!==G&&ca(O.target)}).length||vn(pt?lt:a,"scroll",ih),G.isPressed&&(G._vx.reset(),G._vy.reset(),vn(z?a:lt,ci[1],Zt,!0)),vn(pt?lt:a,"scroll",gt,xt),vn(a,"wheel",Bt,xt),vn(a,ci[0],k,xt),vn(lt,ci[2],Q),vn(lt,ci[3],Q),vn(a,"click",Yt,!0),vn(a,"click",rt),vn(lt,"gesturestart",st),vn(lt,"gestureend",mt),vn(a,os+"enter",Mt),vn(a,os+"leave",L),vn(a,os+"move",ee),G.isEnabled=G.isPressed=G.isDragging=!1,Ut&&Ut(G))},G.kill=G.revert=function(){G.disable();var O=Js.indexOf(G);O>=0&&Js.splice(O,1),Hi===G&&(Hi=0)},Js.push(G),z&&ca(a)&&(Hi=G),G.enable(p)},Dv(r,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),r}();Fe.version="3.12.5";Fe.create=function(r){return new Fe(r)};Fe.register=Jp;Fe.getAll=function(){return Js.slice()};Fe.getById=function(r){return Js.filter(function(t){return t.vars.id===r})[0]};Yp()&&rn.registerPlugin(Fe);var Ot,Qs,de,Pe,hi,Ee,dm,kl,Ma,ga,ha,wl,hn,Gl,hh,bn,$p,Kp,to,pm,rh,mm,Mn,fh,gm,_m,yr,dh,xh,eo,vh,zl,ph,sh,El=1,fn=Date.now,oh=fn(),Kn=0,fa=0,jp=function(t,e,n){var i=zn(t)&&(t.substr(0,6)==="clamp("||t.indexOf("max")>-1);return n["_"+e+"Clamp"]=i,i?t.substr(6,t.length-7):t},Qp=function(t,e){return e&&(!zn(t)||t.substr(0,6)!=="clamp(")?"clamp("+t+")":t},Pv=function r(){return fa&&requestAnimationFrame(r)},tm=function(){return Gl=1},em=function(){return Gl=0},Ri=function(t){return t},da=function(t){return Math.round(t*1e5)/1e5||0},xm=function(){return typeof window<"u"},vm=function(){return Ot||xm()&&(Ot=window.gsap)&&Ot.registerPlugin&&Ot},fs=function(t){return!!~dm.indexOf(t)},ym=function(t){return(t==="Height"?vh:de["inner"+t])||hi["client"+t]||Ee["client"+t]},Sm=function(t){return Wi(t,"getBoundingClientRect")||(fs(t)?function(){return Bl.width=de.innerWidth,Bl.height=vh,Bl}:function(){return Xi(t)})},Iv=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?ym(s):t["client"+s])||0}},Lv=function(t,e){return!e||~ui.indexOf(t)?Sm(t):function(){return Bl}},Pi=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()-Sm(t)()[s]:fs(t)?(hi[n]||Ee[n])-ym(i):t[n]-t["offset"+i])},Tl=function(t,e){for(var n=0;n<to.length;n+=3)(!e||~e.indexOf(to[n+1]))&&t(to[n],to[n+1],to[n+2])},zn=function(t){return typeof t=="string"},En=function(t){return typeof t=="function"},pa=function(t){return typeof t=="number"},as=function(t){return typeof t=="object"},ua=function(t,e,n){return t&&t.progress(e?0:1)&&n&&t.pause()},ah=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)}},Ks=Math.abs,Mm="left",bm="top",yh="right",Sh="bottom",cs="width",us="height",_a="Right",xa="Left",va="Top",ya="Bottom",ze="padding",Jn="margin",io="Width",Mh="Height",We="px",$n=function(t){return de.getComputedStyle(t)},Fv=function(t){var e=$n(t).position;t.style.position=e==="absolute"||e==="fixed"?e:"relative"},nm=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Xi=function(t,e){var n=e&&$n(t)[hh]!=="matrix(1, 0, 0, 1, 0, 0)"&&Ot.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},Vl=function(t,e){var n=e.d2;return t["offset"+n]||t["client"+n]||0},wm=function(t){var e=[],n=t.labels,i=t.duration(),s;for(s in n)e.push(n[s]/i);return e},Nv=function(t){return function(e){return Ot.utils.snap(wm(t),e)}},bh=function(t){var e=Ot.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)}},Uv=function(t){return function(e,n){return bh(wm(t))(e,n.direction)}},Al=function(t,e,n,i){return n.split(",").forEach(function(s){return t(e,s,i)})},Ke=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:!i,capture:!!s})},$e=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},Dl=function(t,e,n){n=n&&n.wheelHandler,n&&(t(e,"wheel",n),t(e,"touchmove",n))},im={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},Cl={toggleActions:"play",anticipatePin:0},Hl={top:0,left:0,center:.5,bottom:1,right:1},Fl=function(t,e){if(zn(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 Hl?Hl[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t},Rl=function(t,e,n,i,s,o,a,l){var c=s.startColor,h=s.endColor,f=s.fontSize,d=s.indent,u=s.fontWeight,_=Pe.createElement("div"),p=fs(n)||Wi(n,"pinType")==="fixed",m=t.indexOf("scroller")!==-1,g=p?Ee:n,b=t.indexOf("start")!==-1,y=b?c:h,S="border-color:"+y+";font-size:"+f+";color:"+y+";font-weight:"+u+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return S+="position:"+((m||l)&&p?"fixed;":"absolute;"),(m||l||!p)&&(S+=(i===ke?yh:Sh)+":"+(o+parseFloat(d))+"px;"),a&&(S+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),_._isStart=b,_.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),_.style.cssText=S,_.innerText=e||e===0?t+"-"+e:t,g.children[0]?g.insertBefore(_,g.children[0]):g.appendChild(_),_._offset=_["offset"+i.op.d2],Nl(_,0,i,b),_},Nl=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+io]=1,s["border"+a+io]=0,s[n.p]=e+"px",Ot.set(t,s)},le=[],mh={},ba,rm=function(){return fn()-Kn>34&&(ba||(ba=requestAnimationFrame(Yi)))},js=function(){(!Mn||!Mn.isPressed||Mn.startX>Ee.clientWidth)&&(ae.cache++,Mn?ba||(ba=requestAnimationFrame(Yi)):Yi(),Kn||ps("scrollStart"),Kn=fn())},lh=function(){_m=de.innerWidth,gm=de.innerHeight},ma=function(){ae.cache++,!hn&&!mm&&!Pe.fullscreenElement&&!Pe.webkitFullscreenElement&&(!fh||_m!==de.innerWidth||Math.abs(de.innerHeight-gm)>de.innerHeight*.25)&&kl.restart(!0)},ds={},Ov=[],Em=function r(){return $e(te,"scrollEnd",r)||ls(!0)},ps=function(t){return ds[t]&&ds[t].map(function(e){return e()})||Ov},kn=[],Tm=function(t){for(var e=0;e<kn.length;e+=5)(!t||kn[e+4]&&kn[e+4].query===t)&&(kn[e].style.cssText=kn[e+1],kn[e].getBBox&&kn[e].setAttribute("transform",kn[e+2]||""),kn[e+3].uncache=1)},wh=function(t,e){var n;for(bn=0;bn<le.length;bn++)n=le[bn],n&&(!e||n._ctx===e)&&(t?n.kill(1):n.revert(!0,!0));zl=!0,e&&Tm(e),e||ps("revert")},Am=function(t,e){ae.cache++,(e||!wn)&&ae.forEach(function(n){return En(n)&&n.cacheID++&&(n.rec=0)}),zn(t)&&(de.history.scrollRestoration=xh=t)},wn,hs=0,sm,Bv=function(){if(sm!==hs){var t=sm=hs;requestAnimationFrame(function(){return t===hs&&ls(!0)})}},Dm=function(){Ee.appendChild(eo),vh=!Mn&&eo.offsetHeight||de.innerHeight,Ee.removeChild(eo)},om=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"})},ls=function(t,e){if(Kn&&!t&&!zl){Ke(te,"scrollEnd",Em);return}Dm(),wn=te.isRefreshing=!0,ae.forEach(function(i){return En(i)&&++i.cacheID&&(i.rec=i())});var n=ps("refreshInit");pm&&te.sort(),e||wh(),ae.forEach(function(i){En(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),le.slice(0).forEach(function(i){return i.refresh()}),zl=!1,le.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()}}),ph=1,om(!0),le.forEach(function(i){var s=Pi(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)}),om(!1),ph=0,n.forEach(function(i){return i&&i.render&&i.render(-1)}),ae.forEach(function(i){En(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),Am(xh,1),kl.pause(),hs++,wn=2,Yi(2),le.forEach(function(i){return En(i.vars.onRefresh)&&i.vars.onRefresh(i)}),wn=te.isRefreshing=!1,ps("refresh")},gh=0,Ul=1,Sa,Yi=function(t){if(t===2||!wn&&!zl){te.isUpdating=!0,Sa&&Sa.update(0);var e=le.length,n=fn(),i=n-oh>=50,s=e&&le[0].scroll();if(Ul=gh>s?-1:1,wn||(gh=s),i&&(Kn&&!Gl&&n-Kn>200&&(Kn=0,ps("scrollEnd")),ha=oh,oh=n),Ul<0){for(bn=e;bn-- >0;)le[bn]&&le[bn].update(0,i);Ul=1}else for(bn=0;bn<e;bn++)le[bn]&&le[bn].update(0,i);te.isUpdating=!1}ba=0},_h=[Mm,bm,Sh,yh,Jn+ya,Jn+_a,Jn+va,Jn+xa,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Ol=_h.concat([cs,us,"boxSizing","max"+io,"max"+Mh,"position",Jn,ze,ze+va,ze+_a,ze+ya,ze+xa]),kv=function(t,e,n){no(n);var i=t._gsap;if(i.spacerIsNative)no(i.spacerState);else if(t._gsap.swappedIn){var s=e.parentNode;s&&(s.insertBefore(t,e),s.removeChild(e))}t._gsap.swappedIn=!1},ch=function(t,e,n,i){if(!t._gsap.swappedIn){for(var s=_h.length,o=e.style,a=t.style,l;s--;)l=_h[s],o[l]=n[l];o.position=n.position==="absolute"?"absolute":"relative",n.display==="inline"&&(o.display="inline-block"),a[Sh]=a[yh]="auto",o.flexBasis=n.flexBasis||"auto",o.overflow="visible",o.boxSizing="border-box",o[cs]=Vl(t,un)+We,o[us]=Vl(t,ke)+We,o[ze]=a[Jn]=a[bm]=a[Mm]="0",no(i),a[cs]=a["max"+io]=n[cs],a[us]=a["max"+Mh]=n[us],a[ze]=n[ze],t.parentNode!==e&&(t.parentNode.insertBefore(e,t),e.appendChild(t)),t._gsap.swappedIn=!0}},zv=/([A-Z])/g,no=function(t){if(t){var e=t.t.style,n=t.length,i=0,s,o;for((t.t._gsap||Ot.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(zv,"-$1").toLowerCase())}},Pl=function(t){for(var e=Ol.length,n=t.style,i=[],s=0;s<e;s++)i.push(Ol[s],n[Ol[s]]);return i.t=t,i},Vv=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},Bl={left:0,top:0},am=function(t,e,n,i,s,o,a,l,c,h,f,d,u,_){En(t)&&(t=t(l)),zn(t)&&t.substr(0,3)==="max"&&(t=d+(t.charAt(4)==="="?Fl("0"+t.substr(3),n):0));var p=u?u.time():0,m,g,b;if(u&&u.seek(0),isNaN(t)||(t=+t),pa(t))u&&(t=Ot.utils.mapRange(u.scrollTrigger.start,u.scrollTrigger.end,0,d,t)),a&&Nl(a,n,i,!0);else{En(e)&&(e=e(l));var y=(t||"0").split(" "),S,D,T,w;b=Sn(e,l)||Ee,S=Xi(b)||{},(!S||!S.left&&!S.top)&&$n(b).display==="none"&&(w=b.style.display,b.style.display="block",S=Xi(b),w?b.style.display=w:b.style.removeProperty("display")),D=Fl(y[0],S[i.d]),T=Fl(y[1]||"0",n),t=S[i.p]-c[i.p]-h+D+s-T,a&&Nl(a,T,i,n-T<20||a._isStart&&T>20),n-=n-T}if(_&&(l[_]=t||-.001,t<0&&(t=0)),o){var P=t+n,M=o._isStart;m="scroll"+i.d2,Nl(o,P,i,M&&P>20||!M&&(f?Math.max(Ee[m],hi[m]):o.parentNode[m])<=P+1),f&&(c=Xi(a),f&&(o.style[i.op.p]=c[i.op.p]-i.op.m-o._offset+We))}return u&&b&&(m=Xi(b),u.seek(d),g=Xi(b),u._caScrollDist=m[i.p]-g[i.p],t=t/u._caScrollDist*d),u&&u.seek(p),u?t:Math.round(t)},Hv=/(webkit|moz|length|cssText|inset)/i,lm=function(t,e,n,i){if(t.parentNode!==e){var s=t.style,o,a;if(e===Ee){t._stOrig=s.cssText,a=$n(t);for(o in a)!+o&&!Hv.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;Ot.core.getCache(t).uncache=1,e.appendChild(t)}},Cm=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}},Il=function(t,e,n){var i={};i[e.p]="+="+n,Ot.set(t,i)},cm=function(t,e){var n=Gi(t,e),i="_scroll"+e.p2,s=function o(a,l,c,h,f){var d=o.tween,u=l.onComplete,_={};c=c||n();var p=Cm(n,c,function(){d.kill(),o.tween=0});return f=h&&f||0,h=h||a-c,d&&d.kill(),l[i]=a,l.inherit=!1,l.modifiers=_,_[i]=function(){return p(c+h*d.ratio+f*d.ratio*d.ratio)},l.onUpdate=function(){ae.cache++,o.tween&&Yi()},l.onComplete=function(){o.tween=0,u&&u.call(d)},d=o.tween=Ot.to(t,l),d};return t[i]=n,n.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},Ke(t,"wheel",n.wheelHandler),te.isTouch&&Ke(t,"touchmove",n.wheelHandler),s},te=function(){function r(e,n){Qs||r.register(Ot)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),dh(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),!fa){this.update=this.refresh=this.kill=Ri;return}n=nm(zn(n)||pa(n)||n.nodeType?{trigger:n}:n,Cl);var s=n,o=s.onUpdate,a=s.toggleClass,l=s.id,c=s.onToggle,h=s.onRefresh,f=s.scrub,d=s.trigger,u=s.pin,_=s.pinSpacing,p=s.invalidateOnRefresh,m=s.anticipatePin,g=s.onScrubComplete,b=s.onSnapComplete,y=s.once,S=s.snap,D=s.pinReparent,T=s.pinSpacer,w=s.containerAnimation,P=s.fastScrollEnd,M=s.preventOverlaps,v=n.horizontal||n.containerAnimation&&n.horizontal!==!1?un:ke,I=!f&&f!==0,N=Sn(n.scroller||de),C=Ot.core.getCache(N),V=fs(N),$=("pinType"in n?n.pinType:Wi(N,"pinType")||V&&"fixed")==="fixed",W=[n.onEnter,n.onLeave,n.onEnterBack,n.onLeaveBack],Z=I&&n.toggleActions.split(" "),z="markers"in n?n.markers:Cl.markers,U=V?0:parseFloat($n(N)["border"+v.p2+io])||0,R=this,at=n.onRefreshInit&&function(){return n.onRefreshInit(R)},_t=Iv(N,V,v),Ut=Lv(N,V),X=0,ot=0,xt=0,ct=Gi(N,v),Rt,kt,q,Jt,It,Ft,bt,Et,Ht,G,$t,A,x,F,Y,tt,it,yt,pt,lt,Lt,ht,vt,Yt,ut,Tt,Wt,qt,ce,Zt,k,Q,st,mt,gt,Bt,ee,Mt,L;if(R._startClamp=R._endClamp=!1,R._dir=v,m*=45,R.scroller=N,R.scroll=w?w.time.bind(w):ct,Jt=ct(),R.vars=n,i=i||n.animation,"refreshPriority"in n&&(pm=1,n.refreshPriority===-9999&&(Sa=R)),C.tweenScroll=C.tweenScroll||{top:cm(N,ke),left:cm(N,un)},R.tweenTo=Rt=C.tweenScroll[v.p],R.scrubDuration=function(et){st=pa(et)&&et,st?Q?Q.duration(et):Q=Ot.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:st,paused:!0,onComplete:function(){return g&&g(R)}}):(Q&&Q.progress(1).kill(),Q=0)},i&&(i.vars.lazy=!1,i._initted&&!R.isReverted||i.vars.immediateRender!==!1&&n.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),R.animation=i.pause(),i.scrollTrigger=R,R.scrubDuration(f),Zt=0,l||(l=i.vars.id)),S&&((!as(S)||S.push)&&(S={snapTo:S}),"scrollBehavior"in Ee.style&&Ot.set(V?[Ee,hi]:N,{scrollBehavior:"auto"}),ae.forEach(function(et){return En(et)&&et.target===(V?Pe.scrollingElement||hi:N)&&(et.smooth=!1)}),q=En(S.snapTo)?S.snapTo:S.snapTo==="labels"?Nv(i):S.snapTo==="labelsDirectional"?Uv(i):S.directional!==!1?function(et,wt){return bh(S.snapTo)(et,fn()-ot<500?0:wt.direction)}:Ot.utils.snap(S.snapTo),mt=S.duration||{min:.1,max:2},mt=as(mt)?ga(mt.min,mt.max):ga(mt,mt),gt=Ot.delayedCall(S.delay||st/2||.1,function(){var et=ct(),wt=fn()-ot<500,ft=Rt.tween;if((wt||Math.abs(R.getVelocity())<10)&&!ft&&!Gl&&X!==et){var Dt=(et-Ft)/F,zt=i&&!I?i.totalProgress():Dt,Nt=wt?0:(zt-k)/(fn()-ha)*1e3||0,Qt=Ot.utils.clamp(-Dt,1-Dt,Ks(Nt/2)*Nt/.185),he=Dt+(S.inertia===!1?0:Qt),me,oe,E=S,B=E.onStart,H=E.onInterrupt,K=E.onComplete;if(me=q(he,R),pa(me)||(me=he),oe=Math.round(Ft+me*F),et<=bt&&et>=Ft&&oe!==et){if(ft&&!ft._initted&&ft.data<=Ks(oe-et))return;S.inertia===!1&&(Qt=me-Dt),Rt(oe,{duration:mt(Ks(Math.max(Ks(he-zt),Ks(me-zt))*.185/Nt/.05||0)),ease:S.ease||"power3",data:Ks(oe-et),onInterrupt:function(){return gt.restart(!0)&&H&&H(R)},onComplete:function(){R.update(),X=ct(),i&&(Q?Q.resetTo("totalProgress",me,i._tTime/i._tDur):i.progress(me)),Zt=k=i&&!I?i.totalProgress():R.progress,b&&b(R),K&&K(R)}},et,Qt*F,oe-et-Qt*F),B&&B(R,Rt.tween)}}else R.isActive&&X!==et&>.restart(!0)}).pause()),l&&(mh[l]=R),d=R.trigger=Sn(d||u!==!0&&u),L=d&&d._gsap&&d._gsap.stRevert,L&&(L=L(R)),u=u===!0?d:Sn(u),zn(a)&&(a={targets:d,className:a}),u&&(_===!1||_===Jn||(_=!_&&u.parentNode&&u.parentNode.style&&$n(u.parentNode).display==="flex"?!1:ze),R.pin=u,kt=Ot.core.getCache(u),kt.spacer?Y=kt.pinState:(T&&(T=Sn(T),T&&!T.nodeType&&(T=T.current||T.nativeElement),kt.spacerIsNative=!!T,T&&(kt.spacerState=Pl(T))),kt.spacer=yt=T||Pe.createElement("div"),yt.classList.add("pin-spacer"),l&&yt.classList.add("pin-spacer-"+l),kt.pinState=Y=Pl(u)),n.force3D!==!1&&Ot.set(u,{force3D:!0}),R.spacer=yt=kt.spacer,ce=$n(u),Yt=ce[_+v.os2],lt=Ot.getProperty(u),Lt=Ot.quickSetter(u,v.a,We),ch(u,yt,ce),it=Pl(u)),z){A=as(z)?nm(z,im):im,G=Rl("scroller-start",l,N,v,A,0),$t=Rl("scroller-end",l,N,v,A,0,G),pt=G["offset"+v.op.d2];var rt=Sn(Wi(N,"content")||N);Et=this.markerStart=Rl("start",l,rt,v,A,pt,0,w),Ht=this.markerEnd=Rl("end",l,rt,v,A,pt,0,w),w&&(Mt=Ot.quickSetter([Et,Ht],v.a,We)),!$&&!(ui.length&&Wi(N,"fixedMarkers")===!0)&&(Fv(V?Ee:N),Ot.set([G,$t],{force3D:!0}),Tt=Ot.quickSetter(G,v.a,We),qt=Ot.quickSetter($t,v.a,We))}if(w){var O=w.vars.onUpdate,j=w.vars.onUpdateParams;w.eventCallback("onUpdate",function(){R.update(0,0,1),O&&O.apply(w,j||[])})}if(R.previous=function(){return le[le.indexOf(R)-1]},R.next=function(){return le[le.indexOf(R)+1]},R.revert=function(et,wt){if(!wt)return R.kill(!0);var ft=et!==!1||!R.enabled,Dt=hn;ft!==R.isReverted&&(ft&&(Bt=Math.max(ct(),R.scroll.rec||0),xt=R.progress,ee=i&&i.progress()),Et&&[Et,Ht,G,$t].forEach(function(zt){return zt.style.display=ft?"none":"block"}),ft&&(hn=R,R.update(ft)),u&&(!D||!R.isActive)&&(ft?kv(u,yt,Y):ch(u,yt,$n(u),ut)),ft||R.update(ft),hn=Dt,R.isReverted=ft)},R.refresh=function(et,wt,ft,Dt){if(!((hn||!R.enabled)&&!wt)){if(u&&et&&Kn){Ke(r,"scrollEnd",Em);return}!wn&&at&&at(R),hn=R,Rt.tween&&!ft&&(Rt.tween.kill(),Rt.tween=0),Q&&Q.pause(),p&&i&&i.revert({kill:!1}).invalidate(),R.isReverted||R.revert(!0,!0),R._subPinOffset=!1;var zt=_t(),Nt=Ut(),Qt=w?w.duration():Pi(N,v),he=F<=.01,me=0,oe=Dt||0,E=as(ft)?ft.end:n.end,B=n.endTrigger||d,H=as(ft)?ft.start:n.start||(n.start===0||!d?0:u?"0 0":"0 100%"),K=R.pinnedContainer=n.pinnedContainer&&Sn(n.pinnedContainer,R),J=d&&Math.max(0,le.indexOf(R))||0,St=J,At,Pt,Xt,jt,Gt,Vt,xe,Be,sn,gn,ne,Kt,bi;for(z&&as(ft)&&(Kt=Ot.getProperty(G,v.p),bi=Ot.getProperty($t,v.p));St--;)Vt=le[St],Vt.end||Vt.refresh(0,1)||(hn=R),xe=Vt.pin,xe&&(xe===d||xe===u||xe===K)&&!Vt.isReverted&&(gn||(gn=[]),gn.unshift(Vt),Vt.revert(!0,!0)),Vt!==le[St]&&(J--,St--);for(En(H)&&(H=H(R)),H=jp(H,"start",R),Ft=am(H,d,zt,v,ct(),Et,G,R,Nt,U,$,Qt,w,R._startClamp&&"_startClamp")||(u?-.001:0),En(E)&&(E=E(R)),zn(E)&&!E.indexOf("+=")&&(~E.indexOf(" ")?E=(zn(H)?H.split(" ")[0]:"")+E:(me=Fl(E.substr(2),zt),E=zn(H)?H:(w?Ot.utils.mapRange(0,w.duration(),w.scrollTrigger.start,w.scrollTrigger.end,Ft):Ft)+me,B=d)),E=jp(E,"end",R),bt=Math.max(Ft,am(E||(B?"100% 0":Qt),B,zt,v,ct()+me,Ht,$t,R,Nt,U,$,Qt,w,R._endClamp&&"_endClamp"))||-.001,me=0,St=J;St--;)Vt=le[St],xe=Vt.pin,xe&&Vt.start-Vt._pinPush<=Ft&&!w&&Vt.end>0&&(At=Vt.end-(R._startClamp?Math.max(0,Vt.start):Vt.start),(xe===d&&Vt.start-Vt._pinPush<Ft||xe===K)&&isNaN(H)&&(me+=At*(1-Vt.progress)),xe===u&&(oe+=At));if(Ft+=me,bt+=me,R._startClamp&&(R._startClamp+=me),R._endClamp&&!wn&&(R._endClamp=bt||-.001,bt=Math.min(bt,Pi(N,v))),F=bt-Ft||(Ft-=.01)&&.001,he&&(xt=Ot.utils.clamp(0,1,Ot.utils.normalize(Ft,bt,Bt))),R._pinPush=oe,Et&&me&&(At={},At[v.a]="+="+me,K&&(At[v.p]="-="+ct()),Ot.set([Et,Ht],At)),u&&!(ph&&R.end>=Pi(N,v)))At=$n(u),jt=v===ke,Xt=ct(),ht=parseFloat(lt(v.a))+oe,!Qt&&bt>1&&(ne=(V?Pe.scrollingElement||hi:N).style,ne={style:ne,value:ne["overflow"+v.a.toUpperCase()]},V&&$n(Ee)["overflow"+v.a.toUpperCase()]!=="scroll"&&(ne.style["overflow"+v.a.toUpperCase()]="scroll")),ch(u,yt,At),it=Pl(u),Pt=Xi(u,!0),Be=$&&Gi(N,jt?un:ke)(),_?(ut=[_+v.os2,F+oe+We],ut.t=yt,St=_===ze?Vl(u,v)+F+oe:0,St&&(ut.push(v.d,St+We),yt.style.flexBasis!=="auto"&&(yt.style.flexBasis=St+We)),no(ut),K&&le.forEach(function(ye){ye.pin===K&&ye.vars.pinSpacing!==!1&&(ye._subPinOffset=!0)}),$&&ct(Bt)):(St=Vl(u,v),St&&yt.style.flexBasis!=="auto"&&(yt.style.flexBasis=St+We)),$&&(Gt={top:Pt.top+(jt?Xt-Ft:Be)+We,left:Pt.left+(jt?Be:Xt-Ft)+We,boxSizing:"border-box",position:"fixed"},Gt[cs]=Gt["max"+io]=Math.ceil(Pt.width)+We,Gt[us]=Gt["max"+Mh]=Math.ceil(Pt.height)+We,Gt[Jn]=Gt[Jn+va]=Gt[Jn+_a]=Gt[Jn+ya]=Gt[Jn+xa]="0",Gt[ze]=At[ze],Gt[ze+va]=At[ze+va],Gt[ze+_a]=At[ze+_a],Gt[ze+ya]=At[ze+ya],Gt[ze+xa]=At[ze+xa],tt=Vv(Y,Gt,D),wn&&ct(0)),i?(sn=i._initted,rh(1),i.render(i.duration(),!0,!0),vt=lt(v.a)-ht+F+oe,Wt=Math.abs(F-vt)>1,$&&Wt&&tt.splice(tt.length-2,2),i.render(0,!0,!0),sn||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),rh(0)):vt=F,ne&&(ne.value?ne.style["overflow"+v.a.toUpperCase()]=ne.value:ne.style.removeProperty("overflow-"+v.a));else if(d&&ct()&&!w)for(Pt=d.parentNode;Pt&&Pt!==Ee;)Pt._pinOffset&&(Ft-=Pt._pinOffset,bt-=Pt._pinOffset),Pt=Pt.parentNode;gn&&gn.forEach(function(ye){return ye.revert(!1,!0)}),R.start=Ft,R.end=bt,Jt=It=wn?Bt:ct(),!w&&!wn&&(Jt<Bt&&ct(Bt),R.scroll.rec=0),R.revert(!1,!0),ot=fn(),gt&&(X=-1,gt.restart(!0)),hn=0,i&&I&&(i._initted||ee)&&i.progress()!==ee&&i.progress(ee||0,!0).render(i.time(),!0,!0),(he||xt!==R.progress||w||p)&&(i&&!I&&i.totalProgress(w&&Ft<-.001&&!xt?Ot.utils.normalize(Ft,bt,0):xt,!0),R.progress=he||(Jt-Ft)/F===xt?0:xt),u&&_&&(yt._pinOffset=Math.round(R.progress*vt)),Q&&Q.invalidate(),isNaN(Kt)||(Kt-=Ot.getProperty(G,v.p),bi-=Ot.getProperty($t,v.p),Il(G,v,Kt),Il(Et,v,Kt-(Dt||0)),Il($t,v,bi),Il(Ht,v,bi-(Dt||0))),he&&!wn&&R.update(),h&&!wn&&!x&&(x=!0,h(R),x=!1)}},R.getVelocity=function(){return(ct()-It)/(fn()-ha)*1e3||0},R.endAnimation=function(){ua(R.callbackAnimation),i&&(Q?Q.progress(1):i.paused()?I||ua(i,R.direction<0,1):ua(i,i.reversed()))},R.labelToScroll=function(et){return i&&i.labels&&(Ft||R.refresh()||Ft)+i.labels[et]/i.duration()*F||0},R.getTrailing=function(et){var wt=le.indexOf(R),ft=R.direction>0?le.slice(0,wt).reverse():le.slice(wt+1);return(zn(et)?ft.filter(function(Dt){return Dt.vars.preventOverlaps===et}):ft).filter(function(Dt){return R.direction>0?Dt.end<=Ft:Dt.start>=bt})},R.update=function(et,wt,ft){if(!(w&&!ft&&!et)){var Dt=wn===!0?Bt:R.scroll(),zt=et?0:(Dt-Ft)/F,Nt=zt<0?0:zt>1?1:zt||0,Qt=R.progress,he,me,oe,E,B,H,K,J;if(wt&&(It=Jt,Jt=w?ct():Dt,S&&(k=Zt,Zt=i&&!I?i.totalProgress():Nt)),m&&u&&!hn&&!El&&Kn&&(!Nt&&Ft<Dt+(Dt-It)/(fn()-ha)*m?Nt=1e-4:Nt===1&&bt>Dt+(Dt-It)/(fn()-ha)*m&&(Nt=.9999)),Nt!==Qt&&R.enabled){if(he=R.isActive=!!Nt&&Nt<1,me=!!Qt&&Qt<1,H=he!==me,B=H||!!Nt!=!!Qt,R.direction=Nt>Qt?1:-1,R.progress=Nt,B&&!hn&&(oe=Nt&&!Qt?0:Nt===1?1:Qt===1?2:3,I&&(E=!H&&Z[oe+1]!=="none"&&Z[oe+1]||Z[oe],J=i&&(E==="complete"||E==="reset"||E in i))),M&&(H||J)&&(J||f||!i)&&(En(M)?M(R):R.getTrailing(M).forEach(function(Xt){return Xt.endAnimation()})),I||(Q&&!hn&&!El?(Q._dp._time-Q._start!==Q._time&&Q.render(Q._dp._time-Q._start),Q.resetTo?Q.resetTo("totalProgress",Nt,i._tTime/i._tDur):(Q.vars.totalProgress=Nt,Q.invalidate().restart())):i&&i.totalProgress(Nt,!!(hn&&(ot||et)))),u){if(et&&_&&(yt.style[_+v.os2]=Yt),!$)Lt(da(ht+vt*Nt));else if(B){if(K=!et&&Nt>Qt&&bt+1>Dt&&Dt+1>=Pi(N,v),D)if(!et&&(he||K)){var St=Xi(u,!0),At=Dt-Ft;lm(u,Ee,St.top+(v===ke?At:0)+We,St.left+(v===ke?0:At)+We)}else lm(u,yt);no(he||K?tt:it),Wt&&Nt<1&&he||Lt(ht+(Nt===1&&!K?vt:0))}}S&&!Rt.tween&&!hn&&!El&>.restart(!0),a&&(H||y&&Nt&&(Nt<1||!sh))&&Ma(a.targets).forEach(function(Xt){return Xt.classList[he||y?"add":"remove"](a.className)}),o&&!I&&!et&&o(R),B&&!hn?(I&&(J&&(E==="complete"?i.pause().totalProgress(1):E==="reset"?i.restart(!0).pause():E==="restart"?i.restart(!0):i[E]()),o&&o(R)),(H||!sh)&&(c&&H&&ah(R,c),W[oe]&&ah(R,W[oe]),y&&(Nt===1?R.kill(!1,1):W[oe]=0),H||(oe=Nt===1?1:3,W[oe]&&ah(R,W[oe]))),P&&!he&&Math.abs(R.getVelocity())>(pa(P)?P:2500)&&(ua(R.callbackAnimation),Q?Q.progress(1):ua(i,E==="reverse"?1:!Nt,1))):I&&o&&!hn&&o(R)}if(qt){var Pt=w?Dt/w.duration()*(w._caScrollDist||0):Dt;Tt(Pt+(G._isFlipped?1:0)),qt(Pt)}Mt&&Mt(-Dt/w.duration()*(w._caScrollDist||0))}},R.enable=function(et,wt){R.enabled||(R.enabled=!0,Ke(N,"resize",ma),V||Ke(N,"scroll",js),at&&Ke(r,"refreshInit",at),et!==!1&&(R.progress=xt=0,Jt=It=X=ct()),wt!==!1&&R.refresh())},R.getTween=function(et){return et&&Rt?Rt.tween:Q},R.setPositions=function(et,wt,ft,Dt){if(w){var zt=w.scrollTrigger,Nt=w.duration(),Qt=zt.end-zt.start;et=zt.start+Qt*et/Nt,wt=zt.start+Qt*wt/Nt}R.refresh(!1,!1,{start:Qp(et,ft&&!!R._startClamp),end:Qp(wt,ft&&!!R._endClamp)},Dt),R.update()},R.adjustPinSpacing=function(et){if(ut&&et){var wt=ut.indexOf(v.d)+1;ut[wt]=parseFloat(ut[wt])+et+We,ut[1]=parseFloat(ut[1])+et+We,no(ut)}},R.disable=function(et,wt){if(R.enabled&&(et!==!1&&R.revert(!0,!0),R.enabled=R.isActive=!1,wt||Q&&Q.pause(),Bt=0,kt&&(kt.uncache=1),at&&$e(r,"refreshInit",at),gt&&(gt.pause(),Rt.tween&&Rt.tween.kill()&&(Rt.tween=0)),!V)){for(var ft=le.length;ft--;)if(le[ft].scroller===N&&le[ft]!==R)return;$e(N,"resize",ma),V||$e(N,"scroll",js)}},R.kill=function(et,wt){R.disable(et,wt),Q&&!wt&&Q.kill(),l&&delete mh[l];var ft=le.indexOf(R);ft>=0&&le.splice(ft,1),ft===bn&&Ul>0&&bn--,ft=0,le.forEach(function(Dt){return Dt.scroller===R.scroller&&(ft=1)}),ft||wn||(R.scroll.rec=0),i&&(i.scrollTrigger=null,et&&i.revert({kill:!1}),wt||i.kill()),Et&&[Et,Ht,G,$t].forEach(function(Dt){return Dt.parentNode&&Dt.parentNode.removeChild(Dt)}),Sa===R&&(Sa=0),u&&(kt&&(kt.uncache=1),ft=0,le.forEach(function(Dt){return Dt.pin===u&&ft++}),ft||(kt.spacer=0)),n.onKill&&n.onKill(R)},le.push(R),R.enable(!1,!1),L&&L(R),i&&i.add&&!F){var dt=R.update;R.update=function(){R.update=dt,Ft||bt||R.refresh()},Ot.delayedCall(.01,R.update),F=.01,Ft=bt=0}else R.refresh();u&&Bv()},r.register=function(n){return Qs||(Ot=n||vm(),xm()&&window.document&&r.enable(),Qs=fa),Qs},r.defaults=function(n){if(n)for(var i in n)Cl[i]=n[i];return Cl},r.disable=function(n,i){fa=0,le.forEach(function(o){return o[i?"kill":"disable"](n)}),$e(de,"wheel",js),$e(Pe,"scroll",js),clearInterval(wl),$e(Pe,"touchcancel",Ri),$e(Ee,"touchstart",Ri),Al($e,Pe,"pointerdown,touchstart,mousedown",tm),Al($e,Pe,"pointerup,touchend,mouseup",em),kl.kill(),Tl($e);for(var s=0;s<ae.length;s+=3)Dl($e,ae[s],ae[s+1]),Dl($e,ae[s],ae[s+2])},r.enable=function(){if(de=window,Pe=document,hi=Pe.documentElement,Ee=Pe.body,Ot&&(Ma=Ot.utils.toArray,ga=Ot.utils.clamp,dh=Ot.core.context||Ri,rh=Ot.core.suppressOverwrites||Ri,xh=de.history.scrollRestoration||"auto",gh=de.pageYOffset,Ot.core.globals("ScrollTrigger",r),Ee)){fa=1,eo=document.createElement("div"),eo.style.height="100vh",eo.style.position="absolute",Dm(),Pv(),Fe.register(Ot),r.isTouch=Fe.isTouch,yr=Fe.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),fh=Fe.isTouch===1,Ke(de,"wheel",js),dm=[de,Pe,hi,Ee],Ot.matchMedia?(r.matchMedia=function(l){var c=Ot.matchMedia(),h;for(h in l)c.add(h,l[h]);return c},Ot.addEventListener("matchMediaInit",function(){return wh()}),Ot.addEventListener("matchMediaRevert",function(){return Tm()}),Ot.addEventListener("matchMedia",function(){ls(0,1),ps("matchMedia")}),Ot.matchMedia("(orientation: portrait)",function(){return lh(),lh})):console.warn("Requires GSAP 3.11.0 or later"),lh(),Ke(Pe,"scroll",js);var n=Ee.style,i=n.borderTopStyle,s=Ot.core.Animation.prototype,o,a;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle="solid",o=Xi(Ee),ke.m=Math.round(o.top+ke.sc())||0,un.m=Math.round(o.left+un.sc())||0,i?n.borderTopStyle=i:n.removeProperty("border-top-style"),wl=setInterval(rm,250),Ot.delayedCall(.5,function(){return El=0}),Ke(Pe,"touchcancel",Ri),Ke(Ee,"touchstart",Ri),Al(Ke,Pe,"pointerdown,touchstart,mousedown",tm),Al(Ke,Pe,"pointerup,touchend,mouseup",em),hh=Ot.utils.checkPrefix("transform"),Ol.push(hh),Qs=fn(),kl=Ot.delayedCall(.2,ls).pause(),to=[Pe,"visibilitychange",function(){var l=de.innerWidth,c=de.innerHeight;Pe.hidden?($p=l,Kp=c):($p!==l||Kp!==c)&&ma()},Pe,"DOMContentLoaded",ls,de,"load",ls,de,"resize",ma],Tl(Ke),le.forEach(function(l){return l.enable(0,1)}),a=0;a<ae.length;a+=3)Dl($e,ae[a],ae[a+1]),Dl($e,ae[a],ae[a+2])}},r.config=function(n){"limitCallbacks"in n&&(sh=!!n.limitCallbacks);var i=n.syncInterval;i&&clearInterval(wl)||(wl=i)&&setInterval(rm,i),"ignoreMobileResize"in n&&(fh=r.isTouch===1&&n.ignoreMobileResize),"autoRefreshEvents"in n&&(Tl($e)||Tl(Ke,n.autoRefreshEvents||"none"),mm=(n.autoRefreshEvents+"").indexOf("resize")===-1)},r.scrollerProxy=function(n,i){var s=Sn(n),o=ae.indexOf(s),a=fs(s);~o&&ae.splice(o,a?6:2),i&&(a?ui.unshift(de,i,Ee,i,hi,i):ui.unshift(s,i))},r.clearMatchMedia=function(n){le.forEach(function(i){return i._ctx&&i._ctx.query===n&&i._ctx.kill(!0,!0)})},r.isInViewport=function(n,i,s){var o=(zn(n)?Sn(n):n).getBoundingClientRect(),a=o[s?cs:us]*i||0;return s?o.right-a>0&&o.left+a<de.innerWidth:o.bottom-a>0&&o.top+a<de.innerHeight},r.positionInViewport=function(n,i,s){zn(n)&&(n=Sn(n));var o=n.getBoundingClientRect(),a=o[s?cs:us],l=i==null?a/2:i in Hl?Hl[i]*a:~i.indexOf("%")?parseFloat(i)*a/100:parseFloat(i)||0;return s?(o.left+l)/de.innerWidth:(o.top+l)/de.innerHeight},r.killAll=function(n){if(le.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),n!==!0){var i=ds.killAll||[];ds={},i.forEach(function(s){return s()})}},r}();te.version="3.12.5";te.saveStyles=function(r){return r?Ma(r).forEach(function(t){if(t&&t.style){var e=kn.indexOf(t);e>=0&&kn.splice(e,5),kn.push(t,t.style.cssText,t.getBBox&&t.getAttribute("transform"),Ot.core.getCache(t),dh())}}):kn};te.revert=function(r,t){return wh(!r,t)};te.create=function(r,t){return new te(r,t)};te.refresh=function(r){return r?ma():(Qs||te.register())&&ls(!0)};te.update=function(r){return++ae.cache&&Yi(r===!0?2:0)};te.clearScrollMemory=Am;te.maxScroll=function(r,t){return Pi(r,t?un:ke)};te.getScrollFunc=function(r,t){return Gi(Sn(r),t?un:ke)};te.getById=function(r){return mh[r]};te.getAll=function(){return le.filter(function(r){return r.vars.id!=="ScrollSmoother"})};te.isScrolling=function(){return!!Kn};te.snapDirectional=bh;te.addEventListener=function(r,t){var e=ds[r]||(ds[r]=[]);~e.indexOf(t)||e.push(t)};te.removeEventListener=function(r,t){var e=ds[r],n=e&&e.indexOf(t);n>=0&&e.splice(n,1)};te.batch=function(r,t){var e=[],n={},i=t.interval||.016,s=t.batchMax||1e9,o=function(c,h){var f=[],d=[],u=Ot.delayedCall(i,function(){h(f,d),f=[],d=[]}).pause();return function(_){f.length||u.restart(!0),f.push(_.trigger),d.push(_),s<=f.length&&u.progress(1)}},a;for(a in t)n[a]=a.substr(0,2)==="on"&&En(t[a])&&a!=="onRefreshInit"?o(a,t[a]):t[a];return En(s)&&(s=s(),Ke(te,"refresh",function(){return s=t.batchMax()})),Ma(r).forEach(function(l){var c={};for(a in n)c[a]=n[a];c.trigger=l,e.push(te.create(c))}),e};var um=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},uh=function r(t,e){e===!0?t.style.removeProperty("touch-action"):t.style.touchAction=e===!0?"auto":e?"pan-"+e+(Fe.isTouch?" pinch-zoom":""):"none",t===hi&&r(Ee,e)},Ll={auto:1,scroll:1},Gv=function(t){var e=t.event,n=t.target,i=t.axis,s=(e.changedTouches?e.changedTouches[0]:e).target,o=s._gsap||Ot.core.getCache(s),a=fn(),l;if(!o._isScrollT||a-o._isScrollT>2e3){for(;s&&s!==Ee&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(Ll[(l=$n(s)).overflowY]||Ll[l.overflowX]));)s=s.parentNode;o._isScroll=s&&s!==n&&!fs(s)&&(Ll[(l=$n(s)).overflowY]||Ll[l.overflowX]),o._isScrollT=a}(o._isScroll||i==="x")&&(e.stopPropagation(),e._gsapAllow=!0)},Rm=function(t,e,n,i){return Fe.create({target:t,capture:!0,debounce:!1,lockAxis:!0,type:e,onWheel:i=i&&Gv,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&Ke(Pe,Fe.eventTypes[0],fm,!1,!0)},onDisable:function(){return $e(Pe,Fe.eventTypes[0],fm,!0)}})},Wv=/(input|label|select|textarea)/i,hm,fm=function(t){var e=Wv.test(t.target.tagName);(e||hm)&&(t._gsapAllow=!0,hm=e)},Xv=function(t){as(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=Sn(t.target)||hi,h=Ot.core.globals().ScrollSmoother,f=h&&h.get(),d=yr&&(t.content&&Sn(t.content)||f&&t.content!==!1&&!f.smooth()&&f.content()),u=Gi(c,ke),_=Gi(c,un),p=1,m=(Fe.isTouch&&de.visualViewport?de.visualViewport.scale*de.visualViewport.width:de.outerWidth)/de.innerWidth,g=0,b=En(i)?function(){return i(a)}:function(){return i||2.8},y,S,D=Rm(c,t.type,!0,s),T=function(){return S=!1},w=Ri,P=Ri,M=function(){l=Pi(c,ke),P=ga(yr?1:0,l),n&&(w=ga(0,Pi(c,un))),y=hs},v=function(){d._gsap.y=da(parseFloat(d._gsap.y)+u.offset)+"px",d.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(d._gsap.y)+", 0, 1)",u.offset=u.cacheID=0},I=function(){if(S){requestAnimationFrame(T);var z=da(a.deltaY/2),U=P(u.v-z);if(d&&U!==u.v+u.offset){u.offset=U-u.v;var R=da((parseFloat(d&&d._gsap.y)||0)-u.offset);d.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+R+", 0, 1)",d._gsap.y=R+"px",u.cacheID=ae.cache,Yi()}return!0}u.offset&&v(),S=!0},N,C,V,$,W=function(){M(),N.isActive()&&N.vars.scrollY>l&&(u()>l?N.progress(1)&&u(l):N.resetTo("scrollY",l))};return d&&Ot.set(d,{y:"+=0"}),t.ignoreCheck=function(Z){return yr&&Z.type==="touchmove"&&I(Z)||p>1.05&&Z.type!=="touchstart"||a.isGesturing||Z.touches&&Z.touches.length>1},t.onPress=function(){S=!1;var Z=p;p=da((de.visualViewport&&de.visualViewport.scale||1)/m),N.pause(),Z!==p&&uh(c,p>1.01?!0:n?!1:"x"),C=_(),V=u(),M(),y=hs},t.onRelease=t.onGestureStart=function(Z,z){if(u.offset&&v(),!z)$.restart(!0);else{ae.cache++;var U=b(),R,at;n&&(R=_(),at=R+U*.05*-Z.velocityX/.227,U*=um(_,R,at,Pi(c,un)),N.vars.scrollX=w(at)),R=u(),at=R+U*.05*-Z.velocityY/.227,U*=um(u,R,at,Pi(c,ke)),N.vars.scrollY=P(at),N.invalidate().duration(U).play(.01),(yr&&N.vars.scrollY>=l||R>=l-1)&&Ot.to({},{onUpdate:W,duration:U})}o&&o(Z)},t.onWheel=function(){N._ts&&N.pause(),fn()-g>1e3&&(y=0,g=fn())},t.onChange=function(Z,z,U,R,at){if(hs!==y&&M(),z&&n&&_(w(R[2]===z?C+(Z.startX-Z.x):_()+z-R[1])),U){u.offset&&v();var _t=at[2]===U,Ut=_t?V+Z.startY-Z.y:u()+U-at[1],X=P(Ut);_t&&Ut!==X&&(V+=X-Ut),u(X)}(U||z)&&Yi()},t.onEnable=function(){uh(c,n?!1:"x"),te.addEventListener("refresh",W),Ke(de,"resize",W),u.smooth&&(u.target.style.scrollBehavior="auto",u.smooth=_.smooth=!1),D.enable()},t.onDisable=function(){uh(c,!0),$e(de,"resize",W),te.removeEventListener("refresh",W),D.kill()},t.lockAxis=t.lockAxis!==!1,a=new Fe(t),a.iOS=yr,yr&&!u()&&u(1),yr&&Ot.ticker.add(Ri),$=a._dc,N=Ot.to(a,{ease:"power4",paused:!0,inherit:!1,scrollX:n?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:Cm(u,u(),function(){return N.pause()})},onUpdate:Yi,onComplete:$.vars.onComplete}),a};te.sort=function(r){return le.sort(r||function(t,e){return(t.vars.refreshPriority||0)*-1e6+t.start-(e.start+(e.vars.refreshPriority||0)*-1e6)})};te.observe=function(r){return new Fe(r)};te.normalizeScroll=function(r){if(typeof r>"u")return Mn;if(r===!0&&Mn)return Mn.enable();if(r===!1){Mn&&Mn.kill(),Mn=r;return}var t=r instanceof Fe?r:Xv(r);return Mn&&Mn.target===t.target&&Mn.kill(),fs(t.target)&&(Mn=t),t};te.core={_getVelocityProp:bl,_inputObserver:Rm,_scrollers:ae,_proxies:ui,bridge:{ss:function(){Kn||ps("scrollStart"),Kn=fn()},ref:function(){return hn}}};vm()&&Ot.registerPlugin(te);ue.registerPlugin(te,li);var Pm=()=>{ue.matchMedia().add("(min-width: 992px)",()=>{let t=document.querySelector(".casestudies-heading-section");t&&ue.to(t,{ease:"none",scrollTrigger:{trigger:t,start:"top top",endTrigger:".casestudies-wrapper",end:"bottom bottom",pin:!0,pinSpacing:!1,scrub:!0,anticipatePin:1}})})};var Im=()=>{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`,ue.fromTo(t,{x:0},{x:-n,duration:60,ease:"linear",repeat:-1,force3D:!0})})};var Lm=()=>{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=(h,f)=>{(f||!l.readyState||/loaded|complete/.test(l.readyState))&&(l.onload=l.onreadystatechange=null,l=void 0,f||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)};var Fm=()=>{let r=new Date().toLocaleTimeString("pl-PL",{timeZone:"Poland"}).split(":");return r[0]+" - "+r[1]},Nm=()=>{let r=document.querySelectorAll("[data-current-time]");r.length>0&&r.forEach(t=>{t.textContent=Fm(),setInterval(()=>{t.textContent=Fm()},5e3)})};var Yv=/(?:^\s+|\s+$)/g,Eh=/([\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 ro(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+=ro(r)}else if(t===3||t===4)return r.nodeValue;return e}function fi(r,t,e,n){if(r+="",e&&(r=r.trim?r.trim():r.replace(Yv,"")),t&&t!=="")return r.replace(/>/g,">").replace(/</g,"<").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(Eh)||[])[1]||"").length||2,l=r.substr(o,a),i.emoji=1,o+=a-1),i.push(l===">"?">":l==="<"?"<":n&&l===" "&&(r.charAt(o-1)===" "||r.charAt(o+1)===" ")?" ":l);return i}var so,Ah,Bm,wa,km,Wl,qv=/(?:\r|\n|\t\t)/g,Zv=/(?:\s\s+)/g,Jv="\xA0",zm=function(t){so=document,Ah=window,wa=wa||t||Ah.gsap||console.warn("Please gsap.registerPlugin(SplitText)"),wa&&(Wl=wa.utils.toArray,km=wa.core.context||function(){},Bm=1)},$v=1,Vm=function(t){return Ah.getComputedStyle(t)},Dh=function(t){return t.position==="absolute"||t.absolute===!0},Kv=function(t,e){for(var n=e.length,i;--n>-1;)if(i=e[n],t.substr(0,i.length)===i)return i.length},jv=" style='position:relative;display:inline-block;'",Um=function(t,e){t===void 0&&(t="");var n=~t.indexOf("++"),i=1;return n&&(t=t.split("++").join("")),function(){return"<"+e+jv+(t?" class='"+t+(n?i++:"")+"'>":">")}},Hm=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))},Th=function(t,e){for(var n=e.length;--n>-1;)t.push(e[n])},Om=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}},Qv=function r(t){var e=Wl(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))},Ii=function(t,e){return parseFloat(e[t])||0},ty=function(t,e,n,i,s,o,a){var l=Vm(t),c=Ii("paddingLeft",l),h=-999,f=Ii("borderBottomWidth",l)+Ii("borderTopWidth",l),d=Ii("borderLeftWidth",l)+Ii("borderRightWidth",l),u=Ii("paddingTop",l)+Ii("paddingBottom",l),_=Ii("paddingLeft",l)+Ii("paddingRight",l),p=Ii("fontSize",l)*(e.lineThreshold||.2),m=l.textAlign,g=[],b=[],y=[],S=e.wordDelimiter||" ",D=e.tag?e.tag:e.span?"span":"div",T=e.type||e.split||"chars,words,lines",w=s&&~T.indexOf("lines")?[]:null,P=~T.indexOf("words"),M=~T.indexOf("chars"),v=Dh(e),I=e.linesClass,N=~(I||"").indexOf("++"),C=[],V=l.display==="flex",$=t.style.display,W,Z,z,U,R,at,_t,Ut,X,ot,xt,ct;for(N&&(I=I.split("++").join("")),V&&(t.style.display="block"),Z=t.getElementsByTagName("*"),z=Z.length,R=[],W=0;W<z;W++)R[W]=Z[W];if(w||v)for(W=0;W<z;W++)U=R[W],at=U.parentNode===t,(at||v||M&&!P)&&(ct=U.offsetTop,w&&at&&Math.abs(ct-h)>p&&(U.nodeName!=="BR"||W===0)&&(_t=[],w.push(_t),h=ct),v&&(U._x=U.offsetLeft,U._y=ct,U._w=U.offsetWidth,U._h=U.offsetHeight),w&&((U._isSplit&&at||!M&&at||P&&at||!P&&U.parentNode.parentNode===t&&!U.parentNode._isSplit)&&(_t.push(U),U._x-=c,Om(U,t,S)&&(U._wordEnd=!0)),U.nodeName==="BR"&&(U.nextSibling&&U.nextSibling.nodeName==="BR"||W===0)&&w.push([])));for(W=0;W<z;W++){if(U=R[W],at=U.parentNode===t,U.nodeName==="BR"){w||v?(U.parentNode&&U.parentNode.removeChild(U),R.splice(W--,1),z--):P||t.appendChild(U);continue}if(v&&(X=U.style,!P&&!at&&(U._x+=U.parentNode._x,U._y+=U.parentNode._y),X.left=U._x+"px",X.top=U._y+"px",X.position="absolute",X.display="block",X.width=U._w+1+"px",X.height=U._h+"px"),!P&&M)if(U._isSplit)for(U._next=Z=U.nextSibling,U.parentNode.appendChild(U);Z&&Z.nodeType===3&&Z.textContent===" ";)U._next=Z.nextSibling,U.parentNode.appendChild(Z),Z=Z.nextSibling;else U.parentNode._isSplit?(U._parent=U.parentNode,!U.previousSibling&&U.firstChild&&(U.firstChild._isFirst=!0),U.nextSibling&&U.nextSibling.textContent===" "&&!U.nextSibling.nextSibling&&C.push(U.nextSibling),U._next=U.nextSibling&&U.nextSibling._isFirst?null:U.nextSibling,U.parentNode.removeChild(U),R.splice(W--,1),z--):at||(ct=!U.nextSibling&&Om(U.parentNode,t,S),U.parentNode._parent&&U.parentNode._parent.appendChild(U),ct&&U.parentNode.appendChild(so.createTextNode(" ")),D==="span"&&(U.style.display="inline"),g.push(U));else U.parentNode._isSplit&&!U._isSplit&&U.innerHTML!==""?b.push(U):M&&!U._isSplit&&(D==="span"&&(U.style.display="inline"),g.push(U))}for(W=C.length;--W>-1;)C[W].parentNode.removeChild(C[W]);if(w){for(v&&(ot=so.createElement(D),t.appendChild(ot),xt=ot.offsetWidth+"px",ct=ot.offsetParent===t?0:t.offsetLeft,t.removeChild(ot)),X=t.style.cssText,t.style.cssText="display:none;";t.firstChild;)t.removeChild(t.firstChild);for(Ut=S===" "&&(!v||!P&&!M),W=0;W<w.length;W++){for(_t=w[W],ot=so.createElement(D),ot.style.cssText="display:block;text-align:"+m+";position:"+(v?"absolute;":"relative;"),I&&(ot.className=I+(N?W+1:"")),y.push(ot),z=_t.length,Z=0;Z<z;Z++)_t[Z].nodeName!=="BR"&&(U=_t[Z],ot.appendChild(U),Ut&&U._wordEnd&&ot.appendChild(so.createTextNode(" ")),v&&(Z===0&&(ot.style.top=U._y+"px",ot.style.left=c+ct+"px"),U.style.top="0px",ct&&(U.style.left=U._x-ct+"px")));z===0?ot.innerHTML=" ":!P&&!M&&(Qv(ot),Hm(ot,"\xA0"," ")),v&&(ot.style.width=xt,ot.style.height=U._h+"px"),t.appendChild(ot)}t.style.cssText=X}v&&(a>t.clientHeight&&(t.style.height=a-u+"px",t.clientHeight<a&&(t.style.height=a+f+"px")),o>t.clientWidth&&(t.style.width=o-_+"px",t.clientWidth<o&&(t.style.width=o+d+"px"))),V&&($?t.style.display=$:t.style.removeProperty("display")),Th(n,g),P&&Th(i,b),Th(s,y)},ey=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=Dh(e),c=e.wordDelimiter||" ",h=function(v){return v===c||v===Jv&&c===" "},f=c!==" "?"":l?"­ ":" ",d="</"+s+">",u=1,_=e.specialChars?typeof e.specialChars=="function"?e.specialChars:Kv:null,p,m,g,b,y,S,D,T,w=so.createElement("div"),P=t.parentNode;for(P.insertBefore(w,t),w.textContent=t.nodeValue,P.removeChild(t),t=w,p=ro(t),D=p.indexOf("<")!==-1,e.reduceWhiteSpace!==!1&&(p=p.replace(Zv," ").replace(qv,"")),D&&(p=p.split("<").join("{{LT}}")),y=p.length,m=(p.charAt(0)===" "?f:"")+n(),g=0;g<y;g++)if(S=p.charAt(g),_&&(T=_(p.substr(g),e.specialChars)))S=p.substr(g,T||1),m+=a&&S!==" "?i()+S+"</"+s+">":S,g+=T-1;else if(h(S)&&!h(p.charAt(g-1))&&g){for(m+=u?d:"",u=0;h(p.charAt(g+1));)m+=f,g++;g===y-1?m+=f:p.charAt(g+1)!==")"&&(m+=f+n(),u=1)}else S==="{"&&p.substr(g,6)==="{{LT}}"?(m+=a?i()+"{{LT}}</"+s+">":"{{LT}}",g+=5):S.charCodeAt(0)>=55296&&S.charCodeAt(0)<=56319||p.charCodeAt(g+1)>=65024&&p.charCodeAt(g+1)<=65039?(b=((p.substr(g,12).split(Eh)||[])[1]||"").length||2,m+=a&&S!==" "?i()+p.substr(g,b)+"</"+s+">":p.substr(g,b),g+=b-1):m+=a&&S!==" "?i()+S+"</"+s+">":S;t.outerHTML=m+(u?d:""),D&&Hm(P,"{{LT}}","<")},ny=function r(t,e,n,i){var s=Wl(t.childNodes),o=s.length,a=Dh(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&&Vm(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}ey(t,e,n,i)},oo=function(){function r(e,n){Bm||zm(),this.elements=Wl(e),this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=n||{},km(this),$v&&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=Um(n.wordsClass,s),a=Um(n.charsClass,s),l,c,h;--i>-1;)h=this.elements[i],this._originals[i]={html:h.innerHTML,style:h.getAttribute("style")},l=h.clientHeight,c=h.clientWidth,ny(h,n,o,a),ty(h,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}();oo.version="3.12.5";oo.register=zm;var Gm=()=>{if(ue.registerPlugin(te,oo),document.querySelector(".hero_grid")){let r=document.querySelector(".hero_grid"),t=r.querySelector(".hero_holo"),e=r.querySelector("h1"),n=r.querySelector(".paragraph-big"),i=new oo(e,{type:"lines",tag:"span"}),s=new oo(e,{type:"lines",linesClass:"header_line"});i.lines=s.chars.concat(i.lines),ue.timeline({scrollTrigger:{trigger:r,start:"top bottom",toggleActions:"play none none reset"}}).fromTo(n,{autoAlpha:0},{autoAlpha:1,duration:.35,ease:"circ.out"},"+=1.75").fromTo(i.lines,{y:"100%"},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"-=0.25").fromTo(t,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25")}};var Wm=()=>{let r=document.querySelector(".is-section-loader");if(!r)return;let t=r.querySelector(".loader_line"),e=r.querySelector(".loader_value");!t||!e||ue.to(t,{width:"100%",duration:1.5,onUpdate:function(){let n=Math.round(this.progress()*100);e.innerHTML=`${n}%`},onComplete:function(){ue.to(r,{y:"-100dvh",duration:.75})}},"<")};var Xl=function(){function r(e){this.chars=fi(e),this.sets=[],this.length=50;for(var n=0;n<20;n++)this.sets[n]=Ym(80,this.chars)}var t=r.prototype;return t.grow=function(n){for(var i=0;i<20;i++)this.sets[i]+=Ym(n-this.length,this.chars);this.length=n},r}(),ms,Jm,$m=function(){return ms||typeof window<"u"&&(ms=window.gsap)&&ms.registerPlugin&&ms},iy=1,Xm=/\s+/g,Ym=function(t,e){for(var n=e.length,i="";--t>-1;)i+=e[~~(Math.random()*n)];return i},Ch="ABCDEFGHIJKLMNOPQRSTUVWXYZ",qm=Ch.toLowerCase(),ry={upperCase:new Xl(Ch),lowerCase:new Xl(qm),upperAndLowerCase:new Xl(Ch+qm)},Zm=function(){Jm=ms=$m()},Ea={version:"3.12.5",name:"scrambleText",register:function(t,e,n){ms=t,Zm()},init:function(t,e,n,i,s){if(Jm||Zm(),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,h,f,d;return l.delimiter=c=e.delimiter||"",l.original=fi(ro(t).replace(Xm," ").split(" ").join(""),c,a),(o==="{original}"||o===!0||o==null)&&(o=l.original.join(c)),l.text=fi((o||"").replace(Xm," "),c,a),l.hasClass=!!(e.newClass||e.oldClass),l.newClass=e.newClass,l.oldClass=e.oldClass,d=c==="",l.textHasEmoji=d&&!!l.text.emoji,l.charsHaveEmoji=!!e.chars&&!!fi(e.chars).emoji,l.length=d?l.original.length:l.original.join(c).length,l.lengthDif=(d?l.text.length:l.text.join(c).length)-l.length,l.fillChar=e.fillChar||e.chars&&~e.chars.indexOf(" ")?" ":"",l.charSet=f=ry[e.chars||"upperCase"]||new Xl(e.chars),l.speed=.05/(e.speed||1),l.prevScrambleTime=0,l.setIndex=Math.random()*20|0,h=l.length+Math.max(l.lengthDif,0),h>f.length&&f.grow(h),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"),iy}},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,h=e.setIndex,f=e.chars,d=e.charSet,u=e.length,_=e.textHasEmoji,p=e.charsHaveEmoji,m=e.lengthDif,g=e.tweenLength,b=e.oldClass,y=e.newClass,S=e.rightToLeft,D=e.fillChar,T=e.speed,w=e.original,P=e.hasClass,M=s.length,v=a._time,I=v-l,N,C,V,$,W,Z,z,U,R,at,_t;c&&(a._from&&(v=a._dur-v),t=v===0?0:v<c?1e-6:v===a._dur?1:a._ease((v-c)/(a._dur-c))),t<0?t=0:t>1&&(t=1),S&&(t=1-t),N=~~(t*M+.5),t?((I>T||I<-T)&&(e.setIndex=h=(h+(Math.random()*19|0))%20,e.chars=d.sets[h],e.prevScrambleTime+=I),$=f):$=w.join(o),_t=a._from?t:1-t,at=u+(g?a._from?_t*_t*_t:1-_t*_t*_t:1)*m,S?t===1&&(a._from||a.data==="isFromStart")?(V="",$=w.join(o)):(z=s.slice(N).join(o),p?V=fi($).slice(0,at-(_?fi(z):z).length+.5|0).join(""):V=$.substr(0,at-(_?fi(z):z).length+.5|0),$=z):(V=s.slice(0,N).join(o),C=(_?fi(V):V).length,p?$=fi($).slice(C,at+.5|0).join(""):$=$.substr(C,at-C+.5|0)),P?(U=S?b:y,R=S?y:b,W=U&&N!==0,Z=R&&N!==M,z=(W?"<span class='"+U+"'>":"")+V+(W?"</span>":"")+(Z?"<span class='"+R+"'>":"")+o+$+(Z?"</span>":"")):z=V+o+$,n[i]=D===" "&&~z.indexOf(" ")?z.split(" ").join(" "):z}};Ea.emojiSafeSplit=fi;Ea.getText=ro;$m()&&ms.registerPlugin(Ea);ue.registerPlugin(Ea);var Km=()=>{document.querySelectorAll("[data-scramble-link]").forEach(t=>{let e=t.querySelector("[data-scramble-text]");if(!e)return;let n=e.textContent;t.addEventListener("mouseenter",()=>{ue.matchMedia().add("(min-width: 768px)",()=>{ue.to(e,{duration:1,scrambleText:{text:n,chars:"10"}})})})})};ue.registerPlugin(li,te);var jm=()=>{ue.registerPlugin(li),li.create({smooth:1.5,effects:!0}),te.refresh()};ue.registerPlugin(te);var Qm=()=>{let r=document.querySelector(".special_decors-wrapper"),t=document.querySelector(".special_decors");ue.to(t,{scrollTrigger:{trigger:t,endTrigger:r,start:()=>"top top",end:()=>"bottom bottom",pin:!0,scrub:!0}})};var ng=()=>{let r=document.querySelector(".mastery_techonologies-wrapper");if(!r)return;let t=r.querySelectorAll("img");t&&(window.innerWidth>991?eg(r,t):tg(r,t),window.addEventListener("resize",function(){window.innerWidth>991?eg(r,t):tg(r,t)},!0))};function tg(r,t){r.innerHTML="",t.forEach(s=>{let o=document.createElement("figure");o.classList.add("mastery_techonologies_slide"),o.appendChild(s),r.appendChild(o)});let e=r.querySelectorAll(".mastery_techonologies_slide");ue.set(e,{autoAlpha:1}),e.forEach((s,o)=>{ue.set(s,{xPercent:100*o})});let n=ue.utils.wrap(-100,(e.length-1)*100),i=e.length*2.5;ue.to(e,{xPercent:`-=${e.length*100}`,duration:i,repeat:-1,ease:"none",modifiers:{xPercent:s=>n(parseFloat(s))}})}function eg(r,t){r.innerHTML="";let e=sy(t);e&&(oy(r,e),ay(r))}function sy(r){let t=Math.floor(r.length/2)<11?Math.floor(r.length/2):11,e=Array.from({length:t},()=>[]),n=Math.floor(r.length/t),i=r.length%t,s=0;for(let o=0;o<t;o++){let a=n+(o<i?1:0);for(let l=0;l<a;l++)s<r.length&&(e[o].push(r[s]),s+=1)}return e}function oy(r,t){r.innerHTML="",t.forEach(e=>{let n=document.createElement("div");n.classList.add("mastery_techonologies_vertical_slider"),e.forEach(i=>{let s=document.createElement("figure");s.classList.add("mastery_techonologies_vertical_slider_item"),s.appendChild(i),n.appendChild(s)}),r.appendChild(n)})}function ay(r){let t=r.querySelectorAll(".mastery_techonologies_vertical_slider"),e=parseInt(window.getComputedStyle(document.body).fontSize)*1.5;if(window.addEventListener("resize",function(){e=parseInt(window.getComputedStyle(document.body).fontSize)*1.5},!0),!t)return;function n(){t.forEach((i,s)=>{i.querySelectorAll(".mastery_techonologies_vertical_slider_item").forEach((a,l)=>{let c=l===0,h=window.getComputedStyle(a),f=new WebKitCSSMatrix(h.transform);ue.fromTo(a,{y:c?(l+1)*e:f.f},{y:c?l*e:f.f-e,duration:.5,ease:"circ.out",delay:.1*s,onComplete:function(){c&&i.appendChild(a)}}).play()})})}n(),setInterval(n,5e3)}var Zf="164";var ly=0,ig=1,cy=2;var C_=1,Jf=2,ji=3,Lr=0,Nn=1,tr=2,Rr=0,Pr=1,rg=2,sg=3,og=4,uy=5,bs=100,hy=101,fy=102,dy=103,py=104,my=200,gy=201,_y=202,xy=203,hf=204,ff=205,vy=206,yy=207,Sy=208,My=209,by=210,wy=211,Ey=212,Ty=213,Ay=214,Dy=0,Cy=1,Ry=2,_c=3,Py=4,Iy=5,Ly=6,Fy=7,R_=0,Ny=1,Uy=2,Ir=0,Oy=1,By=2,ky=3,zy=4,Vy=5,Hy=6,Gy=7;var P_=300,Ro=301,Po=302,df=303,pf=304,Wc=306,mf=1e3,Es=1001,gf=1002,ti=1003,Wy=1004;var Yl=1005;var gi=1006,Rh=1007;var Ts=1008;var Fr=1009,Xy=1010,Yy=1011,I_=1012,L_=1013,Io=1014,Dr=1015,Xc=1016,F_=1017,N_=1018,Oa=1020,qy=35902,Zy=1021,Jy=1022,Fi=1023,$y=1024,Ky=1025,Ao=1026,La=1027,jy=1028,U_=1029,Qy=1030,O_=1031,B_=1033,Ph=33776,Ih=33777,Lh=33778,Fh=33779,ag=35840,lg=35841,cg=35842,ug=35843,hg=36196,fg=37492,dg=37496,pg=37808,mg=37809,gg=37810,_g=37811,xg=37812,vg=37813,yg=37814,Sg=37815,Mg=37816,bg=37817,wg=37818,Eg=37819,Tg=37820,Ag=37821,Nh=36492,Dg=36494,Cg=36495,tS=36283,Rg=36284,Pg=36285,Ig=36286;var xc=2300,vc=2301,Uh=2302,Lg=2400,Fg=2401,Ng=2402;var eS=3200,nS=3201,iS=0,rS=1,Ar="",Qn="srgb",Or="srgb-linear",$f="display-p3",Yc="display-p3-linear",yc="linear",Te="srgb",Sc="rec709",Mc="p3";var ao=7680;var Ug=519,sS=512,oS=513,aS=514,k_=515,lS=516,cS=517,uS=518,hS=519,Og=35044;var Bg="300 es",er=2e3,bc=2001,Nr=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}}},dn=["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 Oh=Math.PI/180,_f=180/Math.PI;function Ba(){let r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(dn[r&255]+dn[r>>8&255]+dn[r>>16&255]+dn[r>>24&255]+"-"+dn[t&255]+dn[t>>8&255]+"-"+dn[t>>16&15|64]+dn[t>>24&255]+"-"+dn[e&63|128]+dn[e>>8&255]+"-"+dn[e>>16&255]+dn[e>>24&255]+dn[n&255]+dn[n>>8&255]+dn[n>>16&255]+dn[n>>24&255]).toLowerCase()}function Fn(r,t,e){return Math.max(t,Math.min(e,r))}function fS(r,t){return(r%t+t)%t}function Bh(r,t,e){return(1-e)*r+e*t}function Ta(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 Ln(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 _e=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(Fn(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}},se=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 h=this.elements;return h[0]=t,h[1]=i,h[2]=a,h[3]=e,h[4]=s,h[5]=l,h[6]=n,h[7]=o,h[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],h=n[4],f=n[7],d=n[2],u=n[5],_=n[8],p=i[0],m=i[3],g=i[6],b=i[1],y=i[4],S=i[7],D=i[2],T=i[5],w=i[8];return s[0]=o*p+a*b+l*D,s[3]=o*m+a*y+l*T,s[6]=o*g+a*S+l*w,s[1]=c*p+h*b+f*D,s[4]=c*m+h*y+f*T,s[7]=c*g+h*S+f*w,s[2]=d*p+u*b+_*D,s[5]=d*m+u*y+_*T,s[8]=d*g+u*S+_*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],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8];return e*o*h-e*a*c-n*s*h+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],h=t[8],f=h*o-a*c,d=a*l-h*s,u=c*s-o*l,_=e*f+n*d+i*u;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let p=1/_;return t[0]=f*p,t[1]=(i*c-h*n)*p,t[2]=(a*n-i*o)*p,t[3]=d*p,t[4]=(h*e-i*l)*p,t[5]=(i*s-a*e)*p,t[6]=u*p,t[7]=(n*l-c*e)*p,t[8]=(o*e-n*s)*p,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(kh.makeScale(t,e)),this}rotate(t){return this.premultiply(kh.makeRotation(-t)),this}translate(t,e){return this.premultiply(kh.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)}},kh=new se;function z_(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function wc(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function dS(){let r=wc("canvas");return r.style.display="block",r}var kg={};function pS(r){r in kg||(kg[r]=!0,console.warn(r))}var zg=new se().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Vg=new se().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),ql={[Or]:{transfer:yc,primaries:Sc,toReference:r=>r,fromReference:r=>r},[Qn]:{transfer:Te,primaries:Sc,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Yc]:{transfer:yc,primaries:Mc,toReference:r=>r.applyMatrix3(Vg),fromReference:r=>r.applyMatrix3(zg)},[$f]:{transfer:Te,primaries:Mc,toReference:r=>r.convertSRGBToLinear().applyMatrix3(Vg),fromReference:r=>r.applyMatrix3(zg).convertLinearToSRGB()}},mS=new Set([Or,Yc]),Se={enabled:!0,_workingColorSpace:Or,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!mS.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=ql[t].toReference,i=ql[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 ql[r].primaries},getTransfer:function(r){return r===Ar?yc:ql[r].transfer}};function Do(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function zh(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var lo,xf=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{lo===void 0&&(lo=wc("canvas")),lo.width=t.width,lo.height=t.height;let n=lo.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=lo}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=wc("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]=Do(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(Do(e[n]/255)*255):e[n]=Do(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}},gS=0,Ec=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:gS++}),this.uuid=Ba(),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(Vh(i[o].image)):s.push(Vh(i[o]))}else s=Vh(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function Vh(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?xf.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 _S=0,ii=class r extends Nr{constructor(t=r.DEFAULT_IMAGE,e=r.DEFAULT_MAPPING,n=Es,i=Es,s=gi,o=Ts,a=Fi,l=Fr,c=r.DEFAULT_ANISOTROPY,h=Ar){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:_S++}),this.uuid=Ba(),this.name="",this.source=new Ec(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 _e(0,0),this.repeat=new _e(1,1),this.center=new _e(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new se,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,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!==P_)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case mf:t.x=t.x-Math.floor(t.x);break;case Es:t.x=t.x<0?0:1;break;case gf: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 mf:t.y=t.y-Math.floor(t.y);break;case Es:t.y=t.y<0?0:1;break;case gf: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++}};ii.DEFAULT_IMAGE=null;ii.DEFAULT_MAPPING=P_;ii.DEFAULT_ANISOTROPY=1;var Qe=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],h=l[4],f=l[8],d=l[1],u=l[5],_=l[9],p=l[2],m=l[6],g=l[10];if(Math.abs(h-d)<.01&&Math.abs(f-p)<.01&&Math.abs(_-m)<.01){if(Math.abs(h+d)<.1&&Math.abs(f+p)<.1&&Math.abs(_+m)<.1&&Math.abs(c+u+g-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let y=(c+1)/2,S=(u+1)/2,D=(g+1)/2,T=(h+d)/4,w=(f+p)/4,P=(_+m)/4;return y>S&&y>D?y<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(y),i=T/n,s=w/n):S>D?S<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(S),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 b=Math.sqrt((m-_)*(m-_)+(f-p)*(f-p)+(d-h)*(d-h));return Math.abs(b)<.001&&(b=1),this.x=(m-_)/b,this.y=(f-p)/b,this.z=(d-h)/b,this.w=Math.acos((c+u+g-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}},vf=class extends Nr{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Qe(0,0,t,e),this.scissorTest=!1,this.viewport=new Qe(0,0,t,e);let i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:gi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let s=new ii(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 Ec(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"})}},nr=class extends vf{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},Tc=class extends ii{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=ti,this.minFilter=ti,this.wrapR=Es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var yf=class extends ii{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=ti,this.minFilter=ti,this.wrapR=Es,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,o,a){let l=n[i+0],c=n[i+1],h=n[i+2],f=n[i+3],d=s[o+0],u=s[o+1],_=s[o+2],p=s[o+3];if(a===0){t[e+0]=l,t[e+1]=c,t[e+2]=h,t[e+3]=f;return}if(a===1){t[e+0]=d,t[e+1]=u,t[e+2]=_,t[e+3]=p;return}if(f!==p||l!==d||c!==u||h!==_){let m=1-a,g=l*d+c*u+h*_+f*p,b=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){let D=Math.sqrt(y),T=Math.atan2(D,g*b);m=Math.sin(m*T)/D,a=Math.sin(a*T)/D}let S=a*b;if(l=l*m+d*S,c=c*m+u*S,h=h*m+_*S,f=f*m+p*S,m===1-a){let D=1/Math.sqrt(l*l+c*c+h*h+f*f);l*=D,c*=D,h*=D,f*=D}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=f}static multiplyQuaternionsFlat(t,e,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],h=n[i+3],f=s[o],d=s[o+1],u=s[o+2],_=s[o+3];return t[e]=a*_+h*f+l*u-c*d,t[e+1]=l*_+h*d+c*f-a*u,t[e+2]=c*_+h*u+a*d-l*f,t[e+3]=h*_-a*f-l*d-c*u,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),h=a(i/2),f=a(s/2),d=l(n/2),u=l(i/2),_=l(s/2);switch(o){case"XYZ":this._x=d*h*f+c*u*_,this._y=c*u*f-d*h*_,this._z=c*h*_+d*u*f,this._w=c*h*f-d*u*_;break;case"YXZ":this._x=d*h*f+c*u*_,this._y=c*u*f-d*h*_,this._z=c*h*_-d*u*f,this._w=c*h*f+d*u*_;break;case"ZXY":this._x=d*h*f-c*u*_,this._y=c*u*f+d*h*_,this._z=c*h*_+d*u*f,this._w=c*h*f-d*u*_;break;case"ZYX":this._x=d*h*f-c*u*_,this._y=c*u*f+d*h*_,this._z=c*h*_-d*u*f,this._w=c*h*f+d*u*_;break;case"YZX":this._x=d*h*f+c*u*_,this._y=c*u*f+d*h*_,this._z=c*h*_-d*u*f,this._w=c*h*f-d*u*_;break;case"XZY":this._x=d*h*f-c*u*_,this._y=c*u*f-d*h*_,this._z=c*h*_+d*u*f,this._w=c*h*f+d*u*_;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],h=e[6],f=e[10],d=n+a+f;if(d>0){let u=.5/Math.sqrt(d+1);this._w=.25/u,this._x=(h-l)*u,this._y=(s-c)*u,this._z=(o-i)*u}else if(n>a&&n>f){let u=2*Math.sqrt(1+n-a-f);this._w=(h-l)/u,this._x=.25*u,this._y=(i+o)/u,this._z=(s+c)/u}else if(a>f){let u=2*Math.sqrt(1+a-n-f);this._w=(s-c)/u,this._x=(i+o)/u,this._y=.25*u,this._z=(l+h)/u}else{let u=2*Math.sqrt(1+f-n-a);this._w=(o-i)/u,this._x=(s+c)/u,this._y=(l+h)/u,this._z=.25*u}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(Fn(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,h=e._w;return this._x=n*h+o*a+i*c-s*l,this._y=i*h+o*l+s*a-n*c,this._z=s*h+o*c+n*l-i*a,this._w=o*h-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 u=1-e;return this._w=u*o+e*this._w,this._x=u*n+e*this._x,this._y=u*i+e*this._y,this._z=u*s+e*this._z,this.normalize(),this}let c=Math.sqrt(l),h=Math.atan2(c,a),f=Math.sin((1-e)*h)/c,d=Math.sin(e*h)/c;return this._w=o*f+this._w*d,this._x=n*f+this._x*d,this._y=i*f+this._y*d,this._z=s*f+this._z*d,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}},nt=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(Hg.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Hg.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),h=2*(a*e-s*i),f=2*(s*n-o*e);return this.x=e+l*c+o*f-a*h,this.y=n+l*h+a*c-s*f,this.z=i+l*f+s*h-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 Hh.copy(this).projectOnVector(t),this.sub(Hh)}reflect(t){return this.sub(Hh.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(Fn(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}},Hh=new nt,Hg=new Ur,As=class{constructor(t=new nt(1/0,1/0,1/0),e=new nt(-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(di.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(di.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=di.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,di):di.fromBufferAttribute(s,o),di.applyMatrix4(t.matrixWorld),this.expandByPoint(di);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Zl.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Zl.copy(n.boundingBox)),Zl.applyMatrix4(t.matrixWorld),this.union(Zl)}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,di),di.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(Aa),Jl.subVectors(this.max,Aa),co.subVectors(t.a,Aa),uo.subVectors(t.b,Aa),ho.subVectors(t.c,Aa),Sr.subVectors(uo,co),Mr.subVectors(ho,uo),gs.subVectors(co,ho);let e=[0,-Sr.z,Sr.y,0,-Mr.z,Mr.y,0,-gs.z,gs.y,Sr.z,0,-Sr.x,Mr.z,0,-Mr.x,gs.z,0,-gs.x,-Sr.y,Sr.x,0,-Mr.y,Mr.x,0,-gs.y,gs.x,0];return!Gh(e,co,uo,ho,Jl)||(e=[1,0,0,0,1,0,0,0,1],!Gh(e,co,uo,ho,Jl))?!1:($l.crossVectors(Sr,Mr),e=[$l.x,$l.y,$l.z],Gh(e,co,uo,ho,Jl))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,di).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(di).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:(qi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),qi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),qi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),qi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),qi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),qi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),qi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),qi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(qi),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)}},qi=[new nt,new nt,new nt,new nt,new nt,new nt,new nt,new nt],di=new nt,Zl=new As,co=new nt,uo=new nt,ho=new nt,Sr=new nt,Mr=new nt,gs=new nt,Aa=new nt,Jl=new nt,$l=new nt,_s=new nt;function Gh(r,t,e,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){_s.fromArray(r,s);let a=i.x*Math.abs(_s.x)+i.y*Math.abs(_s.y)+i.z*Math.abs(_s.z),l=t.dot(_s),c=e.dot(_s),h=n.dot(_s);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>a)return!1}return!0}var xS=new As,Da=new nt,Wh=new nt,Lo=class{constructor(t=new nt,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):xS.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;Da.subVectors(t,this.center);let e=Da.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(Da,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):(Wh.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Da.copy(t.center).add(Wh)),this.expandByPoint(Da.copy(t.center).sub(Wh))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},Zi=new nt,Xh=new nt,Kl=new nt,br=new nt,Yh=new nt,jl=new nt,qh=new nt,Ac=class{constructor(t=new nt,e=new nt(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,Zi)),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=Zi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Zi.copy(this.origin).addScaledVector(this.direction,e),Zi.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Xh.copy(t).add(e).multiplyScalar(.5),Kl.copy(e).sub(t).normalize(),br.copy(this.origin).sub(Xh);let s=t.distanceTo(e)*.5,o=-this.direction.dot(Kl),a=br.dot(this.direction),l=-br.dot(Kl),c=br.lengthSq(),h=Math.abs(1-o*o),f,d,u,_;if(h>0)if(f=o*l-a,d=o*a-l,_=s*h,f>=0)if(d>=-_)if(d<=_){let p=1/h;f*=p,d*=p,u=f*(f+o*d+2*a)+d*(o*f+d+2*l)+c}else d=s,f=Math.max(0,-(o*d+a)),u=-f*f+d*(d+2*l)+c;else d=-s,f=Math.max(0,-(o*d+a)),u=-f*f+d*(d+2*l)+c;else d<=-_?(f=Math.max(0,-(-o*s+a)),d=f>0?-s:Math.min(Math.max(-s,-l),s),u=-f*f+d*(d+2*l)+c):d<=_?(f=0,d=Math.min(Math.max(-s,-l),s),u=d*(d+2*l)+c):(f=Math.max(0,-(o*s+a)),d=f>0?s:Math.min(Math.max(-s,-l),s),u=-f*f+d*(d+2*l)+c);else d=o>0?-s:s,f=Math.max(0,-(o*d+a)),u=-f*f+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(Xh).addScaledVector(Kl,d),u}intersectSphere(t,e){Zi.subVectors(t.center,this.origin);let n=Zi.dot(this.direction),i=Zi.dot(Zi)-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,h=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(n=(t.min.x-d.x)*c,i=(t.max.x-d.x)*c):(n=(t.max.x-d.x)*c,i=(t.min.x-d.x)*c),h>=0?(s=(t.min.y-d.y)*h,o=(t.max.y-d.y)*h):(s=(t.max.y-d.y)*h,o=(t.min.y-d.y)*h),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),f>=0?(a=(t.min.z-d.z)*f,l=(t.max.z-d.z)*f):(a=(t.max.z-d.z)*f,l=(t.min.z-d.z)*f),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,Zi)!==null}intersectTriangle(t,e,n,i,s){Yh.subVectors(e,t),jl.subVectors(n,t),qh.crossVectors(Yh,jl);let o=this.direction.dot(qh),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;br.subVectors(this.origin,t);let l=a*this.direction.dot(jl.crossVectors(br,jl));if(l<0)return null;let c=a*this.direction.dot(Yh.cross(br));if(c<0||l+c>o)return null;let h=-a*br.dot(qh);return h<0?null:this.at(h/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)}},Ue=class r{constructor(t,e,n,i,s,o,a,l,c,h,f,d,u,_,p,m){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,h,f,d,u,_,p,m)}set(t,e,n,i,s,o,a,l,c,h,f,d,u,_,p,m){let g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=h,g[10]=f,g[14]=d,g[3]=u,g[7]=_,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new 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/fo.setFromMatrixColumn(t,0).length(),s=1/fo.setFromMatrixColumn(t,1).length(),o=1/fo.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),h=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){let d=o*h,u=o*f,_=a*h,p=a*f;e[0]=l*h,e[4]=-l*f,e[8]=c,e[1]=u+_*c,e[5]=d-p*c,e[9]=-a*l,e[2]=p-d*c,e[6]=_+u*c,e[10]=o*l}else if(t.order==="YXZ"){let d=l*h,u=l*f,_=c*h,p=c*f;e[0]=d+p*a,e[4]=_*a-u,e[8]=o*c,e[1]=o*f,e[5]=o*h,e[9]=-a,e[2]=u*a-_,e[6]=p+d*a,e[10]=o*l}else if(t.order==="ZXY"){let d=l*h,u=l*f,_=c*h,p=c*f;e[0]=d-p*a,e[4]=-o*f,e[8]=_+u*a,e[1]=u+_*a,e[5]=o*h,e[9]=p-d*a,e[2]=-o*c,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){let d=o*h,u=o*f,_=a*h,p=a*f;e[0]=l*h,e[4]=_*c-u,e[8]=d*c+p,e[1]=l*f,e[5]=p*c+d,e[9]=u*c-_,e[2]=-c,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){let d=o*l,u=o*c,_=a*l,p=a*c;e[0]=l*h,e[4]=p-d*f,e[8]=_*f+u,e[1]=f,e[5]=o*h,e[9]=-a*h,e[2]=-c*h,e[6]=u*f+_,e[10]=d-p*f}else if(t.order==="XZY"){let d=o*l,u=o*c,_=a*l,p=a*c;e[0]=l*h,e[4]=-f,e[8]=c*h,e[1]=d*f+p,e[5]=o*h,e[9]=u*f-_,e[2]=_*f-u,e[6]=a*h,e[10]=p*f+d}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(vS,t,yS)}lookAt(t,e,n){let i=this.elements;return Vn.subVectors(t,e),Vn.lengthSq()===0&&(Vn.z=1),Vn.normalize(),wr.crossVectors(n,Vn),wr.lengthSq()===0&&(Math.abs(n.z)===1?Vn.x+=1e-4:Vn.z+=1e-4,Vn.normalize(),wr.crossVectors(n,Vn)),wr.normalize(),Ql.crossVectors(Vn,wr),i[0]=wr.x,i[4]=Ql.x,i[8]=Vn.x,i[1]=wr.y,i[5]=Ql.y,i[9]=Vn.y,i[2]=wr.z,i[6]=Ql.z,i[10]=Vn.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],h=n[1],f=n[5],d=n[9],u=n[13],_=n[2],p=n[6],m=n[10],g=n[14],b=n[3],y=n[7],S=n[11],D=n[15],T=i[0],w=i[4],P=i[8],M=i[12],v=i[1],I=i[5],N=i[9],C=i[13],V=i[2],$=i[6],W=i[10],Z=i[14],z=i[3],U=i[7],R=i[11],at=i[15];return s[0]=o*T+a*v+l*V+c*z,s[4]=o*w+a*I+l*$+c*U,s[8]=o*P+a*N+l*W+c*R,s[12]=o*M+a*C+l*Z+c*at,s[1]=h*T+f*v+d*V+u*z,s[5]=h*w+f*I+d*$+u*U,s[9]=h*P+f*N+d*W+u*R,s[13]=h*M+f*C+d*Z+u*at,s[2]=_*T+p*v+m*V+g*z,s[6]=_*w+p*I+m*$+g*U,s[10]=_*P+p*N+m*W+g*R,s[14]=_*M+p*C+m*Z+g*at,s[3]=b*T+y*v+S*V+D*z,s[7]=b*w+y*I+S*$+D*U,s[11]=b*P+y*N+S*W+D*R,s[15]=b*M+y*C+S*Z+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],o=t[1],a=t[5],l=t[9],c=t[13],h=t[2],f=t[6],d=t[10],u=t[14],_=t[3],p=t[7],m=t[11],g=t[15];return _*(+s*l*f-i*c*f-s*a*d+n*c*d+i*a*u-n*l*u)+p*(+e*l*u-e*c*d+s*o*d-i*o*u+i*c*h-s*l*h)+m*(+e*c*f-e*a*u-s*o*f+n*o*u+s*a*h-n*c*h)+g*(-i*a*h-e*l*f+e*a*d+i*o*f-n*o*d+n*l*h)}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],h=t[8],f=t[9],d=t[10],u=t[11],_=t[12],p=t[13],m=t[14],g=t[15],b=f*m*c-p*d*c+p*l*u-a*m*u-f*l*g+a*d*g,y=_*d*c-h*m*c-_*l*u+o*m*u+h*l*g-o*d*g,S=h*p*c-_*f*c+_*a*u-o*p*u-h*a*g+o*f*g,D=_*f*l-h*p*l-_*a*d+o*p*d+h*a*m-o*f*m,T=e*b+n*y+i*S+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]=b*w,t[1]=(p*d*s-f*m*s-p*i*u+n*m*u+f*i*g-n*d*g)*w,t[2]=(a*m*s-p*l*s+p*i*c-n*m*c-a*i*g+n*l*g)*w,t[3]=(f*l*s-a*d*s-f*i*c+n*d*c+a*i*u-n*l*u)*w,t[4]=y*w,t[5]=(h*m*s-_*d*s+_*i*u-e*m*u-h*i*g+e*d*g)*w,t[6]=(_*l*s-o*m*s-_*i*c+e*m*c+o*i*g-e*l*g)*w,t[7]=(o*d*s-h*l*s+h*i*c-e*d*c-o*i*u+e*l*u)*w,t[8]=S*w,t[9]=(_*f*s-h*p*s-_*n*u+e*p*u+h*n*g-e*f*g)*w,t[10]=(o*p*s-_*a*s+_*n*c-e*p*c-o*n*g+e*a*g)*w,t[11]=(h*a*s-o*f*s-h*n*c+e*f*c+o*n*u-e*a*u)*w,t[12]=D*w,t[13]=(h*p*i-_*f*i+_*n*d-e*p*d-h*n*m+e*f*m)*w,t[14]=(_*a*i-o*p*i-_*n*l+e*p*l+o*n*m-e*a*m)*w,t[15]=(o*f*i-h*a*i+h*n*l-e*f*l-o*n*d+e*a*d)*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,o=t.x,a=t.y,l=t.z,c=s*o,h=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,h*a+n,h*l-i*o,0,c*l-i*a,h*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,h=o+o,f=a+a,d=s*c,u=s*h,_=s*f,p=o*h,m=o*f,g=a*f,b=l*c,y=l*h,S=l*f,D=n.x,T=n.y,w=n.z;return i[0]=(1-(p+g))*D,i[1]=(u+S)*D,i[2]=(_-y)*D,i[3]=0,i[4]=(u-S)*T,i[5]=(1-(d+g))*T,i[6]=(m+b)*T,i[7]=0,i[8]=(_+y)*w,i[9]=(m-b)*w,i[10]=(1-(d+p))*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=fo.set(i[0],i[1],i[2]).length(),o=fo.set(i[4],i[5],i[6]).length(),a=fo.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],pi.copy(this);let c=1/s,h=1/o,f=1/a;return pi.elements[0]*=c,pi.elements[1]*=c,pi.elements[2]*=c,pi.elements[4]*=h,pi.elements[5]*=h,pi.elements[6]*=h,pi.elements[8]*=f,pi.elements[9]*=f,pi.elements[10]*=f,e.setFromRotationMatrix(pi),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,i,s,o,a=er){let l=this.elements,c=2*s/(e-t),h=2*s/(n-i),f=(e+t)/(e-t),d=(n+i)/(n-i),u,_;if(a===er)u=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(a===bc)u=-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]=f,l[12]=0,l[1]=0,l[5]=h,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=u,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,o,a=er){let l=this.elements,c=1/(e-t),h=1/(n-i),f=1/(o-s),d=(e+t)*c,u=(n+i)*h,_,p;if(a===er)_=(o+s)*f,p=-2*f;else if(a===bc)_=s*f,p=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-u,l[2]=0,l[6]=0,l[10]=p,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}},fo=new nt,pi=new Ue,vS=new nt(0,0,0),yS=new nt(1,1,1),wr=new nt,Ql=new nt,Vn=new nt,Gg=new Ue,Wg=new Ur,ir=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],h=i[9],f=i[2],d=i[6],u=i[10];switch(e){case"XYZ":this._y=Math.asin(Fn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,u),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Fn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,u),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(Fn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,u),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Fn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,u),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Fn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,u));break;case"XZY":this._z=Math.asin(-Fn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,u),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 Gg.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Gg,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Wg.setFromEuler(this),this.setFromQuaternion(Wg,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}};ir.DEFAULT_ORDER="XYZ";var Dc=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}},SS=0,Xg=new nt,po=new Ur,Ji=new Ue,tc=new nt,Ca=new nt,MS=new nt,bS=new Ur,Yg=new nt(1,0,0),qg=new nt(0,1,0),Zg=new nt(0,0,1),Jg={type:"added"},wS={type:"removed"},mo={type:"childadded",child:null},Zh={type:"childremoved",child:null},mn=class r extends Nr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:SS++}),this.uuid=Ba(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new nt,e=new ir,n=new Ur,i=new nt(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 Ue},normalMatrix:{value:new se}}),this.matrix=new Ue,this.matrixWorld=new Ue,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Dc,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 po.setFromAxisAngle(t,e),this.quaternion.multiply(po),this}rotateOnWorldAxis(t,e){return po.setFromAxisAngle(t,e),this.quaternion.premultiply(po),this}rotateX(t){return this.rotateOnAxis(Yg,t)}rotateY(t){return this.rotateOnAxis(qg,t)}rotateZ(t){return this.rotateOnAxis(Zg,t)}translateOnAxis(t,e){return Xg.copy(t).applyQuaternion(this.quaternion),this.position.add(Xg.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Yg,t)}translateY(t){return this.translateOnAxis(qg,t)}translateZ(t){return this.translateOnAxis(Zg,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ji.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?tc.copy(t):tc.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),Ca.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ji.lookAt(Ca,tc,this.up):Ji.lookAt(tc,Ca,this.up),this.quaternion.setFromRotationMatrix(Ji),i&&(Ji.extractRotation(i.matrixWorld),po.setFromRotationMatrix(Ji),this.quaternion.premultiply(po.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(Jg),mo.child=t,this.dispatchEvent(mo),mo.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(wS),Zh.child=t,this.dispatchEvent(Zh),Zh.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),Ji.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Ji.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ji),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Jg),mo.child=t,this.dispatchEvent(mo),mo.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(Ca,t,MS),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ca,bS,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,h=l.length;c<h;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 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),h=o(t.images),f=o(t.shapes),d=o(t.skeletons),u=o(t.animations),_=o(t.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),f.length>0&&(n.shapes=f),d.length>0&&(n.skeletons=d),u.length>0&&(n.animations=u),_.length>0&&(n.nodes=_)}return n.object=i,n;function o(a){let l=[];for(let c in a){let h=a[c];delete h.metadata,l.push(h)}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}};mn.DEFAULT_UP=new nt(0,1,0);mn.DEFAULT_MATRIX_AUTO_UPDATE=!0;mn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var mi=new nt,$i=new nt,Jh=new nt,Ki=new nt,go=new nt,_o=new nt,$g=new nt,$h=new nt,Kh=new nt,jh=new nt,Eo=class r{constructor(t=new nt,e=new nt,n=new nt){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),mi.subVectors(t,e),i.cross(mi);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){mi.subVectors(i,e),$i.subVectors(n,e),Jh.subVectors(t,e);let o=mi.dot(mi),a=mi.dot($i),l=mi.dot(Jh),c=$i.dot($i),h=$i.dot(Jh),f=o*c-a*a;if(f===0)return s.set(0,0,0),null;let d=1/f,u=(c*l-a*h)*d,_=(o*h-a*l)*d;return s.set(1-u-_,_,u)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Ki)===null?!1:Ki.x>=0&&Ki.y>=0&&Ki.x+Ki.y<=1}static getInterpolation(t,e,n,i,s,o,a,l){return this.getBarycoord(t,e,n,i,Ki)===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,Ki.x),l.addScaledVector(o,Ki.y),l.addScaledVector(a,Ki.z),l)}static isFrontFacing(t,e,n,i){return mi.subVectors(n,e),$i.subVectors(t,e),mi.cross($i).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 mi.subVectors(this.c,this.b),$i.subVectors(this.a,this.b),mi.cross($i).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;go.subVectors(i,n),_o.subVectors(s,n),$h.subVectors(t,n);let l=go.dot($h),c=_o.dot($h);if(l<=0&&c<=0)return e.copy(n);Kh.subVectors(t,i);let h=go.dot(Kh),f=_o.dot(Kh);if(h>=0&&f<=h)return e.copy(i);let d=l*f-h*c;if(d<=0&&l>=0&&h<=0)return o=l/(l-h),e.copy(n).addScaledVector(go,o);jh.subVectors(t,s);let u=go.dot(jh),_=_o.dot(jh);if(_>=0&&u<=_)return e.copy(s);let p=u*c-l*_;if(p<=0&&c>=0&&_<=0)return a=c/(c-_),e.copy(n).addScaledVector(_o,a);let m=h*_-u*f;if(m<=0&&f-h>=0&&u-_>=0)return $g.subVectors(s,i),a=(f-h)/(f-h+(u-_)),e.copy(i).addScaledVector($g,a);let g=1/(m+p+d);return o=p*g,a=d*g,e.copy(n).addScaledVector(go,o).addScaledVector(_o,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},V_={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},Er={h:0,s:0,l:0},ec={h:0,s:0,l:0};function Qh(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 ge=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=Qn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Se.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=Se.workingColorSpace){return this.r=t,this.g=e,this.b=n,Se.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=Se.workingColorSpace){if(t=fS(t,1),e=Fn(e,0,1),n=Fn(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=Qh(o,s,t+1/3),this.g=Qh(o,s,t),this.b=Qh(o,s,t-1/3)}return Se.toWorkingColorSpace(this,i),this}setStyle(t,e=Qn){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=Qn){let n=V_[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=Do(t.r),this.g=Do(t.g),this.b=Do(t.b),this}copyLinearToSRGB(t){return this.r=zh(t.r),this.g=zh(t.g),this.b=zh(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Qn){return Se.fromWorkingColorSpace(pn.copy(this),t),Math.round(Fn(pn.r*255,0,255))*65536+Math.round(Fn(pn.g*255,0,255))*256+Math.round(Fn(pn.b*255,0,255))}getHexString(t=Qn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Se.workingColorSpace){Se.fromWorkingColorSpace(pn.copy(this),e);let n=pn.r,i=pn.g,s=pn.b,o=Math.max(n,i,s),a=Math.min(n,i,s),l,c,h=(a+o)/2;if(a===o)l=0,c=0;else{let f=o-a;switch(c=h<=.5?f/(o+a):f/(2-o-a),o){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=h,t}getRGB(t,e=Se.workingColorSpace){return Se.fromWorkingColorSpace(pn.copy(this),e),t.r=pn.r,t.g=pn.g,t.b=pn.b,t}getStyle(t=Qn){Se.fromWorkingColorSpace(pn.copy(this),t);let e=pn.r,n=pn.g,i=pn.b;return t!==Qn?`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(Er),this.setHSL(Er.h+t,Er.s+e,Er.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(Er),t.getHSL(ec);let n=Bh(Er.h,ec.h,e),i=Bh(Er.s,ec.s,e),s=Bh(Er.l,ec.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}},pn=new ge;ge.NAMES=V_;var ES=0,Ds=class extends Nr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ES++}),this.uuid=Ba(),this.name="",this.type="Material",this.blending=Pr,this.side=Lr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=hf,this.blendDst=ff,this.blendEquation=bs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ge(0,0,0),this.blendAlpha=0,this.depthFunc=_c,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Ug,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ao,this.stencilZFail=ao,this.stencilZPass=ao,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!==Pr&&(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!==hf&&(n.blendSrc=this.blendSrc),this.blendDst!==ff&&(n.blendDst=this.blendDst),this.blendEquation!==bs&&(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!==_c&&(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!==Ug&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ao&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ao&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ao&&(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++}},Cc=class extends Ds{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ge(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 ir,this.combine=R_,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 Ve=new nt,nc=new _e,ei=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=Og,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Dr,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return pS("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++)nc.fromBufferAttribute(this,e),nc.applyMatrix3(t),this.setXY(e,nc.x,nc.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix3(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix4(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Ve.fromBufferAttribute(this,e),Ve.applyNormalMatrix(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Ve.fromBufferAttribute(this,e),Ve.transformDirection(t),this.setXYZ(e,Ve.x,Ve.y,Ve.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=Ta(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Ln(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ta(e,this.array)),e}setX(t,e){return this.normalized&&(e=Ln(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ta(e,this.array)),e}setY(t,e){return this.normalized&&(e=Ln(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=Ta(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Ln(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=Ta(e,this.array)),e}setW(t,e){return this.normalized&&(e=Ln(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Ln(e,this.array),n=Ln(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=Ln(e,this.array),n=Ln(n,this.array),i=Ln(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=Ln(e,this.array),n=Ln(n,this.array),i=Ln(i,this.array),s=Ln(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!==Og&&(t.usage=this.usage),t}};var Rc=class extends ei{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var Pc=class extends ei{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var ni=class extends ei{constructor(t,e,n){super(new Float32Array(t),e,n)}},TS=0,jn=new Ue,tf=new mn,xo=new nt,Hn=new As,Ra=new As,je=new nt,Ni=class r extends Nr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:TS++}),this.uuid=Ba(),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(z_(t)?Pc:Rc)(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 se().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 jn.makeRotationFromQuaternion(t),this.applyMatrix4(jn),this}rotateX(t){return jn.makeRotationX(t),this.applyMatrix4(jn),this}rotateY(t){return jn.makeRotationY(t),this.applyMatrix4(jn),this}rotateZ(t){return jn.makeRotationZ(t),this.applyMatrix4(jn),this}translate(t,e,n){return jn.makeTranslation(t,e,n),this.applyMatrix4(jn),this}scale(t,e,n){return jn.makeScale(t,e,n),this.applyMatrix4(jn),this}lookAt(t){return tf.lookAt(t),tf.updateMatrix(),this.applyMatrix4(tf.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(xo).negate(),this.translate(xo.x,xo.y,xo.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 ni(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new As);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 nt(-1/0,-1/0,-1/0),new nt(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];Hn.setFromBufferAttribute(s),this.morphTargetsRelative?(je.addVectors(this.boundingBox.min,Hn.min),this.boundingBox.expandByPoint(je),je.addVectors(this.boundingBox.max,Hn.max),this.boundingBox.expandByPoint(je)):(this.boundingBox.expandByPoint(Hn.min),this.boundingBox.expandByPoint(Hn.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 Lo);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 nt,1/0);return}if(t){let n=this.boundingSphere.center;if(Hn.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){let a=e[s];Ra.setFromBufferAttribute(a),this.morphTargetsRelative?(je.addVectors(Hn.min,Ra.min),Hn.expandByPoint(je),je.addVectors(Hn.max,Ra.max),Hn.expandByPoint(je)):(Hn.expandByPoint(Ra.min),Hn.expandByPoint(Ra.max))}Hn.getCenter(n);let i=0;for(let s=0,o=t.count;s<o;s++)je.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(je));if(e)for(let s=0,o=e.length;s<o;s++){let a=e[s],l=this.morphTargetsRelative;for(let c=0,h=a.count;c<h;c++)je.fromBufferAttribute(a,c),l&&(xo.fromBufferAttribute(t,c),je.add(xo)),i=Math.max(i,n.distanceToSquared(je))}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 ei(new Float32Array(4*n.count),4));let o=this.getAttribute("tangent"),a=[],l=[];for(let P=0;P<n.count;P++)a[P]=new nt,l[P]=new nt;let c=new nt,h=new nt,f=new nt,d=new _e,u=new _e,_=new _e,p=new nt,m=new nt;function g(P,M,v){c.fromBufferAttribute(n,P),h.fromBufferAttribute(n,M),f.fromBufferAttribute(n,v),d.fromBufferAttribute(s,P),u.fromBufferAttribute(s,M),_.fromBufferAttribute(s,v),h.sub(c),f.sub(c),u.sub(d),_.sub(d);let I=1/(u.x*_.y-_.x*u.y);isFinite(I)&&(p.copy(h).multiplyScalar(_.y).addScaledVector(f,-u.y).multiplyScalar(I),m.copy(f).multiplyScalar(u.x).addScaledVector(h,-_.x).multiplyScalar(I),a[P].add(p),a[M].add(p),a[v].add(p),l[P].add(m),l[M].add(m),l[v].add(m))}let b=this.groups;b.length===0&&(b=[{start:0,count:t.count}]);for(let P=0,M=b.length;P<M;++P){let v=b[P],I=v.start,N=v.count;for(let C=I,V=I+N;C<V;C+=3)g(t.getX(C+0),t.getX(C+1),t.getX(C+2))}let y=new nt,S=new nt,D=new nt,T=new nt;function w(P){D.fromBufferAttribute(i,P),T.copy(D);let M=a[P];y.copy(M),y.sub(D.multiplyScalar(D.dot(M))).normalize(),S.crossVectors(T,M);let I=S.dot(l[P])<0?-1:1;o.setXYZW(P,y.x,y.y,y.z,I)}for(let P=0,M=b.length;P<M;++P){let v=b[P],I=v.start,N=v.count;for(let C=I,V=I+N;C<V;C+=3)w(t.getX(C+0)),w(t.getX(C+1)),w(t.getX(C+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 ei(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let d=0,u=n.count;d<u;d++)n.setXYZ(d,0,0,0);let i=new nt,s=new nt,o=new nt,a=new nt,l=new nt,c=new nt,h=new nt,f=new nt;if(t)for(let d=0,u=t.count;d<u;d+=3){let _=t.getX(d+0),p=t.getX(d+1),m=t.getX(d+2);i.fromBufferAttribute(e,_),s.fromBufferAttribute(e,p),o.fromBufferAttribute(e,m),h.subVectors(o,s),f.subVectors(i,s),h.cross(f),a.fromBufferAttribute(n,_),l.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),a.add(h),l.add(h),c.add(h),n.setXYZ(_,a.x,a.y,a.z),n.setXYZ(p,l.x,l.y,l.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let d=0,u=e.count;d<u;d+=3)i.fromBufferAttribute(e,d+0),s.fromBufferAttribute(e,d+1),o.fromBufferAttribute(e,d+2),h.subVectors(o,s),f.subVectors(i,s),h.cross(f),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)je.fromBufferAttribute(t,e),je.normalize(),t.setXYZ(e,je.x,je.y,je.z)}toNonIndexed(){function t(a,l){let c=a.array,h=a.itemSize,f=a.normalized,d=new c.constructor(l.length*h),u=0,_=0;for(let p=0,m=l.length;p<m;p++){a.isInterleavedBufferAttribute?u=l[p]*a.data.stride+a.offset:u=l[p]*h;for(let g=0;g<h;g++)d[_++]=c[u++]}return new ei(d,h,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 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 h=0,f=c.length;h<f;h++){let d=c[h],u=t(d,n);l.push(u)}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],h=[];for(let f=0,d=c.length;f<d;f++){let u=c[f];h.push(u.toJSON(t.data))}h.length>0&&(i[l]=h,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 h=i[c];this.setAttribute(c,h.clone(e))}let s=t.morphAttributes;for(let c in s){let h=[],f=s[c];for(let d=0,u=f.length;d<u;d++)h.push(f[d].clone(e));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;let o=t.groups;for(let c=0,h=o.length;c<h;c++){let f=o[c];this.addGroup(f.start,f.count,f.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"})}},Kg=new Ue,xs=new Ac,ic=new Lo,jg=new nt,vo=new nt,yo=new nt,So=new nt,ef=new nt,rc=new nt,sc=new _e,oc=new _e,ac=new _e,Qg=new nt,t_=new nt,e_=new nt,lc=new nt,cc=new nt,_i=class extends mn{constructor(t=new Ni,e=new Cc){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){rc.set(0,0,0);for(let l=0,c=s.length;l<c;l++){let h=a[l],f=s[l];h!==0&&(ef.fromBufferAttribute(f,t),o?rc.addScaledVector(ef,h):rc.addScaledVector(ef.sub(e),h))}e.add(rc)}return e}raycast(t,e){let n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ic.copy(n.boundingSphere),ic.applyMatrix4(s),xs.copy(t.ray).recast(t.near),!(ic.containsPoint(xs.origin)===!1&&(xs.intersectSphere(ic,jg)===null||xs.origin.distanceToSquared(jg)>(t.far-t.near)**2))&&(Kg.copy(s).invert(),xs.copy(t.ray).applyMatrix4(Kg),!(n.boundingBox!==null&&xs.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,xs)))}_computeIntersections(t,e,n){let i,s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,f=s.attributes.normal,d=s.groups,u=s.drawRange;if(a!==null)if(Array.isArray(o))for(let _=0,p=d.length;_<p;_++){let m=d[_],g=o[m.materialIndex],b=Math.max(m.start,u.start),y=Math.min(a.count,Math.min(m.start+m.count,u.start+u.count));for(let S=b,D=y;S<D;S+=3){let T=a.getX(S),w=a.getX(S+1),P=a.getX(S+2);i=uc(this,g,t,n,c,h,f,T,w,P),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=m.materialIndex,e.push(i))}}else{let _=Math.max(0,u.start),p=Math.min(a.count,u.start+u.count);for(let m=_,g=p;m<g;m+=3){let b=a.getX(m),y=a.getX(m+1),S=a.getX(m+2);i=uc(this,o,t,n,c,h,f,b,y,S),i&&(i.faceIndex=Math.floor(m/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(o))for(let _=0,p=d.length;_<p;_++){let m=d[_],g=o[m.materialIndex],b=Math.max(m.start,u.start),y=Math.min(l.count,Math.min(m.start+m.count,u.start+u.count));for(let S=b,D=y;S<D;S+=3){let T=S,w=S+1,P=S+2;i=uc(this,g,t,n,c,h,f,T,w,P),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=m.materialIndex,e.push(i))}}else{let _=Math.max(0,u.start),p=Math.min(l.count,u.start+u.count);for(let m=_,g=p;m<g;m+=3){let b=m,y=m+1,S=m+2;i=uc(this,o,t,n,c,h,f,b,y,S),i&&(i.faceIndex=Math.floor(m/3),e.push(i))}}}};function AS(r,t,e,n,i,s,o,a){let l;if(t.side===Nn?l=n.intersectTriangle(o,s,i,!0,a):l=n.intersectTriangle(i,s,o,t.side===Lr,a),l===null)return null;cc.copy(a),cc.applyMatrix4(r.matrixWorld);let c=e.ray.origin.distanceTo(cc);return c<e.near||c>e.far?null:{distance:c,point:cc.clone(),object:r}}function uc(r,t,e,n,i,s,o,a,l,c){r.getVertexPosition(a,vo),r.getVertexPosition(l,yo),r.getVertexPosition(c,So);let h=AS(r,t,e,n,vo,yo,So,lc);if(h){i&&(sc.fromBufferAttribute(i,a),oc.fromBufferAttribute(i,l),ac.fromBufferAttribute(i,c),h.uv=Eo.getInterpolation(lc,vo,yo,So,sc,oc,ac,new _e)),s&&(sc.fromBufferAttribute(s,a),oc.fromBufferAttribute(s,l),ac.fromBufferAttribute(s,c),h.uv1=Eo.getInterpolation(lc,vo,yo,So,sc,oc,ac,new _e)),o&&(Qg.fromBufferAttribute(o,a),t_.fromBufferAttribute(o,l),e_.fromBufferAttribute(o,c),h.normal=Eo.getInterpolation(lc,vo,yo,So,Qg,t_,e_,new nt),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));let f={a,b:l,c,normal:new nt,materialIndex:0};Eo.getNormal(vo,yo,So,f.normal),h.face=f}return h}var Fa=class r extends Ni{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=[],h=[],f=[],d=0,u=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 ni(c,3)),this.setAttribute("normal",new ni(h,3)),this.setAttribute("uv",new ni(f,2));function _(p,m,g,b,y,S,D,T,w,P,M){let v=S/w,I=D/P,N=S/2,C=D/2,V=T/2,$=w+1,W=P+1,Z=0,z=0,U=new nt;for(let R=0;R<W;R++){let at=R*I-C;for(let _t=0;_t<$;_t++){let Ut=_t*v-N;U[p]=Ut*b,U[m]=at*y,U[g]=V,c.push(U.x,U.y,U.z),U[p]=0,U[m]=0,U[g]=T>0?1:-1,h.push(U.x,U.y,U.z),f.push(_t/w),f.push(1-R/P),Z+=1}}for(let R=0;R<P;R++)for(let at=0;at<w;at++){let _t=d+at+$*R,Ut=d+at+$*(R+1),X=d+(at+1)+$*(R+1),ot=d+(at+1)+$*R;l.push(_t,Ut,ot),l.push(Ut,X,ot),z+=6}a.addGroup(u,z,M),u+=z,d+=Z}}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 Fo(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 Tn(r){let t={};for(let e=0;e<r.length;e++){let n=Fo(r[e]);for(let i in n)t[i]=n[i]}return t}function DS(r){let t=[];for(let e=0;e<r.length;e++)t.push(r[e].clone());return t}function H_(r){let t=r.getRenderTarget();return t===null?r.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Se.workingColorSpace}var CS={clone:Fo,merge:Tn},RS=`void main() {
|
|
1
|
+
(()=>{function Oi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Fd(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var Pn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},ks={duration:.5,overwrite:!1,delay:0},Au,an,Ae,Yn=1e8,we=1/Yn,gu=Math.PI*2,X0=gu/4,Y0=0,Nd=Math.sqrt,q0=Math.cos,Z0=Math.sin,Ge=function(t){return typeof t=="string"},Ie=function(t){return typeof t=="function"},ki=function(t){return typeof t=="number"},cl=function(t){return typeof t>"u"},Ti=function(t){return typeof t=="object"},Rn=function(t){return t!==!1},Du=function(){return typeof window<"u"},tl=function(t){return Ie(t)||Ge(t)},Ud=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ln=Array.isArray,_u=/(?:-?\.?\d|\.)+/gi,Cu=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,$r=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,cu=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ru=/[+-]=-?[.\d]+/,Od=/[^,'"\[\]\s]+/gi,J0=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ce,wi,xu,Pu,On={},rl={},Bd,kd=function(t){return(rl=Jr(t,On))&&cn},ul=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},jo=function(t,e){return!e&&console.warn(t)},zd=function(t,e){return t&&(On[t]=e)&&rl&&(rl[t]=e)||On},Qo=function(){return 0},$0={suppressEvents:!0,isStart:!0,kill:!1},el={suppressEvents:!0,kill:!1},K0={suppressEvents:!0},Iu={},ur=[],vu={},Vd,Dn={},uu={},Ad=30,nl=[],Lu="",Fu=function(t){var e=t[0],n,i;if(Ti(e)||Ie(e)||(t=[t]),!(n=(e._gsap||{}).harness)){for(i=nl.length;i--&&!nl[i].targetTest(e););n=nl[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new Ou(t[i],n)))||t.splice(i,1);return t},hr=function(t){return t._gsap||Fu(qn(t))[0]._gsap},Nu=function(t,e,n){return(n=t[e])&&Ie(n)?t[e]():cl(n)&&t.getAttribute&&t.getAttribute(e)||n},_n=function(t,e){return(t=t.split(",")).forEach(e)||t},Le=function(t){return Math.round(t*1e5)/1e5||0},Je=function(t){return Math.round(t*1e7)/1e7||0},Kr=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},j0=function(t,e){for(var n=e.length,i=0;t.indexOf(e[i])<0&&++i<n;);return i<n},sl=function(){var t=ur.length,e=ur.slice(0),n,i;for(vu={},ur.length=0,n=0;n<t;n++)i=e[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},Hd=function(t,e,n,i){ur.length&&!an&&sl(),t.render(e,n,i||an&&e<0&&(t._initted||t._startAt)),ur.length&&!an&&sl()},Gd=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Od).length<2?e:Ge(t)?t.trim():t},Wd=function(t){return t},Zn=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Q0=function(t){return function(e,n){for(var i in n)i in e||i==="duration"&&t||i==="ease"||(e[i]=n[i])}},Jr=function(t,e){for(var n in e)t[n]=e[n];return t},Dd=function r(t,e){for(var n in e)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=Ti(e[n])?r(t[n]||(t[n]={}),e[n]):e[n]);return t},ol=function(t,e){var n={},i;for(i in t)i in e||(n[i]=t[i]);return n},Jo=function(t){var e=t.parent||Ce,n=t.keyframes?Q0(ln(t.keyframes)):Zn;if(Rn(t.inherit))for(;e;)n(t,e.vars.defaults),e=e.parent||e._dp;return t},tx=function(t,e){for(var n=t.length,i=n===e.length;i&&n--&&t[n]===e[n];);return n<0},Xd=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},hl=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},fr=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Yr=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},ex=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},yu=function(t,e,n,i){return t._startAt&&(an?t._startAt.revert(el):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},nx=function r(t){return!t||t._ts&&r(t.parent)},Cd=function(t){return t._repeat?zs(t._tTime,t=t.duration()+t._rDelay)*t:0},zs=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},al=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},fl=function(t){return t._end=Je(t._start+(t._tDur/Math.abs(t._ts||t._rts||we)||0))},dl=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=Je(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),fl(t),n._dirty||Yr(n,t)),t},Yd=function(t,e){var n;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(n=al(t.rawTime(),e),(!e._dur||na(0,e.totalDuration(),n)-e._tTime>we)&&e.render(n,!0)),Yr(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=-we}},Ei=function(t,e,n,i){return e.parent&&fr(e),e._start=Je((ki(n)?n:n||t!==Ce?Xn(t,n,e):t._time)+e._delay),e._end=Je(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Xd(t,e,"_first","_last",t._sort?"_start":0),Su(e)||(t._recent=e),i||Yd(t,e),t._ts<0&&dl(t,t._tTime),t},qd=function(t,e){return(On.ScrollTrigger||ul("scrollTrigger",e))&&On.ScrollTrigger.create(e,t)},Zd=function(t,e,n,i,s){if(zu(t,e,s),!t._initted)return 1;if(!n&&t._pt&&!an&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Vd!==Cn.frame)return ur.push(t),t._lazy=[s,i],1},ix=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},Su=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},rx=function(t,e,n,i){var s=t.ratio,o=e<0||!e&&(!t._start&&ix(t)&&!(!t._initted&&Su(t))||(t._ts<0||t._dp._ts<0)&&!Su(t))?0:1,a=t._rDelay,l=0,c,h,f;if(a&&t._repeat&&(l=na(0,t._tDur,e),h=zs(l,a),t._yoyo&&h&1&&(o=1-o),h!==zs(t._tTime,a)&&(s=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==s||an||i||t._zTime===we||!e&&t._zTime){if(!t._initted&&Zd(t,e,i,n,l))return;for(f=t._zTime,t._zTime=e||(n?we:0),n||(n=e&&!f),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&&yu(t,e,n,!0),t._onUpdate&&!n&&Un(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&Un(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&fr(t,1),!n&&!an&&(Un(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},sx=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}},Vs=function(t,e,n,i){var s=t._repeat,o=Je(e)||0,a=t._tTime/t._tDur;return a&&!i&&(t._time*=o/t._dur),t._dur=o,t._tDur=s?s<0?1e10:Je(o*(s+1)+t._rDelay*s):o,a>0&&!i&&dl(t,t._tTime=t._tDur*a),t.parent&&fl(t),n||Yr(t.parent,t),t},Rd=function(t){return t instanceof tn?Yr(t):Vs(t,t._dur)},ox={_start:0,endTime:Qo,totalDuration:Qo},Xn=function r(t,e,n){var i=t.labels,s=t._recent||ox,o=t.duration()>=Yn?s.endTime(!1):t._dur,a,l,c;return Ge(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*(ln(n)?n[0]:n).totalDuration()),a>1?r(t,e.substr(0,a-1),n)+l:o+l)):e==null?o:+e},$o=function(t,e,n){var i=ki(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=Rn(l.vars.inherit)&&l.parent;o.immediateRender=Rn(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[s-1]}return new Ne(e[0],o,e[s+1])},dr=function(t,e){return t||t===0?e(t):e},na=function(t,e,n){return n<t?t:n>e?e:n},en=function(t,e){return!Ge(t)||!(e=J0.exec(t))?"":e[1]},ax=function(t,e,n){return dr(n,function(i){return na(t,e,i)})},Mu=[].slice,Jd=function(t,e){return t&&Ti(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&Ti(t[0]))&&!t.nodeType&&t!==wi},lx=function(t,e,n){return n===void 0&&(n=[]),t.forEach(function(i){var s;return Ge(i)&&!e||Jd(i,1)?(s=n).push.apply(s,qn(i)):n.push(i)})||n},qn=function(t,e,n){return Ae&&!e&&Ae.selector?Ae.selector(t):Ge(t)&&!n&&(xu||!Hs())?Mu.call((e||Pu).querySelectorAll(t),0):ln(t)?lx(t,n):Jd(t)?Mu.call(t,0):t?[t]:[]},bu=function(t){return t=qn(t)[0]||jo("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return qn(e,n.querySelectorAll?n:n===t?jo("Invalid scope")||Pu.createElement("div"):t)}},$d=function(t){return t.sort(function(){return .5-Math.random()})},Kd=function(t){if(Ie(t))return t;var e=Ti(t)?t:{each:t},n=qr(e.ease),i=e.from||0,s=parseFloat(e.base)||0,o={},a=i>0&&i<1,l=isNaN(i)||a,c=e.axis,h=i,f=i;return Ge(i)?h=f={center:.5,edges:.5,end:1}[i]||0:!a&&l&&(h=i[0],f=i[1]),function(d,u,_){var p=(_||e).length,m=o[p],g,b,y,S,D,T,w,P,M;if(!m){if(M=e.grid==="auto"?0:(e.grid||[1,Yn])[1],!M){for(w=-Yn;w<(w=_[M++].getBoundingClientRect().left)&&M<p;);M<p&&M--}for(m=o[p]=[],g=l?Math.min(M,p)*h-.5:i%M,b=M===Yn?0:l?p*f/M-.5:i/M|0,w=0,P=Yn,T=0;T<p;T++)y=T%M-g,S=b-(T/M|0),m[T]=D=c?Math.abs(c==="y"?S:y):Nd(y*y+S*S),D>w&&(w=D),D<P&&(P=D);i==="random"&&$d(m),m.max=w-P,m.min=P,m.v=p=(parseFloat(e.amount)||parseFloat(e.each)*(M>p?p-1:c?c==="y"?p/M:M:Math.max(M,p/M))||0)*(i==="edges"?-1:1),m.b=p<0?s-p:s,m.u=en(e.amount||e.each)||0,n=n&&p<0?op(n):n}return p=(m[d]-m.min)/m.max||0,Je(m.b+(n?n(p):p)*m.v)+m.u}},wu=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var i=Je(Math.round(parseFloat(n)/t)*t*e);return(i-i%1)/e+(ki(n)?0:en(n))}},jd=function(t,e){var n=ln(t),i,s;return!n&&Ti(t)&&(i=n=t.radius||Yn,t.values?(t=qn(t.values),(s=!ki(t[0]))&&(i*=i)):t=wu(t.increment)),dr(e,n?Ie(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=Yn,h=0,f=t.length,d,u;f--;)s?(d=t[f].x-a,u=t[f].y-l,d=d*d+u*u):d=Math.abs(t[f]-a),d<c&&(c=d,h=f);return h=!i||c<=i?t[h]:o,s||h===o||ki(o)?h:h+en(o)}:wu(t))},Qd=function(t,e,n,i){return dr(ln(t)?!e:n===!0?!!(n=0):!i,function(){return ln(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})},cx=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)}},ux=function(t,e){return function(n){return t(parseFloat(n))+(e||en(n))}},hx=function(t,e,n){return ep(t,e,0,1,n)},tp=function(t,e,n){return dr(n,function(i){return t[~~e(i)]})},fx=function r(t,e,n){var i=e-t;return ln(t)?tp(t,r(0,t.length),e):dr(n,function(s){return(i+(s-t)%i)%i+t})},dx=function r(t,e,n){var i=e-t,s=i*2;return ln(t)?tp(t,r(0,t.length-1),e):dr(n,function(o){return o=(s+(o-t)%s)%s||0,t+(o>i?s-o:o)})},Gs=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?Od:_u),n+=t.substr(e,i-e)+Qd(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),e=o+1;return n+t.substr(e,t.length-e)},ep=function(t,e,n,i,s){var o=e-t,a=i-n;return dr(s,function(l){return n+((l-t)/o*a||0)})},px=function r(t,e,n,i){var s=isNaN(t+e)?0:function(u){return(1-u)*t+u*e};if(!s){var o=Ge(t),a={},l,c,h,f,d;if(n===!0&&(i=1)&&(n=null),o)t={p:t},e={p:e};else if(ln(t)&&!ln(e)){for(h=[],f=t.length,d=f-2,c=1;c<f;c++)h.push(r(t[c-1],t[c]));f--,s=function(_){_*=f;var p=Math.min(d,~~_);return h[p](_-p)},n=e}else i||(t=Jr(ln(t)?[]:{},t));if(!h){for(l in e)Bu.call(a,t,l,"get",e[l]);s=function(_){return Gu(_,a)||(o?t.p:t)}}}return dr(n,s)},Pd=function(t,e,n){var i=t.labels,s=Yn,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},Un=function(t,e,n){var i=t.vars,s=i[e],o=Ae,a=t._ctx,l,c,h;if(s)return l=i[e+"Params"],c=i.callbackScope||t,n&&ur.length&&sl(),a&&(Ae=a),h=l?s.apply(c,l):s.call(c),Ae=o,h},qo=function(t){return fr(t),t.scrollTrigger&&t.scrollTrigger.kill(!!an),t.progress()<1&&Un(t,"onInterrupt"),t},Bs,np=[],ip=function(t){if(t)if(t=!t.name&&t.default||t,Du()||t.headless){var e=t.name,n=Ie(t),i=e&&!n&&t.init?function(){this._props=[]}:t,s={init:Qo,render:Gu,add:Bu,kill:Rx,modifier:Cx,rawVars:0},o={targetTest:0,get:0,getSetter:pl,aliases:{},register:0};if(Hs(),t!==i){if(Dn[e])return;Zn(i,Zn(ol(t,s),o)),Jr(i.prototype,Jr(s,ol(t,o))),Dn[i.prop=e]=i,t.targetTest&&(nl.push(i),Iu[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}zd(e,i),t.register&&t.register(cn,i,xn)}else np.push(t)},Me=255,Zo={aqua:[0,Me,Me],lime:[0,Me,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Me],navy:[0,0,128],white:[Me,Me,Me],olive:[128,128,0],yellow:[Me,Me,0],orange:[Me,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Me,0,0],pink:[Me,192,203],cyan:[0,Me,Me],transparent:[Me,Me,Me,0]},hu=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)*Me+.5|0},rp=function(t,e,n){var i=t?ki(t)?[t>>16,t>>8&Me,t&Me]:0:Zo.black,s,o,a,l,c,h,f,d,u,_;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Zo[t])i=Zo[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&Me,i&Me,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&Me,t&Me]}else if(t.substr(0,3)==="hsl"){if(i=_=t.match(_u),!e)l=+i[0]%360/360,c=+i[1]/100,h=+i[2]/100,o=h<=.5?h*(c+1):h+c-h*c,s=h*2-o,i.length>3&&(i[3]*=1),i[0]=hu(l+1/3,s,o),i[1]=hu(l,s,o),i[2]=hu(l-1/3,s,o);else if(~t.indexOf("="))return i=t.match(Cu),n&&i.length<4&&(i[3]=1),i}else i=t.match(_u)||Zo.transparent;i=i.map(Number)}return e&&!_&&(s=i[0]/Me,o=i[1]/Me,a=i[2]/Me,f=Math.max(s,o,a),d=Math.min(s,o,a),h=(f+d)/2,f===d?l=c=0:(u=f-d,c=h>.5?u/(2-f-d):u/(f+d),l=f===s?(o-a)/u+(o<a?6:0):f===o?(a-s)/u+2:(s-o)/u+4,l*=60),i[0]=~~(l+.5),i[1]=~~(c*100+.5),i[2]=~~(h*100+.5)),n&&i.length<4&&(i[3]=1),i},sp=function(t){var e=[],n=[],i=-1;return t.split(Bi).forEach(function(s){var o=s.match($r)||[];e.push.apply(e,o),n.push(i+=o.length+1)}),e.c=n,e},Id=function(t,e,n){var i="",s=(t+i).match(Bi),o=e?"hsla(":"rgba(",a=0,l,c,h,f;if(!s)return t;if(s=s.map(function(d){return(d=rp(d,e,1))&&o+(e?d[0]+","+d[1]+"%,"+d[2]+"%,"+d[3]:d.join(","))+")"}),n&&(h=sp(t),l=n.c,l.join(i)!==h.c.join(i)))for(c=t.replace(Bi,"1").split($r),f=c.length-1;a<f;a++)i+=c[a]+(~l.indexOf(a)?s.shift()||o+"0,0,0,0)":(h.length?h:s.length?s:n).shift());if(!c)for(c=t.split(Bi),f=c.length-1;a<f;a++)i+=c[a]+s[a];return i+c[f]},Bi=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Zo)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),mx=/hsl[a]?\(/,Uu=function(t){var e=t.join(" "),n;if(Bi.lastIndex=0,Bi.test(e))return n=mx.test(e),t[1]=Id(t[1],n),t[0]=Id(t[0],n,sp(t[1])),!0},ta,Cn=function(){var r=Date.now,t=500,e=33,n=r(),i=n,s=1e3/240,o=s,a=[],l,c,h,f,d,u,_=function p(m){var g=r()-i,b=m===!0,y,S,D,T;if((g>t||g<0)&&(n+=g-e),i+=g,D=i-n,y=D-o,(y>0||b)&&(T=++f.frame,d=D-f.time*1e3,f.time=D=D/1e3,o+=y+(y>=s?4:s-y),S=1),b||(l=c(p)),S)for(u=0;u<a.length;u++)a[u](D,d,T,m)};return f={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(m){return d/(1e3/(m||60))},wake:function(){Bd&&(!xu&&Du()&&(wi=xu=window,Pu=wi.document||{},On.gsap=cn,(wi.gsapVersions||(wi.gsapVersions=[])).push(cn.version),kd(rl||wi.GreenSockGlobals||!wi.gsap&&wi||{}),np.forEach(ip)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&f.sleep(),c=h||function(m){return setTimeout(m,o-f.time*1e3+1|0)},ta=1,_(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(l),ta=0,c=Qo},lagSmoothing:function(m,g){t=m||1/0,e=Math.min(g||33,t)},fps:function(m){s=1e3/(m||240),o=f.time*1e3+s},add:function(m,g,b){var y=g?function(S,D,T,w){m(S,D,T,w),f.remove(y)}:m;return f.remove(m),a[b?"unshift":"push"](y),Hs(),y},remove:function(m,g){~(g=a.indexOf(m))&&a.splice(g,1)&&u>=g&&u--},_listeners:a},f}(),Hs=function(){return!ta&&Cn.wake()},fe={},gx=/^[\d.\-M][\d.\-,\s]/,_x=/["']/g,xx=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(_x,"").trim():+c,i=l.substr(a+1).trim();return e},vx=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)},yx=function(t){var e=(t+"").split("("),n=fe[e[0]];return n&&e.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[xx(e[1])]:vx(t).split(",").map(Gd)):fe._CE&&gx.test(t)?fe._CE("",t):n},op=function(t){return function(e){return 1-t(1-e)}},ap=function r(t,e){for(var n=t._first,i;n;)n instanceof tn?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},qr=function(t,e){return t&&(Ie(t)?t:fe[t]||yx(t))||e},jr=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 _n(t,function(a){fe[a]=On[a]=s,fe[o=a.toLowerCase()]=n;for(var l in s)fe[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=fe[a+"."+l]=s[l]}),s},lp=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},fu=function r(t,e,n){var i=e>=1?e:1,s=(n||(t?.3:.45))/(e<1?e:1),o=s/gu*(Math.asin(1/i)||0),a=function(h){return h===1?1:i*Math.pow(2,-10*h)*Z0((h-o)*s)+1},l=t==="out"?a:t==="in"?function(c){return 1-a(1-c)}:lp(a);return s=gu/s,l.config=function(c,h){return r(t,c,h)},l},du=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)}:lp(n);return i.config=function(s){return r(t,s)},i};_n("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;jr(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})});fe.Linear.easeNone=fe.none=fe.Linear.easeIn;jr("Elastic",fu("in"),fu("out"),fu());(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};jr("Bounce",function(o){return 1-s(1-o)},s)})(7.5625,2.75);jr("Expo",function(r){return r?Math.pow(2,10*(r-1)):0});jr("Circ",function(r){return-(Nd(1-r*r)-1)});jr("Sine",function(r){return r===1?1:-q0(r*X0)+1});jr("Back",du("in"),du("out"),du());fe.SteppedEase=fe.steps=On.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-we;return function(a){return((i*na(0,o,a)|0)+s)*n}}};ks.ease=fe["quad.out"];_n("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return Lu+=r+","+r+"Params,"});var Ou=function(t,e){this.id=Y0++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:Nu,this.set=e?e.getSetter:pl},ea=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,Vs(this,+e.duration,1,1),this.data=e.data,Ae&&(this._ctx=Ae,Ae.data.push(this)),ta||Cn.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,Vs(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,i){if(Hs(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(dl(this,n),!s._dp||s.parent||Yd(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)&&Ei(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===we||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Hd(this,n,i)),this},t.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+Cd(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)+Cd(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?zs(this._tTime,s)+1:1},t.timeScale=function(n,i){if(!arguments.length)return this._rts===-we?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?al(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-we?0:this._rts,this.totalTime(na(-Math.abs(this._delay),this._tDur,s),i!==!1),fl(this),ex(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):(Hs(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==we&&(this._tTime-=we)))),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)&&Ei(i,this,n-this._delay),this}return this._start},t.endTime=function(n){return this._start+(Rn(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?al(i.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=K0);var i=an;return an=n,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),an=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,Rd(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,Rd(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(Xn(this,n),Rn(i))},t.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,Rn(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?-we:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-we,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)-we)},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=Ie(n)?n:Wd,a=function(){var c=i.then;i.then=null,Ie(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(){qo(this)},r}();Zn(ea.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:-we,_prom:0,_ps:!1,_rts:1});var tn=function(r){Fd(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=Rn(n.sortChildren),Ce&&Ei(n.parent||Ce,Oi(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&qd(Oi(s),n.scrollTrigger),s}var e=t.prototype;return e.to=function(i,s,o){return $o(0,arguments,this),this},e.from=function(i,s,o){return $o(1,arguments,this),this},e.fromTo=function(i,s,o,a){return $o(2,arguments,this),this},e.set=function(i,s,o){return s.duration=0,s.parent=this,Jo(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Ne(i,s,Xn(this,o),1),this},e.call=function(i,s,o){return Ei(this,Ne.delayedCall(0,i,s),o)},e.staggerTo=function(i,s,o,a,l,c,h){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=c,o.onCompleteParams=h,o.parent=this,new Ne(i,o,Xn(this,l)),this},e.staggerFrom=function(i,s,o,a,l,c,h){return o.runBackwards=1,Jo(o).immediateRender=Rn(o.immediateRender),this.staggerTo(i,s,o,a,l,c,h)},e.staggerFromTo=function(i,s,o,a,l,c,h,f){return a.startAt=o,Jo(a).immediateRender=Rn(a.immediateRender),this.staggerTo(i,s,a,l,c,h,f)},e.render=function(i,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,h=i<=0?0:Je(i),f=this._zTime<0!=i<0&&(this._initted||!c),d,u,_,p,m,g,b,y,S,D,T,w;if(this!==Ce&&h>l&&i>=0&&(h=l),h!==this._tTime||o||f){if(a!==this._time&&c&&(h+=this._time-a,i+=this._time-a),d=h,S=this._start,y=this._ts,g=!y,f&&(c||(a=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(T=this._yoyo,m=c+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(m*100+i,s,o);if(d=Je(h%m),h===l?(p=this._repeat,d=c):(p=~~(h/m),p&&p===h/m&&(d=c,p--),d>c&&(d=c)),D=zs(this._tTime,m),!a&&this._tTime&&D!==p&&this._tTime-D*m-this._dur<=0&&(D=p),T&&p&1&&(d=c-d,w=1),p!==D&&!this._lock){var P=T&&D&1,M=P===(T&&p&1);if(p<D&&(P=!P),a=P?0:h%c?c:h,this._lock=1,this.render(a||(w?0:Je(p*m)),s,!c)._lock=0,this._tTime=h,!s&&this.parent&&Un(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),a&&a!==this._time||g!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,M&&(this._lock=2,a=P?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!g)return this;ap(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=sx(this,Je(a),Je(d)),b&&(h-=d-(d=b._start))),this._tTime=h,this._time=d,this._act=!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,a=0),!a&&d&&!s&&!p&&(Un(this,"onStart"),this._tTime!==h))return this;if(d>=a&&i>=0)for(u=this._first;u;){if(_=u._next,(u._act||d>=u._start)&&u._ts&&b!==u){if(u.parent!==this)return this.render(i,s,o);if(u.render(u._ts>0?(d-u._start)*u._ts:(u._dirty?u.totalDuration():u._tDur)+(d-u._start)*u._ts,s,o),d!==this._time||!this._ts&&!g){b=0,_&&(h+=this._zTime=-we);break}}u=_}else{u=this._last;for(var v=i<0?i:d;u;){if(_=u._prev,(u._act||v<=u._end)&&u._ts&&b!==u){if(u.parent!==this)return this.render(i,s,o);if(u.render(u._ts>0?(v-u._start)*u._ts:(u._dirty?u.totalDuration():u._tDur)+(v-u._start)*u._ts,s,o||an&&(u._initted||u._startAt)),d!==this._time||!this._ts&&!g){b=0,_&&(h+=this._zTime=v?-we:we);break}}u=_}}if(b&&!s&&(this.pause(),b.render(d>=a?0:-we)._zTime=d>=a?1:-1,this._ts))return this._start=S,fl(this),this.render(i,s,o);this._onUpdate&&!s&&Un(this,"onUpdate",!0),(h===l&&this._tTime>=this.totalDuration()||!h&&a)&&(S===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((i||!c)&&(h===l&&this._ts>0||!h&&this._ts<0)&&fr(this,1),!s&&!(i<0&&!a)&&(h||a||!l)&&(Un(this,h===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(i,s){var o=this;if(ki(s)||(s=Xn(this,s,i)),!(i instanceof ea)){if(ln(i))return i.forEach(function(a){return o.add(a,s)}),this;if(Ge(i))return this.addLabel(i,s);if(Ie(i))i=Ne.delayedCall(0,i);else return this}return this!==i?Ei(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=-Yn);for(var l=[],c=this._first;c;)c._start>=a&&(c instanceof Ne?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 Ge(i)?this.removeLabel(i):Ie(i)?this.killTweensOf(i):(hl(this,i),i===this._recent&&(this._recent=this._last),Yr(this))},e.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Je(Cn.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]=Xn(this,s),this},e.removeLabel=function(i){return delete this.labels[i],this},e.addPause=function(i,s,o){var a=Ne.delayedCall(0,s||Qo,o);return a.data="isPause",this._hasPause=1,Ei(this,a,Xn(this,i))},e.removePause=function(i){var s=this._first;for(i=Xn(this,i);s;)s._start===i&&s.data==="isPause"&&fr(s),s=s._next},e.killTweensOf=function(i,s,o){for(var a=this.getTweensOf(i,o),l=a.length;l--;)cr!==a[l]&&a[l].kill(i,s);return this},e.getTweensOf=function(i,s){for(var o=[],a=qn(i),l=this._first,c=ki(s),h;l;)l instanceof Ne?j0(l._targets,a)&&(c?(!cr||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&o.push(l):(h=l.getTweensOf(a,s)).length&&o.push.apply(o,h),l=l._next;return o},e.tweenTo=function(i,s){s=s||{};var o=this,a=Xn(o,i),l=s,c=l.startAt,h=l.onStart,f=l.onStartParams,d=l.immediateRender,u,_=Ne.to(o,Zn({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())||we,onStart:function(){if(o.pause(),!u){var m=s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());_._dur!==m&&Vs(_,m,0,1).render(_._time,!0,!0),u=1}h&&h.apply(_,f||[])}},s));return d?_.render(0):_},e.tweenFromTo=function(i,s,o){return this.tweenTo(s,Zn({startAt:{time:Xn(this,i)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(i){return i===void 0&&(i=this._time),Pd(this,Xn(this,i))},e.previousLabel=function(i){return i===void 0&&(i=this._time),Pd(this,Xn(this,i),1)},e.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+we)},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 Yr(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={}),Yr(this)},e.totalDuration=function(i){var s=0,o=this,a=o._last,l=Yn,c,h,f;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));if(o._dirty){for(f=o.parent;a;)c=a._prev,a._dirty&&a.totalDuration(),h=a._start,h>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,Ei(o,a,h-a._delay,1)._lock=0):l=h,h<0&&a._ts&&(s-=h,(!f&&!o._dp||f&&f.smoothChildTiming)&&(o._start+=h/o._ts,o._time-=h,o._tTime-=h),o.shiftChildren(-h,!1,-1/0),l=0),a._end>s&&a._ts&&(s=a._end),a=c;Vs(o,o===Ce&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(i){if(Ce._ts&&(Hd(Ce,al(i,Ce)),Vd=Cn.frame),Cn.frame>=Ad){Ad+=Pn.autoSleep||120;var s=Ce._first;if((!s||!s._ts)&&Pn.autoSleep&&Cn._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||Cn.sleep()}}},t}(ea);Zn(tn.prototype,{_lock:0,_hasPause:0,_forcing:0});var Sx=function(t,e,n,i,s,o,a){var l=new xn(this._pt,t,e,0,1,Hu,null,s),c=0,h=0,f,d,u,_,p,m,g,b;for(l.b=n,l.e=i,n+="",i+="",(g=~i.indexOf("random("))&&(i=Gs(i)),o&&(b=[n,i],o(b,t,e),n=b[0],i=b[1]),d=n.match(cu)||[];f=cu.exec(i);)_=f[0],p=i.substring(c,f.index),u?u=(u+1)%5:p.substr(-5)==="rgba("&&(u=1),_!==d[h++]&&(m=parseFloat(d[h-1])||0,l._pt={_next:l._pt,p:p||h===1?p:",",s:m,c:_.charAt(1)==="="?Kr(m,_)-m:parseFloat(_)-m,m:u&&u<4?Math.round:0},c=cu.lastIndex);return l.c=c<i.length?i.substring(c,i.length):"",l.fp=a,(Ru.test(i)||g)&&(l.e=0),this._pt=l,l},Bu=function(t,e,n,i,s,o,a,l,c,h){Ie(i)&&(i=i(s||0,t,o));var f=t[e],d=n!=="get"?n:Ie(f)?c?t[e.indexOf("set")||!Ie(t["get"+e.substr(3)])?e:"get"+e.substr(3)](c):t[e]():f,u=Ie(f)?c?Tx:hp:Vu,_;if(Ge(i)&&(~i.indexOf("random(")&&(i=Gs(i)),i.charAt(1)==="="&&(_=Kr(d,i)+(en(d)||0),(_||_===0)&&(i=_))),!h||d!==i||Eu)return!isNaN(d*i)&&i!==""?(_=new xn(this._pt,t,e,+d||0,i-(d||0),typeof f=="boolean"?Dx:fp,0,u),c&&(_.fp=c),a&&_.modifier(a,this,t),this._pt=_):(!f&&!(e in t)&&ul(e,i),Sx.call(this,t,e,d,i,u,l||Pn.stringFilter,c))},Mx=function(t,e,n,i,s){if(Ie(t)&&(t=Ko(t,s,e,n,i)),!Ti(t)||t.style&&t.nodeType||ln(t)||Ud(t))return Ge(t)?Ko(t,s,e,n,i):t;var o={},a;for(a in t)o[a]=Ko(t[a],s,e,n,i);return o},ku=function(t,e,n,i,s,o){var a,l,c,h;if(Dn[t]&&(a=new Dn[t]).init(s,a.rawVars?e[t]:Mx(e[t],i,s,o,n),n,i,o)!==!1&&(n._pt=l=new xn(n._pt,s,t,0,1,a.render,a,0,a.priority),n!==Bs))for(c=n._ptLookup[n._targets.indexOf(s)],h=a._props.length;h--;)c[a._props[h]]=l;return a},cr,Eu,zu=function r(t,e,n){var i=t.vars,s=i.ease,o=i.startAt,a=i.immediateRender,l=i.lazy,c=i.onUpdate,h=i.runBackwards,f=i.yoyoEase,d=i.keyframes,u=i.autoRevert,_=t._dur,p=t._startAt,m=t._targets,g=t.parent,b=g&&g.data==="nested"?g.vars.targets:m,y=t._overwrite==="auto"&&!Au,S=t.timeline,D,T,w,P,M,v,I,N,C,V,$,W,Z;if(S&&(!d||!s)&&(s="none"),t._ease=qr(s,ks.ease),t._yEase=f?op(qr(f===!0?s:f,ks.ease)):0,f&&t._yoyo&&!t._repeat&&(f=t._yEase,t._yEase=t._ease,t._ease=f),t._from=!S&&!!i.runBackwards,!S||d&&!i.stagger){if(N=m[0]?hr(m[0]).harness:0,W=N&&i[N.prop],D=ol(i,Iu),p&&(p._zTime<0&&p.progress(1),e<0&&h&&a&&!u?p.render(-1,!0):p.revert(h&&_?el:$0),p._lazy=0),o){if(fr(t._startAt=Ne.set(m,Zn({data:"isStart",overwrite:!1,parent:g,immediateRender:!0,lazy:!p&&Rn(l),startAt:null,delay:0,onUpdate:c&&function(){return Un(t,"onUpdate")},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(an||!a&&!u)&&t._startAt.revert(el),a&&_&&e<=0&&n<=0){e&&(t._zTime=e);return}}else if(h&&_&&!p){if(e&&(a=!1),w=Zn({overwrite:!1,data:"isFromStart",lazy:a&&!p&&Rn(l),immediateRender:a,stagger:0,parent:g},D),W&&(w[N.prop]=W),fr(t._startAt=Ne.set(m,w)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(an?t._startAt.revert(el):t._startAt.render(-1,!0)),t._zTime=e,!a)r(t._startAt,we,we);else if(!e)return}for(t._pt=t._ptCache=0,l=_&&Rn(l)||l&&!_,T=0;T<m.length;T++){if(M=m[T],I=M._gsap||Fu(m)[T]._gsap,t._ptLookup[T]=V={},vu[I.id]&&ur.length&&sl(),$=b===m?T:b.indexOf(M),N&&(C=new N).init(M,W||D,t,$,b)!==!1&&(t._pt=P=new xn(t._pt,M,C.name,0,1,C.render,C,0,C.priority),C._props.forEach(function(z){V[z]=P}),C.priority&&(v=1)),!N||W)for(w in D)Dn[w]&&(C=ku(w,D,t,$,M,b))?C.priority&&(v=1):V[w]=P=Bu.call(t,M,w,"get",D[w],$,b,0,i.stringFilter);t._op&&t._op[T]&&t.kill(M,t._op[T]),y&&t._pt&&(cr=t,Ce.killTweensOf(M,V,t.globalTime(e)),Z=!t.parent,cr=0),t._pt&&l&&(vu[I.id]=1)}v&&Wu(t),t._onInit&&t._onInit(t)}t._onUpdate=c,t._initted=(!t._op||t._pt)&&!Z,d&&e<=0&&S.render(Yn,!0,!0)},bx=function(t,e,n,i,s,o,a,l){var c=(t._pt&&t._ptCache||(t._ptCache={}))[e],h,f,d,u;if(!c)for(c=t._ptCache[e]=[],d=t._ptLookup,u=t._targets.length;u--;){if(h=d[u][e],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==e&&h.fp!==e;)h=h._next;if(!h)return Eu=1,t.vars[e]="+=0",zu(t,a),Eu=0,l?jo(e+" not eligible for reset"):1;c.push(h)}for(u=c.length;u--;)f=c[u],h=f._pt||f,h.s=(i||i===0)&&!s?i:h.s+(i||0)+o*h.c,h.c=n-h.s,f.e&&(f.e=Le(n)+en(f.e)),f.b&&(f.b=h.s+en(f.b))},wx=function(t,e){var n=t[0]?hr(t[0]).harness:0,i=n&&n.aliases,s,o,a,l;if(!i)return e;s=Jr({},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},Ex=function(t,e,n,i){var s=e.ease||i||"power1.inOut",o,a;if(ln(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})},Ko=function(t,e,n,i,s){return Ie(t)?t.call(e,n,i,s):Ge(t)&&~t.indexOf("random(")?Gs(t):t},cp=Lu+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",up={};_n(cp+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return up[r]=1});var Ne=function(r){Fd(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:Jo(i))||this;var l=a.vars,c=l.duration,h=l.delay,f=l.immediateRender,d=l.stagger,u=l.overwrite,_=l.keyframes,p=l.defaults,m=l.scrollTrigger,g=l.yoyoEase,b=i.parent||Ce,y=(ln(n)||Ud(n)?ki(n[0]):"length"in i)?[n]:qn(n),S,D,T,w,P,M,v,I;if(a._targets=y.length?Fu(y):jo("GSAP target "+n+" not found. https://gsap.com",!Pn.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=u,_||d||tl(c)||tl(h)){if(i=a.vars,S=a.timeline=new tn({data:"nested",defaults:p||{},targets:b&&b.data==="nested"?b.vars.targets:y}),S.kill(),S.parent=S._dp=Oi(a),S._start=0,d||tl(c)||tl(h)){if(w=y.length,v=d&&Kd(d),Ti(d))for(P in d)~cp.indexOf(P)&&(I||(I={}),I[P]=d[P]);for(D=0;D<w;D++)T=ol(i,up),T.stagger=0,g&&(T.yoyoEase=g),I&&Jr(T,I),M=y[D],T.duration=+Ko(c,Oi(a),D,M,y),T.delay=(+Ko(h,Oi(a),D,M,y)||0)-a._delay,!d&&w===1&&T.delay&&(a._delay=h=T.delay,a._start+=h,T.delay=0),S.to(M,T,v?v(D,M,y):0),S._ease=fe.none;S.duration()?c=h=0:a.timeline=0}else if(_){Jo(Zn(S.vars.defaults,{ease:"none"})),S._ease=qr(_.ease||i.ease||"none");var N=0,C,V,$;if(ln(_))_.forEach(function(W){return S.to(y,W,">")}),S.duration();else{T={};for(P in _)P==="ease"||P==="easeEach"||Ex(P,_[P],T,_.easeEach);for(P in T)for(C=T[P].sort(function(W,Z){return W.t-Z.t}),N=0,D=0;D<C.length;D++)V=C[D],$={ease:V.e,duration:(V.t-(D?C[D-1].t:0))/100*c},$[P]=V.v,S.to(y,$,N),N+=$.duration;S.duration()<c&&S.to({},{duration:c-S.duration()})}}c||a.duration(c=S.duration())}else a.timeline=0;return u===!0&&!Au&&(cr=Oi(a),Ce.killTweensOf(y),cr=0),Ei(b,Oi(a),s),i.reversed&&a.reverse(),i.paused&&a.paused(!0),(f||!c&&!_&&a._start===Je(b._time)&&Rn(f)&&nx(Oi(a))&&b.data!=="nested")&&(a._tTime=-we,a.render(Math.max(0,-h)||0)),m&&qd(Oi(a),m),a}var e=t.prototype;return e.render=function(i,s,o){var a=this._time,l=this._tDur,c=this._dur,h=i<0,f=i>l-we&&!h?l:i<we?0:i,d,u,_,p,m,g,b,y,S;if(!c)rx(this,i,s,o);else if(f!==this._tTime||!i||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h){if(d=f,y=this.timeline,this._repeat){if(p=c+this._rDelay,this._repeat<-1&&h)return this.totalTime(p*100+i,s,o);if(d=Je(f%p),f===l?(_=this._repeat,d=c):(_=~~(f/p),_&&_===Je(f/p)&&(d=c,_--),d>c&&(d=c)),g=this._yoyo&&_&1,g&&(S=this._yEase,d=c-d),m=zs(this._tTime,p),d===a&&!o&&this._initted&&_===m)return this._tTime=f,this;_!==m&&(y&&this._yEase&&ap(y,g),this.vars.repeatRefresh&&!g&&!this._lock&&this._time!==p&&this._initted&&(this._lock=o=1,this.render(Je(p*_),!0).invalidate()._lock=0))}if(!this._initted){if(Zd(this,h?i:d,o,s,f))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&_!==m))return this;if(c!==this._dur)return this.render(i,s,o)}if(this._tTime=f,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=b=(S||this._ease)(d/c),this._from&&(this.ratio=b=1-b),d&&!a&&!s&&!_&&(Un(this,"onStart"),this._tTime!==f))return this;for(u=this._pt;u;)u.r(b,u.d),u=u._next;y&&y.render(i<0?i:y._dur*y._ease(d/this._dur),s,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(h&&yu(this,i,s,o),Un(this,"onUpdate")),this._repeat&&_!==m&&this.vars.onRepeat&&!s&&this.parent&&Un(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(h&&!this._onUpdate&&yu(this,i,!0,!0),(i||!c)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&fr(this,1),!s&&!(h&&!a)&&(f||a||g)&&(Un(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,o,a,l){ta||Cn.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||zu(this,c),h=this._ease(c/this._dur),bx(this,i,s,o,a,h,c,l)?this.resetTo(i,s,o,a,1):(dl(this,0),this.parent||Xd(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?qo(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,s,cr&&cr.vars.overwrite!==!0)._first||qo(this),this.parent&&o!==this.timeline.totalDuration()&&Vs(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=i?qn(i):a,c=this._ptLookup,h=this._pt,f,d,u,_,p,m,g;if((!s||s==="all")&&tx(a,l))return s==="all"&&(this._pt=0),qo(this);for(f=this._op=this._op||[],s!=="all"&&(Ge(s)&&(p={},_n(s,function(b){return p[b]=1}),s=p),s=wx(a,s)),g=a.length;g--;)if(~l.indexOf(a[g])){d=c[g],s==="all"?(f[g]=s,_=d,u={}):(u=f[g]=f[g]||{},_=s);for(p in _)m=d&&d[p],m&&((!("kill"in m.d)||m.d.kill(p)===!0)&&hl(this,m,"_pt"),delete d[p]),u!=="all"&&(u[p]=1)}return this._initted&&!this._pt&&h&&qo(this),this},t.to=function(i,s){return new t(i,s,arguments[2])},t.from=function(i,s){return $o(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 $o(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 Ce.killTweensOf(i,s,o)},t}(ea);Zn(Ne.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});_n("staggerTo,staggerFrom,staggerFromTo",function(r){Ne[r]=function(){var t=new tn,e=Mu.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var Vu=function(t,e,n){return t[e]=n},hp=function(t,e,n){return t[e](n)},Tx=function(t,e,n,i){return t[e](i.fp,n)},Ax=function(t,e,n){return t.setAttribute(e,n)},pl=function(t,e){return Ie(t[e])?hp:cl(t[e])&&t.setAttribute?Ax:Vu},fp=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},Dx=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},Hu=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)},Gu=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},Cx=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},Rx=function(t){for(var e=this._pt,n,i;e;)i=e._next,e.p===t&&!e.op||e.op===t?hl(this,e,"_pt"):e.dep||(n=1),e=i;return!n},Px=function(t,e,n,i){i.mSet(t,e,i.m.call(i.tween,n,i.mt),i)},Wu=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},xn=function(){function r(e,n,i,s,o,a,l,c,h){this.t=n,this.s=s,this.c=o,this.p=i,this.r=a||fp,this.d=l||this,this.set=c||Vu,this.pr=h||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=Px,this.m=n,this.mt=s,this.tween=i},r}();_n(Lu+"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 Iu[r]=1});On.TweenMax=On.TweenLite=Ne;On.TimelineLite=On.TimelineMax=tn;Ce=new tn({sortChildren:!1,defaults:ks,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Pn.stringFilter=Uu;var Zr=[],il={},Ix=[],Ld=0,Lx=0,pu=function(t){return(il[t]||Ix).map(function(e){return e()})},Tu=function(){var t=Date.now(),e=[];t-Ld>2&&(pu("matchMediaInit"),Zr.forEach(function(n){var i=n.queries,s=n.conditions,o,a,l,c;for(a in i)o=wi.matchMedia(i[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,c=1);c&&(n.revert(),l&&e.push(n))}),pu("matchMediaRevert"),e.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),Ld=t,pu("matchMedia"))},dp=function(){function r(e,n){this.selector=n&&bu(n),this.data=[],this._r=[],this.isReverted=!1,this.id=Lx++,e&&this.add(e)}var t=r.prototype;return t.add=function(n,i,s){Ie(n)&&(s=i,i=n,n=Ie);var o=this,a=function(){var c=Ae,h=o.selector,f;return c&&c!==o&&c.data.push(o),s&&(o.selector=bu(s)),Ae=o,f=i.apply(o,arguments),Ie(f)&&o._r.push(f),Ae=c,o.selector=h,o.isReverted=!1,f};return o.last=a,n===Ie?a(o,function(l){return o.add(null,l)}):n?o[n]=a:a},t.ignore=function(n){var i=Ae;Ae=null,n(this),Ae=i},t.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof Ne&&!(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(h){return a.splice(a.indexOf(h),1)}));for(a.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,f){return f.g-h.g||-1/0}).forEach(function(h){return h.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof tn?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof Ne)&&c.revert&&c.revert(n);s._r.forEach(function(h){return h(n,s)}),s.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),i)for(var o=Zr.length;o--;)Zr[o].id===this.id&&Zr.splice(o,1)},t.revert=function(n){this.kill(n||{})},r}(),Fx=function(){function r(e){this.contexts=[],this.scope=e,Ae&&Ae.data.push(this)}var t=r.prototype;return t.add=function(n,i,s){Ti(n)||(n={matches:n});var o=new dp(0,s||this.scope),a=o.conditions={},l,c,h;Ae&&!o.selector&&(o.selector=Ae.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=n;for(c in n)c==="all"?h=1:(l=wi.matchMedia(n[c]),l&&(Zr.indexOf(o)<0&&Zr.push(o),(a[c]=l.matches)&&(h=1),l.addListener?l.addListener(Tu):l.addEventListener("change",Tu)));return h&&i(o,function(f){return o.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}(),ll={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 ip(i)})},timeline:function(t){return new tn(t)},getTweensOf:function(t,e){return Ce.getTweensOf(t,e)},getProperty:function(t,e,n,i){Ge(t)&&(t=qn(t)[0]);var s=hr(t||{}).get,o=n?Wd:Gd;return n==="native"&&(n=""),t&&(e?o((Dn[e]&&Dn[e].get||s)(t,e,n,i)):function(a,l,c){return o((Dn[a]&&Dn[a].get||s)(t,a,l,c))})},quickSetter:function(t,e,n){if(t=qn(t),t.length>1){var i=t.map(function(h){return cn.quickSetter(h,e,n)}),s=i.length;return function(h){for(var f=s;f--;)i[f](h)}}t=t[0]||{};var o=Dn[e],a=hr(t),l=a.harness&&(a.harness.aliases||{})[e]||e,c=o?function(h){var f=new o;Bs._pt=0,f.init(t,n?h+n:h,Bs,0,[t]),f.render(1,f),Bs._pt&&Gu(1,Bs)}:a.set(t,l);return o?c:function(h){return c(t,l,n?h+n:h,a,1)}},quickTo:function(t,e,n){var i,s=cn.to(t,Jr((i={},i[e]="+=0.1",i.paused=!0,i),n||{})),o=function(l,c,h){return s.resetTo(e,l,c,h)};return o.tween=s,o},isTweening:function(t){return Ce.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=qr(t.ease,ks.ease)),Dd(ks,t||{})},config:function(t){return Dd(Pn,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&&!Dn[a]&&!On[a]&&jo(e+" effect requires "+a+" plugin.")}),uu[e]=function(a,l,c){return n(qn(a),Zn(l||{},s),c)},o&&(tn.prototype[e]=function(a,l,c){return this.add(uu[e](a,Ti(l)?l:(c=l)&&{},this),c)})},registerEase:function(t,e){fe[t]=qr(e)},parseEase:function(t,e){return arguments.length?qr(t,e):fe},getById:function(t){return Ce.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var n=new tn(t),i,s;for(n.smoothChildTiming=Rn(t.smoothChildTiming),Ce.remove(n),n._dp=0,n._time=n._tTime=Ce._time,i=Ce._first;i;)s=i._next,(e||!(!i._dur&&i instanceof Ne&&i.vars.onComplete===i._targets[0]))&&Ei(n,i,i._start-i._delay),i=s;return Ei(Ce,n,0),n},context:function(t,e){return t?new dp(t,e):Ae},matchMedia:function(t){return new Fx(t)},matchMediaRefresh:function(){return Zr.forEach(function(t){var e=t.conditions,n,i;for(i in e)e[i]&&(e[i]=!1,n=1);n&&t.revert()})||Tu()},addEventListener:function(t,e){var n=il[t]||(il[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=il[t],i=n&&n.indexOf(e);i>=0&&n.splice(i,1)},utils:{wrap:fx,wrapYoyo:dx,distribute:Kd,random:Qd,snap:jd,normalize:hx,getUnit:en,clamp:ax,splitColor:rp,toArray:qn,selector:bu,mapRange:ep,pipe:cx,unitize:ux,interpolate:px,shuffle:$d},install:kd,effects:uu,ticker:Cn,updateRoot:tn.updateRoot,plugins:Dn,globalTimeline:Ce,core:{PropTween:xn,globals:zd,Tween:Ne,Timeline:tn,Animation:ea,getCache:hr,_removeLinkedListItem:hl,reverting:function(){return an},context:function(t){return t&&Ae&&(Ae.data.push(t),t._ctx=Ae),Ae},suppressOverwrites:function(t){return Au=t}}};_n("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return ll[r]=Ne[r]});Cn.add(tn.updateRoot);Bs=ll.to({},{duration:0});var Nx=function(t,e){for(var n=t._pt;n&&n.p!==e&&n.op!==e&&n.fp!==e;)n=n._next;return n},Ux=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=Nx(o,i)),o&&o.modifier&&o.modifier(e[i],t,n[s],i))},mu=function(t,e){return{name:t,rawVars:1,init:function(i,s,o){o._onInit=function(a){var l,c;if(Ge(s)&&(l={},_n(s,function(h){return l[h]=1}),s=l),e){l={};for(c in s)l[c]=e(s[c]);s=l}Ux(a,s)}}}},cn=ll.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;)an?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)}},mu("roundProps",wu),mu("modifiers"),mu("snap",jd))||ll;Ne.version=tn.version=cn.version="3.12.5";Bd=1;Du()&&Hs();var Ox=fe.Power0,Bx=fe.Power1,kx=fe.Power2,zx=fe.Power3,Vx=fe.Power4,Hx=fe.Linear,Gx=fe.Quad,Wx=fe.Cubic,Xx=fe.Quart,Yx=fe.Quint,qx=fe.Strong,Zx=fe.Elastic,Jx=fe.Back,$x=fe.SteppedEase,Kx=fe.Bounce,jx=fe.Sine,Qx=fe.Expo,tv=fe.Circ;var pp,pr,Xs,Ku,ns,ev,mp,ju,nv=function(){return typeof window<"u"},Vi={},es=180/Math.PI,Ys=Math.PI/180,Ws=Math.atan2,gp=1e8,Qu=/([A-Z])/g,iv=/(left|right|width|margin|padding|x)/i,rv=/[\s,\(]\S/,Ai={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},qu=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},sv=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)},ov=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)},av=function(t,e){var n=e.s+e.c*t;e.set(e.t,e.p,~~(n+(n<0?-.5:.5))+e.u,e)},bp=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},wp=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},lv=function(t,e,n){return t.style[e]=n},cv=function(t,e,n){return t.style.setProperty(e,n)},uv=function(t,e,n){return t._gsap[e]=n},hv=function(t,e,n){return t._gsap.scaleX=t._gsap.scaleY=n},fv=function(t,e,n,i,s){var o=t._gsap;o.scaleX=o.scaleY=n,o.renderTransform(s,o)},dv=function(t,e,n,i,s){var o=t._gsap;o[e]=n,o.renderTransform(s,o)},Re="transform",In=Re+"Origin",pv=function r(t,e){var n=this,i=this.target,s=i.style,o=i._gsap;if(t in Vi&&s){if(this.tfm=this.tfm||{},t!=="transform")t=Ai[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return n.tfm[a]=zi(i,a)}):this.tfm[t]=o.x?o[t]:zi(i,t),t===In&&(this.tfm.zOrigin=o.zOrigin);else return Ai.transform.split(",").forEach(function(a){return r.call(n,a,e)});if(this.props.indexOf(Re)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(In,e,"")),t=Re}(s||e)&&this.props.push(t,e,s[t])},Ep=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},mv=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(Qu,"-$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=ju(),(!s||!s.isStart)&&!n[Re]&&(Ep(n),i.zOrigin&&n[In]&&(n[In]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},Tp=function(t,e){var n={target:t,props:[],revert:mv,save:pv};return t._gsap||cn.core.getCache(t),e&&e.split(",").forEach(function(i){return n.save(i)}),n},Ap,Zu=function(t,e){var n=pr.createElementNS?pr.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):pr.createElement(t);return n&&n.style?n:pr.createElement(t)},Di=function r(t,e,n){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(Qu,"-$1").toLowerCase())||i.getPropertyValue(e)||!n&&r(t,qs(e)||e,1)||""},_p="O,Moz,ms,Ms,Webkit".split(","),qs=function(t,e,n){var i=e||ns,s=i.style,o=5;if(t in s&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(_p[o]+t in s););return o<0?null:(o===3?"ms":o>=0?_p[o]:"")+t},Ju=function(){nv()&&window.document&&(pp=window,pr=pp.document,Xs=pr.documentElement,ns=Zu("div")||{style:{}},ev=Zu("div"),Re=qs(Re),In=Re+"Origin",ns.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ap=!!qs("perspective"),ju=cn.core.reverting,Ku=1)},Xu=function r(t){var e=Zu("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(Xs.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)),Xs.removeChild(e),this.style.cssText=s,o},xp=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},Dp=function(t){var e;try{e=t.getBBox()}catch{e=Xu.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Xu||(e=Xu.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+xp(t,["x","cx","x1"])||0,y:+xp(t,["y","cy","y1"])||0,width:0,height:0}:e},Cp=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&Dp(t))},is=function(t,e){if(e){var n=t.style,i;e in Vi&&e!==In&&(e=Re),n.removeProperty?(i=e.substr(0,2),(i==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),n.removeProperty(i==="--"?e:e.replace(Qu,"-$1").toLowerCase())):n.removeAttribute(e)}},mr=function(t,e,n,i,s,o){var a=new xn(t._pt,e,n,0,1,o?wp:bp);return t._pt=a,a.b=i,a.e=s,t._props.push(n),a},vp={deg:1,rad:1,turn:1},gv={grid:1,flex:1},gr=function r(t,e,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",a=ns.style,l=iv.test(e),c=t.tagName.toLowerCase()==="svg",h=(c?"client":"offset")+(l?"Width":"Height"),f=100,d=i==="px",u=i==="%",_,p,m,g;if(i===o||!s||vp[i]||vp[o])return s;if(o!=="px"&&!d&&(s=r(t,e,n,"px")),g=t.getCTM&&Cp(t),(u||o==="%")&&(Vi[e]||~e.indexOf("adius")))return _=g?t.getBBox()[l?"width":"height"]:t[h],Le(u?s/_*f:s/100*_);if(a[l?"width":"height"]=f+(d?o:i),p=~e.indexOf("adius")||i==="em"&&t.appendChild&&!c?t:t.parentNode,g&&(p=(t.ownerSVGElement||{}).parentNode),(!p||p===pr||!p.appendChild)&&(p=pr.body),m=p._gsap,m&&u&&m.width&&l&&m.time===Cn.time&&!m.uncache)return Le(s/m.width*f);if(u&&(e==="height"||e==="width")){var b=t.style[e];t.style[e]=f+i,_=t[h],b?t.style[e]=b:is(t,e)}else(u||o==="%")&&!gv[Di(p,"display")]&&(a.position=Di(t,"position")),p===t&&(a.position="static"),p.appendChild(ns),_=ns[h],p.removeChild(ns),a.position="absolute";return l&&u&&(m=hr(p),m.time=Cn.time,m.width=p[h]),Le(d?_*s/f:_&&s?f/_*s:0)},zi=function(t,e,n,i){var s;return Ku||Ju(),e in Ai&&e!=="transform"&&(e=Ai[e],~e.indexOf(",")&&(e=e.split(",")[0])),Vi[e]&&e!=="transform"?(s=sa(t,i),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:gl(Di(t,In))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=ml[e]&&ml[e](t,e,n)||Di(t,e)||Nu(t,e)||(e==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?gr(t,e,s,n)+n:s},_v=function(t,e,n,i){if(!n||n==="none"){var s=qs(e,t,1),o=s&&Di(t,s,1);o&&o!==n?(e=s,n=o):e==="borderColor"&&(n=Di(t,"borderTopColor"))}var a=new xn(this._pt,t.style,e,0,1,Hu),l=0,c=0,h,f,d,u,_,p,m,g,b,y,S,D;if(a.b=n,a.e=i,n+="",i+="",i==="auto"&&(p=t.style[e],t.style[e]=i,i=Di(t,e)||i,p?t.style[e]=p:is(t,e)),h=[n,i],Uu(h),n=h[0],i=h[1],d=n.match($r)||[],D=i.match($r)||[],D.length){for(;f=$r.exec(i);)m=f[0],b=i.substring(l,f.index),_?_=(_+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(_=1),m!==(p=d[c++]||"")&&(u=parseFloat(p)||0,S=p.substr((u+"").length),m.charAt(1)==="="&&(m=Kr(u,m)+S),g=parseFloat(m),y=m.substr((g+"").length),l=$r.lastIndex-y.length,y||(y=y||Pn.units[e]||S,l===i.length&&(i+=y,a.e+=y)),S!==y&&(u=gr(t,e,p,y)||0),a._pt={_next:a._pt,p:b||c===1?b:",",s:u,c:g-u,m:_&&_<4||e==="zIndex"?Math.round:0});a.c=l<i.length?i.substring(l,i.length):""}else a.r=e==="display"&&i==="none"?wp:bp;return Ru.test(i)&&(a.e=0),this._pt=a,a},yp={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},xv=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]=yp[n]||n,e[1]=yp[i]||i,e.join(" ")},vv=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],Vi[a]&&(l=1,a=a==="transformOrigin"?In:Re),is(n,a);l&&(is(n,Re),o&&(o.svg&&n.removeAttribute("transform"),sa(n,1),o.uncache=1,Ep(i)))}},ml={clearProps:function(t,e,n,i,s){if(s.data!=="isFromStart"){var o=t._pt=new xn(t._pt,e,n,0,0,vv);return o.u=i,o.pr=-10,o.tween=s,t._props.push(n),1}}},ra=[1,0,0,1,0,0],Rp={},Pp=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Sp=function(t){var e=Di(t,Re);return Pp(e)?ra:e.substr(7).match(Cu).map(Le)},th=function(t,e){var n=t._gsap||hr(t),i=t.style,s=Sp(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"?ra:s):(s===ra&&!t.offsetParent&&t!==Xs&&!n.svg&&(l=i.display,i.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(c=1,a=t.nextElementSibling,Xs.appendChild(t)),s=Sp(t),l?i.display=l:is(t,"display"),c&&(a?o.insertBefore(t,a):o?o.appendChild(t):Xs.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},$u=function(t,e,n,i,s,o){var a=t._gsap,l=s||th(t,!0),c=a.xOrigin||0,h=a.yOrigin||0,f=a.xOffset||0,d=a.yOffset||0,u=l[0],_=l[1],p=l[2],m=l[3],g=l[4],b=l[5],y=e.split(" "),S=parseFloat(y[0])||0,D=parseFloat(y[1])||0,T,w,P,M;n?l!==ra&&(w=u*m-_*p)&&(P=S*(m/w)+D*(-p/w)+(p*b-m*g)/w,M=S*(-_/w)+D*(u/w)-(u*b-_*g)/w,S=P,D=M):(T=Dp(t),S=T.x+(~y[0].indexOf("%")?S/100*T.width:S),D=T.y+(~(y[1]||y[0]).indexOf("%")?D/100*T.height:D)),i||i!==!1&&a.smooth?(g=S-c,b=D-h,a.xOffset=f+(g*u+b*p)-g,a.yOffset=d+(g*_+b*m)-b):a.xOffset=a.yOffset=0,a.xOrigin=S,a.yOrigin=D,a.smooth=!!i,a.origin=e,a.originIsAbsolute=!!n,t.style[In]="0px 0px",o&&(mr(o,a,"xOrigin",c,S),mr(o,a,"yOrigin",h,D),mr(o,a,"xOffset",f,a.xOffset),mr(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",S+" "+D)},sa=function(t,e){var n=t._gsap||new Ou(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=Di(t,In)||"0",h,f,d,u,_,p,m,g,b,y,S,D,T,w,P,M,v,I,N,C,V,$,W,Z,z,U,R,at,_t,Ut,X,ot;return h=f=d=p=m=g=b=y=S=0,u=_=1,n.svg=!!(t.getCTM&&Cp(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Re]=(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[Re]!=="none"?l[Re]:"")),i.scale=i.rotate=i.translate="none"),w=th(t,n.svg),n.svg&&(n.uncache?(z=t.getBBox(),c=n.xOrigin-z.x+"px "+(n.yOrigin-z.y)+"px",Z=""):Z=!e&&t.getAttribute("data-svg-origin"),$u(t,Z||c,!!Z||n.originIsAbsolute,n.smooth!==!1,w)),D=n.xOrigin||0,T=n.yOrigin||0,w!==ra&&(I=w[0],N=w[1],C=w[2],V=w[3],h=$=w[4],f=W=w[5],w.length===6?(u=Math.sqrt(I*I+N*N),_=Math.sqrt(V*V+C*C),p=I||N?Ws(N,I)*es:0,b=C||V?Ws(C,V)*es+p:0,b&&(_*=Math.abs(Math.cos(b*Ys))),n.svg&&(h-=D-(D*I+T*C),f-=T-(D*N+T*V))):(ot=w[6],Ut=w[7],R=w[8],at=w[9],_t=w[10],X=w[11],h=w[12],f=w[13],d=w[14],P=Ws(ot,_t),m=P*es,P&&(M=Math.cos(-P),v=Math.sin(-P),Z=$*M+R*v,z=W*M+at*v,U=ot*M+_t*v,R=$*-v+R*M,at=W*-v+at*M,_t=ot*-v+_t*M,X=Ut*-v+X*M,$=Z,W=z,ot=U),P=Ws(-C,_t),g=P*es,P&&(M=Math.cos(-P),v=Math.sin(-P),Z=I*M-R*v,z=N*M-at*v,U=C*M-_t*v,X=V*v+X*M,I=Z,N=z,C=U),P=Ws(N,I),p=P*es,P&&(M=Math.cos(P),v=Math.sin(P),Z=I*M+N*v,z=$*M+W*v,N=N*M-I*v,W=W*M-$*v,I=Z,$=z),m&&Math.abs(m)+Math.abs(p)>359.9&&(m=p=0,g=180-g),u=Le(Math.sqrt(I*I+N*N+C*C)),_=Le(Math.sqrt(W*W+ot*ot)),P=Ws($,W),b=Math.abs(P)>2e-4?P*es:0,S=X?1/(X<0?-X:X):0),n.svg&&(Z=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Pp(Di(t,Re)),Z&&t.setAttribute("transform",Z))),Math.abs(b)>90&&Math.abs(b)<270&&(s?(u*=-1,b+=p<=0?180:-180,p+=p<=0?180:-180):(_*=-1,b+=b<=0?180:-180)),e=e||n.uncache,n.x=h-((n.xPercent=h&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-h)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+o,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)+o,n.z=d+o,n.scaleX=Le(u),n.scaleY=Le(_),n.rotation=Le(p)+a,n.rotationX=Le(m)+a,n.rotationY=Le(g)+a,n.skewX=b+a,n.skewY=y+a,n.transformPerspective=S+o,(n.zOrigin=parseFloat(c.split(" ")[2])||!e&&n.zOrigin||0)&&(i[In]=gl(c)),n.xOffset=n.yOffset=0,n.force3D=Pn.force3D,n.renderTransform=n.svg?Sv:Ap?Ip:yv,n.uncache=0,n},gl=function(t){return(t=t.split(" "))[0]+" "+t[1]},Yu=function(t,e,n){var i=en(e);return Le(parseFloat(e)+parseFloat(gr(t,"x",n+"px",i)))+i},yv=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Ip(t,e)},Qr="0deg",ia="0px",ts=") ",Ip=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,h=n.rotationY,f=n.rotationX,d=n.skewX,u=n.skewY,_=n.scaleX,p=n.scaleY,m=n.transformPerspective,g=n.force3D,b=n.target,y=n.zOrigin,S="",D=g==="auto"&&t&&t!==1||g===!0;if(y&&(f!==Qr||h!==Qr)){var T=parseFloat(h)*Ys,w=Math.sin(T),P=Math.cos(T),M;T=parseFloat(f)*Ys,M=Math.cos(T),o=Yu(b,o,w*M*-y),a=Yu(b,a,-Math.sin(T)*-y),l=Yu(b,l,P*M*-y+y)}m!==ia&&(S+="perspective("+m+ts),(i||s)&&(S+="translate("+i+"%, "+s+"%) "),(D||o!==ia||a!==ia||l!==ia)&&(S+=l!==ia||D?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+ts),c!==Qr&&(S+="rotate("+c+ts),h!==Qr&&(S+="rotateY("+h+ts),f!==Qr&&(S+="rotateX("+f+ts),(d!==Qr||u!==Qr)&&(S+="skew("+d+", "+u+ts),(_!==1||p!==1)&&(S+="scale("+_+", "+p+ts),b.style[Re]=S||"translate(0, 0)"},Sv=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,h=n.skewY,f=n.scaleX,d=n.scaleY,u=n.target,_=n.xOrigin,p=n.yOrigin,m=n.xOffset,g=n.yOffset,b=n.forceCSS,y=parseFloat(o),S=parseFloat(a),D,T,w,P,M;l=parseFloat(l),c=parseFloat(c),h=parseFloat(h),h&&(h=parseFloat(h),c+=h,l+=h),l||c?(l*=Ys,c*=Ys,D=Math.cos(l)*f,T=Math.sin(l)*f,w=Math.sin(l-c)*-d,P=Math.cos(l-c)*d,c&&(h*=Ys,M=Math.tan(c-h),M=Math.sqrt(1+M*M),w*=M,P*=M,h&&(M=Math.tan(h),M=Math.sqrt(1+M*M),D*=M,T*=M)),D=Le(D),T=Le(T),w=Le(w),P=Le(P)):(D=f,P=d,T=w=0),(y&&!~(o+"").indexOf("px")||S&&!~(a+"").indexOf("px"))&&(y=gr(u,"x",o,"px"),S=gr(u,"y",a,"px")),(_||p||m||g)&&(y=Le(y+_-(_*D+p*w)+m),S=Le(S+p-(_*T+p*P)+g)),(i||s)&&(M=u.getBBox(),y=Le(y+i/100*M.width),S=Le(S+s/100*M.height)),M="matrix("+D+","+T+","+w+","+P+","+y+","+S+")",u.setAttribute("transform",M),b&&(u.style[Re]=M)},Mv=function(t,e,n,i,s){var o=360,a=Ge(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?es:1),c=l-i,h=i+c+"deg",f,d;return a&&(f=s.split("_")[1],f==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-o)),f==="cw"&&c<0?c=(c+o*gp)%o-~~(c/o)*o:f==="ccw"&&c>0&&(c=(c-o*gp)%o-~~(c/o)*o)),t._pt=d=new xn(t._pt,e,n,i,c,sv),d.e=h,d.u="deg",t._props.push(n),d},Mp=function(t,e){for(var n in e)t[n]=e[n];return t},bv=function(t,e,n){var i=Mp({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=n.style,a,l,c,h,f,d,u,_;i.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),o[Re]=e,a=sa(n,1),is(n,Re),n.setAttribute("transform",c)):(c=getComputedStyle(n)[Re],o[Re]=e,a=sa(n,1),o[Re]=c);for(l in Vi)c=i[l],h=a[l],c!==h&&s.indexOf(l)<0&&(u=en(c),_=en(h),f=u!==_?gr(n,l,c,_):parseFloat(c),d=parseFloat(h),t._pt=new xn(t._pt,a,l,f,d-f,qu),t._pt.u=_||0,t._props.push(l));Mp(a,i)};_n("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});ml[t>1?"border"+r:r]=function(a,l,c,h,f){var d,u;if(arguments.length<4)return d=o.map(function(_){return zi(a,_,c)}),u=d.join(" "),u.split(d[0]).length===5?d[0]:u;d=(h+"").split(" "),u={},o.forEach(function(_,p){return u[_]=d[p]=d[p]||d[(p-1)/2|0]}),a.init(l,u,f)}});var eh={name:"css",register:Ju,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,h,f,d,u,_,p,m,g,b,y,S,D,T,w,P;Ku||Ju(),this.styles=this.styles||Tp(t),P=this.styles.props,this.tween=n;for(p in e)if(p!=="autoRound"&&(h=e[p],!(Dn[p]&&ku(p,e,n,i,t,s)))){if(u=typeof h,_=ml[p],u==="function"&&(h=h.call(n,i,t,s),u=typeof h),u==="string"&&~h.indexOf("random(")&&(h=Gs(h)),_)_(this,t,p,h,n)&&(w=1);else if(p.substr(0,2)==="--")c=(getComputedStyle(t).getPropertyValue(p)+"").trim(),h+="",Bi.lastIndex=0,Bi.test(c)||(m=en(c),g=en(h)),g?m!==g&&(c=gr(t,p,c,g)+g):m&&(h+=m),this.add(a,"setProperty",c,h,i,s,0,0,p),o.push(p),P.push(p,0,a[p]);else if(u!=="undefined"){if(l&&p in l?(c=typeof l[p]=="function"?l[p].call(n,i,t,s):l[p],Ge(c)&&~c.indexOf("random(")&&(c=Gs(c)),en(c+"")||c==="auto"||(c+=Pn.units[p]||en(zi(t,p))||""),(c+"").charAt(1)==="="&&(c=zi(t,p))):c=zi(t,p),d=parseFloat(c),b=u==="string"&&h.charAt(1)==="="&&h.substr(0,2),b&&(h=h.substr(2)),f=parseFloat(h),p in Ai&&(p==="autoAlpha"&&(d===1&&zi(t,"visibility")==="hidden"&&f&&(d=0),P.push("visibility",0,a.visibility),mr(this,a,"visibility",d?"inherit":"hidden",f?"inherit":"hidden",!f)),p!=="scale"&&p!=="transform"&&(p=Ai[p],~p.indexOf(",")&&(p=p.split(",")[0]))),y=p in Vi,y){if(this.styles.save(p),S||(D=t._gsap,D.renderTransform&&!e.parseTransform||sa(t,e.parseTransform),T=e.smoothOrigin!==!1&&D.smooth,S=this._pt=new xn(this._pt,a,Re,0,1,D.renderTransform,D,0,-1),S.dep=1),p==="scale")this._pt=new xn(this._pt,D,"scaleY",D.scaleY,(b?Kr(D.scaleY,b+f):f)-D.scaleY||0,qu),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){P.push(In,0,a[In]),h=xv(h),D.svg?$u(t,h,0,T,0,this):(g=parseFloat(h.split(" ")[2])||0,g!==D.zOrigin&&mr(this,D,"zOrigin",D.zOrigin,g),mr(this,a,p,gl(c),gl(h)));continue}else if(p==="svgOrigin"){$u(t,h,1,T,0,this);continue}else if(p in Rp){Mv(this,D,p,d,b?Kr(d,b+h):h);continue}else if(p==="smoothOrigin"){mr(this,D,"smooth",D.smooth,h);continue}else if(p==="force3D"){D[p]=h;continue}else if(p==="transform"){bv(this,h,t);continue}}else p in a||(p=qs(p)||p);if(y||(f||f===0)&&(d||d===0)&&!rv.test(h)&&p in a)m=(c+"").substr((d+"").length),f||(f=0),g=en(h)||(p in Pn.units?Pn.units[p]:m),m!==g&&(d=gr(t,p,c,g)),this._pt=new xn(this._pt,y?D:a,p,d,(b?Kr(d,b+f):f)-d,!y&&(g==="px"||p==="zIndex")&&e.autoRound!==!1?av:qu),this._pt.u=g||0,m!==g&&g!=="%"&&(this._pt.b=c,this._pt.r=ov);else if(p in a)_v.call(this,t,p,c,b?b+h:h);else if(p in t)this.add(t,p,c||t[p],b?b+h:h,i,s);else if(p!=="parseTransform"){ul(p,h);continue}y||(p in a?P.push(p,0,a[p]):P.push(p,1,c||t[p])),o.push(p)}}w&&Wu(this)},render:function(t,e){if(e.tween._time||!ju())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:zi,aliases:Ai,getSetter:function(t,e,n){var i=Ai[e];return i&&i.indexOf(",")<0&&(e=i),e in Vi&&e!==In&&(t._gsap.x||zi(t,"x"))?n&&mp===n?e==="scale"?hv:uv:(mp=n||{})&&(e==="scale"?fv:dv):t.style&&!cl(t.style[e])?lv:~e.indexOf("-")?cv:pl(t,e)},core:{_removeProperty:is,_getMatrix:th}};cn.utils.checkPrefix=qs;cn.core.getStyleSaver=Tp;(function(r,t,e,n){var i=_n(r+","+t+","+e,function(s){Vi[s]=1});_n(t,function(s){Pn.units[s]="deg",Rp[s]=1}),Ai[i[13]]=r+","+t,_n(n,function(s){var o=s.split(":");Ai[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");_n("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Pn.units[r]="px"});cn.registerPlugin(eh);var ue=cn.registerPlugin(eh)||cn,xT=ue.core.Tween;function Lp(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 wv(r,t,e){return t&&Lp(r.prototype,t),e&&Lp(r,e),r}var ve,_l,nn,ss,Zs,ai,Ev,rs,Fp,ie,Ci,xl,Np,Up,Op,Bp,kp=function(){return typeof window<"u"},zp=function(){return ve||kp()&&(ve=window.gsap)&&ve.registerPlugin&&ve};var Tv=function(t){return Math.round(t*1e5)/1e5||0},_r=function(t){return ie.maxScroll(t||nn)},Av=function(t,e){var n=t.parentNode||Zs,i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),o=s.top-i.top,a=s.bottom-i.bottom,l=(Math.abs(o)>Math.abs(a)?o:a)/(1-e),c=-l*e,h,f;return l>0&&(h=s.height/(nn.innerHeight+s.height),f=h===.5?s.height*2:Math.min(s.height,Math.abs(-l*h/(2*h-1)))*2*(e||1),c+=e?-f*e:-f/2,l+=f),{change:l,offset:c}},Dv=function(t){var e=ss.querySelector(".ScrollSmoother-wrapper");return e||(e=ss.createElement("div"),e.classList.add("ScrollSmoother-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t)),e},li=function(){function r(t){var e=this;_l||r.register(ve)||console.warn("Please gsap.registerPlugin(ScrollSmoother)"),t=this.vars=t||{},Ci&&Ci.kill(),Ci=this,Op(this);var n=t,i=n.smoothTouch,s=n.onUpdate,o=n.onStop,a=n.smooth,l=n.onFocusIn,c=n.normalizeScroll,h=n.wholePixels,f,d,u,_,p,m,g,b,y,S,D,T,w,P,M=this,v=t.effectsPrefix||"",I=ie.getScrollFunc(nn),N=ie.isTouch===1?i===!0?.8:parseFloat(i)||0:a===0||a===!1?0:parseFloat(a)||.8,C=N&&+t.speed||1,V=0,$=0,W=1,Z=Np(0),z=function(){return Z.update(-V)},U={y:0},R=function(){return f.style.overflow="visible"},at,_t=function(x){x.update();var F=x.getTween();F&&(F.pause(),F._time=F._dur,F._tTime=F._tDur),at=!1,x.animation.progress(x.progress,!0)},Ut=function(x,F){(x!==V&&!S||F)&&(h&&(x=Math.round(x)),N&&(f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+x+", 0, 1)",f._gsap.y=x+"px"),$=x-V,V=x,ie.isUpdating||r.isRefreshing||ie.update())},X=function(x){return arguments.length?(x<0&&(x=0),U.y=-x,at=!0,S?V=-x:Ut(-x),ie.isRefreshing?_.update():I(x/C),this):-V},ot=typeof ResizeObserver<"u"&&t.autoResize!==!1&&new ResizeObserver(function(){if(!ie.isRefreshing){var A=_r(d)*C;A<-V&&X(A),Bp.restart(!0)}}),xt,ct=function(x){d.scrollTop=0,!(x.target.contains&&x.target.contains(d)||l&&l(e,x)===!1)&&(ie.isInViewport(x.target)||x.target===xt||e.scrollTo(x.target,!1,"center center"),xt=x.target)},Rt=function(x,F){if(x<F.start)return x;var Y=isNaN(F.ratio)?1:F.ratio,tt=F.end-F.start,it=x-F.start,yt=F.offset||0,pt=F.pins||[],lt=pt.offset||0,Lt=F._startClamp&&F.start<=0||F.pins&&F.pins.offset?0:F._endClamp&&F.end===_r()?1:.5;return pt.forEach(function(ht){tt-=ht.distance,ht.nativeStart<=x&&(it-=ht.distance)}),lt&&(it*=(tt-lt/Y)/tt),x+(it-yt*Lt)/Y-it},kt=function A(x,F,Y){Y||(x.pins.length=x.pins.offset=0);var tt=x.pins,it=x.markers,yt,pt,lt,Lt,ht,vt,Yt,ut;for(Yt=0;Yt<F.length;Yt++)if(ut=F[Yt],x.trigger&&ut.trigger&&x!==ut&&(ut.trigger===x.trigger||ut.pinnedContainer===x.trigger||x.trigger.contains(ut.trigger))&&(ht=ut._startNative||ut._startClamp||ut.start,vt=ut._endNative||ut._endClamp||ut.end,lt=Rt(ht,x),Lt=ut.pin&&vt>0?lt+(vt-ht):Rt(vt,x),ut.setPositions(lt,Lt,!0,(ut._startClamp?Math.max(0,lt):lt)-ht),ut.markerStart&&it.push(ve.quickSetter([ut.markerStart,ut.markerEnd],"y","px")),ut.pin&&ut.end>0&&!Y)){if(yt=ut.end-ut.start,pt=x._startClamp&&ut.start<0,pt){if(x.start>0){x.setPositions(0,x.end+(x._startNative-x.start),!0),A(x,F);return}yt+=ut.start,tt.offset=-ut.start}tt.push({start:ut.start,nativeStart:ht,end:ut.end,distance:yt,trig:ut}),x.setPositions(x.start,x.end+(pt?-ut.start:yt),!0)}},q=function(x,F){p.forEach(function(Y){return kt(Y,x,F)})},Jt=function(){R(),requestAnimationFrame(R),p&&(ie.getAll().forEach(function(x){x._startNative=x.start,x._endNative=x.end}),p.forEach(function(x){var F=x._startClamp||x.start,Y=x.autoSpeed?Math.min(_r(),x.end):F+Math.abs((x.end-F)/x.ratio),tt=Y-x.end;if(F-=tt/2,Y-=tt/2,F>Y){var it=F;F=Y,Y=it}x._startClamp&&F<0?(Y=x.ratio<0?_r():x.end/x.ratio,tt=Y-x.end,F=0):(x.ratio<0||x._endClamp&&Y>=_r())&&(Y=_r(),F=x.ratio<0||x.ratio>1?0:Y-(Y-x.start)/x.ratio,tt=(Y-F)*x.ratio-(x.end-x.start)),x.offset=tt||1e-4,x.pins.length=x.pins.offset=0,x.setPositions(F,Y,!0)}),q(ie.sort())),Z.reset()},It=function(){return ie.addEventListener("refresh",Jt)},Ft=function(){return p&&p.forEach(function(x){return x.vars.onRefresh(x)})},bt=function(){return p&&p.forEach(function(x){return x.vars.onRefreshInit(x)}),Ft},Et=function(x,F,Y,tt){return function(){var it=typeof F=="function"?F(Y,tt):F;it||it===0||(it=tt.getAttribute("data-"+v+x)||(x==="speed"?1:0)),tt.setAttribute("data-"+v+x,it);var yt=(it+"").substr(0,6)==="clamp(";return{clamp:yt,value:yt?it.substr(6,it.length-7):it}}},Ht=function(x,F,Y,tt,it){it=(typeof it=="function"?it(tt,x):it)||0;var yt=Et("speed",F,tt,x),pt=Et("lag",Y,tt,x),lt=ve.getProperty(x,"y"),Lt=x._gsap,ht,vt,Yt,ut,Tt,Wt,qt=[],ce=function(){F=yt(),Y=parseFloat(pt().value),ht=parseFloat(F.value)||1,Yt=F.value==="auto",Tt=Yt||vt&&vt._startClamp&&vt.start<=0||qt.offset?0:vt&&vt._endClamp&&vt.end===_r()?1:.5,ut&&ut.kill(),ut=Y&&ve.to(x,{ease:xl,overwrite:!1,y:"+=0",duration:Y}),vt&&(vt.ratio=ht,vt.autoSpeed=Yt)},Zt=function(){Lt.y=lt+"px",Lt.renderTransform(1),ce()},k=[],Q=0,st=function(gt){if(Yt){Zt();var Bt=Av(x,Fp(0,1,-gt.start/(gt.end-gt.start)));Q=Bt.change,Wt=Bt.offset}else Wt=qt.offset||0,Q=(gt.end-gt.start-Wt)*(1-ht);qt.forEach(function(ee){return Q-=ee.distance*(1-ht)}),gt.offset=Q||.001,gt.vars.onUpdate(gt),ut&&ut.progress(1)};return ce(),(ht!==1||Yt||ut)&&(vt=ie.create({trigger:Yt?x.parentNode:x,start:function(){return F.clamp?"clamp(top bottom+="+it+")":"top bottom+="+it},end:function(){return F.value<0?"max":F.clamp?"clamp(bottom top-="+it+")":"bottom top-="+it},scroller:d,scrub:!0,refreshPriority:-999,onRefreshInit:Zt,onRefresh:st,onKill:function(gt){var Bt=p.indexOf(gt);Bt>=0&&p.splice(Bt,1),Zt()},onUpdate:function(gt){var Bt=lt+Q*(gt.progress-Tt),ee=qt.length,Mt=0,L,rt,O;if(gt.offset){if(ee){for(rt=-V,O=gt.end;ee--;){if(L=qt[ee],L.trig.isActive||rt>=L.start&&rt<=L.end){ut&&(L.trig.progress+=L.trig.direction<0?.001:-.001,L.trig.update(0,0,1),ut.resetTo("y",parseFloat(Lt.y),-$,!0),W&&ut.progress(1));return}rt>L.end&&(Mt+=L.distance),O-=L.distance}Bt=lt+Mt+Q*((ve.utils.clamp(gt.start,gt.end,rt)-gt.start-Mt)/(O-gt.start)-Tt)}k.length&&!Yt&&k.forEach(function(j){return j(Bt-Mt)}),Bt=Tv(Bt+Wt),ut?(ut.resetTo("y",Bt,-$,!0),W&&ut.progress(1)):(Lt.y=Bt+"px",Lt.renderTransform(1))}}}),st(vt),ve.core.getCache(vt.trigger).stRevert=bt,vt.startY=lt,vt.pins=qt,vt.markers=k,vt.ratio=ht,vt.autoSpeed=Yt,x.style.willChange="transform"),vt};It(),ie.addEventListener("killAll",It),ve.delayedCall(.5,function(){return W=0}),this.scrollTop=X,this.scrollTo=function(A,x,F){var Y=ve.utils.clamp(0,_r(),isNaN(A)?e.offset(A,F,!!x&&!S):+A);x?S?ve.to(e,{duration:N,scrollTop:Y,overwrite:"auto",ease:xl}):I(Y):X(Y)},this.offset=function(A,x,F){A=rs(A)[0];var Y=A.style.cssText,tt=ie.create({trigger:A,start:x||"top top"}),it;return p&&(W?ie.refresh():q([tt],!0)),it=tt.start/(F?C:1),tt.kill(!1),A.style.cssText=Y,ve.core.getCache(A).uncache=1,it};function G(){return u=f.clientHeight,f.style.overflow="visible",ai.style.height=nn.innerHeight+(u-nn.innerHeight)/C+"px",u-nn.innerHeight}this.content=function(A){if(arguments.length){var x=rs(A||"#smooth-content")[0]||console.warn("ScrollSmoother needs a valid content element.")||ai.children[0];return x!==f&&(f=x,y=f.getAttribute("style")||"",ot&&ot.observe(f),ve.set(f,{overflow:"visible",width:"100%",boxSizing:"border-box",y:"+=0"}),N||ve.set(f,{clearProps:"transform"})),this}return f},this.wrapper=function(A){return arguments.length?(d=rs(A||"#smooth-wrapper")[0]||Dv(f),b=d.getAttribute("style")||"",G(),ve.set(d,N?{overflow:"hidden",position:"fixed",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0}:{overflow:"visible",position:"relative",width:"100%",height:"auto",top:"auto",bottom:"auto",left:"auto",right:"auto"}),this):d},this.effects=function(A,x){var F;if(p||(p=[]),!A)return p.slice(0);A=rs(A),A.forEach(function(ht){for(var vt=p.length;vt--;)p[vt].trigger===ht&&p[vt].kill()}),x=x||{};var Y=x,tt=Y.speed,it=Y.lag,yt=Y.effectsPadding,pt=[],lt,Lt;for(lt=0;lt<A.length;lt++)Lt=Ht(A[lt],tt,it,lt,yt),Lt&&pt.push(Lt);return(F=p).push.apply(F,pt),x.refresh!==!1&&ie.refresh(),pt},this.sections=function(A,x){var F;if(m||(m=[]),!A)return m.slice(0);var Y=rs(A).map(function(tt){return ie.create({trigger:tt,start:"top 120%",end:"bottom -20%",onToggle:function(yt){tt.style.opacity=yt.isActive?"1":"0",tt.style.pointerEvents=yt.isActive?"all":"none"}})});return x&&x.add?(F=m).push.apply(F,Y):m=Y.slice(0),Y},this.content(t.content),this.wrapper(t.wrapper),this.render=function(A){return Ut(A||A===0?A:V)},this.getVelocity=function(){return Z.getVelocity(-V)},ie.scrollerProxy(d,{scrollTop:X,scrollHeight:function(){return G()&&ai.scrollHeight},fixedMarkers:t.fixedMarkers!==!1&&!!N,content:f,getBoundingClientRect:function(){return{top:0,left:0,width:nn.innerWidth,height:nn.innerHeight}}}),ie.defaults({scroller:d});var $t=ie.getAll().filter(function(A){return A.scroller===nn||A.scroller===d});$t.forEach(function(A){return A.revert(!0,!0)}),_=ie.create({animation:ve.fromTo(U,{y:function(){return P=0,0}},{y:function(){return P=1,-G()},immediateRender:!1,ease:"none",data:"ScrollSmoother",duration:100,onUpdate:function(){if(P){var x=at;x&&(_t(_),U.y=V),Ut(U.y,x),z(),s&&!S&&s(M)}}}),onRefreshInit:function(x){if(!r.isRefreshing){if(r.isRefreshing=!0,p){var F=ie.getAll().filter(function(tt){return!!tt.pin});p.forEach(function(tt){tt.vars.pinnedContainer||F.forEach(function(it){if(it.pin.contains(tt.trigger)){var yt=tt.vars;yt.pinnedContainer=it.pin,tt.vars=null,tt.init(yt,tt.animation)}})})}var Y=x.getTween();w=Y&&Y._end>Y._dp._time,T=V,U.y=0,N&&(ie.isTouch===1&&(d.style.position="absolute"),d.scrollTop=0,ie.isTouch===1&&(d.style.position="fixed"))}},onRefresh:function(x){x.animation.invalidate(),x.setPositions(x.start,G()/C),w||_t(x),U.y=-I()*C,Ut(U.y),W||(w&&(at=!1),x.animation.progress(ve.utils.clamp(0,1,T/C/-x.end))),w&&(x.progress-=.001,x.update()),r.isRefreshing=!1},id:"ScrollSmoother",scroller:nn,invalidateOnRefresh:!0,start:0,refreshPriority:-9999,end:function(){return G()/C},onScrubComplete:function(){Z.reset(),o&&o(e)},scrub:N||!0}),this.smooth=function(A){return arguments.length&&(N=A||0,C=N&&+t.speed||1,_.scrubDuration(A)),_.getTween()?_.getTween().duration():0},_.getTween()&&(_.getTween().vars.ease=t.ease||xl),this.scrollTrigger=_,t.effects&&this.effects(t.effects===!0?"[data-"+v+"speed], [data-"+v+"lag]":t.effects,{effectsPadding:t.effectsPadding,refresh:!1}),t.sections&&this.sections(t.sections===!0?"[data-section]":t.sections),$t.forEach(function(A){A.vars.scroller=d,A.revert(!1,!0),A.init(A.vars,A.animation)}),this.paused=function(A,x){return arguments.length?(!!S!==A&&(A?(_.getTween()&&_.getTween().pause(),I(-V/C),Z.reset(),D=ie.normalizeScroll(),D&&D.disable(),S=ie.observe({preventDefault:!0,type:"wheel,touch,scroll",debounce:!1,allowClicks:!0,onChangeY:function(){return X(-V)}}),S.nested=Up(Zs,"wheel,touch,scroll",!0,x!==!1)):(S.nested.kill(),S.kill(),S=0,D&&D.enable(),_.progress=(-V/C-_.start)/(_.end-_.start),_t(_))),this):!!S},this.kill=this.revert=function(){e.paused(!1),_t(_),_.kill();for(var A=(p||[]).concat(m||[]),x=A.length;x--;)A[x].kill();ie.scrollerProxy(d),ie.removeEventListener("killAll",It),ie.removeEventListener("refresh",Jt),d.style.cssText=b,f.style.cssText=y;var F=ie.defaults({});F&&F.scroller===d&&ie.defaults({scroller:nn}),e.normalizer&&ie.normalizeScroll(!1),clearInterval(g),Ci=null,ot&&ot.disconnect(),ai.style.removeProperty("height"),nn.removeEventListener("focusin",ct)},this.refresh=function(A,x){return _.refresh(A,x)},c&&(this.normalizer=ie.normalizeScroll(c===!0?{debounce:!0,content:!N&&f}:c)),ie.config(t),"overscrollBehavior"in nn.getComputedStyle(ai)&&ve.set([ai,Zs],{overscrollBehavior:"none"}),"scrollBehavior"in nn.getComputedStyle(ai)&&ve.set([ai,Zs],{scrollBehavior:"auto"}),nn.addEventListener("focusin",ct),g=setInterval(z,250),ss.readyState==="loading"||requestAnimationFrame(function(){return ie.refresh()})}return r.register=function(e){return _l||(ve=e||zp(),kp()&&window.document&&(nn=window,ss=document,Zs=ss.documentElement,ai=ss.body),ve&&(rs=ve.utils.toArray,Fp=ve.utils.clamp,xl=ve.parseEase("expo"),Op=ve.core.context||function(){},ie=ve.core.globals().ScrollTrigger,ve.core.globals("ScrollSmoother",r),ai&&ie&&(Bp=ve.delayedCall(.2,function(){return ie.isRefreshing||Ci&&Ci.refresh()}).pause(),Ev=[nn,ss,Zs,ai],Np=ie.core._getVelocityProp,Up=ie.core._inputObserver,r.refresh=ie.refresh,_l=1))),_l},wv(r,[{key:"progress",get:function(){return this.scrollTrigger?this.scrollTrigger.animation._time/100:0}}]),r}();li.version="3.12.5";li.create=function(r){return Ci&&r&&Ci.content()===rs(r.content)[0]?Ci:new li(r)};li.get=function(){return Ci};zp()&&ve.registerPlugin(li);function Vp(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 Cv(r,t,e){return t&&Vp(r.prototype,t),e&&Vp(r,e),r}var rn,Sl,Rv,Bn,xr,vr,$s,Gp,os,aa,Wp,Hi,ci,Xp,Yp=function(){return rn||typeof window<"u"&&(rn=window.gsap)&&rn.registerPlugin&&rn},qp=1,Js=[],ae=[],ui=[],la=Date.now,nh=function(t,e){return e},Pv=function(){var t=aa.core,e=t.bridge||{},n=t._scrollers,i=t._proxies;n.push.apply(n,ae),i.push.apply(i,ui),ae=n,ui=i,nh=function(o,a){return e[o](a)}},Wi=function(t,e){return~ui.indexOf(t)&&ui[ui.indexOf(t)+1][e]},ca=function(t){return!!~Wp.indexOf(t)},yn=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:i!==!1,capture:!!s})},vn=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},vl="scrollLeft",yl="scrollTop",ih=function(){return Hi&&Hi.isPressed||ae.cache++},Ml=function(t,e){var n=function i(s){if(s||s===0){qp&&(Bn.history.scrollRestoration="manual");var o=Hi&&Hi.isPressed;s=i.v=Math.round(s)||(Hi&&Hi.iOS?1:0),t(s),i.cacheID=ae.cache,o&&nh("ss",s)}else(e||ae.cache!==i.cacheID||nh("ref"))&&(i.cacheID=ae.cache,i.v=t());return i.v+i.offset};return n.offset=0,t&&n},un={s:vl,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:Ml(function(r){return arguments.length?Bn.scrollTo(r,ke.sc()):Bn.pageXOffset||xr[vl]||vr[vl]||$s[vl]||0})},ke={s:yl,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:un,sc:Ml(function(r){return arguments.length?Bn.scrollTo(un.sc(),r):Bn.pageYOffset||xr[yl]||vr[yl]||$s[yl]||0})},Sn=function(t,e){return(e&&e._ctx&&e._ctx.selector||rn.utils.toArray)(t)[0]||(typeof t=="string"&&rn.config().nullTargetWarn!==!1?console.warn("Element not found:",t):null)},Gi=function(t,e){var n=e.s,i=e.sc;ca(t)&&(t=xr.scrollingElement||vr);var s=ae.indexOf(t),o=i===ke.sc?1:2;!~s&&(s=ae.push(t)-1),ae[s+o]||yn(t,"scroll",ih);var a=ae[s+o],l=a||(ae[s+o]=Ml(Wi(t,n),!0)||(ca(t)?i:Ml(function(c){return arguments.length?t[n]=c:t[n]})));return l.target=t,a||(l.smooth=rn.getProperty(t,"scrollBehavior")==="smooth"),l},bl=function(t,e,n){var i=t,s=t,o=la(),a=o,l=e||50,c=Math.max(500,l*3),h=function(_,p){var m=la();p||m-o>l?(s=i,i=_,a=o,o=m):n?i+=_:i=s+(_-s)/(m-a)*(o-a)},f=function(){s=i=n?0:i,a=o=0},d=function(_){var p=a,m=s,g=la();return(_||_===0)&&_!==i&&h(_),o===a||g-a>c?0:(i+(n?m:-m))/((n?g:o)-p)*1e3};return{update:h,reset:f,getVelocity:d}},oa=function(t,e){return e&&!t._gsapAllow&&t.preventDefault(),t.changedTouches?t.changedTouches[0]:t},Hp=function(t){var e=Math.max.apply(Math,t),n=Math.min.apply(Math,t);return Math.abs(e)>=Math.abs(n)?e:n},Zp=function(){aa=rn.core.globals().ScrollTrigger,aa&&aa.core&&Pv()},Jp=function(t){return rn=t||Yp(),!Sl&&rn&&typeof document<"u"&&document.body&&(Bn=window,xr=document,vr=xr.documentElement,$s=xr.body,Wp=[Bn,xr,vr,$s],Rv=rn.utils.clamp,Xp=rn.core.context||function(){},os="onpointerenter"in $s?"pointer":"mouse",Gp=Fe.isTouch=Bn.matchMedia&&Bn.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in Bn||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,ci=Fe.eventTypes=("ontouchstart"in vr?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in vr?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return qp=0},500),Zp(),Sl=1),Sl};un.op=ke;ae.cache=0;var Fe=function(){function r(e){this.init(e)}var t=r.prototype;return t.init=function(n){Sl||Jp(rn)||console.warn("Please gsap.registerPlugin(Observer)"),aa||Zp();var i=n.tolerance,s=n.dragMinimum,o=n.type,a=n.target,l=n.lineHeight,c=n.debounce,h=n.preventDefault,f=n.onStop,d=n.onStopDelay,u=n.ignore,_=n.wheelSpeed,p=n.event,m=n.onDragStart,g=n.onDragEnd,b=n.onDrag,y=n.onPress,S=n.onRelease,D=n.onRight,T=n.onLeft,w=n.onUp,P=n.onDown,M=n.onChangeX,v=n.onChangeY,I=n.onChange,N=n.onToggleX,C=n.onToggleY,V=n.onHover,$=n.onHoverEnd,W=n.onMove,Z=n.ignoreCheck,z=n.isNormalizer,U=n.onGestureStart,R=n.onGestureEnd,at=n.onWheel,_t=n.onEnable,Ut=n.onDisable,X=n.onClick,ot=n.scrollSpeed,xt=n.capture,ct=n.allowClicks,Rt=n.lockAxis,kt=n.onLockAxis;this.target=a=Sn(a)||vr,this.vars=n,u&&(u=rn.utils.toArray(u)),i=i||1e-9,s=s||0,_=_||1,ot=ot||1,o=o||"wheel,touch,pointer",c=c!==!1,l||(l=parseFloat(Bn.getComputedStyle($s).lineHeight)||22);var q,Jt,It,Ft,bt,Et,Ht,G=this,$t=0,A=0,x=n.passive||!h,F=Gi(a,un),Y=Gi(a,ke),tt=F(),it=Y(),yt=~o.indexOf("touch")&&!~o.indexOf("pointer")&&ci[0]==="pointerdown",pt=ca(a),lt=a.ownerDocument||xr,Lt=[0,0,0],ht=[0,0,0],vt=0,Yt=function(){return vt=la()},ut=function(j,dt){return(G.event=j)&&u&&~u.indexOf(j.target)||dt&&yt&&j.pointerType!=="touch"||Z&&Z(j,dt)},Tt=function(){G._vx.reset(),G._vy.reset(),Jt.pause(),f&&f(G)},Wt=function(){var j=G.deltaX=Hp(Lt),dt=G.deltaY=Hp(ht),et=Math.abs(j)>=i,wt=Math.abs(dt)>=i;I&&(et||wt)&&I(G,j,dt,Lt,ht),et&&(D&&G.deltaX>0&&D(G),T&&G.deltaX<0&&T(G),M&&M(G),N&&G.deltaX<0!=$t<0&&N(G),$t=G.deltaX,Lt[0]=Lt[1]=Lt[2]=0),wt&&(P&&G.deltaY>0&&P(G),w&&G.deltaY<0&&w(G),v&&v(G),C&&G.deltaY<0!=A<0&&C(G),A=G.deltaY,ht[0]=ht[1]=ht[2]=0),(Ft||It)&&(W&&W(G),It&&(b(G),It=!1),Ft=!1),Et&&!(Et=!1)&&kt&&kt(G),bt&&(at(G),bt=!1),q=0},qt=function(j,dt,et){Lt[et]+=j,ht[et]+=dt,G._vx.update(j),G._vy.update(dt),c?q||(q=requestAnimationFrame(Wt)):Wt()},ce=function(j,dt){Rt&&!Ht&&(G.axis=Ht=Math.abs(j)>Math.abs(dt)?"x":"y",Et=!0),Ht!=="y"&&(Lt[2]+=j,G._vx.update(j,!0)),Ht!=="x"&&(ht[2]+=dt,G._vy.update(dt,!0)),c?q||(q=requestAnimationFrame(Wt)):Wt()},Zt=function(j){if(!ut(j,1)){j=oa(j,h);var dt=j.clientX,et=j.clientY,wt=dt-G.x,ft=et-G.y,Dt=G.isDragging;G.x=dt,G.y=et,(Dt||Math.abs(G.startX-dt)>=s||Math.abs(G.startY-et)>=s)&&(b&&(It=!0),Dt||(G.isDragging=!0),ce(wt,ft),Dt||m&&m(G))}},k=G.onPress=function(O){ut(O,1)||O&&O.button||(G.axis=Ht=null,Jt.pause(),G.isPressed=!0,O=oa(O),$t=A=0,G.startX=G.x=O.clientX,G.startY=G.y=O.clientY,G._vx.reset(),G._vy.reset(),yn(z?a:lt,ci[1],Zt,x,!0),G.deltaX=G.deltaY=0,y&&y(G))},Q=G.onRelease=function(O){if(!ut(O,1)){vn(z?a:lt,ci[1],Zt,!0);var j=!isNaN(G.y-G.startY),dt=G.isDragging,et=dt&&(Math.abs(G.x-G.startX)>3||Math.abs(G.y-G.startY)>3),wt=oa(O);!et&&j&&(G._vx.reset(),G._vy.reset(),h&&ct&&rn.delayedCall(.08,function(){if(la()-vt>300&&!O.defaultPrevented){if(O.target.click)O.target.click();else if(lt.createEvent){var ft=lt.createEvent("MouseEvents");ft.initMouseEvent("click",!0,!0,Bn,1,wt.screenX,wt.screenY,wt.clientX,wt.clientY,!1,!1,!1,!1,0,null),O.target.dispatchEvent(ft)}}})),G.isDragging=G.isGesturing=G.isPressed=!1,f&&dt&&!z&&Jt.restart(!0),g&&dt&&g(G),S&&S(G,et)}},st=function(j){return j.touches&&j.touches.length>1&&(G.isGesturing=!0)&&U(j,G.isDragging)},mt=function(){return(G.isGesturing=!1)||R(G)},gt=function(j){if(!ut(j)){var dt=F(),et=Y();qt((dt-tt)*ot,(et-it)*ot,1),tt=dt,it=et,f&&Jt.restart(!0)}},Bt=function(j){if(!ut(j)){j=oa(j,h),at&&(bt=!0);var dt=(j.deltaMode===1?l:j.deltaMode===2?Bn.innerHeight:1)*_;qt(j.deltaX*dt,j.deltaY*dt,0),f&&!z&&Jt.restart(!0)}},ee=function(j){if(!ut(j)){var dt=j.clientX,et=j.clientY,wt=dt-G.x,ft=et-G.y;G.x=dt,G.y=et,Ft=!0,f&&Jt.restart(!0),(wt||ft)&&ce(wt,ft)}},Mt=function(j){G.event=j,V(G)},L=function(j){G.event=j,$(G)},rt=function(j){return ut(j)||oa(j,h)&&X(G)};Jt=G._dc=rn.delayedCall(d||.25,Tt).pause(),G.deltaX=G.deltaY=0,G._vx=bl(0,50,!0),G._vy=bl(0,50,!0),G.scrollX=F,G.scrollY=Y,G.isDragging=G.isGesturing=G.isPressed=!1,Xp(this),G.enable=function(O){return G.isEnabled||(yn(pt?lt:a,"scroll",ih),o.indexOf("scroll")>=0&&yn(pt?lt:a,"scroll",gt,x,xt),o.indexOf("wheel")>=0&&yn(a,"wheel",Bt,x,xt),(o.indexOf("touch")>=0&&Gp||o.indexOf("pointer")>=0)&&(yn(a,ci[0],k,x,xt),yn(lt,ci[2],Q),yn(lt,ci[3],Q),ct&&yn(a,"click",Yt,!0,!0),X&&yn(a,"click",rt),U&&yn(lt,"gesturestart",st),R&&yn(lt,"gestureend",mt),V&&yn(a,os+"enter",Mt),$&&yn(a,os+"leave",L),W&&yn(a,os+"move",ee)),G.isEnabled=!0,O&&O.type&&k(O),_t&&_t(G)),G},G.disable=function(){G.isEnabled&&(Js.filter(function(O){return O!==G&&ca(O.target)}).length||vn(pt?lt:a,"scroll",ih),G.isPressed&&(G._vx.reset(),G._vy.reset(),vn(z?a:lt,ci[1],Zt,!0)),vn(pt?lt:a,"scroll",gt,xt),vn(a,"wheel",Bt,xt),vn(a,ci[0],k,xt),vn(lt,ci[2],Q),vn(lt,ci[3],Q),vn(a,"click",Yt,!0),vn(a,"click",rt),vn(lt,"gesturestart",st),vn(lt,"gestureend",mt),vn(a,os+"enter",Mt),vn(a,os+"leave",L),vn(a,os+"move",ee),G.isEnabled=G.isPressed=G.isDragging=!1,Ut&&Ut(G))},G.kill=G.revert=function(){G.disable();var O=Js.indexOf(G);O>=0&&Js.splice(O,1),Hi===G&&(Hi=0)},Js.push(G),z&&ca(a)&&(Hi=G),G.enable(p)},Cv(r,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),r}();Fe.version="3.12.5";Fe.create=function(r){return new Fe(r)};Fe.register=Jp;Fe.getAll=function(){return Js.slice()};Fe.getById=function(r){return Js.filter(function(t){return t.vars.id===r})[0]};Yp()&&rn.registerPlugin(Fe);var Ot,Qs,de,Pe,hi,Ee,dm,kl,Ma,ga,ha,wl,hn,Gl,hh,bn,$p,Kp,to,pm,rh,mm,Mn,fh,gm,_m,yr,dh,xh,eo,vh,zl,ph,sh,El=1,fn=Date.now,oh=fn(),Kn=0,fa=0,jp=function(t,e,n){var i=zn(t)&&(t.substr(0,6)==="clamp("||t.indexOf("max")>-1);return n["_"+e+"Clamp"]=i,i?t.substr(6,t.length-7):t},Qp=function(t,e){return e&&(!zn(t)||t.substr(0,6)!=="clamp(")?"clamp("+t+")":t},Iv=function r(){return fa&&requestAnimationFrame(r)},tm=function(){return Gl=1},em=function(){return Gl=0},Ri=function(t){return t},da=function(t){return Math.round(t*1e5)/1e5||0},xm=function(){return typeof window<"u"},vm=function(){return Ot||xm()&&(Ot=window.gsap)&&Ot.registerPlugin&&Ot},fs=function(t){return!!~dm.indexOf(t)},ym=function(t){return(t==="Height"?vh:de["inner"+t])||hi["client"+t]||Ee["client"+t]},Sm=function(t){return Wi(t,"getBoundingClientRect")||(fs(t)?function(){return Bl.width=de.innerWidth,Bl.height=vh,Bl}:function(){return Xi(t)})},Lv=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?ym(s):t["client"+s])||0}},Fv=function(t,e){return!e||~ui.indexOf(t)?Sm(t):function(){return Bl}},Pi=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()-Sm(t)()[s]:fs(t)?(hi[n]||Ee[n])-ym(i):t[n]-t["offset"+i])},Tl=function(t,e){for(var n=0;n<to.length;n+=3)(!e||~e.indexOf(to[n+1]))&&t(to[n],to[n+1],to[n+2])},zn=function(t){return typeof t=="string"},En=function(t){return typeof t=="function"},pa=function(t){return typeof t=="number"},as=function(t){return typeof t=="object"},ua=function(t,e,n){return t&&t.progress(e?0:1)&&n&&t.pause()},ah=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)}},Ks=Math.abs,Mm="left",bm="top",yh="right",Sh="bottom",cs="width",us="height",_a="Right",xa="Left",va="Top",ya="Bottom",ze="padding",Jn="margin",io="Width",Mh="Height",We="px",$n=function(t){return de.getComputedStyle(t)},Nv=function(t){var e=$n(t).position;t.style.position=e==="absolute"||e==="fixed"?e:"relative"},nm=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Xi=function(t,e){var n=e&&$n(t)[hh]!=="matrix(1, 0, 0, 1, 0, 0)"&&Ot.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},Vl=function(t,e){var n=e.d2;return t["offset"+n]||t["client"+n]||0},wm=function(t){var e=[],n=t.labels,i=t.duration(),s;for(s in n)e.push(n[s]/i);return e},Uv=function(t){return function(e){return Ot.utils.snap(wm(t),e)}},bh=function(t){var e=Ot.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)}},Ov=function(t){return function(e,n){return bh(wm(t))(e,n.direction)}},Al=function(t,e,n,i){return n.split(",").forEach(function(s){return t(e,s,i)})},Ke=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:!i,capture:!!s})},$e=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},Dl=function(t,e,n){n=n&&n.wheelHandler,n&&(t(e,"wheel",n),t(e,"touchmove",n))},im={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},Cl={toggleActions:"play",anticipatePin:0},Hl={top:0,left:0,center:.5,bottom:1,right:1},Fl=function(t,e){if(zn(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 Hl?Hl[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t},Rl=function(t,e,n,i,s,o,a,l){var c=s.startColor,h=s.endColor,f=s.fontSize,d=s.indent,u=s.fontWeight,_=Pe.createElement("div"),p=fs(n)||Wi(n,"pinType")==="fixed",m=t.indexOf("scroller")!==-1,g=p?Ee:n,b=t.indexOf("start")!==-1,y=b?c:h,S="border-color:"+y+";font-size:"+f+";color:"+y+";font-weight:"+u+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return S+="position:"+((m||l)&&p?"fixed;":"absolute;"),(m||l||!p)&&(S+=(i===ke?yh:Sh)+":"+(o+parseFloat(d))+"px;"),a&&(S+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),_._isStart=b,_.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),_.style.cssText=S,_.innerText=e||e===0?t+"-"+e:t,g.children[0]?g.insertBefore(_,g.children[0]):g.appendChild(_),_._offset=_["offset"+i.op.d2],Nl(_,0,i,b),_},Nl=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+io]=1,s["border"+a+io]=0,s[n.p]=e+"px",Ot.set(t,s)},le=[],mh={},ba,rm=function(){return fn()-Kn>34&&(ba||(ba=requestAnimationFrame(Yi)))},js=function(){(!Mn||!Mn.isPressed||Mn.startX>Ee.clientWidth)&&(ae.cache++,Mn?ba||(ba=requestAnimationFrame(Yi)):Yi(),Kn||ps("scrollStart"),Kn=fn())},lh=function(){_m=de.innerWidth,gm=de.innerHeight},ma=function(){ae.cache++,!hn&&!mm&&!Pe.fullscreenElement&&!Pe.webkitFullscreenElement&&(!fh||_m!==de.innerWidth||Math.abs(de.innerHeight-gm)>de.innerHeight*.25)&&kl.restart(!0)},ds={},Bv=[],Em=function r(){return $e(te,"scrollEnd",r)||ls(!0)},ps=function(t){return ds[t]&&ds[t].map(function(e){return e()})||Bv},kn=[],Tm=function(t){for(var e=0;e<kn.length;e+=5)(!t||kn[e+4]&&kn[e+4].query===t)&&(kn[e].style.cssText=kn[e+1],kn[e].getBBox&&kn[e].setAttribute("transform",kn[e+2]||""),kn[e+3].uncache=1)},wh=function(t,e){var n;for(bn=0;bn<le.length;bn++)n=le[bn],n&&(!e||n._ctx===e)&&(t?n.kill(1):n.revert(!0,!0));zl=!0,e&&Tm(e),e||ps("revert")},Am=function(t,e){ae.cache++,(e||!wn)&&ae.forEach(function(n){return En(n)&&n.cacheID++&&(n.rec=0)}),zn(t)&&(de.history.scrollRestoration=xh=t)},wn,hs=0,sm,kv=function(){if(sm!==hs){var t=sm=hs;requestAnimationFrame(function(){return t===hs&&ls(!0)})}},Dm=function(){Ee.appendChild(eo),vh=!Mn&&eo.offsetHeight||de.innerHeight,Ee.removeChild(eo)},om=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"})},ls=function(t,e){if(Kn&&!t&&!zl){Ke(te,"scrollEnd",Em);return}Dm(),wn=te.isRefreshing=!0,ae.forEach(function(i){return En(i)&&++i.cacheID&&(i.rec=i())});var n=ps("refreshInit");pm&&te.sort(),e||wh(),ae.forEach(function(i){En(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),le.slice(0).forEach(function(i){return i.refresh()}),zl=!1,le.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()}}),ph=1,om(!0),le.forEach(function(i){var s=Pi(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)}),om(!1),ph=0,n.forEach(function(i){return i&&i.render&&i.render(-1)}),ae.forEach(function(i){En(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),Am(xh,1),kl.pause(),hs++,wn=2,Yi(2),le.forEach(function(i){return En(i.vars.onRefresh)&&i.vars.onRefresh(i)}),wn=te.isRefreshing=!1,ps("refresh")},gh=0,Ul=1,Sa,Yi=function(t){if(t===2||!wn&&!zl){te.isUpdating=!0,Sa&&Sa.update(0);var e=le.length,n=fn(),i=n-oh>=50,s=e&&le[0].scroll();if(Ul=gh>s?-1:1,wn||(gh=s),i&&(Kn&&!Gl&&n-Kn>200&&(Kn=0,ps("scrollEnd")),ha=oh,oh=n),Ul<0){for(bn=e;bn-- >0;)le[bn]&&le[bn].update(0,i);Ul=1}else for(bn=0;bn<e;bn++)le[bn]&&le[bn].update(0,i);te.isUpdating=!1}ba=0},_h=[Mm,bm,Sh,yh,Jn+ya,Jn+_a,Jn+va,Jn+xa,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Ol=_h.concat([cs,us,"boxSizing","max"+io,"max"+Mh,"position",Jn,ze,ze+va,ze+_a,ze+ya,ze+xa]),zv=function(t,e,n){no(n);var i=t._gsap;if(i.spacerIsNative)no(i.spacerState);else if(t._gsap.swappedIn){var s=e.parentNode;s&&(s.insertBefore(t,e),s.removeChild(e))}t._gsap.swappedIn=!1},ch=function(t,e,n,i){if(!t._gsap.swappedIn){for(var s=_h.length,o=e.style,a=t.style,l;s--;)l=_h[s],o[l]=n[l];o.position=n.position==="absolute"?"absolute":"relative",n.display==="inline"&&(o.display="inline-block"),a[Sh]=a[yh]="auto",o.flexBasis=n.flexBasis||"auto",o.overflow="visible",o.boxSizing="border-box",o[cs]=Vl(t,un)+We,o[us]=Vl(t,ke)+We,o[ze]=a[Jn]=a[bm]=a[Mm]="0",no(i),a[cs]=a["max"+io]=n[cs],a[us]=a["max"+Mh]=n[us],a[ze]=n[ze],t.parentNode!==e&&(t.parentNode.insertBefore(e,t),e.appendChild(t)),t._gsap.swappedIn=!0}},Vv=/([A-Z])/g,no=function(t){if(t){var e=t.t.style,n=t.length,i=0,s,o;for((t.t._gsap||Ot.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(Vv,"-$1").toLowerCase())}},Pl=function(t){for(var e=Ol.length,n=t.style,i=[],s=0;s<e;s++)i.push(Ol[s],n[Ol[s]]);return i.t=t,i},Hv=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},Bl={left:0,top:0},am=function(t,e,n,i,s,o,a,l,c,h,f,d,u,_){En(t)&&(t=t(l)),zn(t)&&t.substr(0,3)==="max"&&(t=d+(t.charAt(4)==="="?Fl("0"+t.substr(3),n):0));var p=u?u.time():0,m,g,b;if(u&&u.seek(0),isNaN(t)||(t=+t),pa(t))u&&(t=Ot.utils.mapRange(u.scrollTrigger.start,u.scrollTrigger.end,0,d,t)),a&&Nl(a,n,i,!0);else{En(e)&&(e=e(l));var y=(t||"0").split(" "),S,D,T,w;b=Sn(e,l)||Ee,S=Xi(b)||{},(!S||!S.left&&!S.top)&&$n(b).display==="none"&&(w=b.style.display,b.style.display="block",S=Xi(b),w?b.style.display=w:b.style.removeProperty("display")),D=Fl(y[0],S[i.d]),T=Fl(y[1]||"0",n),t=S[i.p]-c[i.p]-h+D+s-T,a&&Nl(a,T,i,n-T<20||a._isStart&&T>20),n-=n-T}if(_&&(l[_]=t||-.001,t<0&&(t=0)),o){var P=t+n,M=o._isStart;m="scroll"+i.d2,Nl(o,P,i,M&&P>20||!M&&(f?Math.max(Ee[m],hi[m]):o.parentNode[m])<=P+1),f&&(c=Xi(a),f&&(o.style[i.op.p]=c[i.op.p]-i.op.m-o._offset+We))}return u&&b&&(m=Xi(b),u.seek(d),g=Xi(b),u._caScrollDist=m[i.p]-g[i.p],t=t/u._caScrollDist*d),u&&u.seek(p),u?t:Math.round(t)},Gv=/(webkit|moz|length|cssText|inset)/i,lm=function(t,e,n,i){if(t.parentNode!==e){var s=t.style,o,a;if(e===Ee){t._stOrig=s.cssText,a=$n(t);for(o in a)!+o&&!Gv.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;Ot.core.getCache(t).uncache=1,e.appendChild(t)}},Cm=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}},Il=function(t,e,n){var i={};i[e.p]="+="+n,Ot.set(t,i)},cm=function(t,e){var n=Gi(t,e),i="_scroll"+e.p2,s=function o(a,l,c,h,f){var d=o.tween,u=l.onComplete,_={};c=c||n();var p=Cm(n,c,function(){d.kill(),o.tween=0});return f=h&&f||0,h=h||a-c,d&&d.kill(),l[i]=a,l.inherit=!1,l.modifiers=_,_[i]=function(){return p(c+h*d.ratio+f*d.ratio*d.ratio)},l.onUpdate=function(){ae.cache++,o.tween&&Yi()},l.onComplete=function(){o.tween=0,u&&u.call(d)},d=o.tween=Ot.to(t,l),d};return t[i]=n,n.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},Ke(t,"wheel",n.wheelHandler),te.isTouch&&Ke(t,"touchmove",n.wheelHandler),s},te=function(){function r(e,n){Qs||r.register(Ot)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),dh(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),!fa){this.update=this.refresh=this.kill=Ri;return}n=nm(zn(n)||pa(n)||n.nodeType?{trigger:n}:n,Cl);var s=n,o=s.onUpdate,a=s.toggleClass,l=s.id,c=s.onToggle,h=s.onRefresh,f=s.scrub,d=s.trigger,u=s.pin,_=s.pinSpacing,p=s.invalidateOnRefresh,m=s.anticipatePin,g=s.onScrubComplete,b=s.onSnapComplete,y=s.once,S=s.snap,D=s.pinReparent,T=s.pinSpacer,w=s.containerAnimation,P=s.fastScrollEnd,M=s.preventOverlaps,v=n.horizontal||n.containerAnimation&&n.horizontal!==!1?un:ke,I=!f&&f!==0,N=Sn(n.scroller||de),C=Ot.core.getCache(N),V=fs(N),$=("pinType"in n?n.pinType:Wi(N,"pinType")||V&&"fixed")==="fixed",W=[n.onEnter,n.onLeave,n.onEnterBack,n.onLeaveBack],Z=I&&n.toggleActions.split(" "),z="markers"in n?n.markers:Cl.markers,U=V?0:parseFloat($n(N)["border"+v.p2+io])||0,R=this,at=n.onRefreshInit&&function(){return n.onRefreshInit(R)},_t=Lv(N,V,v),Ut=Fv(N,V),X=0,ot=0,xt=0,ct=Gi(N,v),Rt,kt,q,Jt,It,Ft,bt,Et,Ht,G,$t,A,x,F,Y,tt,it,yt,pt,lt,Lt,ht,vt,Yt,ut,Tt,Wt,qt,ce,Zt,k,Q,st,mt,gt,Bt,ee,Mt,L;if(R._startClamp=R._endClamp=!1,R._dir=v,m*=45,R.scroller=N,R.scroll=w?w.time.bind(w):ct,Jt=ct(),R.vars=n,i=i||n.animation,"refreshPriority"in n&&(pm=1,n.refreshPriority===-9999&&(Sa=R)),C.tweenScroll=C.tweenScroll||{top:cm(N,ke),left:cm(N,un)},R.tweenTo=Rt=C.tweenScroll[v.p],R.scrubDuration=function(et){st=pa(et)&&et,st?Q?Q.duration(et):Q=Ot.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:st,paused:!0,onComplete:function(){return g&&g(R)}}):(Q&&Q.progress(1).kill(),Q=0)},i&&(i.vars.lazy=!1,i._initted&&!R.isReverted||i.vars.immediateRender!==!1&&n.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),R.animation=i.pause(),i.scrollTrigger=R,R.scrubDuration(f),Zt=0,l||(l=i.vars.id)),S&&((!as(S)||S.push)&&(S={snapTo:S}),"scrollBehavior"in Ee.style&&Ot.set(V?[Ee,hi]:N,{scrollBehavior:"auto"}),ae.forEach(function(et){return En(et)&&et.target===(V?Pe.scrollingElement||hi:N)&&(et.smooth=!1)}),q=En(S.snapTo)?S.snapTo:S.snapTo==="labels"?Uv(i):S.snapTo==="labelsDirectional"?Ov(i):S.directional!==!1?function(et,wt){return bh(S.snapTo)(et,fn()-ot<500?0:wt.direction)}:Ot.utils.snap(S.snapTo),mt=S.duration||{min:.1,max:2},mt=as(mt)?ga(mt.min,mt.max):ga(mt,mt),gt=Ot.delayedCall(S.delay||st/2||.1,function(){var et=ct(),wt=fn()-ot<500,ft=Rt.tween;if((wt||Math.abs(R.getVelocity())<10)&&!ft&&!Gl&&X!==et){var Dt=(et-Ft)/F,zt=i&&!I?i.totalProgress():Dt,Nt=wt?0:(zt-k)/(fn()-ha)*1e3||0,Qt=Ot.utils.clamp(-Dt,1-Dt,Ks(Nt/2)*Nt/.185),he=Dt+(S.inertia===!1?0:Qt),me,oe,E=S,B=E.onStart,H=E.onInterrupt,K=E.onComplete;if(me=q(he,R),pa(me)||(me=he),oe=Math.round(Ft+me*F),et<=bt&&et>=Ft&&oe!==et){if(ft&&!ft._initted&&ft.data<=Ks(oe-et))return;S.inertia===!1&&(Qt=me-Dt),Rt(oe,{duration:mt(Ks(Math.max(Ks(he-zt),Ks(me-zt))*.185/Nt/.05||0)),ease:S.ease||"power3",data:Ks(oe-et),onInterrupt:function(){return gt.restart(!0)&&H&&H(R)},onComplete:function(){R.update(),X=ct(),i&&(Q?Q.resetTo("totalProgress",me,i._tTime/i._tDur):i.progress(me)),Zt=k=i&&!I?i.totalProgress():R.progress,b&&b(R),K&&K(R)}},et,Qt*F,oe-et-Qt*F),B&&B(R,Rt.tween)}}else R.isActive&&X!==et&>.restart(!0)}).pause()),l&&(mh[l]=R),d=R.trigger=Sn(d||u!==!0&&u),L=d&&d._gsap&&d._gsap.stRevert,L&&(L=L(R)),u=u===!0?d:Sn(u),zn(a)&&(a={targets:d,className:a}),u&&(_===!1||_===Jn||(_=!_&&u.parentNode&&u.parentNode.style&&$n(u.parentNode).display==="flex"?!1:ze),R.pin=u,kt=Ot.core.getCache(u),kt.spacer?Y=kt.pinState:(T&&(T=Sn(T),T&&!T.nodeType&&(T=T.current||T.nativeElement),kt.spacerIsNative=!!T,T&&(kt.spacerState=Pl(T))),kt.spacer=yt=T||Pe.createElement("div"),yt.classList.add("pin-spacer"),l&&yt.classList.add("pin-spacer-"+l),kt.pinState=Y=Pl(u)),n.force3D!==!1&&Ot.set(u,{force3D:!0}),R.spacer=yt=kt.spacer,ce=$n(u),Yt=ce[_+v.os2],lt=Ot.getProperty(u),Lt=Ot.quickSetter(u,v.a,We),ch(u,yt,ce),it=Pl(u)),z){A=as(z)?nm(z,im):im,G=Rl("scroller-start",l,N,v,A,0),$t=Rl("scroller-end",l,N,v,A,0,G),pt=G["offset"+v.op.d2];var rt=Sn(Wi(N,"content")||N);Et=this.markerStart=Rl("start",l,rt,v,A,pt,0,w),Ht=this.markerEnd=Rl("end",l,rt,v,A,pt,0,w),w&&(Mt=Ot.quickSetter([Et,Ht],v.a,We)),!$&&!(ui.length&&Wi(N,"fixedMarkers")===!0)&&(Nv(V?Ee:N),Ot.set([G,$t],{force3D:!0}),Tt=Ot.quickSetter(G,v.a,We),qt=Ot.quickSetter($t,v.a,We))}if(w){var O=w.vars.onUpdate,j=w.vars.onUpdateParams;w.eventCallback("onUpdate",function(){R.update(0,0,1),O&&O.apply(w,j||[])})}if(R.previous=function(){return le[le.indexOf(R)-1]},R.next=function(){return le[le.indexOf(R)+1]},R.revert=function(et,wt){if(!wt)return R.kill(!0);var ft=et!==!1||!R.enabled,Dt=hn;ft!==R.isReverted&&(ft&&(Bt=Math.max(ct(),R.scroll.rec||0),xt=R.progress,ee=i&&i.progress()),Et&&[Et,Ht,G,$t].forEach(function(zt){return zt.style.display=ft?"none":"block"}),ft&&(hn=R,R.update(ft)),u&&(!D||!R.isActive)&&(ft?zv(u,yt,Y):ch(u,yt,$n(u),ut)),ft||R.update(ft),hn=Dt,R.isReverted=ft)},R.refresh=function(et,wt,ft,Dt){if(!((hn||!R.enabled)&&!wt)){if(u&&et&&Kn){Ke(r,"scrollEnd",Em);return}!wn&&at&&at(R),hn=R,Rt.tween&&!ft&&(Rt.tween.kill(),Rt.tween=0),Q&&Q.pause(),p&&i&&i.revert({kill:!1}).invalidate(),R.isReverted||R.revert(!0,!0),R._subPinOffset=!1;var zt=_t(),Nt=Ut(),Qt=w?w.duration():Pi(N,v),he=F<=.01,me=0,oe=Dt||0,E=as(ft)?ft.end:n.end,B=n.endTrigger||d,H=as(ft)?ft.start:n.start||(n.start===0||!d?0:u?"0 0":"0 100%"),K=R.pinnedContainer=n.pinnedContainer&&Sn(n.pinnedContainer,R),J=d&&Math.max(0,le.indexOf(R))||0,St=J,At,Pt,Xt,jt,Gt,Vt,xe,Be,sn,gn,ne,Kt,bi;for(z&&as(ft)&&(Kt=Ot.getProperty(G,v.p),bi=Ot.getProperty($t,v.p));St--;)Vt=le[St],Vt.end||Vt.refresh(0,1)||(hn=R),xe=Vt.pin,xe&&(xe===d||xe===u||xe===K)&&!Vt.isReverted&&(gn||(gn=[]),gn.unshift(Vt),Vt.revert(!0,!0)),Vt!==le[St]&&(J--,St--);for(En(H)&&(H=H(R)),H=jp(H,"start",R),Ft=am(H,d,zt,v,ct(),Et,G,R,Nt,U,$,Qt,w,R._startClamp&&"_startClamp")||(u?-.001:0),En(E)&&(E=E(R)),zn(E)&&!E.indexOf("+=")&&(~E.indexOf(" ")?E=(zn(H)?H.split(" ")[0]:"")+E:(me=Fl(E.substr(2),zt),E=zn(H)?H:(w?Ot.utils.mapRange(0,w.duration(),w.scrollTrigger.start,w.scrollTrigger.end,Ft):Ft)+me,B=d)),E=jp(E,"end",R),bt=Math.max(Ft,am(E||(B?"100% 0":Qt),B,zt,v,ct()+me,Ht,$t,R,Nt,U,$,Qt,w,R._endClamp&&"_endClamp"))||-.001,me=0,St=J;St--;)Vt=le[St],xe=Vt.pin,xe&&Vt.start-Vt._pinPush<=Ft&&!w&&Vt.end>0&&(At=Vt.end-(R._startClamp?Math.max(0,Vt.start):Vt.start),(xe===d&&Vt.start-Vt._pinPush<Ft||xe===K)&&isNaN(H)&&(me+=At*(1-Vt.progress)),xe===u&&(oe+=At));if(Ft+=me,bt+=me,R._startClamp&&(R._startClamp+=me),R._endClamp&&!wn&&(R._endClamp=bt||-.001,bt=Math.min(bt,Pi(N,v))),F=bt-Ft||(Ft-=.01)&&.001,he&&(xt=Ot.utils.clamp(0,1,Ot.utils.normalize(Ft,bt,Bt))),R._pinPush=oe,Et&&me&&(At={},At[v.a]="+="+me,K&&(At[v.p]="-="+ct()),Ot.set([Et,Ht],At)),u&&!(ph&&R.end>=Pi(N,v)))At=$n(u),jt=v===ke,Xt=ct(),ht=parseFloat(lt(v.a))+oe,!Qt&&bt>1&&(ne=(V?Pe.scrollingElement||hi:N).style,ne={style:ne,value:ne["overflow"+v.a.toUpperCase()]},V&&$n(Ee)["overflow"+v.a.toUpperCase()]!=="scroll"&&(ne.style["overflow"+v.a.toUpperCase()]="scroll")),ch(u,yt,At),it=Pl(u),Pt=Xi(u,!0),Be=$&&Gi(N,jt?un:ke)(),_?(ut=[_+v.os2,F+oe+We],ut.t=yt,St=_===ze?Vl(u,v)+F+oe:0,St&&(ut.push(v.d,St+We),yt.style.flexBasis!=="auto"&&(yt.style.flexBasis=St+We)),no(ut),K&&le.forEach(function(ye){ye.pin===K&&ye.vars.pinSpacing!==!1&&(ye._subPinOffset=!0)}),$&&ct(Bt)):(St=Vl(u,v),St&&yt.style.flexBasis!=="auto"&&(yt.style.flexBasis=St+We)),$&&(Gt={top:Pt.top+(jt?Xt-Ft:Be)+We,left:Pt.left+(jt?Be:Xt-Ft)+We,boxSizing:"border-box",position:"fixed"},Gt[cs]=Gt["max"+io]=Math.ceil(Pt.width)+We,Gt[us]=Gt["max"+Mh]=Math.ceil(Pt.height)+We,Gt[Jn]=Gt[Jn+va]=Gt[Jn+_a]=Gt[Jn+ya]=Gt[Jn+xa]="0",Gt[ze]=At[ze],Gt[ze+va]=At[ze+va],Gt[ze+_a]=At[ze+_a],Gt[ze+ya]=At[ze+ya],Gt[ze+xa]=At[ze+xa],tt=Hv(Y,Gt,D),wn&&ct(0)),i?(sn=i._initted,rh(1),i.render(i.duration(),!0,!0),vt=lt(v.a)-ht+F+oe,Wt=Math.abs(F-vt)>1,$&&Wt&&tt.splice(tt.length-2,2),i.render(0,!0,!0),sn||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),rh(0)):vt=F,ne&&(ne.value?ne.style["overflow"+v.a.toUpperCase()]=ne.value:ne.style.removeProperty("overflow-"+v.a));else if(d&&ct()&&!w)for(Pt=d.parentNode;Pt&&Pt!==Ee;)Pt._pinOffset&&(Ft-=Pt._pinOffset,bt-=Pt._pinOffset),Pt=Pt.parentNode;gn&&gn.forEach(function(ye){return ye.revert(!1,!0)}),R.start=Ft,R.end=bt,Jt=It=wn?Bt:ct(),!w&&!wn&&(Jt<Bt&&ct(Bt),R.scroll.rec=0),R.revert(!1,!0),ot=fn(),gt&&(X=-1,gt.restart(!0)),hn=0,i&&I&&(i._initted||ee)&&i.progress()!==ee&&i.progress(ee||0,!0).render(i.time(),!0,!0),(he||xt!==R.progress||w||p)&&(i&&!I&&i.totalProgress(w&&Ft<-.001&&!xt?Ot.utils.normalize(Ft,bt,0):xt,!0),R.progress=he||(Jt-Ft)/F===xt?0:xt),u&&_&&(yt._pinOffset=Math.round(R.progress*vt)),Q&&Q.invalidate(),isNaN(Kt)||(Kt-=Ot.getProperty(G,v.p),bi-=Ot.getProperty($t,v.p),Il(G,v,Kt),Il(Et,v,Kt-(Dt||0)),Il($t,v,bi),Il(Ht,v,bi-(Dt||0))),he&&!wn&&R.update(),h&&!wn&&!x&&(x=!0,h(R),x=!1)}},R.getVelocity=function(){return(ct()-It)/(fn()-ha)*1e3||0},R.endAnimation=function(){ua(R.callbackAnimation),i&&(Q?Q.progress(1):i.paused()?I||ua(i,R.direction<0,1):ua(i,i.reversed()))},R.labelToScroll=function(et){return i&&i.labels&&(Ft||R.refresh()||Ft)+i.labels[et]/i.duration()*F||0},R.getTrailing=function(et){var wt=le.indexOf(R),ft=R.direction>0?le.slice(0,wt).reverse():le.slice(wt+1);return(zn(et)?ft.filter(function(Dt){return Dt.vars.preventOverlaps===et}):ft).filter(function(Dt){return R.direction>0?Dt.end<=Ft:Dt.start>=bt})},R.update=function(et,wt,ft){if(!(w&&!ft&&!et)){var Dt=wn===!0?Bt:R.scroll(),zt=et?0:(Dt-Ft)/F,Nt=zt<0?0:zt>1?1:zt||0,Qt=R.progress,he,me,oe,E,B,H,K,J;if(wt&&(It=Jt,Jt=w?ct():Dt,S&&(k=Zt,Zt=i&&!I?i.totalProgress():Nt)),m&&u&&!hn&&!El&&Kn&&(!Nt&&Ft<Dt+(Dt-It)/(fn()-ha)*m?Nt=1e-4:Nt===1&&bt>Dt+(Dt-It)/(fn()-ha)*m&&(Nt=.9999)),Nt!==Qt&&R.enabled){if(he=R.isActive=!!Nt&&Nt<1,me=!!Qt&&Qt<1,H=he!==me,B=H||!!Nt!=!!Qt,R.direction=Nt>Qt?1:-1,R.progress=Nt,B&&!hn&&(oe=Nt&&!Qt?0:Nt===1?1:Qt===1?2:3,I&&(E=!H&&Z[oe+1]!=="none"&&Z[oe+1]||Z[oe],J=i&&(E==="complete"||E==="reset"||E in i))),M&&(H||J)&&(J||f||!i)&&(En(M)?M(R):R.getTrailing(M).forEach(function(Xt){return Xt.endAnimation()})),I||(Q&&!hn&&!El?(Q._dp._time-Q._start!==Q._time&&Q.render(Q._dp._time-Q._start),Q.resetTo?Q.resetTo("totalProgress",Nt,i._tTime/i._tDur):(Q.vars.totalProgress=Nt,Q.invalidate().restart())):i&&i.totalProgress(Nt,!!(hn&&(ot||et)))),u){if(et&&_&&(yt.style[_+v.os2]=Yt),!$)Lt(da(ht+vt*Nt));else if(B){if(K=!et&&Nt>Qt&&bt+1>Dt&&Dt+1>=Pi(N,v),D)if(!et&&(he||K)){var St=Xi(u,!0),At=Dt-Ft;lm(u,Ee,St.top+(v===ke?At:0)+We,St.left+(v===ke?0:At)+We)}else lm(u,yt);no(he||K?tt:it),Wt&&Nt<1&&he||Lt(ht+(Nt===1&&!K?vt:0))}}S&&!Rt.tween&&!hn&&!El&>.restart(!0),a&&(H||y&&Nt&&(Nt<1||!sh))&&Ma(a.targets).forEach(function(Xt){return Xt.classList[he||y?"add":"remove"](a.className)}),o&&!I&&!et&&o(R),B&&!hn?(I&&(J&&(E==="complete"?i.pause().totalProgress(1):E==="reset"?i.restart(!0).pause():E==="restart"?i.restart(!0):i[E]()),o&&o(R)),(H||!sh)&&(c&&H&&ah(R,c),W[oe]&&ah(R,W[oe]),y&&(Nt===1?R.kill(!1,1):W[oe]=0),H||(oe=Nt===1?1:3,W[oe]&&ah(R,W[oe]))),P&&!he&&Math.abs(R.getVelocity())>(pa(P)?P:2500)&&(ua(R.callbackAnimation),Q?Q.progress(1):ua(i,E==="reverse"?1:!Nt,1))):I&&o&&!hn&&o(R)}if(qt){var Pt=w?Dt/w.duration()*(w._caScrollDist||0):Dt;Tt(Pt+(G._isFlipped?1:0)),qt(Pt)}Mt&&Mt(-Dt/w.duration()*(w._caScrollDist||0))}},R.enable=function(et,wt){R.enabled||(R.enabled=!0,Ke(N,"resize",ma),V||Ke(N,"scroll",js),at&&Ke(r,"refreshInit",at),et!==!1&&(R.progress=xt=0,Jt=It=X=ct()),wt!==!1&&R.refresh())},R.getTween=function(et){return et&&Rt?Rt.tween:Q},R.setPositions=function(et,wt,ft,Dt){if(w){var zt=w.scrollTrigger,Nt=w.duration(),Qt=zt.end-zt.start;et=zt.start+Qt*et/Nt,wt=zt.start+Qt*wt/Nt}R.refresh(!1,!1,{start:Qp(et,ft&&!!R._startClamp),end:Qp(wt,ft&&!!R._endClamp)},Dt),R.update()},R.adjustPinSpacing=function(et){if(ut&&et){var wt=ut.indexOf(v.d)+1;ut[wt]=parseFloat(ut[wt])+et+We,ut[1]=parseFloat(ut[1])+et+We,no(ut)}},R.disable=function(et,wt){if(R.enabled&&(et!==!1&&R.revert(!0,!0),R.enabled=R.isActive=!1,wt||Q&&Q.pause(),Bt=0,kt&&(kt.uncache=1),at&&$e(r,"refreshInit",at),gt&&(gt.pause(),Rt.tween&&Rt.tween.kill()&&(Rt.tween=0)),!V)){for(var ft=le.length;ft--;)if(le[ft].scroller===N&&le[ft]!==R)return;$e(N,"resize",ma),V||$e(N,"scroll",js)}},R.kill=function(et,wt){R.disable(et,wt),Q&&!wt&&Q.kill(),l&&delete mh[l];var ft=le.indexOf(R);ft>=0&&le.splice(ft,1),ft===bn&&Ul>0&&bn--,ft=0,le.forEach(function(Dt){return Dt.scroller===R.scroller&&(ft=1)}),ft||wn||(R.scroll.rec=0),i&&(i.scrollTrigger=null,et&&i.revert({kill:!1}),wt||i.kill()),Et&&[Et,Ht,G,$t].forEach(function(Dt){return Dt.parentNode&&Dt.parentNode.removeChild(Dt)}),Sa===R&&(Sa=0),u&&(kt&&(kt.uncache=1),ft=0,le.forEach(function(Dt){return Dt.pin===u&&ft++}),ft||(kt.spacer=0)),n.onKill&&n.onKill(R)},le.push(R),R.enable(!1,!1),L&&L(R),i&&i.add&&!F){var dt=R.update;R.update=function(){R.update=dt,Ft||bt||R.refresh()},Ot.delayedCall(.01,R.update),F=.01,Ft=bt=0}else R.refresh();u&&kv()},r.register=function(n){return Qs||(Ot=n||vm(),xm()&&window.document&&r.enable(),Qs=fa),Qs},r.defaults=function(n){if(n)for(var i in n)Cl[i]=n[i];return Cl},r.disable=function(n,i){fa=0,le.forEach(function(o){return o[i?"kill":"disable"](n)}),$e(de,"wheel",js),$e(Pe,"scroll",js),clearInterval(wl),$e(Pe,"touchcancel",Ri),$e(Ee,"touchstart",Ri),Al($e,Pe,"pointerdown,touchstart,mousedown",tm),Al($e,Pe,"pointerup,touchend,mouseup",em),kl.kill(),Tl($e);for(var s=0;s<ae.length;s+=3)Dl($e,ae[s],ae[s+1]),Dl($e,ae[s],ae[s+2])},r.enable=function(){if(de=window,Pe=document,hi=Pe.documentElement,Ee=Pe.body,Ot&&(Ma=Ot.utils.toArray,ga=Ot.utils.clamp,dh=Ot.core.context||Ri,rh=Ot.core.suppressOverwrites||Ri,xh=de.history.scrollRestoration||"auto",gh=de.pageYOffset,Ot.core.globals("ScrollTrigger",r),Ee)){fa=1,eo=document.createElement("div"),eo.style.height="100vh",eo.style.position="absolute",Dm(),Iv(),Fe.register(Ot),r.isTouch=Fe.isTouch,yr=Fe.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),fh=Fe.isTouch===1,Ke(de,"wheel",js),dm=[de,Pe,hi,Ee],Ot.matchMedia?(r.matchMedia=function(l){var c=Ot.matchMedia(),h;for(h in l)c.add(h,l[h]);return c},Ot.addEventListener("matchMediaInit",function(){return wh()}),Ot.addEventListener("matchMediaRevert",function(){return Tm()}),Ot.addEventListener("matchMedia",function(){ls(0,1),ps("matchMedia")}),Ot.matchMedia("(orientation: portrait)",function(){return lh(),lh})):console.warn("Requires GSAP 3.11.0 or later"),lh(),Ke(Pe,"scroll",js);var n=Ee.style,i=n.borderTopStyle,s=Ot.core.Animation.prototype,o,a;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle="solid",o=Xi(Ee),ke.m=Math.round(o.top+ke.sc())||0,un.m=Math.round(o.left+un.sc())||0,i?n.borderTopStyle=i:n.removeProperty("border-top-style"),wl=setInterval(rm,250),Ot.delayedCall(.5,function(){return El=0}),Ke(Pe,"touchcancel",Ri),Ke(Ee,"touchstart",Ri),Al(Ke,Pe,"pointerdown,touchstart,mousedown",tm),Al(Ke,Pe,"pointerup,touchend,mouseup",em),hh=Ot.utils.checkPrefix("transform"),Ol.push(hh),Qs=fn(),kl=Ot.delayedCall(.2,ls).pause(),to=[Pe,"visibilitychange",function(){var l=de.innerWidth,c=de.innerHeight;Pe.hidden?($p=l,Kp=c):($p!==l||Kp!==c)&&ma()},Pe,"DOMContentLoaded",ls,de,"load",ls,de,"resize",ma],Tl(Ke),le.forEach(function(l){return l.enable(0,1)}),a=0;a<ae.length;a+=3)Dl($e,ae[a],ae[a+1]),Dl($e,ae[a],ae[a+2])}},r.config=function(n){"limitCallbacks"in n&&(sh=!!n.limitCallbacks);var i=n.syncInterval;i&&clearInterval(wl)||(wl=i)&&setInterval(rm,i),"ignoreMobileResize"in n&&(fh=r.isTouch===1&&n.ignoreMobileResize),"autoRefreshEvents"in n&&(Tl($e)||Tl(Ke,n.autoRefreshEvents||"none"),mm=(n.autoRefreshEvents+"").indexOf("resize")===-1)},r.scrollerProxy=function(n,i){var s=Sn(n),o=ae.indexOf(s),a=fs(s);~o&&ae.splice(o,a?6:2),i&&(a?ui.unshift(de,i,Ee,i,hi,i):ui.unshift(s,i))},r.clearMatchMedia=function(n){le.forEach(function(i){return i._ctx&&i._ctx.query===n&&i._ctx.kill(!0,!0)})},r.isInViewport=function(n,i,s){var o=(zn(n)?Sn(n):n).getBoundingClientRect(),a=o[s?cs:us]*i||0;return s?o.right-a>0&&o.left+a<de.innerWidth:o.bottom-a>0&&o.top+a<de.innerHeight},r.positionInViewport=function(n,i,s){zn(n)&&(n=Sn(n));var o=n.getBoundingClientRect(),a=o[s?cs:us],l=i==null?a/2:i in Hl?Hl[i]*a:~i.indexOf("%")?parseFloat(i)*a/100:parseFloat(i)||0;return s?(o.left+l)/de.innerWidth:(o.top+l)/de.innerHeight},r.killAll=function(n){if(le.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),n!==!0){var i=ds.killAll||[];ds={},i.forEach(function(s){return s()})}},r}();te.version="3.12.5";te.saveStyles=function(r){return r?Ma(r).forEach(function(t){if(t&&t.style){var e=kn.indexOf(t);e>=0&&kn.splice(e,5),kn.push(t,t.style.cssText,t.getBBox&&t.getAttribute("transform"),Ot.core.getCache(t),dh())}}):kn};te.revert=function(r,t){return wh(!r,t)};te.create=function(r,t){return new te(r,t)};te.refresh=function(r){return r?ma():(Qs||te.register())&&ls(!0)};te.update=function(r){return++ae.cache&&Yi(r===!0?2:0)};te.clearScrollMemory=Am;te.maxScroll=function(r,t){return Pi(r,t?un:ke)};te.getScrollFunc=function(r,t){return Gi(Sn(r),t?un:ke)};te.getById=function(r){return mh[r]};te.getAll=function(){return le.filter(function(r){return r.vars.id!=="ScrollSmoother"})};te.isScrolling=function(){return!!Kn};te.snapDirectional=bh;te.addEventListener=function(r,t){var e=ds[r]||(ds[r]=[]);~e.indexOf(t)||e.push(t)};te.removeEventListener=function(r,t){var e=ds[r],n=e&&e.indexOf(t);n>=0&&e.splice(n,1)};te.batch=function(r,t){var e=[],n={},i=t.interval||.016,s=t.batchMax||1e9,o=function(c,h){var f=[],d=[],u=Ot.delayedCall(i,function(){h(f,d),f=[],d=[]}).pause();return function(_){f.length||u.restart(!0),f.push(_.trigger),d.push(_),s<=f.length&&u.progress(1)}},a;for(a in t)n[a]=a.substr(0,2)==="on"&&En(t[a])&&a!=="onRefreshInit"?o(a,t[a]):t[a];return En(s)&&(s=s(),Ke(te,"refresh",function(){return s=t.batchMax()})),Ma(r).forEach(function(l){var c={};for(a in n)c[a]=n[a];c.trigger=l,e.push(te.create(c))}),e};var um=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},uh=function r(t,e){e===!0?t.style.removeProperty("touch-action"):t.style.touchAction=e===!0?"auto":e?"pan-"+e+(Fe.isTouch?" pinch-zoom":""):"none",t===hi&&r(Ee,e)},Ll={auto:1,scroll:1},Wv=function(t){var e=t.event,n=t.target,i=t.axis,s=(e.changedTouches?e.changedTouches[0]:e).target,o=s._gsap||Ot.core.getCache(s),a=fn(),l;if(!o._isScrollT||a-o._isScrollT>2e3){for(;s&&s!==Ee&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(Ll[(l=$n(s)).overflowY]||Ll[l.overflowX]));)s=s.parentNode;o._isScroll=s&&s!==n&&!fs(s)&&(Ll[(l=$n(s)).overflowY]||Ll[l.overflowX]),o._isScrollT=a}(o._isScroll||i==="x")&&(e.stopPropagation(),e._gsapAllow=!0)},Rm=function(t,e,n,i){return Fe.create({target:t,capture:!0,debounce:!1,lockAxis:!0,type:e,onWheel:i=i&&Wv,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&Ke(Pe,Fe.eventTypes[0],fm,!1,!0)},onDisable:function(){return $e(Pe,Fe.eventTypes[0],fm,!0)}})},Xv=/(input|label|select|textarea)/i,hm,fm=function(t){var e=Xv.test(t.target.tagName);(e||hm)&&(t._gsapAllow=!0,hm=e)},Yv=function(t){as(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=Sn(t.target)||hi,h=Ot.core.globals().ScrollSmoother,f=h&&h.get(),d=yr&&(t.content&&Sn(t.content)||f&&t.content!==!1&&!f.smooth()&&f.content()),u=Gi(c,ke),_=Gi(c,un),p=1,m=(Fe.isTouch&&de.visualViewport?de.visualViewport.scale*de.visualViewport.width:de.outerWidth)/de.innerWidth,g=0,b=En(i)?function(){return i(a)}:function(){return i||2.8},y,S,D=Rm(c,t.type,!0,s),T=function(){return S=!1},w=Ri,P=Ri,M=function(){l=Pi(c,ke),P=ga(yr?1:0,l),n&&(w=ga(0,Pi(c,un))),y=hs},v=function(){d._gsap.y=da(parseFloat(d._gsap.y)+u.offset)+"px",d.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(d._gsap.y)+", 0, 1)",u.offset=u.cacheID=0},I=function(){if(S){requestAnimationFrame(T);var z=da(a.deltaY/2),U=P(u.v-z);if(d&&U!==u.v+u.offset){u.offset=U-u.v;var R=da((parseFloat(d&&d._gsap.y)||0)-u.offset);d.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+R+", 0, 1)",d._gsap.y=R+"px",u.cacheID=ae.cache,Yi()}return!0}u.offset&&v(),S=!0},N,C,V,$,W=function(){M(),N.isActive()&&N.vars.scrollY>l&&(u()>l?N.progress(1)&&u(l):N.resetTo("scrollY",l))};return d&&Ot.set(d,{y:"+=0"}),t.ignoreCheck=function(Z){return yr&&Z.type==="touchmove"&&I(Z)||p>1.05&&Z.type!=="touchstart"||a.isGesturing||Z.touches&&Z.touches.length>1},t.onPress=function(){S=!1;var Z=p;p=da((de.visualViewport&&de.visualViewport.scale||1)/m),N.pause(),Z!==p&&uh(c,p>1.01?!0:n?!1:"x"),C=_(),V=u(),M(),y=hs},t.onRelease=t.onGestureStart=function(Z,z){if(u.offset&&v(),!z)$.restart(!0);else{ae.cache++;var U=b(),R,at;n&&(R=_(),at=R+U*.05*-Z.velocityX/.227,U*=um(_,R,at,Pi(c,un)),N.vars.scrollX=w(at)),R=u(),at=R+U*.05*-Z.velocityY/.227,U*=um(u,R,at,Pi(c,ke)),N.vars.scrollY=P(at),N.invalidate().duration(U).play(.01),(yr&&N.vars.scrollY>=l||R>=l-1)&&Ot.to({},{onUpdate:W,duration:U})}o&&o(Z)},t.onWheel=function(){N._ts&&N.pause(),fn()-g>1e3&&(y=0,g=fn())},t.onChange=function(Z,z,U,R,at){if(hs!==y&&M(),z&&n&&_(w(R[2]===z?C+(Z.startX-Z.x):_()+z-R[1])),U){u.offset&&v();var _t=at[2]===U,Ut=_t?V+Z.startY-Z.y:u()+U-at[1],X=P(Ut);_t&&Ut!==X&&(V+=X-Ut),u(X)}(U||z)&&Yi()},t.onEnable=function(){uh(c,n?!1:"x"),te.addEventListener("refresh",W),Ke(de,"resize",W),u.smooth&&(u.target.style.scrollBehavior="auto",u.smooth=_.smooth=!1),D.enable()},t.onDisable=function(){uh(c,!0),$e(de,"resize",W),te.removeEventListener("refresh",W),D.kill()},t.lockAxis=t.lockAxis!==!1,a=new Fe(t),a.iOS=yr,yr&&!u()&&u(1),yr&&Ot.ticker.add(Ri),$=a._dc,N=Ot.to(a,{ease:"power4",paused:!0,inherit:!1,scrollX:n?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:Cm(u,u(),function(){return N.pause()})},onUpdate:Yi,onComplete:$.vars.onComplete}),a};te.sort=function(r){return le.sort(r||function(t,e){return(t.vars.refreshPriority||0)*-1e6+t.start-(e.start+(e.vars.refreshPriority||0)*-1e6)})};te.observe=function(r){return new Fe(r)};te.normalizeScroll=function(r){if(typeof r>"u")return Mn;if(r===!0&&Mn)return Mn.enable();if(r===!1){Mn&&Mn.kill(),Mn=r;return}var t=r instanceof Fe?r:Yv(r);return Mn&&Mn.target===t.target&&Mn.kill(),fs(t.target)&&(Mn=t),t};te.core={_getVelocityProp:bl,_inputObserver:Rm,_scrollers:ae,_proxies:ui,bridge:{ss:function(){Kn||ps("scrollStart"),Kn=fn()},ref:function(){return hn}}};vm()&&Ot.registerPlugin(te);ue.registerPlugin(te,li);var Pm=()=>{ue.matchMedia().add("(min-width: 992px)",()=>{let t=document.querySelector(".casestudies-heading-section");t&&ue.to(t,{ease:"none",scrollTrigger:{trigger:t,start:"top top",endTrigger:".casestudies-wrapper",end:"bottom bottom",pin:!0,pinSpacing:!1,scrub:!0,anticipatePin:1}})})};var Im=()=>{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`,ue.fromTo(t,{x:0},{x:-n,duration:60,ease:"linear",repeat:-1,force3D:!0})})};var Lm=()=>{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=(h,f)=>{(f||!l.readyState||/loaded|complete/.test(l.readyState))&&(l.onload=l.onreadystatechange=null,l=void 0,f||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)};var Fm=()=>{let r=new Date().toLocaleTimeString("pl-PL",{timeZone:"Poland"}).split(":");return r[0]+" - "+r[1]},Nm=()=>{let r=document.querySelectorAll("[data-current-time]");r.length>0&&r.forEach(t=>{t.textContent=Fm(),setInterval(()=>{t.textContent=Fm()},5e3)})};var qv=/(?:^\s+|\s+$)/g,Eh=/([\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 ro(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+=ro(r)}else if(t===3||t===4)return r.nodeValue;return e}function fi(r,t,e,n){if(r+="",e&&(r=r.trim?r.trim():r.replace(qv,"")),t&&t!=="")return r.replace(/>/g,">").replace(/</g,"<").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(Eh)||[])[1]||"").length||2,l=r.substr(o,a),i.emoji=1,o+=a-1),i.push(l===">"?">":l==="<"?"<":n&&l===" "&&(r.charAt(o-1)===" "||r.charAt(o+1)===" ")?" ":l);return i}var so,Ah,Bm,wa,km,Wl,Zv=/(?:\r|\n|\t\t)/g,Jv=/(?:\s\s+)/g,$v="\xA0",zm=function(t){so=document,Ah=window,wa=wa||t||Ah.gsap||console.warn("Please gsap.registerPlugin(SplitText)"),wa&&(Wl=wa.utils.toArray,km=wa.core.context||function(){},Bm=1)},Kv=1,Vm=function(t){return Ah.getComputedStyle(t)},Dh=function(t){return t.position==="absolute"||t.absolute===!0},jv=function(t,e){for(var n=e.length,i;--n>-1;)if(i=e[n],t.substr(0,i.length)===i)return i.length},Qv=" style='position:relative;display:inline-block;'",Um=function(t,e){t===void 0&&(t="");var n=~t.indexOf("++"),i=1;return n&&(t=t.split("++").join("")),function(){return"<"+e+Qv+(t?" class='"+t+(n?i++:"")+"'>":">")}},Hm=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))},Th=function(t,e){for(var n=e.length;--n>-1;)t.push(e[n])},Om=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}},ty=function r(t){var e=Wl(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))},Ii=function(t,e){return parseFloat(e[t])||0},ey=function(t,e,n,i,s,o,a){var l=Vm(t),c=Ii("paddingLeft",l),h=-999,f=Ii("borderBottomWidth",l)+Ii("borderTopWidth",l),d=Ii("borderLeftWidth",l)+Ii("borderRightWidth",l),u=Ii("paddingTop",l)+Ii("paddingBottom",l),_=Ii("paddingLeft",l)+Ii("paddingRight",l),p=Ii("fontSize",l)*(e.lineThreshold||.2),m=l.textAlign,g=[],b=[],y=[],S=e.wordDelimiter||" ",D=e.tag?e.tag:e.span?"span":"div",T=e.type||e.split||"chars,words,lines",w=s&&~T.indexOf("lines")?[]:null,P=~T.indexOf("words"),M=~T.indexOf("chars"),v=Dh(e),I=e.linesClass,N=~(I||"").indexOf("++"),C=[],V=l.display==="flex",$=t.style.display,W,Z,z,U,R,at,_t,Ut,X,ot,xt,ct;for(N&&(I=I.split("++").join("")),V&&(t.style.display="block"),Z=t.getElementsByTagName("*"),z=Z.length,R=[],W=0;W<z;W++)R[W]=Z[W];if(w||v)for(W=0;W<z;W++)U=R[W],at=U.parentNode===t,(at||v||M&&!P)&&(ct=U.offsetTop,w&&at&&Math.abs(ct-h)>p&&(U.nodeName!=="BR"||W===0)&&(_t=[],w.push(_t),h=ct),v&&(U._x=U.offsetLeft,U._y=ct,U._w=U.offsetWidth,U._h=U.offsetHeight),w&&((U._isSplit&&at||!M&&at||P&&at||!P&&U.parentNode.parentNode===t&&!U.parentNode._isSplit)&&(_t.push(U),U._x-=c,Om(U,t,S)&&(U._wordEnd=!0)),U.nodeName==="BR"&&(U.nextSibling&&U.nextSibling.nodeName==="BR"||W===0)&&w.push([])));for(W=0;W<z;W++){if(U=R[W],at=U.parentNode===t,U.nodeName==="BR"){w||v?(U.parentNode&&U.parentNode.removeChild(U),R.splice(W--,1),z--):P||t.appendChild(U);continue}if(v&&(X=U.style,!P&&!at&&(U._x+=U.parentNode._x,U._y+=U.parentNode._y),X.left=U._x+"px",X.top=U._y+"px",X.position="absolute",X.display="block",X.width=U._w+1+"px",X.height=U._h+"px"),!P&&M)if(U._isSplit)for(U._next=Z=U.nextSibling,U.parentNode.appendChild(U);Z&&Z.nodeType===3&&Z.textContent===" ";)U._next=Z.nextSibling,U.parentNode.appendChild(Z),Z=Z.nextSibling;else U.parentNode._isSplit?(U._parent=U.parentNode,!U.previousSibling&&U.firstChild&&(U.firstChild._isFirst=!0),U.nextSibling&&U.nextSibling.textContent===" "&&!U.nextSibling.nextSibling&&C.push(U.nextSibling),U._next=U.nextSibling&&U.nextSibling._isFirst?null:U.nextSibling,U.parentNode.removeChild(U),R.splice(W--,1),z--):at||(ct=!U.nextSibling&&Om(U.parentNode,t,S),U.parentNode._parent&&U.parentNode._parent.appendChild(U),ct&&U.parentNode.appendChild(so.createTextNode(" ")),D==="span"&&(U.style.display="inline"),g.push(U));else U.parentNode._isSplit&&!U._isSplit&&U.innerHTML!==""?b.push(U):M&&!U._isSplit&&(D==="span"&&(U.style.display="inline"),g.push(U))}for(W=C.length;--W>-1;)C[W].parentNode.removeChild(C[W]);if(w){for(v&&(ot=so.createElement(D),t.appendChild(ot),xt=ot.offsetWidth+"px",ct=ot.offsetParent===t?0:t.offsetLeft,t.removeChild(ot)),X=t.style.cssText,t.style.cssText="display:none;";t.firstChild;)t.removeChild(t.firstChild);for(Ut=S===" "&&(!v||!P&&!M),W=0;W<w.length;W++){for(_t=w[W],ot=so.createElement(D),ot.style.cssText="display:block;text-align:"+m+";position:"+(v?"absolute;":"relative;"),I&&(ot.className=I+(N?W+1:"")),y.push(ot),z=_t.length,Z=0;Z<z;Z++)_t[Z].nodeName!=="BR"&&(U=_t[Z],ot.appendChild(U),Ut&&U._wordEnd&&ot.appendChild(so.createTextNode(" ")),v&&(Z===0&&(ot.style.top=U._y+"px",ot.style.left=c+ct+"px"),U.style.top="0px",ct&&(U.style.left=U._x-ct+"px")));z===0?ot.innerHTML=" ":!P&&!M&&(ty(ot),Hm(ot,"\xA0"," ")),v&&(ot.style.width=xt,ot.style.height=U._h+"px"),t.appendChild(ot)}t.style.cssText=X}v&&(a>t.clientHeight&&(t.style.height=a-u+"px",t.clientHeight<a&&(t.style.height=a+f+"px")),o>t.clientWidth&&(t.style.width=o-_+"px",t.clientWidth<o&&(t.style.width=o+d+"px"))),V&&($?t.style.display=$:t.style.removeProperty("display")),Th(n,g),P&&Th(i,b),Th(s,y)},ny=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=Dh(e),c=e.wordDelimiter||" ",h=function(v){return v===c||v===$v&&c===" "},f=c!==" "?"":l?"­ ":" ",d="</"+s+">",u=1,_=e.specialChars?typeof e.specialChars=="function"?e.specialChars:jv:null,p,m,g,b,y,S,D,T,w=so.createElement("div"),P=t.parentNode;for(P.insertBefore(w,t),w.textContent=t.nodeValue,P.removeChild(t),t=w,p=ro(t),D=p.indexOf("<")!==-1,e.reduceWhiteSpace!==!1&&(p=p.replace(Jv," ").replace(Zv,"")),D&&(p=p.split("<").join("{{LT}}")),y=p.length,m=(p.charAt(0)===" "?f:"")+n(),g=0;g<y;g++)if(S=p.charAt(g),_&&(T=_(p.substr(g),e.specialChars)))S=p.substr(g,T||1),m+=a&&S!==" "?i()+S+"</"+s+">":S,g+=T-1;else if(h(S)&&!h(p.charAt(g-1))&&g){for(m+=u?d:"",u=0;h(p.charAt(g+1));)m+=f,g++;g===y-1?m+=f:p.charAt(g+1)!==")"&&(m+=f+n(),u=1)}else S==="{"&&p.substr(g,6)==="{{LT}}"?(m+=a?i()+"{{LT}}</"+s+">":"{{LT}}",g+=5):S.charCodeAt(0)>=55296&&S.charCodeAt(0)<=56319||p.charCodeAt(g+1)>=65024&&p.charCodeAt(g+1)<=65039?(b=((p.substr(g,12).split(Eh)||[])[1]||"").length||2,m+=a&&S!==" "?i()+p.substr(g,b)+"</"+s+">":p.substr(g,b),g+=b-1):m+=a&&S!==" "?i()+S+"</"+s+">":S;t.outerHTML=m+(u?d:""),D&&Hm(P,"{{LT}}","<")},iy=function r(t,e,n,i){var s=Wl(t.childNodes),o=s.length,a=Dh(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&&Vm(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}ny(t,e,n,i)},oo=function(){function r(e,n){Bm||zm(),this.elements=Wl(e),this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=n||{},km(this),Kv&&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=Um(n.wordsClass,s),a=Um(n.charsClass,s),l,c,h;--i>-1;)h=this.elements[i],this._originals[i]={html:h.innerHTML,style:h.getAttribute("style")},l=h.clientHeight,c=h.clientWidth,iy(h,n,o,a),ey(h,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}();oo.version="3.12.5";oo.register=zm;var Gm=()=>{if(ue.registerPlugin(te,oo),document.querySelector(".hero_grid")){let r=document.querySelector(".hero_grid"),t=r.querySelector(".hero_holo"),e=r.querySelector("h1"),n=r.querySelector(".paragraph-big"),i=new oo(e,{type:"lines",tag:"span"}),s=new oo(e,{type:"lines",linesClass:"header_line"});i.lines=s.chars.concat(i.lines),ue.timeline({scrollTrigger:{trigger:r,start:"top bottom",toggleActions:"play none none reset"}}).fromTo(n,{autoAlpha:0},{autoAlpha:1,duration:.35,ease:"circ.out"}).fromTo(i.lines,{y:"100%"},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"-=0.25").fromTo(t,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25")}};var Wm=()=>{let r=document.querySelector(".is-section-loader");if(!r)return;let t=r.querySelector(".loader_line"),e=r.querySelector(".loader_value");!t||!e||ue.to(t,{width:"100%",duration:1.5,onUpdate:function(){let n=Math.round(this.progress()*100);e.innerHTML=`${n}%`},onComplete:function(){ue.to(r,{y:"-100dvh",duration:.75})}},"<")};var Xl=function(){function r(e){this.chars=fi(e),this.sets=[],this.length=50;for(var n=0;n<20;n++)this.sets[n]=Ym(80,this.chars)}var t=r.prototype;return t.grow=function(n){for(var i=0;i<20;i++)this.sets[i]+=Ym(n-this.length,this.chars);this.length=n},r}(),ms,Jm,$m=function(){return ms||typeof window<"u"&&(ms=window.gsap)&&ms.registerPlugin&&ms},ry=1,Xm=/\s+/g,Ym=function(t,e){for(var n=e.length,i="";--t>-1;)i+=e[~~(Math.random()*n)];return i},Ch="ABCDEFGHIJKLMNOPQRSTUVWXYZ",qm=Ch.toLowerCase(),sy={upperCase:new Xl(Ch),lowerCase:new Xl(qm),upperAndLowerCase:new Xl(Ch+qm)},Zm=function(){Jm=ms=$m()},Ea={version:"3.12.5",name:"scrambleText",register:function(t,e,n){ms=t,Zm()},init:function(t,e,n,i,s){if(Jm||Zm(),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,h,f,d;return l.delimiter=c=e.delimiter||"",l.original=fi(ro(t).replace(Xm," ").split(" ").join(""),c,a),(o==="{original}"||o===!0||o==null)&&(o=l.original.join(c)),l.text=fi((o||"").replace(Xm," "),c,a),l.hasClass=!!(e.newClass||e.oldClass),l.newClass=e.newClass,l.oldClass=e.oldClass,d=c==="",l.textHasEmoji=d&&!!l.text.emoji,l.charsHaveEmoji=!!e.chars&&!!fi(e.chars).emoji,l.length=d?l.original.length:l.original.join(c).length,l.lengthDif=(d?l.text.length:l.text.join(c).length)-l.length,l.fillChar=e.fillChar||e.chars&&~e.chars.indexOf(" ")?" ":"",l.charSet=f=sy[e.chars||"upperCase"]||new Xl(e.chars),l.speed=.05/(e.speed||1),l.prevScrambleTime=0,l.setIndex=Math.random()*20|0,h=l.length+Math.max(l.lengthDif,0),h>f.length&&f.grow(h),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"),ry}},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,h=e.setIndex,f=e.chars,d=e.charSet,u=e.length,_=e.textHasEmoji,p=e.charsHaveEmoji,m=e.lengthDif,g=e.tweenLength,b=e.oldClass,y=e.newClass,S=e.rightToLeft,D=e.fillChar,T=e.speed,w=e.original,P=e.hasClass,M=s.length,v=a._time,I=v-l,N,C,V,$,W,Z,z,U,R,at,_t;c&&(a._from&&(v=a._dur-v),t=v===0?0:v<c?1e-6:v===a._dur?1:a._ease((v-c)/(a._dur-c))),t<0?t=0:t>1&&(t=1),S&&(t=1-t),N=~~(t*M+.5),t?((I>T||I<-T)&&(e.setIndex=h=(h+(Math.random()*19|0))%20,e.chars=d.sets[h],e.prevScrambleTime+=I),$=f):$=w.join(o),_t=a._from?t:1-t,at=u+(g?a._from?_t*_t*_t:1-_t*_t*_t:1)*m,S?t===1&&(a._from||a.data==="isFromStart")?(V="",$=w.join(o)):(z=s.slice(N).join(o),p?V=fi($).slice(0,at-(_?fi(z):z).length+.5|0).join(""):V=$.substr(0,at-(_?fi(z):z).length+.5|0),$=z):(V=s.slice(0,N).join(o),C=(_?fi(V):V).length,p?$=fi($).slice(C,at+.5|0).join(""):$=$.substr(C,at-C+.5|0)),P?(U=S?b:y,R=S?y:b,W=U&&N!==0,Z=R&&N!==M,z=(W?"<span class='"+U+"'>":"")+V+(W?"</span>":"")+(Z?"<span class='"+R+"'>":"")+o+$+(Z?"</span>":"")):z=V+o+$,n[i]=D===" "&&~z.indexOf(" ")?z.split(" ").join(" "):z}};Ea.emojiSafeSplit=fi;Ea.getText=ro;$m()&&ms.registerPlugin(Ea);ue.registerPlugin(Ea);var Km=()=>{document.querySelectorAll("[data-scramble-link]").forEach(t=>{let e=t.querySelector("[data-scramble-text]");if(!e)return;let n=e.textContent;t.addEventListener("mouseenter",()=>{ue.matchMedia().add("(min-width: 768px)",()=>{ue.to(e,{duration:1,scrambleText:{text:n,chars:"10"}})})})})};ue.registerPlugin(li,te);var jm=()=>{ue.registerPlugin(li),li.create({smooth:1.5,effects:!0}),te.refresh()};ue.registerPlugin(te);var Qm=()=>{let r=document.querySelector(".special_decors-wrapper"),t=document.querySelector(".special_decors");ue.to(t,{scrollTrigger:{trigger:t,endTrigger:r,start:()=>"top top",end:()=>"bottom bottom",pin:!0,scrub:!0}})};var ng=()=>{let r=document.querySelector(".mastery_techonologies-wrapper");if(!r)return;let t=r.querySelectorAll("img");t&&(window.innerWidth>991?eg(r,t):tg(r,t),window.addEventListener("resize",function(){window.innerWidth>991?eg(r,t):tg(r,t)},!0))};function tg(r,t){r.innerHTML="",t.forEach(s=>{let o=document.createElement("figure");o.classList.add("mastery_techonologies_slide"),o.appendChild(s),r.appendChild(o)});let e=r.querySelectorAll(".mastery_techonologies_slide");ue.set(e,{autoAlpha:1}),e.forEach((s,o)=>{ue.set(s,{xPercent:100*o})});let n=ue.utils.wrap(-100,(e.length-1)*100),i=e.length*2.5;ue.to(e,{xPercent:`-=${e.length*100}`,duration:i,repeat:-1,ease:"none",modifiers:{xPercent:s=>n(parseFloat(s))}})}function eg(r,t){r.innerHTML="";let e=oy(t);e&&(ay(r,e),ly(r))}function oy(r){let t=Math.floor(r.length/2)<11?Math.floor(r.length/2):11,e=Array.from({length:t},()=>[]),n=Math.floor(r.length/t),i=r.length%t,s=0;for(let o=0;o<t;o++){let a=n+(o<i?1:0);for(let l=0;l<a;l++)s<r.length&&(e[o].push(r[s]),s+=1)}return e}function ay(r,t){r.innerHTML="",t.forEach(e=>{let n=document.createElement("div");n.classList.add("mastery_techonologies_vertical_slider"),e.forEach(i=>{let s=document.createElement("figure");s.classList.add("mastery_techonologies_vertical_slider_item"),s.appendChild(i),n.appendChild(s)}),r.appendChild(n)})}function ly(r){let t=r.querySelectorAll(".mastery_techonologies_vertical_slider"),e=parseInt(window.getComputedStyle(document.body).fontSize)*1.5;if(window.addEventListener("resize",function(){e=parseInt(window.getComputedStyle(document.body).fontSize)*1.5},!0),!t)return;function n(){t.forEach((i,s)=>{i.querySelectorAll(".mastery_techonologies_vertical_slider_item").forEach((a,l)=>{let c=l===0,h=window.getComputedStyle(a),f=new WebKitCSSMatrix(h.transform);ue.fromTo(a,{y:c?(l+1)*e:f.f},{y:c?l*e:f.f-e,duration:.5,ease:"circ.out",delay:.1*s,onComplete:function(){c&&i.appendChild(a)}}).play()})})}n(),setInterval(n,5e3)}var Zf="164";var cy=0,ig=1,uy=2;var C_=1,Jf=2,ji=3,Lr=0,Nn=1,tr=2,Rr=0,Pr=1,rg=2,sg=3,og=4,hy=5,bs=100,fy=101,dy=102,py=103,my=104,gy=200,_y=201,xy=202,vy=203,hf=204,ff=205,yy=206,Sy=207,My=208,by=209,wy=210,Ey=211,Ty=212,Ay=213,Dy=214,Cy=0,Ry=1,Py=2,_c=3,Iy=4,Ly=5,Fy=6,Ny=7,R_=0,Uy=1,Oy=2,Ir=0,By=1,ky=2,zy=3,Vy=4,Hy=5,Gy=6,Wy=7;var P_=300,Ro=301,Po=302,df=303,pf=304,Wc=306,mf=1e3,Es=1001,gf=1002,ti=1003,Xy=1004;var Yl=1005;var gi=1006,Rh=1007;var Ts=1008;var Fr=1009,Yy=1010,qy=1011,I_=1012,L_=1013,Io=1014,Dr=1015,Xc=1016,F_=1017,N_=1018,Oa=1020,Zy=35902,Jy=1021,$y=1022,Fi=1023,Ky=1024,jy=1025,Ao=1026,La=1027,Qy=1028,U_=1029,tS=1030,O_=1031,B_=1033,Ph=33776,Ih=33777,Lh=33778,Fh=33779,ag=35840,lg=35841,cg=35842,ug=35843,hg=36196,fg=37492,dg=37496,pg=37808,mg=37809,gg=37810,_g=37811,xg=37812,vg=37813,yg=37814,Sg=37815,Mg=37816,bg=37817,wg=37818,Eg=37819,Tg=37820,Ag=37821,Nh=36492,Dg=36494,Cg=36495,eS=36283,Rg=36284,Pg=36285,Ig=36286;var xc=2300,vc=2301,Uh=2302,Lg=2400,Fg=2401,Ng=2402;var nS=3200,iS=3201,rS=0,sS=1,Ar="",Qn="srgb",Or="srgb-linear",$f="display-p3",Yc="display-p3-linear",yc="linear",Te="srgb",Sc="rec709",Mc="p3";var ao=7680;var Ug=519,oS=512,aS=513,lS=514,k_=515,cS=516,uS=517,hS=518,fS=519,Og=35044;var Bg="300 es",er=2e3,bc=2001,Nr=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}}},dn=["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 Oh=Math.PI/180,_f=180/Math.PI;function Ba(){let r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(dn[r&255]+dn[r>>8&255]+dn[r>>16&255]+dn[r>>24&255]+"-"+dn[t&255]+dn[t>>8&255]+"-"+dn[t>>16&15|64]+dn[t>>24&255]+"-"+dn[e&63|128]+dn[e>>8&255]+"-"+dn[e>>16&255]+dn[e>>24&255]+dn[n&255]+dn[n>>8&255]+dn[n>>16&255]+dn[n>>24&255]).toLowerCase()}function Fn(r,t,e){return Math.max(t,Math.min(e,r))}function dS(r,t){return(r%t+t)%t}function Bh(r,t,e){return(1-e)*r+e*t}function Ta(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 Ln(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 _e=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(Fn(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}},se=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 h=this.elements;return h[0]=t,h[1]=i,h[2]=a,h[3]=e,h[4]=s,h[5]=l,h[6]=n,h[7]=o,h[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],h=n[4],f=n[7],d=n[2],u=n[5],_=n[8],p=i[0],m=i[3],g=i[6],b=i[1],y=i[4],S=i[7],D=i[2],T=i[5],w=i[8];return s[0]=o*p+a*b+l*D,s[3]=o*m+a*y+l*T,s[6]=o*g+a*S+l*w,s[1]=c*p+h*b+f*D,s[4]=c*m+h*y+f*T,s[7]=c*g+h*S+f*w,s[2]=d*p+u*b+_*D,s[5]=d*m+u*y+_*T,s[8]=d*g+u*S+_*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],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8];return e*o*h-e*a*c-n*s*h+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],h=t[8],f=h*o-a*c,d=a*l-h*s,u=c*s-o*l,_=e*f+n*d+i*u;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let p=1/_;return t[0]=f*p,t[1]=(i*c-h*n)*p,t[2]=(a*n-i*o)*p,t[3]=d*p,t[4]=(h*e-i*l)*p,t[5]=(i*s-a*e)*p,t[6]=u*p,t[7]=(n*l-c*e)*p,t[8]=(o*e-n*s)*p,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(kh.makeScale(t,e)),this}rotate(t){return this.premultiply(kh.makeRotation(-t)),this}translate(t,e){return this.premultiply(kh.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)}},kh=new se;function z_(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function wc(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function pS(){let r=wc("canvas");return r.style.display="block",r}var kg={};function mS(r){r in kg||(kg[r]=!0,console.warn(r))}var zg=new se().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Vg=new se().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),ql={[Or]:{transfer:yc,primaries:Sc,toReference:r=>r,fromReference:r=>r},[Qn]:{transfer:Te,primaries:Sc,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Yc]:{transfer:yc,primaries:Mc,toReference:r=>r.applyMatrix3(Vg),fromReference:r=>r.applyMatrix3(zg)},[$f]:{transfer:Te,primaries:Mc,toReference:r=>r.convertSRGBToLinear().applyMatrix3(Vg),fromReference:r=>r.applyMatrix3(zg).convertLinearToSRGB()}},gS=new Set([Or,Yc]),Se={enabled:!0,_workingColorSpace:Or,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!gS.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=ql[t].toReference,i=ql[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 ql[r].primaries},getTransfer:function(r){return r===Ar?yc:ql[r].transfer}};function Do(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function zh(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var lo,xf=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{lo===void 0&&(lo=wc("canvas")),lo.width=t.width,lo.height=t.height;let n=lo.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=lo}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=wc("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]=Do(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(Do(e[n]/255)*255):e[n]=Do(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}},_S=0,Ec=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:_S++}),this.uuid=Ba(),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(Vh(i[o].image)):s.push(Vh(i[o]))}else s=Vh(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function Vh(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?xf.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 xS=0,ii=class r extends Nr{constructor(t=r.DEFAULT_IMAGE,e=r.DEFAULT_MAPPING,n=Es,i=Es,s=gi,o=Ts,a=Fi,l=Fr,c=r.DEFAULT_ANISOTROPY,h=Ar){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:xS++}),this.uuid=Ba(),this.name="",this.source=new Ec(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 _e(0,0),this.repeat=new _e(1,1),this.center=new _e(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new se,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,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!==P_)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case mf:t.x=t.x-Math.floor(t.x);break;case Es:t.x=t.x<0?0:1;break;case gf: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 mf:t.y=t.y-Math.floor(t.y);break;case Es:t.y=t.y<0?0:1;break;case gf: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++}};ii.DEFAULT_IMAGE=null;ii.DEFAULT_MAPPING=P_;ii.DEFAULT_ANISOTROPY=1;var Qe=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],h=l[4],f=l[8],d=l[1],u=l[5],_=l[9],p=l[2],m=l[6],g=l[10];if(Math.abs(h-d)<.01&&Math.abs(f-p)<.01&&Math.abs(_-m)<.01){if(Math.abs(h+d)<.1&&Math.abs(f+p)<.1&&Math.abs(_+m)<.1&&Math.abs(c+u+g-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let y=(c+1)/2,S=(u+1)/2,D=(g+1)/2,T=(h+d)/4,w=(f+p)/4,P=(_+m)/4;return y>S&&y>D?y<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(y),i=T/n,s=w/n):S>D?S<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(S),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 b=Math.sqrt((m-_)*(m-_)+(f-p)*(f-p)+(d-h)*(d-h));return Math.abs(b)<.001&&(b=1),this.x=(m-_)/b,this.y=(f-p)/b,this.z=(d-h)/b,this.w=Math.acos((c+u+g-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}},vf=class extends Nr{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Qe(0,0,t,e),this.scissorTest=!1,this.viewport=new Qe(0,0,t,e);let i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:gi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let s=new ii(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 Ec(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"})}},nr=class extends vf{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},Tc=class extends ii{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=ti,this.minFilter=ti,this.wrapR=Es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var yf=class extends ii{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=ti,this.minFilter=ti,this.wrapR=Es,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,o,a){let l=n[i+0],c=n[i+1],h=n[i+2],f=n[i+3],d=s[o+0],u=s[o+1],_=s[o+2],p=s[o+3];if(a===0){t[e+0]=l,t[e+1]=c,t[e+2]=h,t[e+3]=f;return}if(a===1){t[e+0]=d,t[e+1]=u,t[e+2]=_,t[e+3]=p;return}if(f!==p||l!==d||c!==u||h!==_){let m=1-a,g=l*d+c*u+h*_+f*p,b=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){let D=Math.sqrt(y),T=Math.atan2(D,g*b);m=Math.sin(m*T)/D,a=Math.sin(a*T)/D}let S=a*b;if(l=l*m+d*S,c=c*m+u*S,h=h*m+_*S,f=f*m+p*S,m===1-a){let D=1/Math.sqrt(l*l+c*c+h*h+f*f);l*=D,c*=D,h*=D,f*=D}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=f}static multiplyQuaternionsFlat(t,e,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],h=n[i+3],f=s[o],d=s[o+1],u=s[o+2],_=s[o+3];return t[e]=a*_+h*f+l*u-c*d,t[e+1]=l*_+h*d+c*f-a*u,t[e+2]=c*_+h*u+a*d-l*f,t[e+3]=h*_-a*f-l*d-c*u,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),h=a(i/2),f=a(s/2),d=l(n/2),u=l(i/2),_=l(s/2);switch(o){case"XYZ":this._x=d*h*f+c*u*_,this._y=c*u*f-d*h*_,this._z=c*h*_+d*u*f,this._w=c*h*f-d*u*_;break;case"YXZ":this._x=d*h*f+c*u*_,this._y=c*u*f-d*h*_,this._z=c*h*_-d*u*f,this._w=c*h*f+d*u*_;break;case"ZXY":this._x=d*h*f-c*u*_,this._y=c*u*f+d*h*_,this._z=c*h*_+d*u*f,this._w=c*h*f-d*u*_;break;case"ZYX":this._x=d*h*f-c*u*_,this._y=c*u*f+d*h*_,this._z=c*h*_-d*u*f,this._w=c*h*f+d*u*_;break;case"YZX":this._x=d*h*f+c*u*_,this._y=c*u*f+d*h*_,this._z=c*h*_-d*u*f,this._w=c*h*f-d*u*_;break;case"XZY":this._x=d*h*f-c*u*_,this._y=c*u*f-d*h*_,this._z=c*h*_+d*u*f,this._w=c*h*f+d*u*_;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],h=e[6],f=e[10],d=n+a+f;if(d>0){let u=.5/Math.sqrt(d+1);this._w=.25/u,this._x=(h-l)*u,this._y=(s-c)*u,this._z=(o-i)*u}else if(n>a&&n>f){let u=2*Math.sqrt(1+n-a-f);this._w=(h-l)/u,this._x=.25*u,this._y=(i+o)/u,this._z=(s+c)/u}else if(a>f){let u=2*Math.sqrt(1+a-n-f);this._w=(s-c)/u,this._x=(i+o)/u,this._y=.25*u,this._z=(l+h)/u}else{let u=2*Math.sqrt(1+f-n-a);this._w=(o-i)/u,this._x=(s+c)/u,this._y=(l+h)/u,this._z=.25*u}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(Fn(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,h=e._w;return this._x=n*h+o*a+i*c-s*l,this._y=i*h+o*l+s*a-n*c,this._z=s*h+o*c+n*l-i*a,this._w=o*h-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 u=1-e;return this._w=u*o+e*this._w,this._x=u*n+e*this._x,this._y=u*i+e*this._y,this._z=u*s+e*this._z,this.normalize(),this}let c=Math.sqrt(l),h=Math.atan2(c,a),f=Math.sin((1-e)*h)/c,d=Math.sin(e*h)/c;return this._w=o*f+this._w*d,this._x=n*f+this._x*d,this._y=i*f+this._y*d,this._z=s*f+this._z*d,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}},nt=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(Hg.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Hg.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),h=2*(a*e-s*i),f=2*(s*n-o*e);return this.x=e+l*c+o*f-a*h,this.y=n+l*h+a*c-s*f,this.z=i+l*f+s*h-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 Hh.copy(this).projectOnVector(t),this.sub(Hh)}reflect(t){return this.sub(Hh.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(Fn(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}},Hh=new nt,Hg=new Ur,As=class{constructor(t=new nt(1/0,1/0,1/0),e=new nt(-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(di.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(di.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=di.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,di):di.fromBufferAttribute(s,o),di.applyMatrix4(t.matrixWorld),this.expandByPoint(di);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Zl.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Zl.copy(n.boundingBox)),Zl.applyMatrix4(t.matrixWorld),this.union(Zl)}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,di),di.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(Aa),Jl.subVectors(this.max,Aa),co.subVectors(t.a,Aa),uo.subVectors(t.b,Aa),ho.subVectors(t.c,Aa),Sr.subVectors(uo,co),Mr.subVectors(ho,uo),gs.subVectors(co,ho);let e=[0,-Sr.z,Sr.y,0,-Mr.z,Mr.y,0,-gs.z,gs.y,Sr.z,0,-Sr.x,Mr.z,0,-Mr.x,gs.z,0,-gs.x,-Sr.y,Sr.x,0,-Mr.y,Mr.x,0,-gs.y,gs.x,0];return!Gh(e,co,uo,ho,Jl)||(e=[1,0,0,0,1,0,0,0,1],!Gh(e,co,uo,ho,Jl))?!1:($l.crossVectors(Sr,Mr),e=[$l.x,$l.y,$l.z],Gh(e,co,uo,ho,Jl))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,di).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(di).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:(qi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),qi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),qi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),qi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),qi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),qi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),qi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),qi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(qi),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)}},qi=[new nt,new nt,new nt,new nt,new nt,new nt,new nt,new nt],di=new nt,Zl=new As,co=new nt,uo=new nt,ho=new nt,Sr=new nt,Mr=new nt,gs=new nt,Aa=new nt,Jl=new nt,$l=new nt,_s=new nt;function Gh(r,t,e,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){_s.fromArray(r,s);let a=i.x*Math.abs(_s.x)+i.y*Math.abs(_s.y)+i.z*Math.abs(_s.z),l=t.dot(_s),c=e.dot(_s),h=n.dot(_s);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>a)return!1}return!0}var vS=new As,Da=new nt,Wh=new nt,Lo=class{constructor(t=new nt,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):vS.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;Da.subVectors(t,this.center);let e=Da.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(Da,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):(Wh.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Da.copy(t.center).add(Wh)),this.expandByPoint(Da.copy(t.center).sub(Wh))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},Zi=new nt,Xh=new nt,Kl=new nt,br=new nt,Yh=new nt,jl=new nt,qh=new nt,Ac=class{constructor(t=new nt,e=new nt(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,Zi)),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=Zi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Zi.copy(this.origin).addScaledVector(this.direction,e),Zi.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Xh.copy(t).add(e).multiplyScalar(.5),Kl.copy(e).sub(t).normalize(),br.copy(this.origin).sub(Xh);let s=t.distanceTo(e)*.5,o=-this.direction.dot(Kl),a=br.dot(this.direction),l=-br.dot(Kl),c=br.lengthSq(),h=Math.abs(1-o*o),f,d,u,_;if(h>0)if(f=o*l-a,d=o*a-l,_=s*h,f>=0)if(d>=-_)if(d<=_){let p=1/h;f*=p,d*=p,u=f*(f+o*d+2*a)+d*(o*f+d+2*l)+c}else d=s,f=Math.max(0,-(o*d+a)),u=-f*f+d*(d+2*l)+c;else d=-s,f=Math.max(0,-(o*d+a)),u=-f*f+d*(d+2*l)+c;else d<=-_?(f=Math.max(0,-(-o*s+a)),d=f>0?-s:Math.min(Math.max(-s,-l),s),u=-f*f+d*(d+2*l)+c):d<=_?(f=0,d=Math.min(Math.max(-s,-l),s),u=d*(d+2*l)+c):(f=Math.max(0,-(o*s+a)),d=f>0?s:Math.min(Math.max(-s,-l),s),u=-f*f+d*(d+2*l)+c);else d=o>0?-s:s,f=Math.max(0,-(o*d+a)),u=-f*f+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(Xh).addScaledVector(Kl,d),u}intersectSphere(t,e){Zi.subVectors(t.center,this.origin);let n=Zi.dot(this.direction),i=Zi.dot(Zi)-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,h=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(n=(t.min.x-d.x)*c,i=(t.max.x-d.x)*c):(n=(t.max.x-d.x)*c,i=(t.min.x-d.x)*c),h>=0?(s=(t.min.y-d.y)*h,o=(t.max.y-d.y)*h):(s=(t.max.y-d.y)*h,o=(t.min.y-d.y)*h),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),f>=0?(a=(t.min.z-d.z)*f,l=(t.max.z-d.z)*f):(a=(t.max.z-d.z)*f,l=(t.min.z-d.z)*f),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,Zi)!==null}intersectTriangle(t,e,n,i,s){Yh.subVectors(e,t),jl.subVectors(n,t),qh.crossVectors(Yh,jl);let o=this.direction.dot(qh),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;br.subVectors(this.origin,t);let l=a*this.direction.dot(jl.crossVectors(br,jl));if(l<0)return null;let c=a*this.direction.dot(Yh.cross(br));if(c<0||l+c>o)return null;let h=-a*br.dot(qh);return h<0?null:this.at(h/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)}},Ue=class r{constructor(t,e,n,i,s,o,a,l,c,h,f,d,u,_,p,m){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,h,f,d,u,_,p,m)}set(t,e,n,i,s,o,a,l,c,h,f,d,u,_,p,m){let g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=h,g[10]=f,g[14]=d,g[3]=u,g[7]=_,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new 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/fo.setFromMatrixColumn(t,0).length(),s=1/fo.setFromMatrixColumn(t,1).length(),o=1/fo.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),h=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){let d=o*h,u=o*f,_=a*h,p=a*f;e[0]=l*h,e[4]=-l*f,e[8]=c,e[1]=u+_*c,e[5]=d-p*c,e[9]=-a*l,e[2]=p-d*c,e[6]=_+u*c,e[10]=o*l}else if(t.order==="YXZ"){let d=l*h,u=l*f,_=c*h,p=c*f;e[0]=d+p*a,e[4]=_*a-u,e[8]=o*c,e[1]=o*f,e[5]=o*h,e[9]=-a,e[2]=u*a-_,e[6]=p+d*a,e[10]=o*l}else if(t.order==="ZXY"){let d=l*h,u=l*f,_=c*h,p=c*f;e[0]=d-p*a,e[4]=-o*f,e[8]=_+u*a,e[1]=u+_*a,e[5]=o*h,e[9]=p-d*a,e[2]=-o*c,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){let d=o*h,u=o*f,_=a*h,p=a*f;e[0]=l*h,e[4]=_*c-u,e[8]=d*c+p,e[1]=l*f,e[5]=p*c+d,e[9]=u*c-_,e[2]=-c,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){let d=o*l,u=o*c,_=a*l,p=a*c;e[0]=l*h,e[4]=p-d*f,e[8]=_*f+u,e[1]=f,e[5]=o*h,e[9]=-a*h,e[2]=-c*h,e[6]=u*f+_,e[10]=d-p*f}else if(t.order==="XZY"){let d=o*l,u=o*c,_=a*l,p=a*c;e[0]=l*h,e[4]=-f,e[8]=c*h,e[1]=d*f+p,e[5]=o*h,e[9]=u*f-_,e[2]=_*f-u,e[6]=a*h,e[10]=p*f+d}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(yS,t,SS)}lookAt(t,e,n){let i=this.elements;return Vn.subVectors(t,e),Vn.lengthSq()===0&&(Vn.z=1),Vn.normalize(),wr.crossVectors(n,Vn),wr.lengthSq()===0&&(Math.abs(n.z)===1?Vn.x+=1e-4:Vn.z+=1e-4,Vn.normalize(),wr.crossVectors(n,Vn)),wr.normalize(),Ql.crossVectors(Vn,wr),i[0]=wr.x,i[4]=Ql.x,i[8]=Vn.x,i[1]=wr.y,i[5]=Ql.y,i[9]=Vn.y,i[2]=wr.z,i[6]=Ql.z,i[10]=Vn.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],h=n[1],f=n[5],d=n[9],u=n[13],_=n[2],p=n[6],m=n[10],g=n[14],b=n[3],y=n[7],S=n[11],D=n[15],T=i[0],w=i[4],P=i[8],M=i[12],v=i[1],I=i[5],N=i[9],C=i[13],V=i[2],$=i[6],W=i[10],Z=i[14],z=i[3],U=i[7],R=i[11],at=i[15];return s[0]=o*T+a*v+l*V+c*z,s[4]=o*w+a*I+l*$+c*U,s[8]=o*P+a*N+l*W+c*R,s[12]=o*M+a*C+l*Z+c*at,s[1]=h*T+f*v+d*V+u*z,s[5]=h*w+f*I+d*$+u*U,s[9]=h*P+f*N+d*W+u*R,s[13]=h*M+f*C+d*Z+u*at,s[2]=_*T+p*v+m*V+g*z,s[6]=_*w+p*I+m*$+g*U,s[10]=_*P+p*N+m*W+g*R,s[14]=_*M+p*C+m*Z+g*at,s[3]=b*T+y*v+S*V+D*z,s[7]=b*w+y*I+S*$+D*U,s[11]=b*P+y*N+S*W+D*R,s[15]=b*M+y*C+S*Z+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],o=t[1],a=t[5],l=t[9],c=t[13],h=t[2],f=t[6],d=t[10],u=t[14],_=t[3],p=t[7],m=t[11],g=t[15];return _*(+s*l*f-i*c*f-s*a*d+n*c*d+i*a*u-n*l*u)+p*(+e*l*u-e*c*d+s*o*d-i*o*u+i*c*h-s*l*h)+m*(+e*c*f-e*a*u-s*o*f+n*o*u+s*a*h-n*c*h)+g*(-i*a*h-e*l*f+e*a*d+i*o*f-n*o*d+n*l*h)}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],h=t[8],f=t[9],d=t[10],u=t[11],_=t[12],p=t[13],m=t[14],g=t[15],b=f*m*c-p*d*c+p*l*u-a*m*u-f*l*g+a*d*g,y=_*d*c-h*m*c-_*l*u+o*m*u+h*l*g-o*d*g,S=h*p*c-_*f*c+_*a*u-o*p*u-h*a*g+o*f*g,D=_*f*l-h*p*l-_*a*d+o*p*d+h*a*m-o*f*m,T=e*b+n*y+i*S+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]=b*w,t[1]=(p*d*s-f*m*s-p*i*u+n*m*u+f*i*g-n*d*g)*w,t[2]=(a*m*s-p*l*s+p*i*c-n*m*c-a*i*g+n*l*g)*w,t[3]=(f*l*s-a*d*s-f*i*c+n*d*c+a*i*u-n*l*u)*w,t[4]=y*w,t[5]=(h*m*s-_*d*s+_*i*u-e*m*u-h*i*g+e*d*g)*w,t[6]=(_*l*s-o*m*s-_*i*c+e*m*c+o*i*g-e*l*g)*w,t[7]=(o*d*s-h*l*s+h*i*c-e*d*c-o*i*u+e*l*u)*w,t[8]=S*w,t[9]=(_*f*s-h*p*s-_*n*u+e*p*u+h*n*g-e*f*g)*w,t[10]=(o*p*s-_*a*s+_*n*c-e*p*c-o*n*g+e*a*g)*w,t[11]=(h*a*s-o*f*s-h*n*c+e*f*c+o*n*u-e*a*u)*w,t[12]=D*w,t[13]=(h*p*i-_*f*i+_*n*d-e*p*d-h*n*m+e*f*m)*w,t[14]=(_*a*i-o*p*i-_*n*l+e*p*l+o*n*m-e*a*m)*w,t[15]=(o*f*i-h*a*i+h*n*l-e*f*l-o*n*d+e*a*d)*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,o=t.x,a=t.y,l=t.z,c=s*o,h=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,h*a+n,h*l-i*o,0,c*l-i*a,h*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,h=o+o,f=a+a,d=s*c,u=s*h,_=s*f,p=o*h,m=o*f,g=a*f,b=l*c,y=l*h,S=l*f,D=n.x,T=n.y,w=n.z;return i[0]=(1-(p+g))*D,i[1]=(u+S)*D,i[2]=(_-y)*D,i[3]=0,i[4]=(u-S)*T,i[5]=(1-(d+g))*T,i[6]=(m+b)*T,i[7]=0,i[8]=(_+y)*w,i[9]=(m-b)*w,i[10]=(1-(d+p))*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=fo.set(i[0],i[1],i[2]).length(),o=fo.set(i[4],i[5],i[6]).length(),a=fo.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],pi.copy(this);let c=1/s,h=1/o,f=1/a;return pi.elements[0]*=c,pi.elements[1]*=c,pi.elements[2]*=c,pi.elements[4]*=h,pi.elements[5]*=h,pi.elements[6]*=h,pi.elements[8]*=f,pi.elements[9]*=f,pi.elements[10]*=f,e.setFromRotationMatrix(pi),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,i,s,o,a=er){let l=this.elements,c=2*s/(e-t),h=2*s/(n-i),f=(e+t)/(e-t),d=(n+i)/(n-i),u,_;if(a===er)u=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(a===bc)u=-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]=f,l[12]=0,l[1]=0,l[5]=h,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=u,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,o,a=er){let l=this.elements,c=1/(e-t),h=1/(n-i),f=1/(o-s),d=(e+t)*c,u=(n+i)*h,_,p;if(a===er)_=(o+s)*f,p=-2*f;else if(a===bc)_=s*f,p=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-u,l[2]=0,l[6]=0,l[10]=p,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}},fo=new nt,pi=new Ue,yS=new nt(0,0,0),SS=new nt(1,1,1),wr=new nt,Ql=new nt,Vn=new nt,Gg=new Ue,Wg=new Ur,ir=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],h=i[9],f=i[2],d=i[6],u=i[10];switch(e){case"XYZ":this._y=Math.asin(Fn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,u),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Fn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,u),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(Fn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,u),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Fn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,u),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Fn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,u));break;case"XZY":this._z=Math.asin(-Fn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,u),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 Gg.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Gg,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Wg.setFromEuler(this),this.setFromQuaternion(Wg,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}};ir.DEFAULT_ORDER="XYZ";var Dc=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}},MS=0,Xg=new nt,po=new Ur,Ji=new Ue,tc=new nt,Ca=new nt,bS=new nt,wS=new Ur,Yg=new nt(1,0,0),qg=new nt(0,1,0),Zg=new nt(0,0,1),Jg={type:"added"},ES={type:"removed"},mo={type:"childadded",child:null},Zh={type:"childremoved",child:null},mn=class r extends Nr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:MS++}),this.uuid=Ba(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new nt,e=new ir,n=new Ur,i=new nt(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 Ue},normalMatrix:{value:new se}}),this.matrix=new Ue,this.matrixWorld=new Ue,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Dc,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 po.setFromAxisAngle(t,e),this.quaternion.multiply(po),this}rotateOnWorldAxis(t,e){return po.setFromAxisAngle(t,e),this.quaternion.premultiply(po),this}rotateX(t){return this.rotateOnAxis(Yg,t)}rotateY(t){return this.rotateOnAxis(qg,t)}rotateZ(t){return this.rotateOnAxis(Zg,t)}translateOnAxis(t,e){return Xg.copy(t).applyQuaternion(this.quaternion),this.position.add(Xg.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Yg,t)}translateY(t){return this.translateOnAxis(qg,t)}translateZ(t){return this.translateOnAxis(Zg,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ji.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?tc.copy(t):tc.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),Ca.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ji.lookAt(Ca,tc,this.up):Ji.lookAt(tc,Ca,this.up),this.quaternion.setFromRotationMatrix(Ji),i&&(Ji.extractRotation(i.matrixWorld),po.setFromRotationMatrix(Ji),this.quaternion.premultiply(po.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(Jg),mo.child=t,this.dispatchEvent(mo),mo.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(ES),Zh.child=t,this.dispatchEvent(Zh),Zh.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),Ji.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Ji.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ji),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Jg),mo.child=t,this.dispatchEvent(mo),mo.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(Ca,t,bS),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ca,wS,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,h=l.length;c<h;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 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),h=o(t.images),f=o(t.shapes),d=o(t.skeletons),u=o(t.animations),_=o(t.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),f.length>0&&(n.shapes=f),d.length>0&&(n.skeletons=d),u.length>0&&(n.animations=u),_.length>0&&(n.nodes=_)}return n.object=i,n;function o(a){let l=[];for(let c in a){let h=a[c];delete h.metadata,l.push(h)}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}};mn.DEFAULT_UP=new nt(0,1,0);mn.DEFAULT_MATRIX_AUTO_UPDATE=!0;mn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var mi=new nt,$i=new nt,Jh=new nt,Ki=new nt,go=new nt,_o=new nt,$g=new nt,$h=new nt,Kh=new nt,jh=new nt,Eo=class r{constructor(t=new nt,e=new nt,n=new nt){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),mi.subVectors(t,e),i.cross(mi);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){mi.subVectors(i,e),$i.subVectors(n,e),Jh.subVectors(t,e);let o=mi.dot(mi),a=mi.dot($i),l=mi.dot(Jh),c=$i.dot($i),h=$i.dot(Jh),f=o*c-a*a;if(f===0)return s.set(0,0,0),null;let d=1/f,u=(c*l-a*h)*d,_=(o*h-a*l)*d;return s.set(1-u-_,_,u)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Ki)===null?!1:Ki.x>=0&&Ki.y>=0&&Ki.x+Ki.y<=1}static getInterpolation(t,e,n,i,s,o,a,l){return this.getBarycoord(t,e,n,i,Ki)===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,Ki.x),l.addScaledVector(o,Ki.y),l.addScaledVector(a,Ki.z),l)}static isFrontFacing(t,e,n,i){return mi.subVectors(n,e),$i.subVectors(t,e),mi.cross($i).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 mi.subVectors(this.c,this.b),$i.subVectors(this.a,this.b),mi.cross($i).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;go.subVectors(i,n),_o.subVectors(s,n),$h.subVectors(t,n);let l=go.dot($h),c=_o.dot($h);if(l<=0&&c<=0)return e.copy(n);Kh.subVectors(t,i);let h=go.dot(Kh),f=_o.dot(Kh);if(h>=0&&f<=h)return e.copy(i);let d=l*f-h*c;if(d<=0&&l>=0&&h<=0)return o=l/(l-h),e.copy(n).addScaledVector(go,o);jh.subVectors(t,s);let u=go.dot(jh),_=_o.dot(jh);if(_>=0&&u<=_)return e.copy(s);let p=u*c-l*_;if(p<=0&&c>=0&&_<=0)return a=c/(c-_),e.copy(n).addScaledVector(_o,a);let m=h*_-u*f;if(m<=0&&f-h>=0&&u-_>=0)return $g.subVectors(s,i),a=(f-h)/(f-h+(u-_)),e.copy(i).addScaledVector($g,a);let g=1/(m+p+d);return o=p*g,a=d*g,e.copy(n).addScaledVector(go,o).addScaledVector(_o,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},V_={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},Er={h:0,s:0,l:0},ec={h:0,s:0,l:0};function Qh(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 ge=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=Qn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Se.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=Se.workingColorSpace){return this.r=t,this.g=e,this.b=n,Se.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=Se.workingColorSpace){if(t=dS(t,1),e=Fn(e,0,1),n=Fn(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=Qh(o,s,t+1/3),this.g=Qh(o,s,t),this.b=Qh(o,s,t-1/3)}return Se.toWorkingColorSpace(this,i),this}setStyle(t,e=Qn){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=Qn){let n=V_[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=Do(t.r),this.g=Do(t.g),this.b=Do(t.b),this}copyLinearToSRGB(t){return this.r=zh(t.r),this.g=zh(t.g),this.b=zh(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Qn){return Se.fromWorkingColorSpace(pn.copy(this),t),Math.round(Fn(pn.r*255,0,255))*65536+Math.round(Fn(pn.g*255,0,255))*256+Math.round(Fn(pn.b*255,0,255))}getHexString(t=Qn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Se.workingColorSpace){Se.fromWorkingColorSpace(pn.copy(this),e);let n=pn.r,i=pn.g,s=pn.b,o=Math.max(n,i,s),a=Math.min(n,i,s),l,c,h=(a+o)/2;if(a===o)l=0,c=0;else{let f=o-a;switch(c=h<=.5?f/(o+a):f/(2-o-a),o){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=h,t}getRGB(t,e=Se.workingColorSpace){return Se.fromWorkingColorSpace(pn.copy(this),e),t.r=pn.r,t.g=pn.g,t.b=pn.b,t}getStyle(t=Qn){Se.fromWorkingColorSpace(pn.copy(this),t);let e=pn.r,n=pn.g,i=pn.b;return t!==Qn?`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(Er),this.setHSL(Er.h+t,Er.s+e,Er.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(Er),t.getHSL(ec);let n=Bh(Er.h,ec.h,e),i=Bh(Er.s,ec.s,e),s=Bh(Er.l,ec.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}},pn=new ge;ge.NAMES=V_;var TS=0,Ds=class extends Nr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:TS++}),this.uuid=Ba(),this.name="",this.type="Material",this.blending=Pr,this.side=Lr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=hf,this.blendDst=ff,this.blendEquation=bs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ge(0,0,0),this.blendAlpha=0,this.depthFunc=_c,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Ug,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ao,this.stencilZFail=ao,this.stencilZPass=ao,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!==Pr&&(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!==hf&&(n.blendSrc=this.blendSrc),this.blendDst!==ff&&(n.blendDst=this.blendDst),this.blendEquation!==bs&&(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!==_c&&(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!==Ug&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ao&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ao&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ao&&(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++}},Cc=class extends Ds{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ge(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 ir,this.combine=R_,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 Ve=new nt,nc=new _e,ei=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=Og,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Dr,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return mS("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++)nc.fromBufferAttribute(this,e),nc.applyMatrix3(t),this.setXY(e,nc.x,nc.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix3(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix4(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Ve.fromBufferAttribute(this,e),Ve.applyNormalMatrix(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Ve.fromBufferAttribute(this,e),Ve.transformDirection(t),this.setXYZ(e,Ve.x,Ve.y,Ve.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=Ta(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Ln(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ta(e,this.array)),e}setX(t,e){return this.normalized&&(e=Ln(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ta(e,this.array)),e}setY(t,e){return this.normalized&&(e=Ln(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=Ta(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Ln(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=Ta(e,this.array)),e}setW(t,e){return this.normalized&&(e=Ln(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Ln(e,this.array),n=Ln(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=Ln(e,this.array),n=Ln(n,this.array),i=Ln(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=Ln(e,this.array),n=Ln(n,this.array),i=Ln(i,this.array),s=Ln(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!==Og&&(t.usage=this.usage),t}};var Rc=class extends ei{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var Pc=class extends ei{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var ni=class extends ei{constructor(t,e,n){super(new Float32Array(t),e,n)}},AS=0,jn=new Ue,tf=new mn,xo=new nt,Hn=new As,Ra=new As,je=new nt,Ni=class r extends Nr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:AS++}),this.uuid=Ba(),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(z_(t)?Pc:Rc)(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 se().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 jn.makeRotationFromQuaternion(t),this.applyMatrix4(jn),this}rotateX(t){return jn.makeRotationX(t),this.applyMatrix4(jn),this}rotateY(t){return jn.makeRotationY(t),this.applyMatrix4(jn),this}rotateZ(t){return jn.makeRotationZ(t),this.applyMatrix4(jn),this}translate(t,e,n){return jn.makeTranslation(t,e,n),this.applyMatrix4(jn),this}scale(t,e,n){return jn.makeScale(t,e,n),this.applyMatrix4(jn),this}lookAt(t){return tf.lookAt(t),tf.updateMatrix(),this.applyMatrix4(tf.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(xo).negate(),this.translate(xo.x,xo.y,xo.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 ni(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new As);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 nt(-1/0,-1/0,-1/0),new nt(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];Hn.setFromBufferAttribute(s),this.morphTargetsRelative?(je.addVectors(this.boundingBox.min,Hn.min),this.boundingBox.expandByPoint(je),je.addVectors(this.boundingBox.max,Hn.max),this.boundingBox.expandByPoint(je)):(this.boundingBox.expandByPoint(Hn.min),this.boundingBox.expandByPoint(Hn.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 Lo);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 nt,1/0);return}if(t){let n=this.boundingSphere.center;if(Hn.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){let a=e[s];Ra.setFromBufferAttribute(a),this.morphTargetsRelative?(je.addVectors(Hn.min,Ra.min),Hn.expandByPoint(je),je.addVectors(Hn.max,Ra.max),Hn.expandByPoint(je)):(Hn.expandByPoint(Ra.min),Hn.expandByPoint(Ra.max))}Hn.getCenter(n);let i=0;for(let s=0,o=t.count;s<o;s++)je.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(je));if(e)for(let s=0,o=e.length;s<o;s++){let a=e[s],l=this.morphTargetsRelative;for(let c=0,h=a.count;c<h;c++)je.fromBufferAttribute(a,c),l&&(xo.fromBufferAttribute(t,c),je.add(xo)),i=Math.max(i,n.distanceToSquared(je))}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 ei(new Float32Array(4*n.count),4));let o=this.getAttribute("tangent"),a=[],l=[];for(let P=0;P<n.count;P++)a[P]=new nt,l[P]=new nt;let c=new nt,h=new nt,f=new nt,d=new _e,u=new _e,_=new _e,p=new nt,m=new nt;function g(P,M,v){c.fromBufferAttribute(n,P),h.fromBufferAttribute(n,M),f.fromBufferAttribute(n,v),d.fromBufferAttribute(s,P),u.fromBufferAttribute(s,M),_.fromBufferAttribute(s,v),h.sub(c),f.sub(c),u.sub(d),_.sub(d);let I=1/(u.x*_.y-_.x*u.y);isFinite(I)&&(p.copy(h).multiplyScalar(_.y).addScaledVector(f,-u.y).multiplyScalar(I),m.copy(f).multiplyScalar(u.x).addScaledVector(h,-_.x).multiplyScalar(I),a[P].add(p),a[M].add(p),a[v].add(p),l[P].add(m),l[M].add(m),l[v].add(m))}let b=this.groups;b.length===0&&(b=[{start:0,count:t.count}]);for(let P=0,M=b.length;P<M;++P){let v=b[P],I=v.start,N=v.count;for(let C=I,V=I+N;C<V;C+=3)g(t.getX(C+0),t.getX(C+1),t.getX(C+2))}let y=new nt,S=new nt,D=new nt,T=new nt;function w(P){D.fromBufferAttribute(i,P),T.copy(D);let M=a[P];y.copy(M),y.sub(D.multiplyScalar(D.dot(M))).normalize(),S.crossVectors(T,M);let I=S.dot(l[P])<0?-1:1;o.setXYZW(P,y.x,y.y,y.z,I)}for(let P=0,M=b.length;P<M;++P){let v=b[P],I=v.start,N=v.count;for(let C=I,V=I+N;C<V;C+=3)w(t.getX(C+0)),w(t.getX(C+1)),w(t.getX(C+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 ei(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let d=0,u=n.count;d<u;d++)n.setXYZ(d,0,0,0);let i=new nt,s=new nt,o=new nt,a=new nt,l=new nt,c=new nt,h=new nt,f=new nt;if(t)for(let d=0,u=t.count;d<u;d+=3){let _=t.getX(d+0),p=t.getX(d+1),m=t.getX(d+2);i.fromBufferAttribute(e,_),s.fromBufferAttribute(e,p),o.fromBufferAttribute(e,m),h.subVectors(o,s),f.subVectors(i,s),h.cross(f),a.fromBufferAttribute(n,_),l.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),a.add(h),l.add(h),c.add(h),n.setXYZ(_,a.x,a.y,a.z),n.setXYZ(p,l.x,l.y,l.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let d=0,u=e.count;d<u;d+=3)i.fromBufferAttribute(e,d+0),s.fromBufferAttribute(e,d+1),o.fromBufferAttribute(e,d+2),h.subVectors(o,s),f.subVectors(i,s),h.cross(f),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)je.fromBufferAttribute(t,e),je.normalize(),t.setXYZ(e,je.x,je.y,je.z)}toNonIndexed(){function t(a,l){let c=a.array,h=a.itemSize,f=a.normalized,d=new c.constructor(l.length*h),u=0,_=0;for(let p=0,m=l.length;p<m;p++){a.isInterleavedBufferAttribute?u=l[p]*a.data.stride+a.offset:u=l[p]*h;for(let g=0;g<h;g++)d[_++]=c[u++]}return new ei(d,h,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 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 h=0,f=c.length;h<f;h++){let d=c[h],u=t(d,n);l.push(u)}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],h=[];for(let f=0,d=c.length;f<d;f++){let u=c[f];h.push(u.toJSON(t.data))}h.length>0&&(i[l]=h,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 h=i[c];this.setAttribute(c,h.clone(e))}let s=t.morphAttributes;for(let c in s){let h=[],f=s[c];for(let d=0,u=f.length;d<u;d++)h.push(f[d].clone(e));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;let o=t.groups;for(let c=0,h=o.length;c<h;c++){let f=o[c];this.addGroup(f.start,f.count,f.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"})}},Kg=new Ue,xs=new Ac,ic=new Lo,jg=new nt,vo=new nt,yo=new nt,So=new nt,ef=new nt,rc=new nt,sc=new _e,oc=new _e,ac=new _e,Qg=new nt,t_=new nt,e_=new nt,lc=new nt,cc=new nt,_i=class extends mn{constructor(t=new Ni,e=new Cc){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){rc.set(0,0,0);for(let l=0,c=s.length;l<c;l++){let h=a[l],f=s[l];h!==0&&(ef.fromBufferAttribute(f,t),o?rc.addScaledVector(ef,h):rc.addScaledVector(ef.sub(e),h))}e.add(rc)}return e}raycast(t,e){let n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ic.copy(n.boundingSphere),ic.applyMatrix4(s),xs.copy(t.ray).recast(t.near),!(ic.containsPoint(xs.origin)===!1&&(xs.intersectSphere(ic,jg)===null||xs.origin.distanceToSquared(jg)>(t.far-t.near)**2))&&(Kg.copy(s).invert(),xs.copy(t.ray).applyMatrix4(Kg),!(n.boundingBox!==null&&xs.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,xs)))}_computeIntersections(t,e,n){let i,s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,f=s.attributes.normal,d=s.groups,u=s.drawRange;if(a!==null)if(Array.isArray(o))for(let _=0,p=d.length;_<p;_++){let m=d[_],g=o[m.materialIndex],b=Math.max(m.start,u.start),y=Math.min(a.count,Math.min(m.start+m.count,u.start+u.count));for(let S=b,D=y;S<D;S+=3){let T=a.getX(S),w=a.getX(S+1),P=a.getX(S+2);i=uc(this,g,t,n,c,h,f,T,w,P),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=m.materialIndex,e.push(i))}}else{let _=Math.max(0,u.start),p=Math.min(a.count,u.start+u.count);for(let m=_,g=p;m<g;m+=3){let b=a.getX(m),y=a.getX(m+1),S=a.getX(m+2);i=uc(this,o,t,n,c,h,f,b,y,S),i&&(i.faceIndex=Math.floor(m/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(o))for(let _=0,p=d.length;_<p;_++){let m=d[_],g=o[m.materialIndex],b=Math.max(m.start,u.start),y=Math.min(l.count,Math.min(m.start+m.count,u.start+u.count));for(let S=b,D=y;S<D;S+=3){let T=S,w=S+1,P=S+2;i=uc(this,g,t,n,c,h,f,T,w,P),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=m.materialIndex,e.push(i))}}else{let _=Math.max(0,u.start),p=Math.min(l.count,u.start+u.count);for(let m=_,g=p;m<g;m+=3){let b=m,y=m+1,S=m+2;i=uc(this,o,t,n,c,h,f,b,y,S),i&&(i.faceIndex=Math.floor(m/3),e.push(i))}}}};function DS(r,t,e,n,i,s,o,a){let l;if(t.side===Nn?l=n.intersectTriangle(o,s,i,!0,a):l=n.intersectTriangle(i,s,o,t.side===Lr,a),l===null)return null;cc.copy(a),cc.applyMatrix4(r.matrixWorld);let c=e.ray.origin.distanceTo(cc);return c<e.near||c>e.far?null:{distance:c,point:cc.clone(),object:r}}function uc(r,t,e,n,i,s,o,a,l,c){r.getVertexPosition(a,vo),r.getVertexPosition(l,yo),r.getVertexPosition(c,So);let h=DS(r,t,e,n,vo,yo,So,lc);if(h){i&&(sc.fromBufferAttribute(i,a),oc.fromBufferAttribute(i,l),ac.fromBufferAttribute(i,c),h.uv=Eo.getInterpolation(lc,vo,yo,So,sc,oc,ac,new _e)),s&&(sc.fromBufferAttribute(s,a),oc.fromBufferAttribute(s,l),ac.fromBufferAttribute(s,c),h.uv1=Eo.getInterpolation(lc,vo,yo,So,sc,oc,ac,new _e)),o&&(Qg.fromBufferAttribute(o,a),t_.fromBufferAttribute(o,l),e_.fromBufferAttribute(o,c),h.normal=Eo.getInterpolation(lc,vo,yo,So,Qg,t_,e_,new nt),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));let f={a,b:l,c,normal:new nt,materialIndex:0};Eo.getNormal(vo,yo,So,f.normal),h.face=f}return h}var Fa=class r extends Ni{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=[],h=[],f=[],d=0,u=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 ni(c,3)),this.setAttribute("normal",new ni(h,3)),this.setAttribute("uv",new ni(f,2));function _(p,m,g,b,y,S,D,T,w,P,M){let v=S/w,I=D/P,N=S/2,C=D/2,V=T/2,$=w+1,W=P+1,Z=0,z=0,U=new nt;for(let R=0;R<W;R++){let at=R*I-C;for(let _t=0;_t<$;_t++){let Ut=_t*v-N;U[p]=Ut*b,U[m]=at*y,U[g]=V,c.push(U.x,U.y,U.z),U[p]=0,U[m]=0,U[g]=T>0?1:-1,h.push(U.x,U.y,U.z),f.push(_t/w),f.push(1-R/P),Z+=1}}for(let R=0;R<P;R++)for(let at=0;at<w;at++){let _t=d+at+$*R,Ut=d+at+$*(R+1),X=d+(at+1)+$*(R+1),ot=d+(at+1)+$*R;l.push(_t,Ut,ot),l.push(Ut,X,ot),z+=6}a.addGroup(u,z,M),u+=z,d+=Z}}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 Fo(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 Tn(r){let t={};for(let e=0;e<r.length;e++){let n=Fo(r[e]);for(let i in n)t[i]=n[i]}return t}function CS(r){let t=[];for(let e=0;e<r.length;e++)t.push(r[e].clone());return t}function H_(r){let t=r.getRenderTarget();return t===null?r.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Se.workingColorSpace}var RS={clone:Fo,merge:Tn},PS=`void main() {
|
|
2
2
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
3
|
-
}`,
|
|
3
|
+
}`,IS=`void main() {
|
|
4
4
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
5
|
-
}`,ri=class extends Ds{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=
|
|
5
|
+
}`,ri=class extends Ds{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=PS,this.fragmentShader=IS,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=Fo(t.uniforms),this.uniformsGroups=CS(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}},Ic=class extends mn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ue,this.projectionMatrix=new Ue,this.projectionMatrixInverse=new Ue,this.coordinateSystem=er}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 nt,n_=new _e,i_=new _e,An=class extends Ic{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=_f*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(Oh*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return _f*2*Math.atan(Math.tan(Oh*.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,n_,i_),e.subVectors(i_,n_)}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(Oh*.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}},Mo=-90,bo=1,Sf=class extends mn{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let i=new An(Mo,bo,t,e);i.layers=this.layers,this.add(i);let s=new An(Mo,bo,t,e);s.layers=this.layers,this.add(s);let o=new An(Mo,bo,t,e);o.layers=this.layers,this.add(o);let a=new An(Mo,bo,t,e);a.layers=this.layers,this.add(a);let l=new An(Mo,bo,t,e);l.layers=this.layers,this.add(l);let c=new An(Mo,bo,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===er)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===bc)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,h]=this.children,f=t.getRenderTarget(),d=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),_=t.xr.enabled;t.xr.enabled=!1;let p=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=p,t.setRenderTarget(n,5,i),t.render(e,h),t.setRenderTarget(f,d,u),t.xr.enabled=_,n.texture.needsPMREMUpdate=!0}},Lc=class extends ii{constructor(t,e,n,i,s,o,a,l,c,h){t=t!==void 0?t:[],e=e!==void 0?e:Ro,super(t,e,n,i,s,o,a,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},Mf=class extends nr{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 Lc(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:gi}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 Fa(5,5,5),s=new ri({name:"CubemapFromEquirect",uniforms:Fo(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Nn,blending:Rr});s.uniforms.tEquirect.value=e;let o=new _i(i,s),a=e.minFilter;return e.minFilter===Ts&&(e.minFilter=gi),new Sf(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)}},nf=new nt,
|
|
40
|
+
`},i=new Fa(5,5,5),s=new ri({name:"CubemapFromEquirect",uniforms:Fo(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Nn,blending:Rr});s.uniforms.tEquirect.value=e;let o=new _i(i,s),a=e.minFilter;return e.minFilter===Ts&&(e.minFilter=gi),new Sf(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)}},nf=new nt,LS=new nt,FS=new se,Qi=class{constructor(t=new nt(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=nf.subVectors(n,e).cross(LS.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(nf),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||FS.getNormalMatrix(t),i=this.coplanarPoint(nf).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)}},vs=new Lo,hc=new nt,Na=class{constructor(t=new Qi,e=new Qi,n=new Qi,i=new Qi,s=new Qi,o=new Qi){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=er){let n=this.planes,i=t.elements,s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],h=i[5],f=i[6],d=i[7],u=i[8],_=i[9],p=i[10],m=i[11],g=i[12],b=i[13],y=i[14],S=i[15];if(n[0].setComponents(l-s,d-c,m-u,S-g).normalize(),n[1].setComponents(l+s,d+c,m+u,S+g).normalize(),n[2].setComponents(l+o,d+h,m+_,S+b).normalize(),n[3].setComponents(l-o,d-h,m-_,S-b).normalize(),n[4].setComponents(l-a,d-f,m-p,S-y).normalize(),e===er)n[5].setComponents(l+a,d+f,m+p,S+y).normalize();else if(e===bc)n[5].setComponents(a,f,p,y).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(),vs.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),vs.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(vs)}intersectsSprite(t){return vs.center.set(0,0,0),vs.radius=.7071067811865476,vs.applyMatrix4(t.matrixWorld),this.intersectsSphere(vs)}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(hc.x=i.normal.x>0?t.max.x:t.min.x,hc.y=i.normal.y>0?t.max.y:t.min.y,hc.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(hc)<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 G_(){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 NS(r){let t=new WeakMap;function e(a,l){let c=a.array,h=a.usage,f=c.byteLength,d=r.createBuffer();r.bindBuffer(l,d),r.bufferData(l,c,h),a.onUploadCallback();let u;if(c instanceof Float32Array)u=r.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?u=r.HALF_FLOAT:u=r.UNSIGNED_SHORT;else if(c instanceof Int16Array)u=r.SHORT;else if(c instanceof Uint32Array)u=r.UNSIGNED_INT;else if(c instanceof Int32Array)u=r.INT;else if(c instanceof Int8Array)u=r.BYTE;else if(c instanceof Uint8Array)u=r.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)u=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:u,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function n(a,l,c){let h=l.array,f=l._updateRange,d=l.updateRanges;if(r.bindBuffer(c,a),f.count===-1&&d.length===0&&r.bufferSubData(c,0,h),d.length!==0){for(let u=0,_=d.length;u<_;u++){let p=d[u];r.bufferSubData(c,p.start*h.BYTES_PER_ELEMENT,h,p.start,p.count)}l.clearUpdateRanges()}f.count!==-1&&(r.bufferSubData(c,f.offset*h.BYTES_PER_ELEMENT,h,f.offset,f.count),f.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 h=t.get(a);(!h||h.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 Fc=class r extends Ni{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,h=l+1,f=t/a,d=e/l,u=[],_=[],p=[],m=[];for(let g=0;g<h;g++){let b=g*d-o;for(let y=0;y<c;y++){let S=y*f-s;_.push(S,-b,0),p.push(0,0,1),m.push(y/a),m.push(1-g/l)}}for(let g=0;g<l;g++)for(let b=0;b<a;b++){let y=b+c*g,S=b+c*(g+1),D=b+1+c*(g+1),T=b+1+c*g;u.push(y,S,T),u.push(S,D,T)}this.setIndex(u),this.setAttribute("position",new ni(_,3)),this.setAttribute("normal",new ni(p,3)),this.setAttribute("uv",new ni(m,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)}},US=`#ifdef USE_ALPHAHASH
|
|
41
41
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
42
|
-
#endif`,
|
|
42
|
+
#endif`,OS=`#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`,OS=`#ifdef USE_ALPHAMAP
|
|
78
|
-
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
|
|
79
77
|
#endif`,BS=`#ifdef USE_ALPHAMAP
|
|
78
|
+
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
|
|
79
|
+
#endif`,kS=`#ifdef USE_ALPHAMAP
|
|
80
80
|
uniform sampler2D alphaMap;
|
|
81
|
-
#endif`,
|
|
81
|
+
#endif`,zS=`#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`,
|
|
88
|
+
#endif`,VS=`#ifdef USE_ALPHATEST
|
|
89
89
|
uniform float alphaTest;
|
|
90
|
-
#endif`,
|
|
90
|
+
#endif`,HS=`#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`,
|
|
103
|
+
#endif`,GS=`#ifdef USE_AOMAP
|
|
104
104
|
uniform sampler2D aoMap;
|
|
105
105
|
uniform float aoMapIntensity;
|
|
106
|
-
#endif`,
|
|
106
|
+
#endif`,WS=`#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`,
|
|
120
|
+
#endif`,XS=`#ifdef USE_BATCHING
|
|
121
121
|
mat4 batchingMatrix = getBatchingMatrix( batchId );
|
|
122
|
-
#endif`,
|
|
122
|
+
#endif`,YS=`vec3 transformed = vec3( position );
|
|
123
123
|
#ifdef USE_ALPHAHASH
|
|
124
124
|
vPosition = vec3( position );
|
|
125
|
-
#endif`,
|
|
125
|
+
#endif`,qS=`vec3 objectNormal = vec3( normal );
|
|
126
126
|
#ifdef USE_TANGENT
|
|
127
127
|
vec3 objectTangent = vec3( tangent.xyz );
|
|
128
|
-
#endif`,
|
|
128
|
+
#endif`,ZS=`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`,
|
|
142
|
+
} // validated`,JS=`#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
|
|
205
|
+
#endif`,$S=`#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
|
|
226
|
+
#endif`,KS=`#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`,KS=`#if NUM_CLIPPING_PLANES > 0
|
|
273
|
-
varying vec3 vClipPosition;
|
|
274
|
-
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
|
|
275
272
|
#endif`,jS=`#if NUM_CLIPPING_PLANES > 0
|
|
276
273
|
varying vec3 vClipPosition;
|
|
274
|
+
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
|
|
277
275
|
#endif`,QS=`#if NUM_CLIPPING_PLANES > 0
|
|
276
|
+
varying vec3 vClipPosition;
|
|
277
|
+
#endif`,tM=`#if NUM_CLIPPING_PLANES > 0
|
|
278
278
|
vClipPosition = - mvPosition.xyz;
|
|
279
|
-
#endif`,
|
|
279
|
+
#endif`,eM=`#if defined( USE_COLOR_ALPHA )
|
|
280
280
|
diffuseColor *= vColor;
|
|
281
281
|
#elif defined( USE_COLOR )
|
|
282
282
|
diffuseColor.rgb *= vColor;
|
|
283
|
-
#endif`,
|
|
283
|
+
#endif`,nM=`#if defined( USE_COLOR_ALPHA )
|
|
284
284
|
varying vec4 vColor;
|
|
285
285
|
#elif defined( USE_COLOR )
|
|
286
286
|
varying vec3 vColor;
|
|
287
|
-
#endif`,
|
|
287
|
+
#endif`,iM=`#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`,
|
|
291
|
+
#endif`,rM=`#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`,
|
|
301
|
+
#endif`,sM=`#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`,
|
|
379
|
+
} // validated`,oM=`#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`,
|
|
472
|
+
#endif`,aM=`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`,
|
|
501
|
+
#endif`,lM=`#ifdef USE_DISPLACEMENTMAP
|
|
502
502
|
uniform sampler2D displacementMap;
|
|
503
503
|
uniform float displacementScale;
|
|
504
504
|
uniform float displacementBias;
|
|
505
|
-
#endif`,
|
|
505
|
+
#endif`,cM=`#ifdef USE_DISPLACEMENTMAP
|
|
506
506
|
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
|
|
507
|
-
#endif`,
|
|
507
|
+
#endif`,uM=`#ifdef USE_EMISSIVEMAP
|
|
508
508
|
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
|
|
509
509
|
totalEmissiveRadiance *= emissiveColor.rgb;
|
|
510
|
-
#endif`,
|
|
510
|
+
#endif`,hM=`#ifdef USE_EMISSIVEMAP
|
|
511
511
|
uniform sampler2D emissiveMap;
|
|
512
|
-
#endif`,
|
|
512
|
+
#endif`,fM="gl_FragColor = linearToOutputTexel( gl_FragColor );",dM=`
|
|
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
|
-
}`,
|
|
540
|
+
}`,pM=`#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`,
|
|
569
|
+
#endif`,mM=`#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`,
|
|
579
|
+
#endif`,gM=`#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`,
|
|
590
|
+
#endif`,_M=`#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`,
|
|
601
|
+
#endif`,xM=`#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`,xM=`#ifdef USE_FOG
|
|
619
|
-
vFogDepth = - mvPosition.z;
|
|
620
618
|
#endif`,vM=`#ifdef USE_FOG
|
|
621
|
-
|
|
619
|
+
vFogDepth = - mvPosition.z;
|
|
622
620
|
#endif`,yM=`#ifdef USE_FOG
|
|
621
|
+
varying float vFogDepth;
|
|
622
|
+
#endif`,SM=`#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`,
|
|
629
|
+
#endif`,MM=`#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`,
|
|
638
|
+
#endif`,bM=`#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
|
-
}`,
|
|
650
|
+
}`,wM=`#ifdef USE_LIGHTMAP
|
|
651
651
|
uniform sampler2D lightMap;
|
|
652
652
|
uniform float lightMapIntensity;
|
|
653
|
-
#endif`,
|
|
653
|
+
#endif`,EM=`LambertMaterial material;
|
|
654
654
|
material.diffuseColor = diffuseColor.rgb;
|
|
655
|
-
material.specularStrength = specularStrength;`,
|
|
655
|
+
material.specularStrength = specularStrength;`,TM=`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`,
|
|
669
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,AM=`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`,
|
|
792
|
+
#endif`,DM=`#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`,
|
|
826
|
-
material.diffuseColor = diffuseColor.rgb;`,
|
|
825
|
+
#endif`,CM=`ToonMaterial material;
|
|
826
|
+
material.diffuseColor = diffuseColor.rgb;`,RM=`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`,
|
|
838
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,PM=`BlinnPhongMaterial material;
|
|
839
839
|
material.diffuseColor = diffuseColor.rgb;
|
|
840
840
|
material.specularColor = specular;
|
|
841
841
|
material.specularShininess = shininess;
|
|
842
|
-
material.specularStrength = specularStrength;`,
|
|
842
|
+
material.specularStrength = specularStrength;`,IM=`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`,
|
|
859
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,LM=`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`,
|
|
945
|
+
#endif`,FM=`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
|
-
}`,
|
|
1246
|
+
}`,NM=`
|
|
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`,
|
|
1361
|
+
#endif`,UM=`#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`,
|
|
1380
|
+
#endif`,OM=`#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`,OM=`#if defined( USE_LOGDEPTHBUF )
|
|
1386
|
-
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
|
|
1387
1385
|
#endif`,BM=`#if defined( USE_LOGDEPTHBUF )
|
|
1386
|
+
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
|
|
1387
|
+
#endif`,kM=`#if defined( USE_LOGDEPTHBUF )
|
|
1388
1388
|
uniform float logDepthBufFC;
|
|
1389
1389
|
varying float vFragDepth;
|
|
1390
1390
|
varying float vIsPerspective;
|
|
1391
|
-
#endif`,
|
|
1391
|
+
#endif`,zM=`#ifdef USE_LOGDEPTHBUF
|
|
1392
1392
|
varying float vFragDepth;
|
|
1393
1393
|
varying float vIsPerspective;
|
|
1394
|
-
#endif`,
|
|
1394
|
+
#endif`,VM=`#ifdef USE_LOGDEPTHBUF
|
|
1395
1395
|
vFragDepth = 1.0 + gl_Position.w;
|
|
1396
1396
|
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
|
|
1397
|
-
#endif`,
|
|
1397
|
+
#endif`,HM=`#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`,
|
|
1404
|
+
#endif`,GM=`#ifdef USE_MAP
|
|
1405
1405
|
uniform sampler2D map;
|
|
1406
|
-
#endif`,
|
|
1406
|
+
#endif`,WM=`#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`,
|
|
1418
|
+
#endif`,XM=`#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`,
|
|
1430
|
+
#endif`,YM=`float metalnessFactor = metalness;
|
|
1431
1431
|
#ifdef USE_METALNESSMAP
|
|
1432
1432
|
vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
|
|
1433
1433
|
metalnessFactor *= texelMetalness.b;
|
|
1434
|
-
#endif`,
|
|
1434
|
+
#endif`,qM=`#ifdef USE_METALNESSMAP
|
|
1435
1435
|
uniform sampler2D metalnessMap;
|
|
1436
|
-
#endif`,
|
|
1436
|
+
#endif`,ZM=`#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`,
|
|
1442
|
+
#endif`,JM=`#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
|
|
1451
|
+
#endif`,$M=`#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
|
|
1463
|
+
#endif`,KM=`#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`,
|
|
1487
|
+
#endif`,jM=`#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`,
|
|
1505
|
+
#endif`,QM=`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;`,
|
|
1546
|
+
vec3 nonPerturbedNormal = normal;`,tb=`#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;`,QM=`#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`,
|
|
1561
|
+
#endif`,eb=`#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`,
|
|
1567
|
+
#endif`,nb=`#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`,
|
|
1573
|
+
#endif`,ib=`#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`,
|
|
1579
|
+
#endif`,rb=`#ifdef USE_NORMALMAP
|
|
1580
1580
|
uniform sampler2D normalMap;
|
|
1581
1581
|
uniform vec2 normalScale;
|
|
1582
1582
|
#endif
|
|
@@ -1598,13 +1598,13 @@ vec3 nonPerturbedNormal = normal;`,QM=`#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`,
|
|
1601
|
+
#endif`,sb=`#ifdef USE_CLEARCOAT
|
|
1602
1602
|
vec3 clearcoatNormal = nonPerturbedNormal;
|
|
1603
|
-
#endif`,
|
|
1603
|
+
#endif`,ob=`#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`,
|
|
1607
|
+
#endif`,ab=`#ifdef USE_CLEARCOATMAP
|
|
1608
1608
|
uniform sampler2D clearcoatMap;
|
|
1609
1609
|
#endif
|
|
1610
1610
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
|
@@ -1613,18 +1613,18 @@ vec3 nonPerturbedNormal = normal;`,QM=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1613
1613
|
#endif
|
|
1614
1614
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
|
1615
1615
|
uniform sampler2D clearcoatRoughnessMap;
|
|
1616
|
-
#endif`,
|
|
1616
|
+
#endif`,lb=`#ifdef USE_IRIDESCENCEMAP
|
|
1617
1617
|
uniform sampler2D iridescenceMap;
|
|
1618
1618
|
#endif
|
|
1619
1619
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
|
1620
1620
|
uniform sampler2D iridescenceThicknessMap;
|
|
1621
|
-
#endif`,
|
|
1621
|
+
#endif`,cb=`#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 );`,
|
|
1627
|
+
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,ub=`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
|
-
}`,
|
|
1668
|
+
}`,hb=`#ifdef PREMULTIPLIED_ALPHA
|
|
1669
1669
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
1670
|
-
#endif`,
|
|
1670
|
+
#endif`,fb=`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;`,
|
|
1678
|
+
gl_Position = projectionMatrix * mvPosition;`,db=`#ifdef DITHERING
|
|
1679
1679
|
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
|
|
1680
|
-
#endif`,
|
|
1680
|
+
#endif`,pb=`#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`,
|
|
1687
|
+
#endif`,mb=`float roughnessFactor = roughness;
|
|
1688
1688
|
#ifdef USE_ROUGHNESSMAP
|
|
1689
1689
|
vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
|
|
1690
1690
|
roughnessFactor *= texelRoughness.g;
|
|
1691
|
-
#endif`,
|
|
1691
|
+
#endif`,gb=`#ifdef USE_ROUGHNESSMAP
|
|
1692
1692
|
uniform sampler2D roughnessMap;
|
|
1693
|
-
#endif`,
|
|
1693
|
+
#endif`,_b=`#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;`,fb=`#ifdef DITHERING
|
|
|
1873
1873
|
}
|
|
1874
1874
|
return shadow;
|
|
1875
1875
|
}
|
|
1876
|
-
#endif`,
|
|
1876
|
+
#endif`,xb=`#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;`,fb=`#ifdef DITHERING
|
|
|
1911
1911
|
};
|
|
1912
1912
|
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
|
|
1913
1913
|
#endif
|
|
1914
|
-
#endif`,
|
|
1914
|
+
#endif`,vb=`#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;`,fb=`#ifdef DITHERING
|
|
|
1943
1943
|
vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
|
|
1944
1944
|
}
|
|
1945
1945
|
#pragma unroll_loop_end
|
|
1946
|
-
#endif`,
|
|
1946
|
+
#endif`,yb=`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;`,fb=`#ifdef DITHERING
|
|
|
1975
1975
|
#endif
|
|
1976
1976
|
#endif
|
|
1977
1977
|
return shadow;
|
|
1978
|
-
}`,
|
|
1978
|
+
}`,Sb=`#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`,
|
|
1983
|
+
#endif`,Mb=`#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;`,fb=`#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`,
|
|
1998
|
+
#endif`,bb=`#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;`,fb=`#ifdef DITHERING
|
|
|
2003
2003
|
skinned += boneMatZ * skinVertex * skinWeight.z;
|
|
2004
2004
|
skinned += boneMatW * skinVertex * skinWeight.w;
|
|
2005
2005
|
transformed = ( bindMatrixInverse * skinned ).xyz;
|
|
2006
|
-
#endif`,
|
|
2006
|
+
#endif`,wb=`#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;`,fb=`#ifdef DITHERING
|
|
|
2014
2014
|
#ifdef USE_TANGENT
|
|
2015
2015
|
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
|
|
2016
2016
|
#endif
|
|
2017
|
-
#endif`,
|
|
2017
|
+
#endif`,Eb=`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`,
|
|
2023
|
+
#endif`,Tb=`#ifdef USE_SPECULARMAP
|
|
2024
2024
|
uniform sampler2D specularMap;
|
|
2025
|
-
#endif`,
|
|
2025
|
+
#endif`,Ab=`#if defined( TONE_MAPPING )
|
|
2026
2026
|
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
|
|
2027
|
-
#endif`,
|
|
2027
|
+
#endif`,Db=`#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; }`,
|
|
2124
|
+
vec3 CustomToneMapping( vec3 color ) { return color; }`,Cb=`#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; }`,Db=`#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`,
|
|
2145
|
+
#endif`,Rb=`#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; }`,Db=`#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`,
|
|
2276
|
+
#endif`,Pb=`#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; }`,Db=`#ifdef USE_TRANSMISS
|
|
|
2343
2343
|
#ifdef USE_THICKNESSMAP
|
|
2344
2344
|
uniform mat3 thicknessMapTransform;
|
|
2345
2345
|
varying vec2 vThicknessMapUv;
|
|
2346
|
-
#endif`,
|
|
2346
|
+
#endif`,Ib=`#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; }`,Db=`#ifdef USE_TRANSMISS
|
|
|
2437
2437
|
#ifdef USE_THICKNESSMAP
|
|
2438
2438
|
uniform mat3 thicknessMapTransform;
|
|
2439
2439
|
varying vec2 vThicknessMapUv;
|
|
2440
|
-
#endif`,
|
|
2440
|
+
#endif`,Lb=`#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; }`,Db=`#ifdef USE_TRANSMISS
|
|
|
2508
2508
|
#endif
|
|
2509
2509
|
#ifdef USE_THICKNESSMAP
|
|
2510
2510
|
vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
|
|
2511
|
-
#endif`,
|
|
2511
|
+
#endif`,Fb=`#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; }`,Db=`#ifdef USE_TRANSMISS
|
|
|
2517
2517
|
worldPosition = instanceMatrix * worldPosition;
|
|
2518
2518
|
#endif
|
|
2519
2519
|
worldPosition = modelMatrix * worldPosition;
|
|
2520
|
-
#endif`,
|
|
2520
|
+
#endif`,Nb=`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
|
-
}`,
|
|
2525
|
+
}`,Ub=`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
|
-
}`,
|
|
2537
|
+
}`,Ob=`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
|
-
}`,
|
|
2544
|
+
}`,Bb=`#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
|
-
}`,
|
|
2567
|
+
}`,kb=`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
|
-
}`,
|
|
2574
|
+
}`,zb=`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
|
-
}`,
|
|
2584
|
+
}`,Vb=`#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
|
-
}`,
|
|
2611
|
+
}`,Hb=`#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
|
-
}`,
|
|
2641
|
+
}`,Gb=`#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
|
-
}`,
|
|
2668
|
+
}`,Wb=`#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
|
-
}`,
|
|
2692
|
+
}`,Xb=`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
|
-
}`,
|
|
2698
|
+
}`,Yb=`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
|
-
}`,
|
|
2707
|
+
}`,qb=`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
|
-
}`,
|
|
2729
|
+
}`,Zb=`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
|
-
}`,
|
|
2757
|
+
}`,Jb=`#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
|
-
}
|
|
2789
|
+
}`,$b=`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
|
-
}
|
|
2837
|
+
}`,Kb=`#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
|
-
}`,
|
|
2876
|
+
}`,jb=`#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
|
-
}`,
|
|
2933
|
+
}`,Qb=`#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
|
-
}`,
|
|
2967
|
+
}`,tw=`#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
|
-
}`,
|
|
3013
|
+
}`,ew=`#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
|
-
}`,
|
|
3046
|
+
}`,nw=`#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
|
-
}`,
|
|
3068
|
+
}`,iw=`#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
|
-
}`,
|
|
3107
|
+
}`,rw=`#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
|
-
}`,
|
|
3166
|
+
}`,sw=`#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
|
-
}`,
|
|
3209
|
+
}`,ow=`#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
|
-
}`,
|
|
3334
|
+
}`,aw=`#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
|
-
}`,
|
|
3371
|
+
}`,lw=`#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
|
-
}`,
|
|
3424
|
+
}`,cw=`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
|
-
}`,
|
|
3455
|
+
}`,uw=`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
|
-
}`,
|
|
3480
|
+
}`,hw=`#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
|
-
}`,
|
|
3503
|
+
}`,fw=`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
|
-
}`,
|
|
3519
|
+
}`,dw=`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
|
-
}`,
|
|
3545
|
+
}`,pw=`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
|
-
}`,re={alphahash_fragment:NS,alphahash_pars_fragment:US,alphamap_fragment:OS,alphamap_pars_fragment:BS,alphatest_fragment:kS,alphatest_pars_fragment:zS,aomap_fragment:VS,aomap_pars_fragment:HS,batching_pars_vertex:GS,batching_vertex:WS,begin_vertex:XS,beginnormal_vertex:YS,bsdfs:qS,iridescence_fragment:ZS,bumpmap_pars_fragment:JS,clipping_planes_fragment:$S,clipping_planes_pars_fragment:KS,clipping_planes_pars_vertex:jS,clipping_planes_vertex:QS,color_fragment:tM,color_pars_fragment:eM,color_pars_vertex:nM,color_vertex:iM,common:rM,cube_uv_reflection_fragment:sM,defaultnormal_vertex:oM,displacementmap_pars_vertex:aM,displacementmap_vertex:lM,emissivemap_fragment:cM,emissivemap_pars_fragment:uM,colorspace_fragment:hM,colorspace_pars_fragment:fM,envmap_fragment:dM,envmap_common_pars_fragment:pM,envmap_pars_fragment:mM,envmap_pars_vertex:gM,envmap_physical_pars_fragment:AM,envmap_vertex:_M,fog_vertex:xM,fog_pars_vertex:vM,fog_fragment:yM,fog_pars_fragment:SM,gradientmap_pars_fragment:MM,lightmap_pars_fragment:bM,lights_lambert_fragment:wM,lights_lambert_pars_fragment:EM,lights_pars_begin:TM,lights_toon_fragment:DM,lights_toon_pars_fragment:CM,lights_phong_fragment:RM,lights_phong_pars_fragment:PM,lights_physical_fragment:IM,lights_physical_pars_fragment:LM,lights_fragment_begin:FM,lights_fragment_maps:NM,lights_fragment_end:UM,logdepthbuf_fragment:OM,logdepthbuf_pars_fragment:BM,logdepthbuf_pars_vertex:kM,logdepthbuf_vertex:zM,map_fragment:VM,map_pars_fragment:HM,map_particle_fragment:GM,map_particle_pars_fragment:WM,metalnessmap_fragment:XM,metalnessmap_pars_fragment:YM,morphinstance_vertex:qM,morphcolor_vertex:ZM,morphnormal_vertex:JM,morphtarget_pars_vertex:$M,morphtarget_vertex:KM,normal_fragment_begin:jM,normal_fragment_maps:QM,normal_pars_fragment:tb,normal_pars_vertex:eb,normal_vertex:nb,normalmap_pars_fragment:ib,clearcoat_normal_fragment_begin:rb,clearcoat_normal_fragment_maps:sb,clearcoat_pars_fragment:ob,iridescence_pars_fragment:ab,opaque_fragment:lb,packing:cb,premultiplied_alpha_fragment:ub,project_vertex:hb,dithering_fragment:fb,dithering_pars_fragment:db,roughnessmap_fragment:pb,roughnessmap_pars_fragment:mb,shadowmap_pars_fragment:gb,shadowmap_pars_vertex:_b,shadowmap_vertex:xb,shadowmask_pars_fragment:vb,skinbase_vertex:yb,skinning_pars_vertex:Sb,skinning_vertex:Mb,skinnormal_vertex:bb,specularmap_fragment:wb,specularmap_pars_fragment:Eb,tonemapping_fragment:Tb,tonemapping_pars_fragment:Ab,transmission_fragment:Db,transmission_pars_fragment:Cb,uv_pars_fragment:Rb,uv_pars_vertex:Pb,uv_vertex:Ib,worldpos_vertex:Lb,background_vert:Fb,background_frag:Nb,backgroundCube_vert:Ub,backgroundCube_frag:Ob,cube_vert:Bb,cube_frag:kb,depth_vert:zb,depth_frag:Vb,distanceRGBA_vert:Hb,distanceRGBA_frag:Gb,equirect_vert:Wb,equirect_frag:Xb,linedashed_vert:Yb,linedashed_frag:qb,meshbasic_vert:Zb,meshbasic_frag:Jb,meshlambert_vert:$b,meshlambert_frag:Kb,meshmatcap_vert:jb,meshmatcap_frag:Qb,meshnormal_vert:tw,meshnormal_frag:ew,meshphong_vert:nw,meshphong_frag:iw,meshphysical_vert:rw,meshphysical_frag:sw,meshtoon_vert:ow,meshtoon_frag:aw,points_vert:lw,points_frag:cw,shadow_vert:uw,shadow_frag:hw,sprite_vert:fw,sprite_frag:dw},Ct={common:{diffuse:{value:new ge(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new se},alphaMap:{value:null},alphaMapTransform:{value:new se},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new se}},envmap:{envMap:{value:null},envMapRotation:{value:new se},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new se}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new se}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new se},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new se},normalScale:{value:new _e(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new se},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new se}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new se}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new se}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ge(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 ge(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new se},alphaTest:{value:0},uvTransform:{value:new se}},sprite:{diffuse:{value:new ge(16777215)},opacity:{value:1},center:{value:new _e(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new se},alphaMap:{value:null},alphaMapTransform:{value:new se},alphaTest:{value:0}}},Li={basic:{uniforms:Tn([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.fog]),vertexShader:re.meshbasic_vert,fragmentShader:re.meshbasic_frag},lambert:{uniforms:Tn([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)}}]),vertexShader:re.meshlambert_vert,fragmentShader:re.meshlambert_frag},phong:{uniforms:Tn([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)},specular:{value:new ge(1118481)},shininess:{value:30}}]),vertexShader:re.meshphong_vert,fragmentShader:re.meshphong_frag},standard:{uniforms:Tn([Ct.common,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.roughnessmap,Ct.metalnessmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:re.meshphysical_vert,fragmentShader:re.meshphysical_frag},toon:{uniforms:Tn([Ct.common,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.gradientmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)}}]),vertexShader:re.meshtoon_vert,fragmentShader:re.meshtoon_frag},matcap:{uniforms:Tn([Ct.common,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,{matcap:{value:null}}]),vertexShader:re.meshmatcap_vert,fragmentShader:re.meshmatcap_frag},points:{uniforms:Tn([Ct.points,Ct.fog]),vertexShader:re.points_vert,fragmentShader:re.points_frag},dashed:{uniforms:Tn([Ct.common,Ct.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:re.linedashed_vert,fragmentShader:re.linedashed_frag},depth:{uniforms:Tn([Ct.common,Ct.displacementmap]),vertexShader:re.depth_vert,fragmentShader:re.depth_frag},normal:{uniforms:Tn([Ct.common,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,{opacity:{value:1}}]),vertexShader:re.meshnormal_vert,fragmentShader:re.meshnormal_frag},sprite:{uniforms:Tn([Ct.sprite,Ct.fog]),vertexShader:re.sprite_vert,fragmentShader:re.sprite_frag},background:{uniforms:{uvTransform:{value:new se},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:re.background_vert,fragmentShader:re.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new se}},vertexShader:re.backgroundCube_vert,fragmentShader:re.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:re.cube_vert,fragmentShader:re.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:re.equirect_vert,fragmentShader:re.equirect_frag},distanceRGBA:{uniforms:Tn([Ct.common,Ct.displacementmap,{referencePosition:{value:new nt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:re.distanceRGBA_vert,fragmentShader:re.distanceRGBA_frag},shadow:{uniforms:Tn([Ct.lights,Ct.fog,{color:{value:new ge(0)},opacity:{value:1}}]),vertexShader:re.shadow_vert,fragmentShader:re.shadow_frag}};Li.physical={uniforms:Tn([Li.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new se},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new se},clearcoatNormalScale:{value:new _e(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new se},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new se},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new se},sheen:{value:0},sheenColor:{value:new ge(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new se},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new se},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new se},transmissionSamplerSize:{value:new _e},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new se},attenuationDistance:{value:0},attenuationColor:{value:new ge(0)},specularColor:{value:new ge(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new se},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new se},anisotropyVector:{value:new _e},anisotropyMap:{value:null},anisotropyMapTransform:{value:new se}}]),vertexShader:re.meshphysical_vert,fragmentShader:re.meshphysical_frag};var fc={r:0,b:0,g:0},ys=new ir,pw=new Ue;function mw(r,t,e,n,i,s,o){let a=new ge(0),l=s===!0?0:1,c,h,f=null,d=0,u=null;function _(b){let y=b.isScene===!0?b.background:null;return y&&y.isTexture&&(y=(b.backgroundBlurriness>0?e:t).get(y)),y}function p(b){let y=!1,S=_(b);S===null?g(a,l):S&&S.isColor&&(g(S,1),y=!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||y)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil)}function m(b,y){let S=_(y);S&&(S.isCubeTexture||S.mapping===Wc)?(h===void 0&&(h=new _i(new Fa(1,1,1),new ri({name:"BackgroundCubeMaterial",uniforms:Fo(Li.backgroundCube.uniforms),vertexShader:Li.backgroundCube.vertexShader,fragmentShader:Li.backgroundCube.fragmentShader,side:Nn,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(D,T,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),ys.copy(y.backgroundRotation),ys.x*=-1,ys.y*=-1,ys.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(ys.y*=-1,ys.z*=-1),h.material.uniforms.envMap.value=S,h.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(pw.makeRotationFromEuler(ys)),h.material.toneMapped=Se.getTransfer(S.colorSpace)!==Te,(f!==S||d!==S.version||u!==r.toneMapping)&&(h.material.needsUpdate=!0,f=S,d=S.version,u=r.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new _i(new Fc(2,2),new ri({name:"BackgroundMaterial",uniforms:Fo(Li.background.uniforms),vertexShader:Li.background.vertexShader,fragmentShader:Li.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=S,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=Se.getTransfer(S.colorSpace)!==Te,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(f!==S||d!==S.version||u!==r.toneMapping)&&(c.material.needsUpdate=!0,f=S,d=S.version,u=r.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function g(b,y){b.getRGB(fc,H_(r)),n.buffers.color.setClear(fc.r,fc.g,fc.b,y,o)}return{getClearColor:function(){return a},setClearColor:function(b,y=1){a.set(b),l=y,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,g(a,l)},render:p,addToRenderList:m}}function gw(r,t){let e=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=d(null),s=i,o=!1;function a(v,I,N,C,V){let $=!1,W=f(C,N,I);s!==W&&(s=W,c(s.object)),$=u(v,C,N,V),$&&_(v,C,N,V),V!==null&&t.update(V,r.ELEMENT_ARRAY_BUFFER),($||o)&&(o=!1,S(v,I,N,C),V!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function l(){return r.createVertexArray()}function c(v){return r.bindVertexArray(v)}function h(v){return r.deleteVertexArray(v)}function f(v,I,N){let C=N.wireframe===!0,V=n[v.id];V===void 0&&(V={},n[v.id]=V);let $=V[I.id];$===void 0&&($={},V[I.id]=$);let W=$[C];return W===void 0&&(W=d(l()),$[C]=W),W}function d(v){let I=[],N=[],C=[];for(let V=0;V<e;V++)I[V]=0,N[V]=0,C[V]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:I,enabledAttributes:N,attributeDivisors:C,object:v,attributes:{},index:null}}function u(v,I,N,C){let V=s.attributes,$=I.attributes,W=0,Z=N.getAttributes();for(let z in Z)if(Z[z].location>=0){let R=V[z],at=$[z];if(at===void 0&&(z==="instanceMatrix"&&v.instanceMatrix&&(at=v.instanceMatrix),z==="instanceColor"&&v.instanceColor&&(at=v.instanceColor)),R===void 0||R.attribute!==at||at&&R.data!==at.data)return!0;W++}return s.attributesNum!==W||s.index!==C}function _(v,I,N,C){let V={},$=I.attributes,W=0,Z=N.getAttributes();for(let z in Z)if(Z[z].location>=0){let R=$[z];R===void 0&&(z==="instanceMatrix"&&v.instanceMatrix&&(R=v.instanceMatrix),z==="instanceColor"&&v.instanceColor&&(R=v.instanceColor));let at={};at.attribute=R,R&&R.data&&(at.data=R.data),V[z]=at,W++}s.attributes=V,s.attributesNum=W,s.index=C}function p(){let v=s.newAttributes;for(let I=0,N=v.length;I<N;I++)v[I]=0}function m(v){g(v,0)}function g(v,I){let N=s.newAttributes,C=s.enabledAttributes,V=s.attributeDivisors;N[v]=1,C[v]===0&&(r.enableVertexAttribArray(v),C[v]=1),V[v]!==I&&(r.vertexAttribDivisor(v,I),V[v]=I)}function b(){let v=s.newAttributes,I=s.enabledAttributes;for(let N=0,C=I.length;N<C;N++)I[N]!==v[N]&&(r.disableVertexAttribArray(N),I[N]=0)}function y(v,I,N,C,V,$,W){W===!0?r.vertexAttribIPointer(v,I,N,V,$):r.vertexAttribPointer(v,I,N,C,V,$)}function S(v,I,N,C){p();let V=C.attributes,$=N.getAttributes(),W=I.defaultAttributeValues;for(let Z in $){let z=$[Z];if(z.location>=0){let U=V[Z];if(U===void 0&&(Z==="instanceMatrix"&&v.instanceMatrix&&(U=v.instanceMatrix),Z==="instanceColor"&&v.instanceColor&&(U=v.instanceColor)),U!==void 0){let R=U.normalized,at=U.itemSize,_t=t.get(U);if(_t===void 0)continue;let Ut=_t.buffer,X=_t.type,ot=_t.bytesPerElement,xt=X===r.INT||X===r.UNSIGNED_INT||U.gpuType===L_;if(U.isInterleavedBufferAttribute){let ct=U.data,Rt=ct.stride,kt=U.offset;if(ct.isInstancedInterleavedBuffer){for(let q=0;q<z.locationSize;q++)g(z.location+q,ct.meshPerAttribute);v.isInstancedMesh!==!0&&C._maxInstanceCount===void 0&&(C._maxInstanceCount=ct.meshPerAttribute*ct.count)}else for(let q=0;q<z.locationSize;q++)m(z.location+q);r.bindBuffer(r.ARRAY_BUFFER,Ut);for(let q=0;q<z.locationSize;q++)y(z.location+q,at/z.locationSize,X,R,Rt*ot,(kt+at/z.locationSize*q)*ot,xt)}else{if(U.isInstancedBufferAttribute){for(let ct=0;ct<z.locationSize;ct++)g(z.location+ct,U.meshPerAttribute);v.isInstancedMesh!==!0&&C._maxInstanceCount===void 0&&(C._maxInstanceCount=U.meshPerAttribute*U.count)}else for(let ct=0;ct<z.locationSize;ct++)m(z.location+ct);r.bindBuffer(r.ARRAY_BUFFER,Ut);for(let ct=0;ct<z.locationSize;ct++)y(z.location+ct,at/z.locationSize,X,R,at*ot,at/z.locationSize*ct*ot,xt)}}else if(W!==void 0){let R=W[Z];if(R!==void 0)switch(R.length){case 2:r.vertexAttrib2fv(z.location,R);break;case 3:r.vertexAttrib3fv(z.location,R);break;case 4:r.vertexAttrib4fv(z.location,R);break;default:r.vertexAttrib1fv(z.location,R)}}}}b()}function D(){P();for(let v in n){let I=n[v];for(let N in I){let C=I[N];for(let V in C)h(C[V].object),delete C[V];delete I[N]}delete n[v]}}function T(v){if(n[v.id]===void 0)return;let I=n[v.id];for(let N in I){let C=I[N];for(let V in C)h(C[V].object),delete C[V];delete I[N]}delete n[v.id]}function w(v){for(let I in n){let N=n[I];if(N[v.id]===void 0)continue;let C=N[v.id];for(let V in C)h(C[V].object),delete C[V];delete N[v.id]}}function P(){M(),o=!0,s!==i&&(s=i,c(s.object))}function M(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:a,reset:P,resetDefaultState:M,dispose:D,releaseStatesOfGeometry:T,releaseStatesOfProgram:w,initAttributes:p,enableAttribute:m,disableUnusedAttributes:b}}function _w(r,t,e){let n;function i(c){n=c}function s(c,h){r.drawArrays(n,c,h),e.update(h,n,1)}function o(c,h,f){f!==0&&(r.drawArraysInstanced(n,c,h,f),e.update(h,n,f))}function a(c,h,f){if(f===0)return;let d=t.get("WEBGL_multi_draw");if(d===null)for(let u=0;u<f;u++)this.render(c[u],h[u]);else{d.multiDrawArraysWEBGL(n,c,0,h,0,f);let u=0;for(let _=0;_<f;_++)u+=h[_];e.update(u,n,1)}}function l(c,h,f,d){if(f===0)return;let u=t.get("WEBGL_multi_draw");if(u===null)for(let _=0;_<c.length;_++)o(c[_],h[_],d[_]);else{u.multiDrawArraysInstancedWEBGL(n,c,0,h,0,d,0,f);let _=0;for(let p=0;p<f;p++)_+=h[p];for(let p=0;p<d.length;p++)e.update(_,n,d[p])}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function xw(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!==Fi&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(T){let w=T===Xc&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(T!==Fr&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==Dr&&!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",h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);let f=e.logarithmicDepthBuffer===!0,d=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),u=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),m=r.getParameter(r.MAX_VERTEX_ATTRIBS),g=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),b=r.getParameter(r.MAX_VARYING_VECTORS),y=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),S=u>0,D=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,maxTextures:d,maxVertexTextures:u,maxTextureSize:_,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:g,maxVaryings:b,maxFragmentUniforms:y,vertexTextures:S,maxSamples:D}}function vw(r){let t=this,e=null,n=0,i=!1,s=!1,o=new Qi,a=new se,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d){let u=f.length!==0||d||n!==0||i;return i=d,n=f.length,u},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,d){e=h(f,d,0)},this.setState=function(f,d,u){let _=f.clippingPlanes,p=f.clipIntersection,m=f.clipShadows,g=r.get(f);if(!i||_===null||_.length===0||s&&!m)s?h(null):c();else{let b=s?0:n,y=b*4,S=g.clippingState||null;l.value=S,S=h(_,d,y,u);for(let D=0;D!==y;++D)S[D]=e[D];g.clippingState=S,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(f,d,u,_){let p=f!==null?f.length:0,m=null;if(p!==0){if(m=l.value,_!==!0||m===null){let g=u+p*4,b=d.matrixWorldInverse;a.getNormalMatrix(b),(m===null||m.length<g)&&(m=new Float32Array(g));for(let y=0,S=u;y!==p;++y,S+=4)o.copy(f[y]).applyMatrix4(b,a),o.normal.toArray(m,S),m[S+3]=o.constant}l.value=m,l.needsUpdate=!0}return t.numPlanes=p,t.numIntersection=0,m}}function yw(r){let t=new WeakMap;function e(o,a){return a===df?o.mapping=Ro:a===pf&&(o.mapping=Po),o}function n(o){if(o&&o.isTexture){let a=o.mapping;if(a===df||a===pf)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 Mf(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 Nc=class extends Ic{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,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=h*this.view.offsetY,l=a-h*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}},To=4,r_=[.125,.215,.35,.446,.526,.582],ws=20,rf=new Nc,s_=new ge,sf=null,of=0,af=0,lf=!1,Ms=(1+Math.sqrt(5))/2,wo=1/Ms,o_=[new nt(-Ms,wo,0),new nt(Ms,wo,0),new nt(-wo,0,Ms),new nt(wo,0,Ms),new nt(0,Ms,-wo),new nt(0,Ms,wo),new nt(-1,1,-1),new nt(1,1,-1),new nt(-1,1,1),new nt(1,1,1)],Uc=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){sf=this._renderer.getRenderTarget(),of=this._renderer.getActiveCubeFace(),af=this._renderer.getActiveMipmapLevel(),lf=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=c_(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=l_(),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(sf,of,af),this._renderer.xr.enabled=lf,t.scissorTest=!1,dc(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===Ro||t.mapping===Po?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),sf=this._renderer.getRenderTarget(),of=this._renderer.getActiveCubeFace(),af=this._renderer.getActiveMipmapLevel(),lf=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:gi,minFilter:gi,generateMipmaps:!1,type:Xc,format:Fi,colorSpace:Or,depthBuffer:!1},i=a_(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=a_(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Sw(s)),this._blurMaterial=Mw(s,t,e)}return i}_compileMaterial(t){let e=new _i(this._lodPlanes[0],t);this._renderer.compile(e,rf)}_sceneToCubeUV(t,e,n,i){let a=new An(90,1,e,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,f=h.autoClear,d=h.toneMapping;h.getClearColor(s_),h.toneMapping=Ir,h.autoClear=!1;let u=new Cc({name:"PMREM.Background",side:Nn,depthWrite:!1,depthTest:!1}),_=new _i(new Fa,u),p=!1,m=t.background;m?m.isColor&&(u.color.copy(m),t.background=null,p=!0):(u.color.copy(s_),p=!0);for(let g=0;g<6;g++){let b=g%3;b===0?(a.up.set(0,l[g],0),a.lookAt(c[g],0,0)):b===1?(a.up.set(0,0,l[g]),a.lookAt(0,c[g],0)):(a.up.set(0,l[g],0),a.lookAt(0,0,c[g]));let y=this._cubeSize;dc(i,b*y,g>2?y:0,y,y),h.setRenderTarget(i),p&&h.render(_,a),h.render(t,a)}_.geometry.dispose(),_.material.dispose(),h.toneMapping=d,h.autoClear=f,t.background=m}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===Ro||t.mapping===Po;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=c_()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=l_());let s=i?this._cubemapMaterial:this._equirectMaterial,o=new _i(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=t;let l=this._cubeSize;dc(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(o,rf)}_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=o_[(i-s-1)%o_.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 h=3,f=new _i(this._lodPlanes[i],c),d=c.uniforms,u=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*u):2*Math.PI/(2*ws-1),p=s/_,m=isFinite(s)?1+Math.floor(h*p):ws;m>ws&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ws}`);let g=[],b=0;for(let w=0;w<ws;++w){let P=w/p,M=Math.exp(-P*P/2);g.push(M),w===0?b+=M:w<m&&(b+=2*M)}for(let w=0;w<g.length;w++)g[w]=g[w]/b;d.envMap.value=t.texture,d.samples.value=m,d.weights.value=g,d.latitudinal.value=o==="latitudinal",a&&(d.poleAxis.value=a);let{_lodMax:y}=this;d.dTheta.value=_,d.mipInt.value=y-n;let S=this._sizeLods[i],D=3*S*(i>y-To?i-y+To:0),T=4*(this._cubeSize-S);dc(e,D,T,3*S,2*S),l.setRenderTarget(e),l.render(f,rf)}};function Sw(r){let t=[],e=[],n=[],i=r,s=r-To+1+r_.length;for(let o=0;o<s;o++){let a=Math.pow(2,i);e.push(a);let l=1/a;o>r-To?l=r_[o-r+To-1]:o===0&&(l=0),n.push(l);let c=1/(a-2),h=-c,f=1+c,d=[h,h,f,h,f,f,h,h,f,f,h,f],u=6,_=6,p=3,m=2,g=1,b=new Float32Array(p*_*u),y=new Float32Array(m*_*u),S=new Float32Array(g*_*u);for(let T=0;T<u;T++){let w=T%3*2/3-1,P=T>2?0:-1,M=[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];b.set(M,p*_*T),y.set(d,m*_*T);let v=[T,T,T,T,T,T];S.set(v,g*_*T)}let D=new Ni;D.setAttribute("position",new ei(b,p)),D.setAttribute("uv",new ei(y,m)),D.setAttribute("faceIndex",new ei(S,g)),t.push(D),i>To&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function a_(r,t,e){let n=new nr(r,t,e);return n.texture.mapping=Wc,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function dc(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function Mw(r,t,e){let n=new Float32Array(ws),i=new nt(0,1,0);return new ri({name:"SphericalGaussianBlur",defines:{n:ws,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:Kf(),fragmentShader:`
|
|
3570
|
+
}`,re={alphahash_fragment:US,alphahash_pars_fragment:OS,alphamap_fragment:BS,alphamap_pars_fragment:kS,alphatest_fragment:zS,alphatest_pars_fragment:VS,aomap_fragment:HS,aomap_pars_fragment:GS,batching_pars_vertex:WS,batching_vertex:XS,begin_vertex:YS,beginnormal_vertex:qS,bsdfs:ZS,iridescence_fragment:JS,bumpmap_pars_fragment:$S,clipping_planes_fragment:KS,clipping_planes_pars_fragment:jS,clipping_planes_pars_vertex:QS,clipping_planes_vertex:tM,color_fragment:eM,color_pars_fragment:nM,color_pars_vertex:iM,color_vertex:rM,common:sM,cube_uv_reflection_fragment:oM,defaultnormal_vertex:aM,displacementmap_pars_vertex:lM,displacementmap_vertex:cM,emissivemap_fragment:uM,emissivemap_pars_fragment:hM,colorspace_fragment:fM,colorspace_pars_fragment:dM,envmap_fragment:pM,envmap_common_pars_fragment:mM,envmap_pars_fragment:gM,envmap_pars_vertex:_M,envmap_physical_pars_fragment:DM,envmap_vertex:xM,fog_vertex:vM,fog_pars_vertex:yM,fog_fragment:SM,fog_pars_fragment:MM,gradientmap_pars_fragment:bM,lightmap_pars_fragment:wM,lights_lambert_fragment:EM,lights_lambert_pars_fragment:TM,lights_pars_begin:AM,lights_toon_fragment:CM,lights_toon_pars_fragment:RM,lights_phong_fragment:PM,lights_phong_pars_fragment:IM,lights_physical_fragment:LM,lights_physical_pars_fragment:FM,lights_fragment_begin:NM,lights_fragment_maps:UM,lights_fragment_end:OM,logdepthbuf_fragment:BM,logdepthbuf_pars_fragment:kM,logdepthbuf_pars_vertex:zM,logdepthbuf_vertex:VM,map_fragment:HM,map_pars_fragment:GM,map_particle_fragment:WM,map_particle_pars_fragment:XM,metalnessmap_fragment:YM,metalnessmap_pars_fragment:qM,morphinstance_vertex:ZM,morphcolor_vertex:JM,morphnormal_vertex:$M,morphtarget_pars_vertex:KM,morphtarget_vertex:jM,normal_fragment_begin:QM,normal_fragment_maps:tb,normal_pars_fragment:eb,normal_pars_vertex:nb,normal_vertex:ib,normalmap_pars_fragment:rb,clearcoat_normal_fragment_begin:sb,clearcoat_normal_fragment_maps:ob,clearcoat_pars_fragment:ab,iridescence_pars_fragment:lb,opaque_fragment:cb,packing:ub,premultiplied_alpha_fragment:hb,project_vertex:fb,dithering_fragment:db,dithering_pars_fragment:pb,roughnessmap_fragment:mb,roughnessmap_pars_fragment:gb,shadowmap_pars_fragment:_b,shadowmap_pars_vertex:xb,shadowmap_vertex:vb,shadowmask_pars_fragment:yb,skinbase_vertex:Sb,skinning_pars_vertex:Mb,skinning_vertex:bb,skinnormal_vertex:wb,specularmap_fragment:Eb,specularmap_pars_fragment:Tb,tonemapping_fragment:Ab,tonemapping_pars_fragment:Db,transmission_fragment:Cb,transmission_pars_fragment:Rb,uv_pars_fragment:Pb,uv_pars_vertex:Ib,uv_vertex:Lb,worldpos_vertex:Fb,background_vert:Nb,background_frag:Ub,backgroundCube_vert:Ob,backgroundCube_frag:Bb,cube_vert:kb,cube_frag:zb,depth_vert:Vb,depth_frag:Hb,distanceRGBA_vert:Gb,distanceRGBA_frag:Wb,equirect_vert:Xb,equirect_frag:Yb,linedashed_vert:qb,linedashed_frag:Zb,meshbasic_vert:Jb,meshbasic_frag:$b,meshlambert_vert:Kb,meshlambert_frag:jb,meshmatcap_vert:Qb,meshmatcap_frag:tw,meshnormal_vert:ew,meshnormal_frag:nw,meshphong_vert:iw,meshphong_frag:rw,meshphysical_vert:sw,meshphysical_frag:ow,meshtoon_vert:aw,meshtoon_frag:lw,points_vert:cw,points_frag:uw,shadow_vert:hw,shadow_frag:fw,sprite_vert:dw,sprite_frag:pw},Ct={common:{diffuse:{value:new ge(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new se},alphaMap:{value:null},alphaMapTransform:{value:new se},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new se}},envmap:{envMap:{value:null},envMapRotation:{value:new se},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new se}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new se}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new se},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new se},normalScale:{value:new _e(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new se},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new se}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new se}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new se}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ge(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 ge(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new se},alphaTest:{value:0},uvTransform:{value:new se}},sprite:{diffuse:{value:new ge(16777215)},opacity:{value:1},center:{value:new _e(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new se},alphaMap:{value:null},alphaMapTransform:{value:new se},alphaTest:{value:0}}},Li={basic:{uniforms:Tn([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.fog]),vertexShader:re.meshbasic_vert,fragmentShader:re.meshbasic_frag},lambert:{uniforms:Tn([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)}}]),vertexShader:re.meshlambert_vert,fragmentShader:re.meshlambert_frag},phong:{uniforms:Tn([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)},specular:{value:new ge(1118481)},shininess:{value:30}}]),vertexShader:re.meshphong_vert,fragmentShader:re.meshphong_frag},standard:{uniforms:Tn([Ct.common,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.roughnessmap,Ct.metalnessmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:re.meshphysical_vert,fragmentShader:re.meshphysical_frag},toon:{uniforms:Tn([Ct.common,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.gradientmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)}}]),vertexShader:re.meshtoon_vert,fragmentShader:re.meshtoon_frag},matcap:{uniforms:Tn([Ct.common,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,{matcap:{value:null}}]),vertexShader:re.meshmatcap_vert,fragmentShader:re.meshmatcap_frag},points:{uniforms:Tn([Ct.points,Ct.fog]),vertexShader:re.points_vert,fragmentShader:re.points_frag},dashed:{uniforms:Tn([Ct.common,Ct.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:re.linedashed_vert,fragmentShader:re.linedashed_frag},depth:{uniforms:Tn([Ct.common,Ct.displacementmap]),vertexShader:re.depth_vert,fragmentShader:re.depth_frag},normal:{uniforms:Tn([Ct.common,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,{opacity:{value:1}}]),vertexShader:re.meshnormal_vert,fragmentShader:re.meshnormal_frag},sprite:{uniforms:Tn([Ct.sprite,Ct.fog]),vertexShader:re.sprite_vert,fragmentShader:re.sprite_frag},background:{uniforms:{uvTransform:{value:new se},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:re.background_vert,fragmentShader:re.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new se}},vertexShader:re.backgroundCube_vert,fragmentShader:re.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:re.cube_vert,fragmentShader:re.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:re.equirect_vert,fragmentShader:re.equirect_frag},distanceRGBA:{uniforms:Tn([Ct.common,Ct.displacementmap,{referencePosition:{value:new nt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:re.distanceRGBA_vert,fragmentShader:re.distanceRGBA_frag},shadow:{uniforms:Tn([Ct.lights,Ct.fog,{color:{value:new ge(0)},opacity:{value:1}}]),vertexShader:re.shadow_vert,fragmentShader:re.shadow_frag}};Li.physical={uniforms:Tn([Li.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new se},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new se},clearcoatNormalScale:{value:new _e(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new se},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new se},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new se},sheen:{value:0},sheenColor:{value:new ge(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new se},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new se},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new se},transmissionSamplerSize:{value:new _e},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new se},attenuationDistance:{value:0},attenuationColor:{value:new ge(0)},specularColor:{value:new ge(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new se},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new se},anisotropyVector:{value:new _e},anisotropyMap:{value:null},anisotropyMapTransform:{value:new se}}]),vertexShader:re.meshphysical_vert,fragmentShader:re.meshphysical_frag};var fc={r:0,b:0,g:0},ys=new ir,mw=new Ue;function gw(r,t,e,n,i,s,o){let a=new ge(0),l=s===!0?0:1,c,h,f=null,d=0,u=null;function _(b){let y=b.isScene===!0?b.background:null;return y&&y.isTexture&&(y=(b.backgroundBlurriness>0?e:t).get(y)),y}function p(b){let y=!1,S=_(b);S===null?g(a,l):S&&S.isColor&&(g(S,1),y=!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||y)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil)}function m(b,y){let S=_(y);S&&(S.isCubeTexture||S.mapping===Wc)?(h===void 0&&(h=new _i(new Fa(1,1,1),new ri({name:"BackgroundCubeMaterial",uniforms:Fo(Li.backgroundCube.uniforms),vertexShader:Li.backgroundCube.vertexShader,fragmentShader:Li.backgroundCube.fragmentShader,side:Nn,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(D,T,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),ys.copy(y.backgroundRotation),ys.x*=-1,ys.y*=-1,ys.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(ys.y*=-1,ys.z*=-1),h.material.uniforms.envMap.value=S,h.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(mw.makeRotationFromEuler(ys)),h.material.toneMapped=Se.getTransfer(S.colorSpace)!==Te,(f!==S||d!==S.version||u!==r.toneMapping)&&(h.material.needsUpdate=!0,f=S,d=S.version,u=r.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new _i(new Fc(2,2),new ri({name:"BackgroundMaterial",uniforms:Fo(Li.background.uniforms),vertexShader:Li.background.vertexShader,fragmentShader:Li.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=S,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=Se.getTransfer(S.colorSpace)!==Te,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(f!==S||d!==S.version||u!==r.toneMapping)&&(c.material.needsUpdate=!0,f=S,d=S.version,u=r.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function g(b,y){b.getRGB(fc,H_(r)),n.buffers.color.setClear(fc.r,fc.g,fc.b,y,o)}return{getClearColor:function(){return a},setClearColor:function(b,y=1){a.set(b),l=y,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,g(a,l)},render:p,addToRenderList:m}}function _w(r,t){let e=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=d(null),s=i,o=!1;function a(v,I,N,C,V){let $=!1,W=f(C,N,I);s!==W&&(s=W,c(s.object)),$=u(v,C,N,V),$&&_(v,C,N,V),V!==null&&t.update(V,r.ELEMENT_ARRAY_BUFFER),($||o)&&(o=!1,S(v,I,N,C),V!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function l(){return r.createVertexArray()}function c(v){return r.bindVertexArray(v)}function h(v){return r.deleteVertexArray(v)}function f(v,I,N){let C=N.wireframe===!0,V=n[v.id];V===void 0&&(V={},n[v.id]=V);let $=V[I.id];$===void 0&&($={},V[I.id]=$);let W=$[C];return W===void 0&&(W=d(l()),$[C]=W),W}function d(v){let I=[],N=[],C=[];for(let V=0;V<e;V++)I[V]=0,N[V]=0,C[V]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:I,enabledAttributes:N,attributeDivisors:C,object:v,attributes:{},index:null}}function u(v,I,N,C){let V=s.attributes,$=I.attributes,W=0,Z=N.getAttributes();for(let z in Z)if(Z[z].location>=0){let R=V[z],at=$[z];if(at===void 0&&(z==="instanceMatrix"&&v.instanceMatrix&&(at=v.instanceMatrix),z==="instanceColor"&&v.instanceColor&&(at=v.instanceColor)),R===void 0||R.attribute!==at||at&&R.data!==at.data)return!0;W++}return s.attributesNum!==W||s.index!==C}function _(v,I,N,C){let V={},$=I.attributes,W=0,Z=N.getAttributes();for(let z in Z)if(Z[z].location>=0){let R=$[z];R===void 0&&(z==="instanceMatrix"&&v.instanceMatrix&&(R=v.instanceMatrix),z==="instanceColor"&&v.instanceColor&&(R=v.instanceColor));let at={};at.attribute=R,R&&R.data&&(at.data=R.data),V[z]=at,W++}s.attributes=V,s.attributesNum=W,s.index=C}function p(){let v=s.newAttributes;for(let I=0,N=v.length;I<N;I++)v[I]=0}function m(v){g(v,0)}function g(v,I){let N=s.newAttributes,C=s.enabledAttributes,V=s.attributeDivisors;N[v]=1,C[v]===0&&(r.enableVertexAttribArray(v),C[v]=1),V[v]!==I&&(r.vertexAttribDivisor(v,I),V[v]=I)}function b(){let v=s.newAttributes,I=s.enabledAttributes;for(let N=0,C=I.length;N<C;N++)I[N]!==v[N]&&(r.disableVertexAttribArray(N),I[N]=0)}function y(v,I,N,C,V,$,W){W===!0?r.vertexAttribIPointer(v,I,N,V,$):r.vertexAttribPointer(v,I,N,C,V,$)}function S(v,I,N,C){p();let V=C.attributes,$=N.getAttributes(),W=I.defaultAttributeValues;for(let Z in $){let z=$[Z];if(z.location>=0){let U=V[Z];if(U===void 0&&(Z==="instanceMatrix"&&v.instanceMatrix&&(U=v.instanceMatrix),Z==="instanceColor"&&v.instanceColor&&(U=v.instanceColor)),U!==void 0){let R=U.normalized,at=U.itemSize,_t=t.get(U);if(_t===void 0)continue;let Ut=_t.buffer,X=_t.type,ot=_t.bytesPerElement,xt=X===r.INT||X===r.UNSIGNED_INT||U.gpuType===L_;if(U.isInterleavedBufferAttribute){let ct=U.data,Rt=ct.stride,kt=U.offset;if(ct.isInstancedInterleavedBuffer){for(let q=0;q<z.locationSize;q++)g(z.location+q,ct.meshPerAttribute);v.isInstancedMesh!==!0&&C._maxInstanceCount===void 0&&(C._maxInstanceCount=ct.meshPerAttribute*ct.count)}else for(let q=0;q<z.locationSize;q++)m(z.location+q);r.bindBuffer(r.ARRAY_BUFFER,Ut);for(let q=0;q<z.locationSize;q++)y(z.location+q,at/z.locationSize,X,R,Rt*ot,(kt+at/z.locationSize*q)*ot,xt)}else{if(U.isInstancedBufferAttribute){for(let ct=0;ct<z.locationSize;ct++)g(z.location+ct,U.meshPerAttribute);v.isInstancedMesh!==!0&&C._maxInstanceCount===void 0&&(C._maxInstanceCount=U.meshPerAttribute*U.count)}else for(let ct=0;ct<z.locationSize;ct++)m(z.location+ct);r.bindBuffer(r.ARRAY_BUFFER,Ut);for(let ct=0;ct<z.locationSize;ct++)y(z.location+ct,at/z.locationSize,X,R,at*ot,at/z.locationSize*ct*ot,xt)}}else if(W!==void 0){let R=W[Z];if(R!==void 0)switch(R.length){case 2:r.vertexAttrib2fv(z.location,R);break;case 3:r.vertexAttrib3fv(z.location,R);break;case 4:r.vertexAttrib4fv(z.location,R);break;default:r.vertexAttrib1fv(z.location,R)}}}}b()}function D(){P();for(let v in n){let I=n[v];for(let N in I){let C=I[N];for(let V in C)h(C[V].object),delete C[V];delete I[N]}delete n[v]}}function T(v){if(n[v.id]===void 0)return;let I=n[v.id];for(let N in I){let C=I[N];for(let V in C)h(C[V].object),delete C[V];delete I[N]}delete n[v.id]}function w(v){for(let I in n){let N=n[I];if(N[v.id]===void 0)continue;let C=N[v.id];for(let V in C)h(C[V].object),delete C[V];delete N[v.id]}}function P(){M(),o=!0,s!==i&&(s=i,c(s.object))}function M(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:a,reset:P,resetDefaultState:M,dispose:D,releaseStatesOfGeometry:T,releaseStatesOfProgram:w,initAttributes:p,enableAttribute:m,disableUnusedAttributes:b}}function xw(r,t,e){let n;function i(c){n=c}function s(c,h){r.drawArrays(n,c,h),e.update(h,n,1)}function o(c,h,f){f!==0&&(r.drawArraysInstanced(n,c,h,f),e.update(h,n,f))}function a(c,h,f){if(f===0)return;let d=t.get("WEBGL_multi_draw");if(d===null)for(let u=0;u<f;u++)this.render(c[u],h[u]);else{d.multiDrawArraysWEBGL(n,c,0,h,0,f);let u=0;for(let _=0;_<f;_++)u+=h[_];e.update(u,n,1)}}function l(c,h,f,d){if(f===0)return;let u=t.get("WEBGL_multi_draw");if(u===null)for(let _=0;_<c.length;_++)o(c[_],h[_],d[_]);else{u.multiDrawArraysInstancedWEBGL(n,c,0,h,0,d,0,f);let _=0;for(let p=0;p<f;p++)_+=h[p];for(let p=0;p<d.length;p++)e.update(_,n,d[p])}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function vw(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!==Fi&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(T){let w=T===Xc&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(T!==Fr&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==Dr&&!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",h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);let f=e.logarithmicDepthBuffer===!0,d=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),u=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),m=r.getParameter(r.MAX_VERTEX_ATTRIBS),g=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),b=r.getParameter(r.MAX_VARYING_VECTORS),y=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),S=u>0,D=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,maxTextures:d,maxVertexTextures:u,maxTextureSize:_,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:g,maxVaryings:b,maxFragmentUniforms:y,vertexTextures:S,maxSamples:D}}function yw(r){let t=this,e=null,n=0,i=!1,s=!1,o=new Qi,a=new se,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d){let u=f.length!==0||d||n!==0||i;return i=d,n=f.length,u},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,d){e=h(f,d,0)},this.setState=function(f,d,u){let _=f.clippingPlanes,p=f.clipIntersection,m=f.clipShadows,g=r.get(f);if(!i||_===null||_.length===0||s&&!m)s?h(null):c();else{let b=s?0:n,y=b*4,S=g.clippingState||null;l.value=S,S=h(_,d,y,u);for(let D=0;D!==y;++D)S[D]=e[D];g.clippingState=S,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(f,d,u,_){let p=f!==null?f.length:0,m=null;if(p!==0){if(m=l.value,_!==!0||m===null){let g=u+p*4,b=d.matrixWorldInverse;a.getNormalMatrix(b),(m===null||m.length<g)&&(m=new Float32Array(g));for(let y=0,S=u;y!==p;++y,S+=4)o.copy(f[y]).applyMatrix4(b,a),o.normal.toArray(m,S),m[S+3]=o.constant}l.value=m,l.needsUpdate=!0}return t.numPlanes=p,t.numIntersection=0,m}}function Sw(r){let t=new WeakMap;function e(o,a){return a===df?o.mapping=Ro:a===pf&&(o.mapping=Po),o}function n(o){if(o&&o.isTexture){let a=o.mapping;if(a===df||a===pf)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 Mf(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 Nc=class extends Ic{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,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=h*this.view.offsetY,l=a-h*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}},To=4,r_=[.125,.215,.35,.446,.526,.582],ws=20,rf=new Nc,s_=new ge,sf=null,of=0,af=0,lf=!1,Ms=(1+Math.sqrt(5))/2,wo=1/Ms,o_=[new nt(-Ms,wo,0),new nt(Ms,wo,0),new nt(-wo,0,Ms),new nt(wo,0,Ms),new nt(0,Ms,-wo),new nt(0,Ms,wo),new nt(-1,1,-1),new nt(1,1,-1),new nt(-1,1,1),new nt(1,1,1)],Uc=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){sf=this._renderer.getRenderTarget(),of=this._renderer.getActiveCubeFace(),af=this._renderer.getActiveMipmapLevel(),lf=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=c_(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=l_(),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(sf,of,af),this._renderer.xr.enabled=lf,t.scissorTest=!1,dc(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===Ro||t.mapping===Po?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),sf=this._renderer.getRenderTarget(),of=this._renderer.getActiveCubeFace(),af=this._renderer.getActiveMipmapLevel(),lf=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:gi,minFilter:gi,generateMipmaps:!1,type:Xc,format:Fi,colorSpace:Or,depthBuffer:!1},i=a_(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=a_(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Mw(s)),this._blurMaterial=bw(s,t,e)}return i}_compileMaterial(t){let e=new _i(this._lodPlanes[0],t);this._renderer.compile(e,rf)}_sceneToCubeUV(t,e,n,i){let a=new An(90,1,e,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,f=h.autoClear,d=h.toneMapping;h.getClearColor(s_),h.toneMapping=Ir,h.autoClear=!1;let u=new Cc({name:"PMREM.Background",side:Nn,depthWrite:!1,depthTest:!1}),_=new _i(new Fa,u),p=!1,m=t.background;m?m.isColor&&(u.color.copy(m),t.background=null,p=!0):(u.color.copy(s_),p=!0);for(let g=0;g<6;g++){let b=g%3;b===0?(a.up.set(0,l[g],0),a.lookAt(c[g],0,0)):b===1?(a.up.set(0,0,l[g]),a.lookAt(0,c[g],0)):(a.up.set(0,l[g],0),a.lookAt(0,0,c[g]));let y=this._cubeSize;dc(i,b*y,g>2?y:0,y,y),h.setRenderTarget(i),p&&h.render(_,a),h.render(t,a)}_.geometry.dispose(),_.material.dispose(),h.toneMapping=d,h.autoClear=f,t.background=m}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===Ro||t.mapping===Po;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=c_()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=l_());let s=i?this._cubemapMaterial:this._equirectMaterial,o=new _i(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=t;let l=this._cubeSize;dc(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(o,rf)}_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=o_[(i-s-1)%o_.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 h=3,f=new _i(this._lodPlanes[i],c),d=c.uniforms,u=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*u):2*Math.PI/(2*ws-1),p=s/_,m=isFinite(s)?1+Math.floor(h*p):ws;m>ws&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ws}`);let g=[],b=0;for(let w=0;w<ws;++w){let P=w/p,M=Math.exp(-P*P/2);g.push(M),w===0?b+=M:w<m&&(b+=2*M)}for(let w=0;w<g.length;w++)g[w]=g[w]/b;d.envMap.value=t.texture,d.samples.value=m,d.weights.value=g,d.latitudinal.value=o==="latitudinal",a&&(d.poleAxis.value=a);let{_lodMax:y}=this;d.dTheta.value=_,d.mipInt.value=y-n;let S=this._sizeLods[i],D=3*S*(i>y-To?i-y+To:0),T=4*(this._cubeSize-S);dc(e,D,T,3*S,2*S),l.setRenderTarget(e),l.render(f,rf)}};function Mw(r){let t=[],e=[],n=[],i=r,s=r-To+1+r_.length;for(let o=0;o<s;o++){let a=Math.pow(2,i);e.push(a);let l=1/a;o>r-To?l=r_[o-r+To-1]:o===0&&(l=0),n.push(l);let c=1/(a-2),h=-c,f=1+c,d=[h,h,f,h,f,f,h,h,f,f,h,f],u=6,_=6,p=3,m=2,g=1,b=new Float32Array(p*_*u),y=new Float32Array(m*_*u),S=new Float32Array(g*_*u);for(let T=0;T<u;T++){let w=T%3*2/3-1,P=T>2?0:-1,M=[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];b.set(M,p*_*T),y.set(d,m*_*T);let v=[T,T,T,T,T,T];S.set(v,g*_*T)}let D=new Ni;D.setAttribute("position",new ei(b,p)),D.setAttribute("uv",new ei(y,m)),D.setAttribute("faceIndex",new ei(S,g)),t.push(D),i>To&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function a_(r,t,e){let n=new nr(r,t,e);return n.texture.mapping=Wc,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function dc(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function bw(r,t,e){let n=new Float32Array(ws),i=new nt(0,1,0);return new ri({name:"SphericalGaussianBlur",defines:{n:ws,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:Kf(),fragmentShader:`
|
|
3571
3571
|
|
|
3572
3572
|
precision mediump float;
|
|
3573
3573
|
precision mediump int;
|
|
@@ -3717,15 +3717,15 @@ void main() {
|
|
|
3717
3717
|
gl_Position = vec4( position, 1.0 );
|
|
3718
3718
|
|
|
3719
3719
|
}
|
|
3720
|
-
`}function bw(r){let t=new WeakMap,e=null;function n(a){if(a&&a.isTexture){let l=a.mapping,c=l===df||l===pf,h=l===Ro||l===Po;if(c||h){let f=t.get(a),d=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return e===null&&(e=new Uc(r)),f=c?e.fromEquirectangular(a,f):e.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,t.set(a,f),f.texture;if(f!==void 0)return f.texture;{let u=a.image;return c&&u&&u.height>0||h&&u&&i(u)?(e===null&&(e=new Uc(r)),f=c?e.fromEquirectangular(a):e.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,t.set(a,f),a.addEventListener("dispose",s),f.texture):null}}}return a}function i(a){let l=0,c=6;for(let h=0;h<c;h++)a[h]!==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 ww(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 Ew(r,t,e,n){let i={},s=new WeakMap;function o(f){let d=f.target;d.index!==null&&t.remove(d.index);for(let _ in d.attributes)t.remove(d.attributes[_]);for(let _ in d.morphAttributes){let p=d.morphAttributes[_];for(let m=0,g=p.length;m<g;m++)t.remove(p[m])}d.removeEventListener("dispose",o),delete i[d.id];let u=s.get(d);u&&(t.remove(u),s.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,e.memory.geometries--}function a(f,d){return i[d.id]===!0||(d.addEventListener("dispose",o),i[d.id]=!0,e.memory.geometries++),d}function l(f){let d=f.attributes;for(let _ in d)t.update(d[_],r.ARRAY_BUFFER);let u=f.morphAttributes;for(let _ in u){let p=u[_];for(let m=0,g=p.length;m<g;m++)t.update(p[m],r.ARRAY_BUFFER)}}function c(f){let d=[],u=f.index,_=f.attributes.position,p=0;if(u!==null){let b=u.array;p=u.version;for(let y=0,S=b.length;y<S;y+=3){let D=b[y+0],T=b[y+1],w=b[y+2];d.push(D,T,T,w,w,D)}}else if(_!==void 0){let b=_.array;p=_.version;for(let y=0,S=b.length/3-1;y<S;y+=3){let D=y+0,T=y+1,w=y+2;d.push(D,T,T,w,w,D)}}else return;let m=new(z_(d)?Pc:Rc)(d,1);m.version=p;let g=s.get(f);g&&t.remove(g),s.set(f,m)}function h(f){let d=s.get(f);if(d){let u=f.index;u!==null&&d.version<u.version&&c(f)}else c(f);return s.get(f)}return{get:a,update:l,getWireframeAttribute:h}}function Tw(r,t,e){let n;function i(d){n=d}let s,o;function a(d){s=d.type,o=d.bytesPerElement}function l(d,u){r.drawElements(n,u,s,d*o),e.update(u,n,1)}function c(d,u,_){_!==0&&(r.drawElementsInstanced(n,u,s,d*o,_),e.update(u,n,_))}function h(d,u,_){if(_===0)return;let p=t.get("WEBGL_multi_draw");if(p===null)for(let m=0;m<_;m++)this.render(d[m]/o,u[m]);else{p.multiDrawElementsWEBGL(n,u,0,s,d,0,_);let m=0;for(let g=0;g<_;g++)m+=u[g];e.update(m,n,1)}}function f(d,u,_,p){if(_===0)return;let m=t.get("WEBGL_multi_draw");if(m===null)for(let g=0;g<d.length;g++)c(d[g]/o,u[g],p[g]);else{m.multiDrawElementsInstancedWEBGL(n,u,0,s,d,0,p,0,_);let g=0;for(let b=0;b<_;b++)g+=u[b];for(let b=0;b<p.length;b++)e.update(g,n,p[b])}}this.setMode=i,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=f}function Aw(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 Dw(r,t,e){let n=new WeakMap,i=new Qe;function s(o,a,l){let c=o.morphTargetInfluences,h=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,f=h!==void 0?h.length:0,d=n.get(a);if(d===void 0||d.count!==f){let M=function(){w.dispose(),n.delete(a),a.removeEventListener("dispose",M)};d!==void 0&&d.texture.dispose();let u=a.morphAttributes.position!==void 0,_=a.morphAttributes.normal!==void 0,p=a.morphAttributes.color!==void 0,m=a.morphAttributes.position||[],g=a.morphAttributes.normal||[],b=a.morphAttributes.color||[],y=0;u===!0&&(y=1),_===!0&&(y=2),p===!0&&(y=3);let S=a.attributes.position.count*y,D=1;S>t.maxTextureSize&&(D=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);let T=new Float32Array(S*D*4*f),w=new Tc(T,S,D,f);w.type=Dr,w.needsUpdate=!0;let P=y*4;for(let v=0;v<f;v++){let I=m[v],N=g[v],C=b[v],V=S*D*4*v;for(let $=0;$<I.count;$++){let W=$*P;u===!0&&(i.fromBufferAttribute(I,$),T[V+W+0]=i.x,T[V+W+1]=i.y,T[V+W+2]=i.z,T[V+W+3]=0),_===!0&&(i.fromBufferAttribute(N,$),T[V+W+4]=i.x,T[V+W+5]=i.y,T[V+W+6]=i.z,T[V+W+7]=0),p===!0&&(i.fromBufferAttribute(C,$),T[V+W+8]=i.x,T[V+W+9]=i.y,T[V+W+10]=i.z,T[V+W+11]=C.itemSize===4?i.w:1)}}d={count:f,texture:w,size:new _e(S,D)},n.set(a,d),a.addEventListener("dispose",M)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(r,"morphTexture",o.morphTexture,e);else{let u=0;for(let p=0;p<c.length;p++)u+=c[p];let _=a.morphTargetsRelative?1:1-u;l.getUniforms().setValue(r,"morphTargetBaseInfluence",_),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",d.texture,e),l.getUniforms().setValue(r,"morphTargetsTextureSize",d.size)}return{update:s}}function Cw(r,t,e,n){let i=new WeakMap;function s(l){let c=n.render.frame,h=l.geometry,f=t.get(l,h);if(i.get(f)!==c&&(t.update(f),i.set(f,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 d=l.skeleton;i.get(d)!==c&&(d.update(),i.set(d,c))}return f}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 Oc=class extends ii{constructor(t,e,n,i,s,o,a,l,c,h){if(h=h!==void 0?h:Ao,h!==Ao&&h!==La)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Ao&&(n=Io),n===void 0&&h===La&&(n=Oa),super(null,i,s,o,a,l,h,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=a!==void 0?a:ti,this.minFilter=l!==void 0?l:ti,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}},W_=new ii,X_=new Oc(1,1);X_.compareFunction=k_;var Y_=new Tc,q_=new yf,Z_=new Lc,u_=[],h_=[],f_=new Float32Array(16),d_=new Float32Array(9),p_=new Float32Array(4);function Uo(r,t,e){let n=r[0];if(n<=0||n>0)return r;let i=t*e,s=u_[i];if(s===void 0&&(s=new Float32Array(i),u_[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 Xe(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 Ye(r,t){for(let e=0,n=t.length;e<n;e++)r[e]=t[e]}function qc(r,t){let e=h_[t];e===void 0&&(e=new Int32Array(t),h_[t]=e);for(let n=0;n!==t;++n)e[n]=r.allocateTextureUnit();return e}function Rw(r,t){let e=this.cache;e[0]!==t&&(r.uniform1f(this.addr,t),e[0]=t)}function Pw(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(Xe(e,t))return;r.uniform2fv(this.addr,t),Ye(e,t)}}function Iw(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(Xe(e,t))return;r.uniform3fv(this.addr,t),Ye(e,t)}}function Lw(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(Xe(e,t))return;r.uniform4fv(this.addr,t),Ye(e,t)}}function Fw(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Xe(e,t))return;r.uniformMatrix2fv(this.addr,!1,t),Ye(e,t)}else{if(Xe(e,n))return;p_.set(n),r.uniformMatrix2fv(this.addr,!1,p_),Ye(e,n)}}function Nw(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Xe(e,t))return;r.uniformMatrix3fv(this.addr,!1,t),Ye(e,t)}else{if(Xe(e,n))return;d_.set(n),r.uniformMatrix3fv(this.addr,!1,d_),Ye(e,n)}}function Uw(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Xe(e,t))return;r.uniformMatrix4fv(this.addr,!1,t),Ye(e,t)}else{if(Xe(e,n))return;f_.set(n),r.uniformMatrix4fv(this.addr,!1,f_),Ye(e,n)}}function Ow(r,t){let e=this.cache;e[0]!==t&&(r.uniform1i(this.addr,t),e[0]=t)}function Bw(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(Xe(e,t))return;r.uniform2iv(this.addr,t),Ye(e,t)}}function kw(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(Xe(e,t))return;r.uniform3iv(this.addr,t),Ye(e,t)}}function zw(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(Xe(e,t))return;r.uniform4iv(this.addr,t),Ye(e,t)}}function Vw(r,t){let e=this.cache;e[0]!==t&&(r.uniform1ui(this.addr,t),e[0]=t)}function Hw(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(Xe(e,t))return;r.uniform2uiv(this.addr,t),Ye(e,t)}}function Gw(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(Xe(e,t))return;r.uniform3uiv(this.addr,t),Ye(e,t)}}function Ww(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(Xe(e,t))return;r.uniform4uiv(this.addr,t),Ye(e,t)}}function Xw(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?X_:W_;e.setTexture2D(t||s,i)}function Yw(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||q_,i)}function qw(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||Z_,i)}function Zw(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||Y_,i)}function Jw(r){switch(r){case 5126:return Rw;case 35664:return Pw;case 35665:return Iw;case 35666:return Lw;case 35674:return Fw;case 35675:return Nw;case 35676:return Uw;case 5124:case 35670:return Ow;case 35667:case 35671:return Bw;case 35668:case 35672:return kw;case 35669:case 35673:return zw;case 5125:return Vw;case 36294:return Hw;case 36295:return Gw;case 36296:return Ww;case 35678:case 36198:case 36298:case 36306:case 35682:return Xw;case 35679:case 36299:case 36307:return Yw;case 35680:case 36300:case 36308:case 36293:return qw;case 36289:case 36303:case 36311:case 36292:return Zw}}function $w(r,t){r.uniform1fv(this.addr,t)}function Kw(r,t){let e=Uo(t,this.size,2);r.uniform2fv(this.addr,e)}function jw(r,t){let e=Uo(t,this.size,3);r.uniform3fv(this.addr,e)}function Qw(r,t){let e=Uo(t,this.size,4);r.uniform4fv(this.addr,e)}function t1(r,t){let e=Uo(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,e)}function e1(r,t){let e=Uo(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,e)}function n1(r,t){let e=Uo(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,e)}function i1(r,t){r.uniform1iv(this.addr,t)}function r1(r,t){r.uniform2iv(this.addr,t)}function s1(r,t){r.uniform3iv(this.addr,t)}function o1(r,t){r.uniform4iv(this.addr,t)}function a1(r,t){r.uniform1uiv(this.addr,t)}function l1(r,t){r.uniform2uiv(this.addr,t)}function c1(r,t){r.uniform3uiv(this.addr,t)}function u1(r,t){r.uniform4uiv(this.addr,t)}function h1(r,t,e){let n=this.cache,i=t.length,s=qc(e,i);Xe(n,s)||(r.uniform1iv(this.addr,s),Ye(n,s));for(let o=0;o!==i;++o)e.setTexture2D(t[o]||W_,s[o])}function f1(r,t,e){let n=this.cache,i=t.length,s=qc(e,i);Xe(n,s)||(r.uniform1iv(this.addr,s),Ye(n,s));for(let o=0;o!==i;++o)e.setTexture3D(t[o]||q_,s[o])}function d1(r,t,e){let n=this.cache,i=t.length,s=qc(e,i);Xe(n,s)||(r.uniform1iv(this.addr,s),Ye(n,s));for(let o=0;o!==i;++o)e.setTextureCube(t[o]||Z_,s[o])}function p1(r,t,e){let n=this.cache,i=t.length,s=qc(e,i);Xe(n,s)||(r.uniform1iv(this.addr,s),Ye(n,s));for(let o=0;o!==i;++o)e.setTexture2DArray(t[o]||Y_,s[o])}function m1(r){switch(r){case 5126:return $w;case 35664:return Kw;case 35665:return jw;case 35666:return Qw;case 35674:return t1;case 35675:return e1;case 35676:return n1;case 5124:case 35670:return i1;case 35667:case 35671:return r1;case 35668:case 35672:return s1;case 35669:case 35673:return o1;case 5125:return a1;case 36294:return l1;case 36295:return c1;case 36296:return u1;case 35678:case 36198:case 36298:case 36306:case 35682:return h1;case 35679:case 36299:case 36307:return f1;case 35680:case 36300:case 36308:case 36293:return d1;case 36289:case 36303:case 36311:case 36292:return p1}}var bf=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=Jw(e.type)}},wf=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=m1(e.type)}},Ef=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)}}},cf=/(\w+)(\])?(\[|\.)?/g;function m_(r,t){r.seq.push(t),r.map[t.id]=t}function g1(r,t,e){let n=r.name,i=n.length;for(cf.lastIndex=0;;){let s=cf.exec(n),o=cf.lastIndex,a=s[1],l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===i){m_(e,c===void 0?new bf(a,r,t):new wf(a,r,t));break}else{let f=e.map[a];f===void 0&&(f=new Ef(a),m_(e,f)),e=f}}}var Co=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);g1(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 g_(r,t,e){let n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}var _1=37297,x1=0;function v1(r,t){let e=r.split(`
|
|
3720
|
+
`}function ww(r){let t=new WeakMap,e=null;function n(a){if(a&&a.isTexture){let l=a.mapping,c=l===df||l===pf,h=l===Ro||l===Po;if(c||h){let f=t.get(a),d=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return e===null&&(e=new Uc(r)),f=c?e.fromEquirectangular(a,f):e.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,t.set(a,f),f.texture;if(f!==void 0)return f.texture;{let u=a.image;return c&&u&&u.height>0||h&&u&&i(u)?(e===null&&(e=new Uc(r)),f=c?e.fromEquirectangular(a):e.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,t.set(a,f),a.addEventListener("dispose",s),f.texture):null}}}return a}function i(a){let l=0,c=6;for(let h=0;h<c;h++)a[h]!==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 Ew(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 Tw(r,t,e,n){let i={},s=new WeakMap;function o(f){let d=f.target;d.index!==null&&t.remove(d.index);for(let _ in d.attributes)t.remove(d.attributes[_]);for(let _ in d.morphAttributes){let p=d.morphAttributes[_];for(let m=0,g=p.length;m<g;m++)t.remove(p[m])}d.removeEventListener("dispose",o),delete i[d.id];let u=s.get(d);u&&(t.remove(u),s.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,e.memory.geometries--}function a(f,d){return i[d.id]===!0||(d.addEventListener("dispose",o),i[d.id]=!0,e.memory.geometries++),d}function l(f){let d=f.attributes;for(let _ in d)t.update(d[_],r.ARRAY_BUFFER);let u=f.morphAttributes;for(let _ in u){let p=u[_];for(let m=0,g=p.length;m<g;m++)t.update(p[m],r.ARRAY_BUFFER)}}function c(f){let d=[],u=f.index,_=f.attributes.position,p=0;if(u!==null){let b=u.array;p=u.version;for(let y=0,S=b.length;y<S;y+=3){let D=b[y+0],T=b[y+1],w=b[y+2];d.push(D,T,T,w,w,D)}}else if(_!==void 0){let b=_.array;p=_.version;for(let y=0,S=b.length/3-1;y<S;y+=3){let D=y+0,T=y+1,w=y+2;d.push(D,T,T,w,w,D)}}else return;let m=new(z_(d)?Pc:Rc)(d,1);m.version=p;let g=s.get(f);g&&t.remove(g),s.set(f,m)}function h(f){let d=s.get(f);if(d){let u=f.index;u!==null&&d.version<u.version&&c(f)}else c(f);return s.get(f)}return{get:a,update:l,getWireframeAttribute:h}}function Aw(r,t,e){let n;function i(d){n=d}let s,o;function a(d){s=d.type,o=d.bytesPerElement}function l(d,u){r.drawElements(n,u,s,d*o),e.update(u,n,1)}function c(d,u,_){_!==0&&(r.drawElementsInstanced(n,u,s,d*o,_),e.update(u,n,_))}function h(d,u,_){if(_===0)return;let p=t.get("WEBGL_multi_draw");if(p===null)for(let m=0;m<_;m++)this.render(d[m]/o,u[m]);else{p.multiDrawElementsWEBGL(n,u,0,s,d,0,_);let m=0;for(let g=0;g<_;g++)m+=u[g];e.update(m,n,1)}}function f(d,u,_,p){if(_===0)return;let m=t.get("WEBGL_multi_draw");if(m===null)for(let g=0;g<d.length;g++)c(d[g]/o,u[g],p[g]);else{m.multiDrawElementsInstancedWEBGL(n,u,0,s,d,0,p,0,_);let g=0;for(let b=0;b<_;b++)g+=u[b];for(let b=0;b<p.length;b++)e.update(g,n,p[b])}}this.setMode=i,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=f}function Dw(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 Cw(r,t,e){let n=new WeakMap,i=new Qe;function s(o,a,l){let c=o.morphTargetInfluences,h=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,f=h!==void 0?h.length:0,d=n.get(a);if(d===void 0||d.count!==f){let M=function(){w.dispose(),n.delete(a),a.removeEventListener("dispose",M)};d!==void 0&&d.texture.dispose();let u=a.morphAttributes.position!==void 0,_=a.morphAttributes.normal!==void 0,p=a.morphAttributes.color!==void 0,m=a.morphAttributes.position||[],g=a.morphAttributes.normal||[],b=a.morphAttributes.color||[],y=0;u===!0&&(y=1),_===!0&&(y=2),p===!0&&(y=3);let S=a.attributes.position.count*y,D=1;S>t.maxTextureSize&&(D=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);let T=new Float32Array(S*D*4*f),w=new Tc(T,S,D,f);w.type=Dr,w.needsUpdate=!0;let P=y*4;for(let v=0;v<f;v++){let I=m[v],N=g[v],C=b[v],V=S*D*4*v;for(let $=0;$<I.count;$++){let W=$*P;u===!0&&(i.fromBufferAttribute(I,$),T[V+W+0]=i.x,T[V+W+1]=i.y,T[V+W+2]=i.z,T[V+W+3]=0),_===!0&&(i.fromBufferAttribute(N,$),T[V+W+4]=i.x,T[V+W+5]=i.y,T[V+W+6]=i.z,T[V+W+7]=0),p===!0&&(i.fromBufferAttribute(C,$),T[V+W+8]=i.x,T[V+W+9]=i.y,T[V+W+10]=i.z,T[V+W+11]=C.itemSize===4?i.w:1)}}d={count:f,texture:w,size:new _e(S,D)},n.set(a,d),a.addEventListener("dispose",M)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(r,"morphTexture",o.morphTexture,e);else{let u=0;for(let p=0;p<c.length;p++)u+=c[p];let _=a.morphTargetsRelative?1:1-u;l.getUniforms().setValue(r,"morphTargetBaseInfluence",_),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",d.texture,e),l.getUniforms().setValue(r,"morphTargetsTextureSize",d.size)}return{update:s}}function Rw(r,t,e,n){let i=new WeakMap;function s(l){let c=n.render.frame,h=l.geometry,f=t.get(l,h);if(i.get(f)!==c&&(t.update(f),i.set(f,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 d=l.skeleton;i.get(d)!==c&&(d.update(),i.set(d,c))}return f}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 Oc=class extends ii{constructor(t,e,n,i,s,o,a,l,c,h){if(h=h!==void 0?h:Ao,h!==Ao&&h!==La)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Ao&&(n=Io),n===void 0&&h===La&&(n=Oa),super(null,i,s,o,a,l,h,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=a!==void 0?a:ti,this.minFilter=l!==void 0?l:ti,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}},W_=new ii,X_=new Oc(1,1);X_.compareFunction=k_;var Y_=new Tc,q_=new yf,Z_=new Lc,u_=[],h_=[],f_=new Float32Array(16),d_=new Float32Array(9),p_=new Float32Array(4);function Uo(r,t,e){let n=r[0];if(n<=0||n>0)return r;let i=t*e,s=u_[i];if(s===void 0&&(s=new Float32Array(i),u_[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 Xe(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 Ye(r,t){for(let e=0,n=t.length;e<n;e++)r[e]=t[e]}function qc(r,t){let e=h_[t];e===void 0&&(e=new Int32Array(t),h_[t]=e);for(let n=0;n!==t;++n)e[n]=r.allocateTextureUnit();return e}function Pw(r,t){let e=this.cache;e[0]!==t&&(r.uniform1f(this.addr,t),e[0]=t)}function Iw(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(Xe(e,t))return;r.uniform2fv(this.addr,t),Ye(e,t)}}function Lw(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(Xe(e,t))return;r.uniform3fv(this.addr,t),Ye(e,t)}}function Fw(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(Xe(e,t))return;r.uniform4fv(this.addr,t),Ye(e,t)}}function Nw(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Xe(e,t))return;r.uniformMatrix2fv(this.addr,!1,t),Ye(e,t)}else{if(Xe(e,n))return;p_.set(n),r.uniformMatrix2fv(this.addr,!1,p_),Ye(e,n)}}function Uw(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Xe(e,t))return;r.uniformMatrix3fv(this.addr,!1,t),Ye(e,t)}else{if(Xe(e,n))return;d_.set(n),r.uniformMatrix3fv(this.addr,!1,d_),Ye(e,n)}}function Ow(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(Xe(e,t))return;r.uniformMatrix4fv(this.addr,!1,t),Ye(e,t)}else{if(Xe(e,n))return;f_.set(n),r.uniformMatrix4fv(this.addr,!1,f_),Ye(e,n)}}function Bw(r,t){let e=this.cache;e[0]!==t&&(r.uniform1i(this.addr,t),e[0]=t)}function kw(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(Xe(e,t))return;r.uniform2iv(this.addr,t),Ye(e,t)}}function zw(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(Xe(e,t))return;r.uniform3iv(this.addr,t),Ye(e,t)}}function Vw(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(Xe(e,t))return;r.uniform4iv(this.addr,t),Ye(e,t)}}function Hw(r,t){let e=this.cache;e[0]!==t&&(r.uniform1ui(this.addr,t),e[0]=t)}function Gw(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(Xe(e,t))return;r.uniform2uiv(this.addr,t),Ye(e,t)}}function Ww(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(Xe(e,t))return;r.uniform3uiv(this.addr,t),Ye(e,t)}}function Xw(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(Xe(e,t))return;r.uniform4uiv(this.addr,t),Ye(e,t)}}function Yw(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?X_:W_;e.setTexture2D(t||s,i)}function qw(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||q_,i)}function Zw(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||Z_,i)}function Jw(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||Y_,i)}function $w(r){switch(r){case 5126:return Pw;case 35664:return Iw;case 35665:return Lw;case 35666:return Fw;case 35674:return Nw;case 35675:return Uw;case 35676:return Ow;case 5124:case 35670:return Bw;case 35667:case 35671:return kw;case 35668:case 35672:return zw;case 35669:case 35673:return Vw;case 5125:return Hw;case 36294:return Gw;case 36295:return Ww;case 36296:return Xw;case 35678:case 36198:case 36298:case 36306:case 35682:return Yw;case 35679:case 36299:case 36307:return qw;case 35680:case 36300:case 36308:case 36293:return Zw;case 36289:case 36303:case 36311:case 36292:return Jw}}function Kw(r,t){r.uniform1fv(this.addr,t)}function jw(r,t){let e=Uo(t,this.size,2);r.uniform2fv(this.addr,e)}function Qw(r,t){let e=Uo(t,this.size,3);r.uniform3fv(this.addr,e)}function t1(r,t){let e=Uo(t,this.size,4);r.uniform4fv(this.addr,e)}function e1(r,t){let e=Uo(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,e)}function n1(r,t){let e=Uo(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,e)}function i1(r,t){let e=Uo(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,e)}function r1(r,t){r.uniform1iv(this.addr,t)}function s1(r,t){r.uniform2iv(this.addr,t)}function o1(r,t){r.uniform3iv(this.addr,t)}function a1(r,t){r.uniform4iv(this.addr,t)}function l1(r,t){r.uniform1uiv(this.addr,t)}function c1(r,t){r.uniform2uiv(this.addr,t)}function u1(r,t){r.uniform3uiv(this.addr,t)}function h1(r,t){r.uniform4uiv(this.addr,t)}function f1(r,t,e){let n=this.cache,i=t.length,s=qc(e,i);Xe(n,s)||(r.uniform1iv(this.addr,s),Ye(n,s));for(let o=0;o!==i;++o)e.setTexture2D(t[o]||W_,s[o])}function d1(r,t,e){let n=this.cache,i=t.length,s=qc(e,i);Xe(n,s)||(r.uniform1iv(this.addr,s),Ye(n,s));for(let o=0;o!==i;++o)e.setTexture3D(t[o]||q_,s[o])}function p1(r,t,e){let n=this.cache,i=t.length,s=qc(e,i);Xe(n,s)||(r.uniform1iv(this.addr,s),Ye(n,s));for(let o=0;o!==i;++o)e.setTextureCube(t[o]||Z_,s[o])}function m1(r,t,e){let n=this.cache,i=t.length,s=qc(e,i);Xe(n,s)||(r.uniform1iv(this.addr,s),Ye(n,s));for(let o=0;o!==i;++o)e.setTexture2DArray(t[o]||Y_,s[o])}function g1(r){switch(r){case 5126:return Kw;case 35664:return jw;case 35665:return Qw;case 35666:return t1;case 35674:return e1;case 35675:return n1;case 35676:return i1;case 5124:case 35670:return r1;case 35667:case 35671:return s1;case 35668:case 35672:return o1;case 35669:case 35673:return a1;case 5125:return l1;case 36294:return c1;case 36295:return u1;case 36296:return h1;case 35678:case 36198:case 36298:case 36306:case 35682:return f1;case 35679:case 36299:case 36307:return d1;case 35680:case 36300:case 36308:case 36293:return p1;case 36289:case 36303:case 36311:case 36292:return m1}}var bf=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=$w(e.type)}},wf=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=g1(e.type)}},Ef=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)}}},cf=/(\w+)(\])?(\[|\.)?/g;function m_(r,t){r.seq.push(t),r.map[t.id]=t}function _1(r,t,e){let n=r.name,i=n.length;for(cf.lastIndex=0;;){let s=cf.exec(n),o=cf.lastIndex,a=s[1],l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===i){m_(e,c===void 0?new bf(a,r,t):new wf(a,r,t));break}else{let f=e.map[a];f===void 0&&(f=new Ef(a),m_(e,f)),e=f}}}var Co=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);_1(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 g_(r,t,e){let n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}var x1=37297,v1=0;function y1(r,t){let e=r.split(`
|
|
3721
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
|
|
3722
|
+
`)}function S1(r){let t=Se.getPrimaries(Se.workingColorSpace),e=Se.getPrimaries(r),n;switch(t===e?n="":t===Mc&&e===Sc?n="LinearDisplayP3ToLinearSRGB":t===Sc&&e===Mc&&(n="LinearSRGBToLinearDisplayP3"),r){case Or:case Yc:return[n,"LinearTransferOETF"];case Qn:case $f:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function __(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
|
-
`+
|
|
3727
|
-
`)}function
|
|
3728
|
-
`)}function
|
|
3726
|
+
`+y1(r.getShaderSource(t),o)}else return i}function M1(r,t){let e=S1(t);return`vec4 ${r}( vec4 value ) { return ${e[0]}( ${e[1]}( value ) ); }`}function b1(r,t){let e;switch(t){case By:e="Linear";break;case ky:e="Reinhard";break;case zy:e="OptimizedCineon";break;case Vy:e="ACESFilmic";break;case Gy:e="AgX";break;case Wy:e="Neutral";break;case Hy:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}function w1(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Pa).join(`
|
|
3727
|
+
`)}function E1(r){let t=[];for(let e in r){let n=r[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(`
|
|
3728
|
+
`)}function T1(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 Pa(r){return r!==""}function x_(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 v_(r,t){return r.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var A1=/^[ \t]*#include +<([\w\d./]+)>/gm;function Tf(r){return r.replace(A1,C1)}var D1=new Map;function C1(r,t){let e=re[t];if(e===void 0){let n=D1.get(t);if(n!==void 0)e=re[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 Tf(e)}var R1=/#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 y_(r){return r.replace(R1,P1)}function P1(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 S_(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,14 +3745,14 @@ 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
|
|
3748
|
+
#define LOW_PRECISION`),t}function I1(r){let t="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===C_?t="SHADOWMAP_TYPE_PCF":r.shadowMapType===Jf?t="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===ji&&(t="SHADOWMAP_TYPE_VSM"),t}function L1(r){let t="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case Ro:case Po:t="ENVMAP_TYPE_CUBE";break;case Wc:t="ENVMAP_TYPE_CUBE_UV";break}return t}function F1(r){let t="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case Po:t="ENVMAP_MODE_REFRACTION";break}return t}function N1(r){let t="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case R_:t="ENVMAP_BLENDING_MULTIPLY";break;case Uy:t="ENVMAP_BLENDING_MIX";break;case Oy:t="ENVMAP_BLENDING_ADD";break}return t}function U1(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 O1(r,t,e,n){let i=r.getContext(),s=e.defines,o=e.vertexShader,a=e.fragmentShader,l=I1(e),c=L1(e),h=F1(e),f=N1(e),d=U1(e),u=w1(e),_=E1(s),p=i.createProgram(),m,g,b=e.glslVersion?"#version "+e.glslVersion+`
|
|
3749
3749
|
`:"";e.isRawShaderMaterial?(m=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Pa).join(`
|
|
3750
3750
|
`),m.length>0&&(m+=`
|
|
3751
3751
|
`),g=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Pa).join(`
|
|
3752
3752
|
`),g.length>0&&(g+=`
|
|
3753
3753
|
`)):(m=[S_(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 "+h:"",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
3754
|
`].filter(Pa).join(`
|
|
3755
|
-
`),g=[S_(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 "+h:"",e.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.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!==Ir?"#define TONE_MAPPING":"",e.toneMapping!==Ir?re.tonemapping_pars_fragment:"",e.toneMapping!==Ir?
|
|
3755
|
+
`),g=[S_(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 "+h:"",e.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.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!==Ir?"#define TONE_MAPPING":"",e.toneMapping!==Ir?re.tonemapping_pars_fragment:"",e.toneMapping!==Ir?b1("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",re.colorspace_pars_fragment,M1("linearToOutputTexel",e.outputColorSpace),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
|
|
3756
3756
|
`].filter(Pa).join(`
|
|
3757
3757
|
`)),o=Tf(o),o=x_(o,e),o=v_(o,e),a=Tf(a),a=x_(a,e),a=v_(a,e),o=y_(o),a=y_(a),e.isRawShaderMaterial!==!0&&(b=`#version 300 es
|
|
3758
3758
|
`,m=[u,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
@@ -3766,9 +3766,9 @@ Material Type: `+I.type+`
|
|
|
3766
3766
|
|
|
3767
3767
|
Program Info Log: `+N+`
|
|
3768
3768
|
`+Z+`
|
|
3769
|
-
`+z)}else N!==""?console.warn("THREE.WebGLProgram: Program Info Log:",N):(C===""||V==="")&&(W=!1);W&&(I.diagnostics={runnable:$,programLog:N,vertexShader:{log:C,prefix:m},fragmentShader:{log:V,prefix:g}})}i.deleteShader(D),i.deleteShader(T),P=new Co(i,p),M=E1(i,p)}let P;this.getUniforms=function(){return P===void 0&&w(this),P};let M;this.getAttributes=function(){return M===void 0&&w(this),M};let v=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return v===!1&&(v=i.getProgramParameter(p,_1)),v},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(p),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=x1++,this.cacheKey=t,this.usedTimes=1,this.program=p,this.vertexShader=D,this.fragmentShader=T,this}var O1=0,Af=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 Df(t),e.set(t,n)),n}},Df=class{constructor(t){this.id=O1++,this.code=t,this.usedTimes=0}};function B1(r,t,e,n,i,s,o){let a=new Dc,l=new Af,c=new Set,h=[],f=i.logarithmicDepthBuffer,d=i.vertexTextures,u=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 p(M){return c.add(M),M===0?"uv":`uv${M}`}function m(M,v,I,N,C){let V=N.fog,$=C.geometry,W=M.isMeshStandardMaterial?N.environment:null,Z=(M.isMeshStandardMaterial?e:t).get(M.envMap||W),z=Z&&Z.mapping===Wc?Z.image.height:null,U=_[M.type];M.precision!==null&&(u=i.getMaxPrecision(M.precision),u!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",u,"instead."));let R=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,at=R!==void 0?R.length:0,_t=0;$.morphAttributes.position!==void 0&&(_t=1),$.morphAttributes.normal!==void 0&&(_t=2),$.morphAttributes.color!==void 0&&(_t=3);let Ut,X,ot,xt;if(U){let rt=Li[U];Ut=rt.vertexShader,X=rt.fragmentShader}else Ut=M.vertexShader,X=M.fragmentShader,l.update(M),ot=l.getVertexShaderID(M),xt=l.getFragmentShaderID(M);let ct=r.getRenderTarget(),Rt=C.isInstancedMesh===!0,kt=C.isBatchedMesh===!0,q=!!M.map,Jt=!!M.matcap,It=!!Z,Ft=!!M.aoMap,bt=!!M.lightMap,Et=!!M.bumpMap,Ht=!!M.normalMap,G=!!M.displacementMap,$t=!!M.emissiveMap,A=!!M.metalnessMap,x=!!M.roughnessMap,F=M.anisotropy>0,Y=M.clearcoat>0,tt=M.dispersion>0,it=M.iridescence>0,yt=M.sheen>0,pt=M.transmission>0,lt=F&&!!M.anisotropyMap,Lt=Y&&!!M.clearcoatMap,ht=Y&&!!M.clearcoatNormalMap,vt=Y&&!!M.clearcoatRoughnessMap,Yt=it&&!!M.iridescenceMap,ut=it&&!!M.iridescenceThicknessMap,Tt=yt&&!!M.sheenColorMap,Wt=yt&&!!M.sheenRoughnessMap,qt=!!M.specularMap,ce=!!M.specularColorMap,Zt=!!M.specularIntensityMap,k=pt&&!!M.transmissionMap,Q=pt&&!!M.thicknessMap,st=!!M.gradientMap,mt=!!M.alphaMap,gt=M.alphaTest>0,Bt=!!M.alphaHash,ee=!!M.extensions,Mt=Ir;M.toneMapped&&(ct===null||ct.isXRRenderTarget===!0)&&(Mt=r.toneMapping);let L={shaderID:U,shaderType:M.type,shaderName:M.name,vertexShader:Ut,fragmentShader:X,defines:M.defines,customVertexShaderID:ot,customFragmentShaderID:xt,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:u,batching:kt,instancing:Rt,instancingColor:Rt&&C.instanceColor!==null,instancingMorph:Rt&&C.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:ct===null?r.outputColorSpace:ct.isXRRenderTarget===!0?ct.texture.colorSpace:Or,alphaToCoverage:!!M.alphaToCoverage,map:q,matcap:Jt,envMap:It,envMapMode:It&&Z.mapping,envMapCubeUVHeight:z,aoMap:Ft,lightMap:bt,bumpMap:Et,normalMap:Ht,displacementMap:d&&G,emissiveMap:$t,normalMapObjectSpace:Ht&&M.normalMapType===rS,normalMapTangentSpace:Ht&&M.normalMapType===iS,metalnessMap:A,roughnessMap:x,anisotropy:F,anisotropyMap:lt,clearcoat:Y,clearcoatMap:Lt,clearcoatNormalMap:ht,clearcoatRoughnessMap:vt,dispersion:tt,iridescence:it,iridescenceMap:Yt,iridescenceThicknessMap:ut,sheen:yt,sheenColorMap:Tt,sheenRoughnessMap:Wt,specularMap:qt,specularColorMap:ce,specularIntensityMap:Zt,transmission:pt,transmissionMap:k,thicknessMap:Q,gradientMap:st,opaque:M.transparent===!1&&M.blending===Pr&&M.alphaToCoverage===!1,alphaMap:mt,alphaTest:gt,alphaHash:Bt,combine:M.combine,mapUv:q&&p(M.map.channel),aoMapUv:Ft&&p(M.aoMap.channel),lightMapUv:bt&&p(M.lightMap.channel),bumpMapUv:Et&&p(M.bumpMap.channel),normalMapUv:Ht&&p(M.normalMap.channel),displacementMapUv:G&&p(M.displacementMap.channel),emissiveMapUv:$t&&p(M.emissiveMap.channel),metalnessMapUv:A&&p(M.metalnessMap.channel),roughnessMapUv:x&&p(M.roughnessMap.channel),anisotropyMapUv:lt&&p(M.anisotropyMap.channel),clearcoatMapUv:Lt&&p(M.clearcoatMap.channel),clearcoatNormalMapUv:ht&&p(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:vt&&p(M.clearcoatRoughnessMap.channel),iridescenceMapUv:Yt&&p(M.iridescenceMap.channel),iridescenceThicknessMapUv:ut&&p(M.iridescenceThicknessMap.channel),sheenColorMapUv:Tt&&p(M.sheenColorMap.channel),sheenRoughnessMapUv:Wt&&p(M.sheenRoughnessMap.channel),specularMapUv:qt&&p(M.specularMap.channel),specularColorMapUv:ce&&p(M.specularColorMap.channel),specularIntensityMapUv:Zt&&p(M.specularIntensityMap.channel),transmissionMapUv:k&&p(M.transmissionMap.channel),thicknessMapUv:Q&&p(M.thicknessMap.channel),alphaMapUv:mt&&p(M.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(Ht||F),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:C.isPoints===!0&&!!$.attributes.uv&&(q||mt),fog:!!V,useFog:M.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:C.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:at,morphTextureStride:_t,numDirLights:v.directional.length,numPointLights:v.point.length,numSpotLights:v.spot.length,numSpotLightMaps:v.spotLightMap.length,numRectAreaLights:v.rectArea.length,numHemiLights:v.hemi.length,numDirLightShadows:v.directionalShadowMap.length,numPointLightShadows:v.pointShadowMap.length,numSpotLightShadows:v.spotShadowMap.length,numSpotLightShadowsWithMaps:v.numSpotLightShadowsWithMaps,numLightProbes:v.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:M.dithering,shadowMapEnabled:r.shadowMap.enabled&&I.length>0,shadowMapType:r.shadowMap.type,toneMapping:Mt,useLegacyLights:r._useLegacyLights,decodeVideoTexture:q&&M.map.isVideoTexture===!0&&Se.getTransfer(M.map.colorSpace)===Te,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===tr,flipSided:M.side===Nn,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:ee&&M.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:ee&&M.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return L.vertexUv1s=c.has(1),L.vertexUv2s=c.has(2),L.vertexUv3s=c.has(3),c.clear(),L}function g(M){let v=[];if(M.shaderID?v.push(M.shaderID):(v.push(M.customVertexShaderID),v.push(M.customFragmentShaderID)),M.defines!==void 0)for(let I in M.defines)v.push(I),v.push(M.defines[I]);return M.isRawShaderMaterial===!1&&(b(v,M),y(v,M),v.push(r.outputColorSpace)),v.push(M.customProgramCacheKey),v.join()}function b(M,v){M.push(v.precision),M.push(v.outputColorSpace),M.push(v.envMapMode),M.push(v.envMapCubeUVHeight),M.push(v.mapUv),M.push(v.alphaMapUv),M.push(v.lightMapUv),M.push(v.aoMapUv),M.push(v.bumpMapUv),M.push(v.normalMapUv),M.push(v.displacementMapUv),M.push(v.emissiveMapUv),M.push(v.metalnessMapUv),M.push(v.roughnessMapUv),M.push(v.anisotropyMapUv),M.push(v.clearcoatMapUv),M.push(v.clearcoatNormalMapUv),M.push(v.clearcoatRoughnessMapUv),M.push(v.iridescenceMapUv),M.push(v.iridescenceThicknessMapUv),M.push(v.sheenColorMapUv),M.push(v.sheenRoughnessMapUv),M.push(v.specularMapUv),M.push(v.specularColorMapUv),M.push(v.specularIntensityMapUv),M.push(v.transmissionMapUv),M.push(v.thicknessMapUv),M.push(v.combine),M.push(v.fogExp2),M.push(v.sizeAttenuation),M.push(v.morphTargetsCount),M.push(v.morphAttributeCount),M.push(v.numDirLights),M.push(v.numPointLights),M.push(v.numSpotLights),M.push(v.numSpotLightMaps),M.push(v.numHemiLights),M.push(v.numRectAreaLights),M.push(v.numDirLightShadows),M.push(v.numPointLightShadows),M.push(v.numSpotLightShadows),M.push(v.numSpotLightShadowsWithMaps),M.push(v.numLightProbes),M.push(v.shadowMapType),M.push(v.toneMapping),M.push(v.numClippingPlanes),M.push(v.numClipIntersection),M.push(v.depthPacking)}function y(M,v){a.disableAll(),v.supportsVertexTextures&&a.enable(0),v.instancing&&a.enable(1),v.instancingColor&&a.enable(2),v.instancingMorph&&a.enable(3),v.matcap&&a.enable(4),v.envMap&&a.enable(5),v.normalMapObjectSpace&&a.enable(6),v.normalMapTangentSpace&&a.enable(7),v.clearcoat&&a.enable(8),v.iridescence&&a.enable(9),v.alphaTest&&a.enable(10),v.vertexColors&&a.enable(11),v.vertexAlphas&&a.enable(12),v.vertexUv1s&&a.enable(13),v.vertexUv2s&&a.enable(14),v.vertexUv3s&&a.enable(15),v.vertexTangents&&a.enable(16),v.anisotropy&&a.enable(17),v.alphaHash&&a.enable(18),v.batching&&a.enable(19),v.dispersion&&a.enable(20),M.push(a.mask),a.disableAll(),v.fog&&a.enable(0),v.useFog&&a.enable(1),v.flatShading&&a.enable(2),v.logarithmicDepthBuffer&&a.enable(3),v.skinning&&a.enable(4),v.morphTargets&&a.enable(5),v.morphNormals&&a.enable(6),v.morphColors&&a.enable(7),v.premultipliedAlpha&&a.enable(8),v.shadowMapEnabled&&a.enable(9),v.useLegacyLights&&a.enable(10),v.doubleSided&&a.enable(11),v.flipSided&&a.enable(12),v.useDepthPacking&&a.enable(13),v.dithering&&a.enable(14),v.transmission&&a.enable(15),v.sheen&&a.enable(16),v.opaque&&a.enable(17),v.pointsUvs&&a.enable(18),v.decodeVideoTexture&&a.enable(19),v.alphaToCoverage&&a.enable(20),M.push(a.mask)}function S(M){let v=_[M.type],I;if(v){let N=Li[v];I=CS.clone(N.uniforms)}else I=M.uniforms;return I}function D(M,v){let I;for(let N=0,C=h.length;N<C;N++){let V=h[N];if(V.cacheKey===v){I=V,++I.usedTimes;break}}return I===void 0&&(I=new U1(r,v,M,s),h.push(I)),I}function T(M){if(--M.usedTimes===0){let v=h.indexOf(M);h[v]=h[h.length-1],h.pop(),M.destroy()}}function w(M){l.remove(M)}function P(){l.dispose()}return{getParameters:m,getProgramCacheKey:g,getUniforms:S,acquireProgram:D,releaseProgram:T,releaseShaderCache:w,programs:h,dispose:P}}function k1(){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 z1(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 M_(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 b_(){let r=[],t=0,e=[],n=[],i=[];function s(){t=0,e.length=0,n.length=0,i.length=0}function o(f,d,u,_,p,m){let g=r[t];return g===void 0?(g={id:f.id,object:f,geometry:d,material:u,groupOrder:_,renderOrder:f.renderOrder,z:p,group:m},r[t]=g):(g.id=f.id,g.object=f,g.geometry=d,g.material=u,g.groupOrder=_,g.renderOrder=f.renderOrder,g.z=p,g.group=m),t++,g}function a(f,d,u,_,p,m){let g=o(f,d,u,_,p,m);u.transmission>0?n.push(g):u.transparent===!0?i.push(g):e.push(g)}function l(f,d,u,_,p,m){let g=o(f,d,u,_,p,m);u.transmission>0?n.unshift(g):u.transparent===!0?i.unshift(g):e.unshift(g)}function c(f,d){e.length>1&&e.sort(f||z1),n.length>1&&n.sort(d||M_),i.length>1&&i.sort(d||M_)}function h(){for(let f=t,d=r.length;f<d;f++){let u=r[f];if(u.id===null)break;u.id=null,u.object=null,u.geometry=null,u.material=null,u.group=null}}return{opaque:e,transmissive:n,transparent:i,init:s,push:a,unshift:l,finish:h,sort:c}}function V1(){let r=new WeakMap;function t(n,i){let s=r.get(n),o;return s===void 0?(o=new b_,r.set(n,[o])):i>=s.length?(o=new b_,s.push(o)):o=s[i],o}function e(){r=new WeakMap}return{get:t,dispose:e}}function H1(){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 nt,color:new ge};break;case"SpotLight":e={position:new nt,direction:new nt,color:new ge,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new nt,color:new ge,distance:0,decay:0};break;case"HemisphereLight":e={direction:new nt,skyColor:new ge,groundColor:new ge};break;case"RectAreaLight":e={color:new ge,position:new nt,halfWidth:new nt,halfHeight:new nt};break}return r[t.id]=e,e}}}function G1(){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 _e};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var W1=0;function X1(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function Y1(r){let t=new H1,e=G1(),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 nt);let i=new nt,s=new Ue,o=new Ue;function a(c,h){let f=0,d=0,u=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let _=0,p=0,m=0,g=0,b=0,y=0,S=0,D=0,T=0,w=0,P=0;c.sort(X1);let M=h===!0?Math.PI:1;for(let I=0,N=c.length;I<N;I++){let C=c[I],V=C.color,$=C.intensity,W=C.distance,Z=C.shadow&&C.shadow.map?C.shadow.map.texture:null;if(C.isAmbientLight)f+=V.r*$*M,d+=V.g*$*M,u+=V.b*$*M;else if(C.isLightProbe){for(let z=0;z<9;z++)n.probe[z].addScaledVector(C.sh.coefficients[z],$);P++}else if(C.isDirectionalLight){let z=t.get(C);if(z.color.copy(C.color).multiplyScalar(C.intensity*M),C.castShadow){let U=C.shadow,R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,n.directionalShadow[_]=R,n.directionalShadowMap[_]=Z,n.directionalShadowMatrix[_]=C.shadow.matrix,y++}n.directional[_]=z,_++}else if(C.isSpotLight){let z=t.get(C);z.position.setFromMatrixPosition(C.matrixWorld),z.color.copy(V).multiplyScalar($*M),z.distance=W,z.coneCos=Math.cos(C.angle),z.penumbraCos=Math.cos(C.angle*(1-C.penumbra)),z.decay=C.decay,n.spot[m]=z;let U=C.shadow;if(C.map&&(n.spotLightMap[T]=C.map,T++,U.updateMatrices(C),C.castShadow&&w++),n.spotLightMatrix[m]=U.matrix,C.castShadow){let R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,n.spotShadow[m]=R,n.spotShadowMap[m]=Z,D++}m++}else if(C.isRectAreaLight){let z=t.get(C);z.color.copy(V).multiplyScalar($),z.halfWidth.set(C.width*.5,0,0),z.halfHeight.set(0,C.height*.5,0),n.rectArea[g]=z,g++}else if(C.isPointLight){let z=t.get(C);if(z.color.copy(C.color).multiplyScalar(C.intensity*M),z.distance=C.distance,z.decay=C.decay,C.castShadow){let U=C.shadow,R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,R.shadowCameraNear=U.camera.near,R.shadowCameraFar=U.camera.far,n.pointShadow[p]=R,n.pointShadowMap[p]=Z,n.pointShadowMatrix[p]=C.shadow.matrix,S++}n.point[p]=z,p++}else if(C.isHemisphereLight){let z=t.get(C);z.skyColor.copy(C.color).multiplyScalar($*M),z.groundColor.copy(C.groundColor).multiplyScalar($*M),n.hemi[b]=z,b++}}g>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ct.LTC_FLOAT_1,n.rectAreaLTC2=Ct.LTC_FLOAT_2):(n.rectAreaLTC1=Ct.LTC_HALF_1,n.rectAreaLTC2=Ct.LTC_HALF_2)),n.ambient[0]=f,n.ambient[1]=d,n.ambient[2]=u;let v=n.hash;(v.directionalLength!==_||v.pointLength!==p||v.spotLength!==m||v.rectAreaLength!==g||v.hemiLength!==b||v.numDirectionalShadows!==y||v.numPointShadows!==S||v.numSpotShadows!==D||v.numSpotMaps!==T||v.numLightProbes!==P)&&(n.directional.length=_,n.spot.length=m,n.rectArea.length=g,n.point.length=p,n.hemi.length=b,n.directionalShadow.length=y,n.directionalShadowMap.length=y,n.pointShadow.length=S,n.pointShadowMap.length=S,n.spotShadow.length=D,n.spotShadowMap.length=D,n.directionalShadowMatrix.length=y,n.pointShadowMatrix.length=S,n.spotLightMatrix.length=D+T-w,n.spotLightMap.length=T,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=P,v.directionalLength=_,v.pointLength=p,v.spotLength=m,v.rectAreaLength=g,v.hemiLength=b,v.numDirectionalShadows=y,v.numPointShadows=S,v.numSpotShadows=D,v.numSpotMaps=T,v.numLightProbes=P,n.version=W1++)}function l(c,h){let f=0,d=0,u=0,_=0,p=0,m=h.matrixWorldInverse;for(let g=0,b=c.length;g<b;g++){let y=c[g];if(y.isDirectionalLight){let S=n.directional[f];S.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(m),f++}else if(y.isSpotLight){let S=n.spot[u];S.position.setFromMatrixPosition(y.matrixWorld),S.position.applyMatrix4(m),S.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(m),u++}else if(y.isRectAreaLight){let S=n.rectArea[_];S.position.setFromMatrixPosition(y.matrixWorld),S.position.applyMatrix4(m),o.identity(),s.copy(y.matrixWorld),s.premultiply(m),o.extractRotation(s),S.halfWidth.set(y.width*.5,0,0),S.halfHeight.set(0,y.height*.5,0),S.halfWidth.applyMatrix4(o),S.halfHeight.applyMatrix4(o),_++}else if(y.isPointLight){let S=n.point[d];S.position.setFromMatrixPosition(y.matrixWorld),S.position.applyMatrix4(m),d++}else if(y.isHemisphereLight){let S=n.hemi[p];S.direction.setFromMatrixPosition(y.matrixWorld),S.direction.transformDirection(m),p++}}}return{setup:a,setupView:l,state:n}}function w_(r){let t=new Y1(r),e=[],n=[];function i(h){c.camera=h,e.length=0,n.length=0}function s(h){e.push(h)}function o(h){n.push(h)}function a(h){t.setup(e,h)}function l(h){t.setupView(e,h)}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 q1(r){let t=new WeakMap;function e(i,s=0){let o=t.get(i),a;return o===void 0?(a=new w_(r),t.set(i,[a])):s>=o.length?(a=new w_(r),o.push(a)):a=o[s],a}function n(){t=new WeakMap}return{get:e,dispose:n}}var Cf=class extends Ds{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=eS,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}},Rf=class extends Ds{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}},Z1=`void main() {
|
|
3769
|
+
`+z)}else N!==""?console.warn("THREE.WebGLProgram: Program Info Log:",N):(C===""||V==="")&&(W=!1);W&&(I.diagnostics={runnable:$,programLog:N,vertexShader:{log:C,prefix:m},fragmentShader:{log:V,prefix:g}})}i.deleteShader(D),i.deleteShader(T),P=new Co(i,p),M=T1(i,p)}let P;this.getUniforms=function(){return P===void 0&&w(this),P};let M;this.getAttributes=function(){return M===void 0&&w(this),M};let v=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return v===!1&&(v=i.getProgramParameter(p,x1)),v},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(p),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=v1++,this.cacheKey=t,this.usedTimes=1,this.program=p,this.vertexShader=D,this.fragmentShader=T,this}var B1=0,Af=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 Df(t),e.set(t,n)),n}},Df=class{constructor(t){this.id=B1++,this.code=t,this.usedTimes=0}};function k1(r,t,e,n,i,s,o){let a=new Dc,l=new Af,c=new Set,h=[],f=i.logarithmicDepthBuffer,d=i.vertexTextures,u=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 p(M){return c.add(M),M===0?"uv":`uv${M}`}function m(M,v,I,N,C){let V=N.fog,$=C.geometry,W=M.isMeshStandardMaterial?N.environment:null,Z=(M.isMeshStandardMaterial?e:t).get(M.envMap||W),z=Z&&Z.mapping===Wc?Z.image.height:null,U=_[M.type];M.precision!==null&&(u=i.getMaxPrecision(M.precision),u!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",u,"instead."));let R=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,at=R!==void 0?R.length:0,_t=0;$.morphAttributes.position!==void 0&&(_t=1),$.morphAttributes.normal!==void 0&&(_t=2),$.morphAttributes.color!==void 0&&(_t=3);let Ut,X,ot,xt;if(U){let rt=Li[U];Ut=rt.vertexShader,X=rt.fragmentShader}else Ut=M.vertexShader,X=M.fragmentShader,l.update(M),ot=l.getVertexShaderID(M),xt=l.getFragmentShaderID(M);let ct=r.getRenderTarget(),Rt=C.isInstancedMesh===!0,kt=C.isBatchedMesh===!0,q=!!M.map,Jt=!!M.matcap,It=!!Z,Ft=!!M.aoMap,bt=!!M.lightMap,Et=!!M.bumpMap,Ht=!!M.normalMap,G=!!M.displacementMap,$t=!!M.emissiveMap,A=!!M.metalnessMap,x=!!M.roughnessMap,F=M.anisotropy>0,Y=M.clearcoat>0,tt=M.dispersion>0,it=M.iridescence>0,yt=M.sheen>0,pt=M.transmission>0,lt=F&&!!M.anisotropyMap,Lt=Y&&!!M.clearcoatMap,ht=Y&&!!M.clearcoatNormalMap,vt=Y&&!!M.clearcoatRoughnessMap,Yt=it&&!!M.iridescenceMap,ut=it&&!!M.iridescenceThicknessMap,Tt=yt&&!!M.sheenColorMap,Wt=yt&&!!M.sheenRoughnessMap,qt=!!M.specularMap,ce=!!M.specularColorMap,Zt=!!M.specularIntensityMap,k=pt&&!!M.transmissionMap,Q=pt&&!!M.thicknessMap,st=!!M.gradientMap,mt=!!M.alphaMap,gt=M.alphaTest>0,Bt=!!M.alphaHash,ee=!!M.extensions,Mt=Ir;M.toneMapped&&(ct===null||ct.isXRRenderTarget===!0)&&(Mt=r.toneMapping);let L={shaderID:U,shaderType:M.type,shaderName:M.name,vertexShader:Ut,fragmentShader:X,defines:M.defines,customVertexShaderID:ot,customFragmentShaderID:xt,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:u,batching:kt,instancing:Rt,instancingColor:Rt&&C.instanceColor!==null,instancingMorph:Rt&&C.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:ct===null?r.outputColorSpace:ct.isXRRenderTarget===!0?ct.texture.colorSpace:Or,alphaToCoverage:!!M.alphaToCoverage,map:q,matcap:Jt,envMap:It,envMapMode:It&&Z.mapping,envMapCubeUVHeight:z,aoMap:Ft,lightMap:bt,bumpMap:Et,normalMap:Ht,displacementMap:d&&G,emissiveMap:$t,normalMapObjectSpace:Ht&&M.normalMapType===sS,normalMapTangentSpace:Ht&&M.normalMapType===rS,metalnessMap:A,roughnessMap:x,anisotropy:F,anisotropyMap:lt,clearcoat:Y,clearcoatMap:Lt,clearcoatNormalMap:ht,clearcoatRoughnessMap:vt,dispersion:tt,iridescence:it,iridescenceMap:Yt,iridescenceThicknessMap:ut,sheen:yt,sheenColorMap:Tt,sheenRoughnessMap:Wt,specularMap:qt,specularColorMap:ce,specularIntensityMap:Zt,transmission:pt,transmissionMap:k,thicknessMap:Q,gradientMap:st,opaque:M.transparent===!1&&M.blending===Pr&&M.alphaToCoverage===!1,alphaMap:mt,alphaTest:gt,alphaHash:Bt,combine:M.combine,mapUv:q&&p(M.map.channel),aoMapUv:Ft&&p(M.aoMap.channel),lightMapUv:bt&&p(M.lightMap.channel),bumpMapUv:Et&&p(M.bumpMap.channel),normalMapUv:Ht&&p(M.normalMap.channel),displacementMapUv:G&&p(M.displacementMap.channel),emissiveMapUv:$t&&p(M.emissiveMap.channel),metalnessMapUv:A&&p(M.metalnessMap.channel),roughnessMapUv:x&&p(M.roughnessMap.channel),anisotropyMapUv:lt&&p(M.anisotropyMap.channel),clearcoatMapUv:Lt&&p(M.clearcoatMap.channel),clearcoatNormalMapUv:ht&&p(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:vt&&p(M.clearcoatRoughnessMap.channel),iridescenceMapUv:Yt&&p(M.iridescenceMap.channel),iridescenceThicknessMapUv:ut&&p(M.iridescenceThicknessMap.channel),sheenColorMapUv:Tt&&p(M.sheenColorMap.channel),sheenRoughnessMapUv:Wt&&p(M.sheenRoughnessMap.channel),specularMapUv:qt&&p(M.specularMap.channel),specularColorMapUv:ce&&p(M.specularColorMap.channel),specularIntensityMapUv:Zt&&p(M.specularIntensityMap.channel),transmissionMapUv:k&&p(M.transmissionMap.channel),thicknessMapUv:Q&&p(M.thicknessMap.channel),alphaMapUv:mt&&p(M.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(Ht||F),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:C.isPoints===!0&&!!$.attributes.uv&&(q||mt),fog:!!V,useFog:M.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:C.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:at,morphTextureStride:_t,numDirLights:v.directional.length,numPointLights:v.point.length,numSpotLights:v.spot.length,numSpotLightMaps:v.spotLightMap.length,numRectAreaLights:v.rectArea.length,numHemiLights:v.hemi.length,numDirLightShadows:v.directionalShadowMap.length,numPointLightShadows:v.pointShadowMap.length,numSpotLightShadows:v.spotShadowMap.length,numSpotLightShadowsWithMaps:v.numSpotLightShadowsWithMaps,numLightProbes:v.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:M.dithering,shadowMapEnabled:r.shadowMap.enabled&&I.length>0,shadowMapType:r.shadowMap.type,toneMapping:Mt,useLegacyLights:r._useLegacyLights,decodeVideoTexture:q&&M.map.isVideoTexture===!0&&Se.getTransfer(M.map.colorSpace)===Te,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===tr,flipSided:M.side===Nn,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:ee&&M.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:ee&&M.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return L.vertexUv1s=c.has(1),L.vertexUv2s=c.has(2),L.vertexUv3s=c.has(3),c.clear(),L}function g(M){let v=[];if(M.shaderID?v.push(M.shaderID):(v.push(M.customVertexShaderID),v.push(M.customFragmentShaderID)),M.defines!==void 0)for(let I in M.defines)v.push(I),v.push(M.defines[I]);return M.isRawShaderMaterial===!1&&(b(v,M),y(v,M),v.push(r.outputColorSpace)),v.push(M.customProgramCacheKey),v.join()}function b(M,v){M.push(v.precision),M.push(v.outputColorSpace),M.push(v.envMapMode),M.push(v.envMapCubeUVHeight),M.push(v.mapUv),M.push(v.alphaMapUv),M.push(v.lightMapUv),M.push(v.aoMapUv),M.push(v.bumpMapUv),M.push(v.normalMapUv),M.push(v.displacementMapUv),M.push(v.emissiveMapUv),M.push(v.metalnessMapUv),M.push(v.roughnessMapUv),M.push(v.anisotropyMapUv),M.push(v.clearcoatMapUv),M.push(v.clearcoatNormalMapUv),M.push(v.clearcoatRoughnessMapUv),M.push(v.iridescenceMapUv),M.push(v.iridescenceThicknessMapUv),M.push(v.sheenColorMapUv),M.push(v.sheenRoughnessMapUv),M.push(v.specularMapUv),M.push(v.specularColorMapUv),M.push(v.specularIntensityMapUv),M.push(v.transmissionMapUv),M.push(v.thicknessMapUv),M.push(v.combine),M.push(v.fogExp2),M.push(v.sizeAttenuation),M.push(v.morphTargetsCount),M.push(v.morphAttributeCount),M.push(v.numDirLights),M.push(v.numPointLights),M.push(v.numSpotLights),M.push(v.numSpotLightMaps),M.push(v.numHemiLights),M.push(v.numRectAreaLights),M.push(v.numDirLightShadows),M.push(v.numPointLightShadows),M.push(v.numSpotLightShadows),M.push(v.numSpotLightShadowsWithMaps),M.push(v.numLightProbes),M.push(v.shadowMapType),M.push(v.toneMapping),M.push(v.numClippingPlanes),M.push(v.numClipIntersection),M.push(v.depthPacking)}function y(M,v){a.disableAll(),v.supportsVertexTextures&&a.enable(0),v.instancing&&a.enable(1),v.instancingColor&&a.enable(2),v.instancingMorph&&a.enable(3),v.matcap&&a.enable(4),v.envMap&&a.enable(5),v.normalMapObjectSpace&&a.enable(6),v.normalMapTangentSpace&&a.enable(7),v.clearcoat&&a.enable(8),v.iridescence&&a.enable(9),v.alphaTest&&a.enable(10),v.vertexColors&&a.enable(11),v.vertexAlphas&&a.enable(12),v.vertexUv1s&&a.enable(13),v.vertexUv2s&&a.enable(14),v.vertexUv3s&&a.enable(15),v.vertexTangents&&a.enable(16),v.anisotropy&&a.enable(17),v.alphaHash&&a.enable(18),v.batching&&a.enable(19),v.dispersion&&a.enable(20),M.push(a.mask),a.disableAll(),v.fog&&a.enable(0),v.useFog&&a.enable(1),v.flatShading&&a.enable(2),v.logarithmicDepthBuffer&&a.enable(3),v.skinning&&a.enable(4),v.morphTargets&&a.enable(5),v.morphNormals&&a.enable(6),v.morphColors&&a.enable(7),v.premultipliedAlpha&&a.enable(8),v.shadowMapEnabled&&a.enable(9),v.useLegacyLights&&a.enable(10),v.doubleSided&&a.enable(11),v.flipSided&&a.enable(12),v.useDepthPacking&&a.enable(13),v.dithering&&a.enable(14),v.transmission&&a.enable(15),v.sheen&&a.enable(16),v.opaque&&a.enable(17),v.pointsUvs&&a.enable(18),v.decodeVideoTexture&&a.enable(19),v.alphaToCoverage&&a.enable(20),M.push(a.mask)}function S(M){let v=_[M.type],I;if(v){let N=Li[v];I=RS.clone(N.uniforms)}else I=M.uniforms;return I}function D(M,v){let I;for(let N=0,C=h.length;N<C;N++){let V=h[N];if(V.cacheKey===v){I=V,++I.usedTimes;break}}return I===void 0&&(I=new O1(r,v,M,s),h.push(I)),I}function T(M){if(--M.usedTimes===0){let v=h.indexOf(M);h[v]=h[h.length-1],h.pop(),M.destroy()}}function w(M){l.remove(M)}function P(){l.dispose()}return{getParameters:m,getProgramCacheKey:g,getUniforms:S,acquireProgram:D,releaseProgram:T,releaseShaderCache:w,programs:h,dispose:P}}function z1(){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 V1(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 M_(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 b_(){let r=[],t=0,e=[],n=[],i=[];function s(){t=0,e.length=0,n.length=0,i.length=0}function o(f,d,u,_,p,m){let g=r[t];return g===void 0?(g={id:f.id,object:f,geometry:d,material:u,groupOrder:_,renderOrder:f.renderOrder,z:p,group:m},r[t]=g):(g.id=f.id,g.object=f,g.geometry=d,g.material=u,g.groupOrder=_,g.renderOrder=f.renderOrder,g.z=p,g.group=m),t++,g}function a(f,d,u,_,p,m){let g=o(f,d,u,_,p,m);u.transmission>0?n.push(g):u.transparent===!0?i.push(g):e.push(g)}function l(f,d,u,_,p,m){let g=o(f,d,u,_,p,m);u.transmission>0?n.unshift(g):u.transparent===!0?i.unshift(g):e.unshift(g)}function c(f,d){e.length>1&&e.sort(f||V1),n.length>1&&n.sort(d||M_),i.length>1&&i.sort(d||M_)}function h(){for(let f=t,d=r.length;f<d;f++){let u=r[f];if(u.id===null)break;u.id=null,u.object=null,u.geometry=null,u.material=null,u.group=null}}return{opaque:e,transmissive:n,transparent:i,init:s,push:a,unshift:l,finish:h,sort:c}}function H1(){let r=new WeakMap;function t(n,i){let s=r.get(n),o;return s===void 0?(o=new b_,r.set(n,[o])):i>=s.length?(o=new b_,s.push(o)):o=s[i],o}function e(){r=new WeakMap}return{get:t,dispose:e}}function G1(){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 nt,color:new ge};break;case"SpotLight":e={position:new nt,direction:new nt,color:new ge,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new nt,color:new ge,distance:0,decay:0};break;case"HemisphereLight":e={direction:new nt,skyColor:new ge,groundColor:new ge};break;case"RectAreaLight":e={color:new ge,position:new nt,halfWidth:new nt,halfHeight:new nt};break}return r[t.id]=e,e}}}function W1(){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 _e};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var X1=0;function Y1(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function q1(r){let t=new G1,e=W1(),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 nt);let i=new nt,s=new Ue,o=new Ue;function a(c,h){let f=0,d=0,u=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let _=0,p=0,m=0,g=0,b=0,y=0,S=0,D=0,T=0,w=0,P=0;c.sort(Y1);let M=h===!0?Math.PI:1;for(let I=0,N=c.length;I<N;I++){let C=c[I],V=C.color,$=C.intensity,W=C.distance,Z=C.shadow&&C.shadow.map?C.shadow.map.texture:null;if(C.isAmbientLight)f+=V.r*$*M,d+=V.g*$*M,u+=V.b*$*M;else if(C.isLightProbe){for(let z=0;z<9;z++)n.probe[z].addScaledVector(C.sh.coefficients[z],$);P++}else if(C.isDirectionalLight){let z=t.get(C);if(z.color.copy(C.color).multiplyScalar(C.intensity*M),C.castShadow){let U=C.shadow,R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,n.directionalShadow[_]=R,n.directionalShadowMap[_]=Z,n.directionalShadowMatrix[_]=C.shadow.matrix,y++}n.directional[_]=z,_++}else if(C.isSpotLight){let z=t.get(C);z.position.setFromMatrixPosition(C.matrixWorld),z.color.copy(V).multiplyScalar($*M),z.distance=W,z.coneCos=Math.cos(C.angle),z.penumbraCos=Math.cos(C.angle*(1-C.penumbra)),z.decay=C.decay,n.spot[m]=z;let U=C.shadow;if(C.map&&(n.spotLightMap[T]=C.map,T++,U.updateMatrices(C),C.castShadow&&w++),n.spotLightMatrix[m]=U.matrix,C.castShadow){let R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,n.spotShadow[m]=R,n.spotShadowMap[m]=Z,D++}m++}else if(C.isRectAreaLight){let z=t.get(C);z.color.copy(V).multiplyScalar($),z.halfWidth.set(C.width*.5,0,0),z.halfHeight.set(0,C.height*.5,0),n.rectArea[g]=z,g++}else if(C.isPointLight){let z=t.get(C);if(z.color.copy(C.color).multiplyScalar(C.intensity*M),z.distance=C.distance,z.decay=C.decay,C.castShadow){let U=C.shadow,R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,R.shadowCameraNear=U.camera.near,R.shadowCameraFar=U.camera.far,n.pointShadow[p]=R,n.pointShadowMap[p]=Z,n.pointShadowMatrix[p]=C.shadow.matrix,S++}n.point[p]=z,p++}else if(C.isHemisphereLight){let z=t.get(C);z.skyColor.copy(C.color).multiplyScalar($*M),z.groundColor.copy(C.groundColor).multiplyScalar($*M),n.hemi[b]=z,b++}}g>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ct.LTC_FLOAT_1,n.rectAreaLTC2=Ct.LTC_FLOAT_2):(n.rectAreaLTC1=Ct.LTC_HALF_1,n.rectAreaLTC2=Ct.LTC_HALF_2)),n.ambient[0]=f,n.ambient[1]=d,n.ambient[2]=u;let v=n.hash;(v.directionalLength!==_||v.pointLength!==p||v.spotLength!==m||v.rectAreaLength!==g||v.hemiLength!==b||v.numDirectionalShadows!==y||v.numPointShadows!==S||v.numSpotShadows!==D||v.numSpotMaps!==T||v.numLightProbes!==P)&&(n.directional.length=_,n.spot.length=m,n.rectArea.length=g,n.point.length=p,n.hemi.length=b,n.directionalShadow.length=y,n.directionalShadowMap.length=y,n.pointShadow.length=S,n.pointShadowMap.length=S,n.spotShadow.length=D,n.spotShadowMap.length=D,n.directionalShadowMatrix.length=y,n.pointShadowMatrix.length=S,n.spotLightMatrix.length=D+T-w,n.spotLightMap.length=T,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=P,v.directionalLength=_,v.pointLength=p,v.spotLength=m,v.rectAreaLength=g,v.hemiLength=b,v.numDirectionalShadows=y,v.numPointShadows=S,v.numSpotShadows=D,v.numSpotMaps=T,v.numLightProbes=P,n.version=X1++)}function l(c,h){let f=0,d=0,u=0,_=0,p=0,m=h.matrixWorldInverse;for(let g=0,b=c.length;g<b;g++){let y=c[g];if(y.isDirectionalLight){let S=n.directional[f];S.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(m),f++}else if(y.isSpotLight){let S=n.spot[u];S.position.setFromMatrixPosition(y.matrixWorld),S.position.applyMatrix4(m),S.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(m),u++}else if(y.isRectAreaLight){let S=n.rectArea[_];S.position.setFromMatrixPosition(y.matrixWorld),S.position.applyMatrix4(m),o.identity(),s.copy(y.matrixWorld),s.premultiply(m),o.extractRotation(s),S.halfWidth.set(y.width*.5,0,0),S.halfHeight.set(0,y.height*.5,0),S.halfWidth.applyMatrix4(o),S.halfHeight.applyMatrix4(o),_++}else if(y.isPointLight){let S=n.point[d];S.position.setFromMatrixPosition(y.matrixWorld),S.position.applyMatrix4(m),d++}else if(y.isHemisphereLight){let S=n.hemi[p];S.direction.setFromMatrixPosition(y.matrixWorld),S.direction.transformDirection(m),p++}}}return{setup:a,setupView:l,state:n}}function w_(r){let t=new q1(r),e=[],n=[];function i(h){c.camera=h,e.length=0,n.length=0}function s(h){e.push(h)}function o(h){n.push(h)}function a(h){t.setup(e,h)}function l(h){t.setupView(e,h)}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 Z1(r){let t=new WeakMap;function e(i,s=0){let o=t.get(i),a;return o===void 0?(a=new w_(r),t.set(i,[a])):s>=o.length?(a=new w_(r),o.push(a)):a=o[s],a}function n(){t=new WeakMap}return{get:e,dispose:n}}var Cf=class extends Ds{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=nS,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}},Rf=class extends Ds{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}},J1=`void main() {
|
|
3770
3770
|
gl_Position = vec4( position, 1.0 );
|
|
3771
|
-
}
|
|
3771
|
+
}`,$1=`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 $1(r,t,e){let n=new Na,i=new _e,s=new _e,o=new Qe,a=new Cf({depthPacking:nS}),l=new Rf,c={},h=e.maxTextureSize,f={[Lr]:Nn,[Nn]:Lr,[tr]:tr},d=new ri({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new _e},radius:{value:4}},vertexShader:Z1,fragmentShader:J1}),u=d.clone();u.defines.HORIZONTAL_PASS=1;let _=new Ni;_.setAttribute("position",new ei(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let p=new _i(_,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=C_;let g=this.type;this.render=function(T,w,P){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||T.length===0)return;let M=r.getRenderTarget(),v=r.getActiveCubeFace(),I=r.getActiveMipmapLevel(),N=r.state;N.setBlending(Rr),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);let C=g!==ji&&this.type===ji,V=g===ji&&this.type!==ji;for(let $=0,W=T.length;$<W;$++){let Z=T[$],z=Z.shadow;if(z===void 0){console.warn("THREE.WebGLShadowMap:",Z,"has no shadow.");continue}if(z.autoUpdate===!1&&z.needsUpdate===!1)continue;i.copy(z.mapSize);let U=z.getFrameExtents();if(i.multiply(U),s.copy(z.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/U.x),i.x=s.x*U.x,z.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/U.y),i.y=s.y*U.y,z.mapSize.y=s.y)),z.map===null||C===!0||V===!0){let at=this.type!==ji?{minFilter:ti,magFilter:ti}:{};z.map!==null&&z.map.dispose(),z.map=new nr(i.x,i.y,at),z.map.texture.name=Z.name+".shadowMap",z.camera.updateProjectionMatrix()}r.setRenderTarget(z.map),r.clear();let R=z.getViewportCount();for(let at=0;at<R;at++){let _t=z.getViewport(at);o.set(s.x*_t.x,s.y*_t.y,s.x*_t.z,s.y*_t.w),N.viewport(o),z.updateMatrices(Z,at),n=z.getFrustum(),S(w,P,z.camera,Z,this.type)}z.isPointLightShadow!==!0&&this.type===ji&&b(z,P),z.needsUpdate=!1}g=this.type,m.needsUpdate=!1,r.setRenderTarget(M,v,I)};function b(T,w){let P=t.update(p);d.defines.VSM_SAMPLES!==T.blurSamples&&(d.defines.VSM_SAMPLES=T.blurSamples,u.defines.VSM_SAMPLES=T.blurSamples,d.needsUpdate=!0,u.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new nr(i.x,i.y)),d.uniforms.shadow_pass.value=T.map.texture,d.uniforms.resolution.value=T.mapSize,d.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(w,null,P,d,p,null),u.uniforms.shadow_pass.value=T.mapPass.texture,u.uniforms.resolution.value=T.mapSize,u.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(w,null,P,u,p,null)}function y(T,w,P,M){let v=null,I=P.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(I!==void 0)v=I;else if(v=P.isPointLight===!0?l:a,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 N=v.uuid,C=w.uuid,V=c[N];V===void 0&&(V={},c[N]=V);let $=V[C];$===void 0&&($=v.clone(),V[C]=$,w.addEventListener("dispose",D)),v=$}if(v.visible=w.visible,v.wireframe=w.wireframe,M===ji?v.side=w.shadowSide!==null?w.shadowSide:w.side:v.side=w.shadowSide!==null?w.shadowSide:f[w.side],v.alphaMap=w.alphaMap,v.alphaTest=w.alphaTest,v.map=w.map,v.clipShadows=w.clipShadows,v.clippingPlanes=w.clippingPlanes,v.clipIntersection=w.clipIntersection,v.displacementMap=w.displacementMap,v.displacementScale=w.displacementScale,v.displacementBias=w.displacementBias,v.wireframeLinewidth=w.wireframeLinewidth,v.linewidth=w.linewidth,P.isPointLight===!0&&v.isMeshDistanceMaterial===!0){let N=r.properties.get(v);N.light=P}return v}function S(T,w,P,M,v){if(T.visible===!1)return;if(T.layers.test(w.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&v===ji)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);let C=t.update(T),V=T.material;if(Array.isArray(V)){let $=C.groups;for(let W=0,Z=$.length;W<Z;W++){let z=$[W],U=V[z.materialIndex];if(U&&U.visible){let R=y(T,U,M,v);T.onBeforeShadow(r,T,w,P,C,R,z),r.renderBufferDirect(P,null,C,R,T,z),T.onAfterShadow(r,T,w,P,C,R,z)}}}else if(V.visible){let $=y(T,V,M,v);T.onBeforeShadow(r,T,w,P,C,$,null),r.renderBufferDirect(P,null,C,$,T,null),T.onAfterShadow(r,T,w,P,C,$,null)}}let N=T.children;for(let C=0,V=N.length;C<V;C++)S(N[C],w,P,M,v)}function D(T){T.target.removeEventListener("dispose",D);for(let P in c){let M=c[P],v=T.target.uuid;v in M&&(M[v].dispose(),delete M[v])}}}function K1(r){function t(){let k=!1,Q=new Qe,st=null,mt=new Qe(0,0,0,0);return{setMask:function(gt){st!==gt&&!k&&(r.colorMask(gt,gt,gt,gt),st=gt)},setLocked:function(gt){k=gt},setClear:function(gt,Bt,ee,Mt,L){L===!0&&(gt*=Mt,Bt*=Mt,ee*=Mt),Q.set(gt,Bt,ee,Mt),mt.equals(Q)===!1&&(r.clearColor(gt,Bt,ee,Mt),mt.copy(Q))},reset:function(){k=!1,st=null,mt.set(-1,0,0,0)}}}function e(){let k=!1,Q=null,st=null,mt=null;return{setTest:function(gt){gt?xt(r.DEPTH_TEST):ct(r.DEPTH_TEST)},setMask:function(gt){Q!==gt&&!k&&(r.depthMask(gt),Q=gt)},setFunc:function(gt){if(st!==gt){switch(gt){case Dy:r.depthFunc(r.NEVER);break;case Cy:r.depthFunc(r.ALWAYS);break;case Ry:r.depthFunc(r.LESS);break;case _c:r.depthFunc(r.LEQUAL);break;case Py:r.depthFunc(r.EQUAL);break;case Iy:r.depthFunc(r.GEQUAL);break;case Ly:r.depthFunc(r.GREATER);break;case Fy:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}st=gt}},setLocked:function(gt){k=gt},setClear:function(gt){mt!==gt&&(r.clearDepth(gt),mt=gt)},reset:function(){k=!1,Q=null,st=null,mt=null}}}function n(){let k=!1,Q=null,st=null,mt=null,gt=null,Bt=null,ee=null,Mt=null,L=null;return{setTest:function(rt){k||(rt?xt(r.STENCIL_TEST):ct(r.STENCIL_TEST))},setMask:function(rt){Q!==rt&&!k&&(r.stencilMask(rt),Q=rt)},setFunc:function(rt,O,j){(st!==rt||mt!==O||gt!==j)&&(r.stencilFunc(rt,O,j),st=rt,mt=O,gt=j)},setOp:function(rt,O,j){(Bt!==rt||ee!==O||Mt!==j)&&(r.stencilOp(rt,O,j),Bt=rt,ee=O,Mt=j)},setLocked:function(rt){k=rt},setClear:function(rt){L!==rt&&(r.clearStencil(rt),L=rt)},reset:function(){k=!1,Q=null,st=null,mt=null,gt=null,Bt=null,ee=null,Mt=null,L=null}}}let i=new t,s=new e,o=new n,a=new WeakMap,l=new WeakMap,c={},h={},f=new WeakMap,d=[],u=null,_=!1,p=null,m=null,g=null,b=null,y=null,S=null,D=null,T=new ge(0,0,0),w=0,P=!1,M=null,v=null,I=null,N=null,C=null,V=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS),$=!1,W=0,Z=r.getParameter(r.VERSION);Z.indexOf("WebGL")!==-1?(W=parseFloat(/^WebGL (\d)/.exec(Z)[1]),$=W>=1):Z.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),$=W>=2);let z=null,U={},R=r.getParameter(r.SCISSOR_BOX),at=r.getParameter(r.VIEWPORT),_t=new Qe().fromArray(R),Ut=new Qe().fromArray(at);function X(k,Q,st,mt){let gt=new Uint8Array(4),Bt=r.createTexture();r.bindTexture(k,Bt),r.texParameteri(k,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(k,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let ee=0;ee<st;ee++)k===r.TEXTURE_3D||k===r.TEXTURE_2D_ARRAY?r.texImage3D(Q,0,r.RGBA,1,1,mt,0,r.RGBA,r.UNSIGNED_BYTE,gt):r.texImage2D(Q+ee,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,gt);return Bt}let ot={};ot[r.TEXTURE_2D]=X(r.TEXTURE_2D,r.TEXTURE_2D,1),ot[r.TEXTURE_CUBE_MAP]=X(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),ot[r.TEXTURE_2D_ARRAY]=X(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ot[r.TEXTURE_3D]=X(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),xt(r.DEPTH_TEST),s.setFunc(_c),Et(!1),Ht(ig),xt(r.CULL_FACE),Ft(Rr);function xt(k){c[k]!==!0&&(r.enable(k),c[k]=!0)}function ct(k){c[k]!==!1&&(r.disable(k),c[k]=!1)}function Rt(k,Q){return h[k]!==Q?(r.bindFramebuffer(k,Q),h[k]=Q,k===r.DRAW_FRAMEBUFFER&&(h[r.FRAMEBUFFER]=Q),k===r.FRAMEBUFFER&&(h[r.DRAW_FRAMEBUFFER]=Q),!0):!1}function kt(k,Q){let st=d,mt=!1;if(k){st=f.get(Q),st===void 0&&(st=[],f.set(Q,st));let gt=k.textures;if(st.length!==gt.length||st[0]!==r.COLOR_ATTACHMENT0){for(let Bt=0,ee=gt.length;Bt<ee;Bt++)st[Bt]=r.COLOR_ATTACHMENT0+Bt;st.length=gt.length,mt=!0}}else st[0]!==r.BACK&&(st[0]=r.BACK,mt=!0);mt&&r.drawBuffers(st)}function q(k){return u!==k?(r.useProgram(k),u=k,!0):!1}let Jt={[bs]:r.FUNC_ADD,[hy]:r.FUNC_SUBTRACT,[fy]:r.FUNC_REVERSE_SUBTRACT};Jt[dy]=r.MIN,Jt[py]=r.MAX;let It={[my]:r.ZERO,[gy]:r.ONE,[_y]:r.SRC_COLOR,[hf]:r.SRC_ALPHA,[by]:r.SRC_ALPHA_SATURATE,[Sy]:r.DST_COLOR,[vy]:r.DST_ALPHA,[xy]:r.ONE_MINUS_SRC_COLOR,[ff]:r.ONE_MINUS_SRC_ALPHA,[My]:r.ONE_MINUS_DST_COLOR,[yy]:r.ONE_MINUS_DST_ALPHA,[wy]:r.CONSTANT_COLOR,[Ey]:r.ONE_MINUS_CONSTANT_COLOR,[Ty]:r.CONSTANT_ALPHA,[Ay]:r.ONE_MINUS_CONSTANT_ALPHA};function Ft(k,Q,st,mt,gt,Bt,ee,Mt,L,rt){if(k===Rr){_===!0&&(ct(r.BLEND),_=!1);return}if(_===!1&&(xt(r.BLEND),_=!0),k!==uy){if(k!==p||rt!==P){if((m!==bs||y!==bs)&&(r.blendEquation(r.FUNC_ADD),m=bs,y=bs),rt)switch(k){case Pr:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case rg:r.blendFunc(r.ONE,r.ONE);break;case sg:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case og:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",k);break}else switch(k){case Pr:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case rg:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case sg:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case og:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",k);break}g=null,b=null,S=null,D=null,T.set(0,0,0),w=0,p=k,P=rt}return}gt=gt||Q,Bt=Bt||st,ee=ee||mt,(Q!==m||gt!==y)&&(r.blendEquationSeparate(Jt[Q],Jt[gt]),m=Q,y=gt),(st!==g||mt!==b||Bt!==S||ee!==D)&&(r.blendFuncSeparate(It[st],It[mt],It[Bt],It[ee]),g=st,b=mt,S=Bt,D=ee),(Mt.equals(T)===!1||L!==w)&&(r.blendColor(Mt.r,Mt.g,Mt.b,L),T.copy(Mt),w=L),p=k,P=!1}function bt(k,Q){k.side===tr?ct(r.CULL_FACE):xt(r.CULL_FACE);let st=k.side===Nn;Q&&(st=!st),Et(st),k.blending===Pr&&k.transparent===!1?Ft(Rr):Ft(k.blending,k.blendEquation,k.blendSrc,k.blendDst,k.blendEquationAlpha,k.blendSrcAlpha,k.blendDstAlpha,k.blendColor,k.blendAlpha,k.premultipliedAlpha),s.setFunc(k.depthFunc),s.setTest(k.depthTest),s.setMask(k.depthWrite),i.setMask(k.colorWrite);let mt=k.stencilWrite;o.setTest(mt),mt&&(o.setMask(k.stencilWriteMask),o.setFunc(k.stencilFunc,k.stencilRef,k.stencilFuncMask),o.setOp(k.stencilFail,k.stencilZFail,k.stencilZPass)),$t(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits),k.alphaToCoverage===!0?xt(r.SAMPLE_ALPHA_TO_COVERAGE):ct(r.SAMPLE_ALPHA_TO_COVERAGE)}function Et(k){M!==k&&(k?r.frontFace(r.CW):r.frontFace(r.CCW),M=k)}function Ht(k){k!==ly?(xt(r.CULL_FACE),k!==v&&(k===ig?r.cullFace(r.BACK):k===cy?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):ct(r.CULL_FACE),v=k}function G(k){k!==I&&($&&r.lineWidth(k),I=k)}function $t(k,Q,st){k?(xt(r.POLYGON_OFFSET_FILL),(N!==Q||C!==st)&&(r.polygonOffset(Q,st),N=Q,C=st)):ct(r.POLYGON_OFFSET_FILL)}function A(k){k?xt(r.SCISSOR_TEST):ct(r.SCISSOR_TEST)}function x(k){k===void 0&&(k=r.TEXTURE0+V-1),z!==k&&(r.activeTexture(k),z=k)}function F(k,Q,st){st===void 0&&(z===null?st=r.TEXTURE0+V-1:st=z);let mt=U[st];mt===void 0&&(mt={type:void 0,texture:void 0},U[st]=mt),(mt.type!==k||mt.texture!==Q)&&(z!==st&&(r.activeTexture(st),z=st),r.bindTexture(k,Q||ot[k]),mt.type=k,mt.texture=Q)}function Y(){let k=U[z];k!==void 0&&k.type!==void 0&&(r.bindTexture(k.type,null),k.type=void 0,k.texture=void 0)}function tt(){try{r.compressedTexImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function it(){try{r.compressedTexImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function yt(){try{r.texSubImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function pt(){try{r.texSubImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function lt(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function Lt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function ht(){try{r.texStorage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function vt(){try{r.texStorage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function Yt(){try{r.texImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function ut(){try{r.texImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function Tt(k){_t.equals(k)===!1&&(r.scissor(k.x,k.y,k.z,k.w),_t.copy(k))}function Wt(k){Ut.equals(k)===!1&&(r.viewport(k.x,k.y,k.z,k.w),Ut.copy(k))}function qt(k,Q){let st=l.get(Q);st===void 0&&(st=new WeakMap,l.set(Q,st));let mt=st.get(k);mt===void 0&&(mt=r.getUniformBlockIndex(Q,k.name),st.set(k,mt))}function ce(k,Q){let mt=l.get(Q).get(k);a.get(Q)!==mt&&(r.uniformBlockBinding(Q,mt,k.__bindingPointIndex),a.set(Q,mt))}function Zt(){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={},z=null,U={},h={},f=new WeakMap,d=[],u=null,_=!1,p=null,m=null,g=null,b=null,y=null,S=null,D=null,T=new ge(0,0,0),w=0,P=!1,M=null,v=null,I=null,N=null,C=null,_t.set(0,0,r.canvas.width,r.canvas.height),Ut.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:xt,disable:ct,bindFramebuffer:Rt,drawBuffers:kt,useProgram:q,setBlending:Ft,setMaterial:bt,setFlipSided:Et,setCullFace:Ht,setLineWidth:G,setPolygonOffset:$t,setScissorTest:A,activeTexture:x,bindTexture:F,unbindTexture:Y,compressedTexImage2D:tt,compressedTexImage3D:it,texImage2D:Yt,texImage3D:ut,updateUBOMapping:qt,uniformBlockBinding:ce,texStorage2D:ht,texStorage3D:vt,texSubImage2D:yt,texSubImage3D:pt,compressedTexSubImage2D:lt,compressedTexSubImage3D:Lt,scissor:Tt,viewport:Wt,reset:Zt}}function j1(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 _e,h=new WeakMap,f,d=new WeakMap,u=!1;try{u=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(A,x){return u?new OffscreenCanvas(A,x):wc("canvas")}function p(A,x,F){let Y=1,tt=$t(A);if((tt.width>F||tt.height>F)&&(Y=F/Math.max(tt.width,tt.height)),Y<1)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap||typeof VideoFrame<"u"&&A instanceof VideoFrame){let it=Math.floor(Y*tt.width),yt=Math.floor(Y*tt.height);f===void 0&&(f=_(it,yt));let pt=x?_(it,yt):f;return pt.width=it,pt.height=yt,pt.getContext("2d").drawImage(A,0,0,it,yt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+tt.width+"x"+tt.height+") to ("+it+"x"+yt+")."),pt}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+tt.width+"x"+tt.height+")."),A;return A}function m(A){return A.generateMipmaps&&A.minFilter!==ti&&A.minFilter!==gi}function g(A){r.generateMipmap(A)}function b(A,x,F,Y,tt=!1){if(A!==null){if(r[A]!==void 0)return r[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let it=x;if(x===r.RED&&(F===r.FLOAT&&(it=r.R32F),F===r.HALF_FLOAT&&(it=r.R16F),F===r.UNSIGNED_BYTE&&(it=r.R8)),x===r.RED_INTEGER&&(F===r.UNSIGNED_BYTE&&(it=r.R8UI),F===r.UNSIGNED_SHORT&&(it=r.R16UI),F===r.UNSIGNED_INT&&(it=r.R32UI),F===r.BYTE&&(it=r.R8I),F===r.SHORT&&(it=r.R16I),F===r.INT&&(it=r.R32I)),x===r.RG&&(F===r.FLOAT&&(it=r.RG32F),F===r.HALF_FLOAT&&(it=r.RG16F),F===r.UNSIGNED_BYTE&&(it=r.RG8)),x===r.RG_INTEGER&&(F===r.UNSIGNED_BYTE&&(it=r.RG8UI),F===r.UNSIGNED_SHORT&&(it=r.RG16UI),F===r.UNSIGNED_INT&&(it=r.RG32UI),F===r.BYTE&&(it=r.RG8I),F===r.SHORT&&(it=r.RG16I),F===r.INT&&(it=r.RG32I)),x===r.RGB&&F===r.UNSIGNED_INT_5_9_9_9_REV&&(it=r.RGB9_E5),x===r.RGBA){let yt=tt?yc:Se.getTransfer(Y);F===r.FLOAT&&(it=r.RGBA32F),F===r.HALF_FLOAT&&(it=r.RGBA16F),F===r.UNSIGNED_BYTE&&(it=yt===Te?r.SRGB8_ALPHA8:r.RGBA8),F===r.UNSIGNED_SHORT_4_4_4_4&&(it=r.RGBA4),F===r.UNSIGNED_SHORT_5_5_5_1&&(it=r.RGB5_A1)}return(it===r.R16F||it===r.R32F||it===r.RG16F||it===r.RG32F||it===r.RGBA16F||it===r.RGBA32F)&&t.get("EXT_color_buffer_float"),it}function y(A,x){return m(A)===!0||A.isFramebufferTexture&&A.minFilter!==ti&&A.minFilter!==gi?Math.log2(Math.max(x.width,x.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?x.mipmaps.length:1}function S(A){let x=A.target;x.removeEventListener("dispose",S),T(x),x.isVideoTexture&&h.delete(x)}function D(A){let x=A.target;x.removeEventListener("dispose",D),P(x)}function T(A){let x=n.get(A);if(x.__webglInit===void 0)return;let F=A.source,Y=d.get(F);if(Y){let tt=Y[x.__cacheKey];tt.usedTimes--,tt.usedTimes===0&&w(A),Object.keys(Y).length===0&&d.delete(F)}n.remove(A)}function w(A){let x=n.get(A);r.deleteTexture(x.__webglTexture);let F=A.source,Y=d.get(F);delete Y[x.__cacheKey],o.memory.textures--}function P(A){let x=n.get(A);if(A.depthTexture&&A.depthTexture.dispose(),A.isWebGLCubeRenderTarget)for(let Y=0;Y<6;Y++){if(Array.isArray(x.__webglFramebuffer[Y]))for(let tt=0;tt<x.__webglFramebuffer[Y].length;tt++)r.deleteFramebuffer(x.__webglFramebuffer[Y][tt]);else r.deleteFramebuffer(x.__webglFramebuffer[Y]);x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer[Y])}else{if(Array.isArray(x.__webglFramebuffer))for(let Y=0;Y<x.__webglFramebuffer.length;Y++)r.deleteFramebuffer(x.__webglFramebuffer[Y]);else r.deleteFramebuffer(x.__webglFramebuffer);if(x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer),x.__webglMultisampledFramebuffer&&r.deleteFramebuffer(x.__webglMultisampledFramebuffer),x.__webglColorRenderbuffer)for(let Y=0;Y<x.__webglColorRenderbuffer.length;Y++)x.__webglColorRenderbuffer[Y]&&r.deleteRenderbuffer(x.__webglColorRenderbuffer[Y]);x.__webglDepthRenderbuffer&&r.deleteRenderbuffer(x.__webglDepthRenderbuffer)}let F=A.textures;for(let Y=0,tt=F.length;Y<tt;Y++){let it=n.get(F[Y]);it.__webglTexture&&(r.deleteTexture(it.__webglTexture),o.memory.textures--),n.remove(F[Y])}n.remove(A)}let M=0;function v(){M=0}function I(){let A=M;return A>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+i.maxTextures),M+=1,A}function N(A){let x=[];return x.push(A.wrapS),x.push(A.wrapT),x.push(A.wrapR||0),x.push(A.magFilter),x.push(A.minFilter),x.push(A.anisotropy),x.push(A.internalFormat),x.push(A.format),x.push(A.type),x.push(A.generateMipmaps),x.push(A.premultiplyAlpha),x.push(A.flipY),x.push(A.unpackAlignment),x.push(A.colorSpace),x.join()}function C(A,x){let F=n.get(A);if(A.isVideoTexture&&Ht(A),A.isRenderTargetTexture===!1&&A.version>0&&F.__version!==A.version){let Y=A.image;if(Y===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Y.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{_t(F,A,x);return}}e.bindTexture(r.TEXTURE_2D,F.__webglTexture,r.TEXTURE0+x)}function V(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){_t(F,A,x);return}e.bindTexture(r.TEXTURE_2D_ARRAY,F.__webglTexture,r.TEXTURE0+x)}function $(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){_t(F,A,x);return}e.bindTexture(r.TEXTURE_3D,F.__webglTexture,r.TEXTURE0+x)}function W(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){Ut(F,A,x);return}e.bindTexture(r.TEXTURE_CUBE_MAP,F.__webglTexture,r.TEXTURE0+x)}let Z={[mf]:r.REPEAT,[Es]:r.CLAMP_TO_EDGE,[gf]:r.MIRRORED_REPEAT},z={[ti]:r.NEAREST,[Wy]:r.NEAREST_MIPMAP_NEAREST,[Yl]:r.NEAREST_MIPMAP_LINEAR,[gi]:r.LINEAR,[Rh]:r.LINEAR_MIPMAP_NEAREST,[Ts]:r.LINEAR_MIPMAP_LINEAR},U={[sS]:r.NEVER,[hS]:r.ALWAYS,[oS]:r.LESS,[k_]:r.LEQUAL,[aS]:r.EQUAL,[uS]:r.GEQUAL,[lS]:r.GREATER,[cS]:r.NOTEQUAL};function R(A,x){if(x.type===Dr&&t.has("OES_texture_float_linear")===!1&&(x.magFilter===gi||x.magFilter===Rh||x.magFilter===Yl||x.magFilter===Ts||x.minFilter===gi||x.minFilter===Rh||x.minFilter===Yl||x.minFilter===Ts)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(A,r.TEXTURE_WRAP_S,Z[x.wrapS]),r.texParameteri(A,r.TEXTURE_WRAP_T,Z[x.wrapT]),(A===r.TEXTURE_3D||A===r.TEXTURE_2D_ARRAY)&&r.texParameteri(A,r.TEXTURE_WRAP_R,Z[x.wrapR]),r.texParameteri(A,r.TEXTURE_MAG_FILTER,z[x.magFilter]),r.texParameteri(A,r.TEXTURE_MIN_FILTER,z[x.minFilter]),x.compareFunction&&(r.texParameteri(A,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(A,r.TEXTURE_COMPARE_FUNC,U[x.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===ti||x.minFilter!==Yl&&x.minFilter!==Ts||x.type===Dr&&t.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||n.get(x).__currentAnisotropy){let F=t.get("EXT_texture_filter_anisotropic");r.texParameterf(A,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,i.getMaxAnisotropy())),n.get(x).__currentAnisotropy=x.anisotropy}}}function at(A,x){let F=!1;A.__webglInit===void 0&&(A.__webglInit=!0,x.addEventListener("dispose",S));let Y=x.source,tt=d.get(Y);tt===void 0&&(tt={},d.set(Y,tt));let it=N(x);if(it!==A.__cacheKey){tt[it]===void 0&&(tt[it]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,F=!0),tt[it].usedTimes++;let yt=tt[A.__cacheKey];yt!==void 0&&(tt[A.__cacheKey].usedTimes--,yt.usedTimes===0&&w(x)),A.__cacheKey=it,A.__webglTexture=tt[it].texture}return F}function _t(A,x,F){let Y=r.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(Y=r.TEXTURE_2D_ARRAY),x.isData3DTexture&&(Y=r.TEXTURE_3D);let tt=at(A,x),it=x.source;e.bindTexture(Y,A.__webglTexture,r.TEXTURE0+F);let yt=n.get(it);if(it.version!==yt.__version||tt===!0){e.activeTexture(r.TEXTURE0+F);let pt=Se.getPrimaries(Se.workingColorSpace),lt=x.colorSpace===Ar?null:Se.getPrimaries(x.colorSpace),Lt=x.colorSpace===Ar||pt===lt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Lt);let ht=p(x.image,!1,i.maxTextureSize);ht=G(x,ht);let vt=s.convert(x.format,x.colorSpace),Yt=s.convert(x.type),ut=b(x.internalFormat,vt,Yt,x.colorSpace,x.isVideoTexture);R(Y,x);let Tt,Wt=x.mipmaps,qt=x.isVideoTexture!==!0,ce=yt.__version===void 0||tt===!0,Zt=it.dataReady,k=y(x,ht);if(x.isDepthTexture)ut=r.DEPTH_COMPONENT16,x.type===Dr?ut=r.DEPTH_COMPONENT32F:x.type===Io?ut=r.DEPTH_COMPONENT24:x.type===Oa&&(ut=r.DEPTH24_STENCIL8),ce&&(qt?e.texStorage2D(r.TEXTURE_2D,1,ut,ht.width,ht.height):e.texImage2D(r.TEXTURE_2D,0,ut,ht.width,ht.height,0,vt,Yt,null));else if(x.isDataTexture)if(Wt.length>0){qt&&ce&&e.texStorage2D(r.TEXTURE_2D,k,ut,Wt[0].width,Wt[0].height);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],qt?Zt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,vt,Yt,Tt.data):e.texImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,vt,Yt,Tt.data);x.generateMipmaps=!1}else qt?(ce&&e.texStorage2D(r.TEXTURE_2D,k,ut,ht.width,ht.height),Zt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,ht.width,ht.height,vt,Yt,ht.data)):e.texImage2D(r.TEXTURE_2D,0,ut,ht.width,ht.height,0,vt,Yt,ht.data);else if(x.isCompressedTexture)if(x.isCompressedArrayTexture){qt&&ce&&e.texStorage3D(r.TEXTURE_2D_ARRAY,k,ut,Wt[0].width,Wt[0].height,ht.depth);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],x.format!==Fi?vt!==null?qt?Zt&&e.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Q,0,0,0,Tt.width,Tt.height,ht.depth,vt,Tt.data,0,0):e.compressedTexImage3D(r.TEXTURE_2D_ARRAY,Q,ut,Tt.width,Tt.height,ht.depth,0,Tt.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):qt?Zt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,Q,0,0,0,Tt.width,Tt.height,ht.depth,vt,Yt,Tt.data):e.texImage3D(r.TEXTURE_2D_ARRAY,Q,ut,Tt.width,Tt.height,ht.depth,0,vt,Yt,Tt.data)}else{qt&&ce&&e.texStorage2D(r.TEXTURE_2D,k,ut,Wt[0].width,Wt[0].height);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],x.format!==Fi?vt!==null?qt?Zt&&e.compressedTexSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,vt,Tt.data):e.compressedTexImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,Tt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):qt?Zt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,vt,Yt,Tt.data):e.texImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,vt,Yt,Tt.data)}else if(x.isDataArrayTexture)qt?(ce&&e.texStorage3D(r.TEXTURE_2D_ARRAY,k,ut,ht.width,ht.height,ht.depth),Zt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,ht.width,ht.height,ht.depth,vt,Yt,ht.data)):e.texImage3D(r.TEXTURE_2D_ARRAY,0,ut,ht.width,ht.height,ht.depth,0,vt,Yt,ht.data);else if(x.isData3DTexture)qt?(ce&&e.texStorage3D(r.TEXTURE_3D,k,ut,ht.width,ht.height,ht.depth),Zt&&e.texSubImage3D(r.TEXTURE_3D,0,0,0,0,ht.width,ht.height,ht.depth,vt,Yt,ht.data)):e.texImage3D(r.TEXTURE_3D,0,ut,ht.width,ht.height,ht.depth,0,vt,Yt,ht.data);else if(x.isFramebufferTexture){if(ce)if(qt)e.texStorage2D(r.TEXTURE_2D,k,ut,ht.width,ht.height);else{let Q=ht.width,st=ht.height;for(let mt=0;mt<k;mt++)e.texImage2D(r.TEXTURE_2D,mt,ut,Q,st,0,vt,Yt,null),Q>>=1,st>>=1}}else if(Wt.length>0){if(qt&&ce){let Q=$t(Wt[0]);e.texStorage2D(r.TEXTURE_2D,k,ut,Q.width,Q.height)}for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],qt?Zt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,vt,Yt,Tt):e.texImage2D(r.TEXTURE_2D,Q,ut,vt,Yt,Tt);x.generateMipmaps=!1}else if(qt){if(ce){let Q=$t(ht);e.texStorage2D(r.TEXTURE_2D,k,ut,Q.width,Q.height)}Zt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,vt,Yt,ht)}else e.texImage2D(r.TEXTURE_2D,0,ut,vt,Yt,ht);m(x)&&g(Y),yt.__version=it.version,x.onUpdate&&x.onUpdate(x)}A.__version=x.version}function Ut(A,x,F){if(x.image.length!==6)return;let Y=at(A,x),tt=x.source;e.bindTexture(r.TEXTURE_CUBE_MAP,A.__webglTexture,r.TEXTURE0+F);let it=n.get(tt);if(tt.version!==it.__version||Y===!0){e.activeTexture(r.TEXTURE0+F);let yt=Se.getPrimaries(Se.workingColorSpace),pt=x.colorSpace===Ar?null:Se.getPrimaries(x.colorSpace),lt=x.colorSpace===Ar||yt===pt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,lt);let Lt=x.isCompressedTexture||x.image[0].isCompressedTexture,ht=x.image[0]&&x.image[0].isDataTexture,vt=[];for(let st=0;st<6;st++)!Lt&&!ht?vt[st]=p(x.image[st],!0,i.maxCubemapSize):vt[st]=ht?x.image[st].image:x.image[st],vt[st]=G(x,vt[st]);let Yt=vt[0],ut=s.convert(x.format,x.colorSpace),Tt=s.convert(x.type),Wt=b(x.internalFormat,ut,Tt,x.colorSpace),qt=x.isVideoTexture!==!0,ce=it.__version===void 0||Y===!0,Zt=tt.dataReady,k=y(x,Yt);R(r.TEXTURE_CUBE_MAP,x);let Q;if(Lt){qt&&ce&&e.texStorage2D(r.TEXTURE_CUBE_MAP,k,Wt,Yt.width,Yt.height);for(let st=0;st<6;st++){Q=vt[st].mipmaps;for(let mt=0;mt<Q.length;mt++){let gt=Q[mt];x.format!==Fi?ut!==null?qt?Zt&&e.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,0,0,gt.width,gt.height,ut,gt.data):e.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,Wt,gt.width,gt.height,0,gt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):qt?Zt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,0,0,gt.width,gt.height,ut,Tt,gt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,Wt,gt.width,gt.height,0,ut,Tt,gt.data)}}}else{if(Q=x.mipmaps,qt&&ce){Q.length>0&&k++;let st=$t(vt[0]);e.texStorage2D(r.TEXTURE_CUBE_MAP,k,Wt,st.width,st.height)}for(let st=0;st<6;st++)if(ht){qt?Zt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,0,0,vt[st].width,vt[st].height,ut,Tt,vt[st].data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,Wt,vt[st].width,vt[st].height,0,ut,Tt,vt[st].data);for(let mt=0;mt<Q.length;mt++){let Bt=Q[mt].image[st].image;qt?Zt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,0,0,Bt.width,Bt.height,ut,Tt,Bt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,Wt,Bt.width,Bt.height,0,ut,Tt,Bt.data)}}else{qt?Zt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,0,0,ut,Tt,vt[st]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,Wt,ut,Tt,vt[st]);for(let mt=0;mt<Q.length;mt++){let gt=Q[mt];qt?Zt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,0,0,ut,Tt,gt.image[st]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,Wt,ut,Tt,gt.image[st])}}}m(x)&&g(r.TEXTURE_CUBE_MAP),it.__version=tt.version,x.onUpdate&&x.onUpdate(x)}A.__version=x.version}function X(A,x,F,Y,tt,it){let yt=s.convert(F.format,F.colorSpace),pt=s.convert(F.type),lt=b(F.internalFormat,yt,pt,F.colorSpace);if(!n.get(x).__hasExternalTextures){let ht=Math.max(1,x.width>>it),vt=Math.max(1,x.height>>it);tt===r.TEXTURE_3D||tt===r.TEXTURE_2D_ARRAY?e.texImage3D(tt,it,lt,ht,vt,x.depth,0,yt,pt,null):e.texImage2D(tt,it,lt,ht,vt,0,yt,pt,null)}e.bindFramebuffer(r.FRAMEBUFFER,A),Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Y,tt,n.get(F).__webglTexture,0,bt(x)):(tt===r.TEXTURE_2D||tt>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&tt<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,Y,tt,n.get(F).__webglTexture,it),e.bindFramebuffer(r.FRAMEBUFFER,null)}function ot(A,x,F){if(r.bindRenderbuffer(r.RENDERBUFFER,A),x.depthBuffer&&!x.stencilBuffer){let Y=r.DEPTH_COMPONENT24;if(F||Et(x)){let tt=x.depthTexture;tt&&tt.isDepthTexture&&(tt.type===Dr?Y=r.DEPTH_COMPONENT32F:tt.type===Io&&(Y=r.DEPTH_COMPONENT24));let it=bt(x);Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,it,Y,x.width,x.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,it,Y,x.width,x.height)}else r.renderbufferStorage(r.RENDERBUFFER,Y,x.width,x.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,A)}else if(x.depthBuffer&&x.stencilBuffer){let Y=bt(x);F&&Et(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Y,r.DEPTH24_STENCIL8,x.width,x.height):Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Y,r.DEPTH24_STENCIL8,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,x.width,x.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,A)}else{let Y=x.textures;for(let tt=0;tt<Y.length;tt++){let it=Y[tt],yt=s.convert(it.format,it.colorSpace),pt=s.convert(it.type),lt=b(it.internalFormat,yt,pt,it.colorSpace),Lt=bt(x);F&&Et(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Lt,lt,x.width,x.height):Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Lt,lt,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,lt,x.width,x.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function xt(A,x){if(x&&x.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(r.FRAMEBUFFER,A),!(x.depthTexture&&x.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(x.depthTexture).__webglTexture||x.depthTexture.image.width!==x.width||x.depthTexture.image.height!==x.height)&&(x.depthTexture.image.width=x.width,x.depthTexture.image.height=x.height,x.depthTexture.needsUpdate=!0),C(x.depthTexture,0);let Y=n.get(x.depthTexture).__webglTexture,tt=bt(x);if(x.depthTexture.format===Ao)Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,Y,0,tt):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,Y,0);else if(x.depthTexture.format===La)Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,Y,0,tt):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,Y,0);else throw new Error("Unknown depthTexture format")}function ct(A){let x=n.get(A),F=A.isWebGLCubeRenderTarget===!0;if(A.depthTexture&&!x.__autoAllocateDepthBuffer){if(F)throw new Error("target.depthTexture not supported in Cube render targets");xt(x.__webglFramebuffer,A)}else if(F){x.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer[Y]),x.__webglDepthbuffer[Y]=r.createRenderbuffer(),ot(x.__webglDepthbuffer[Y],A,!1)}else e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer=r.createRenderbuffer(),ot(x.__webglDepthbuffer,A,!1);e.bindFramebuffer(r.FRAMEBUFFER,null)}function Rt(A,x,F){let Y=n.get(A);x!==void 0&&X(Y.__webglFramebuffer,A,A.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),F!==void 0&&ct(A)}function kt(A){let x=A.texture,F=n.get(A),Y=n.get(x);A.addEventListener("dispose",D);let tt=A.textures,it=A.isWebGLCubeRenderTarget===!0,yt=tt.length>1;if(yt||(Y.__webglTexture===void 0&&(Y.__webglTexture=r.createTexture()),Y.__version=x.version,o.memory.textures++),it){F.__webglFramebuffer=[];for(let pt=0;pt<6;pt++)if(x.mipmaps&&x.mipmaps.length>0){F.__webglFramebuffer[pt]=[];for(let lt=0;lt<x.mipmaps.length;lt++)F.__webglFramebuffer[pt][lt]=r.createFramebuffer()}else F.__webglFramebuffer[pt]=r.createFramebuffer()}else{if(x.mipmaps&&x.mipmaps.length>0){F.__webglFramebuffer=[];for(let pt=0;pt<x.mipmaps.length;pt++)F.__webglFramebuffer[pt]=r.createFramebuffer()}else F.__webglFramebuffer=r.createFramebuffer();if(yt)for(let pt=0,lt=tt.length;pt<lt;pt++){let Lt=n.get(tt[pt]);Lt.__webglTexture===void 0&&(Lt.__webglTexture=r.createTexture(),o.memory.textures++)}if(A.samples>0&&Et(A)===!1){F.__webglMultisampledFramebuffer=r.createFramebuffer(),F.__webglColorRenderbuffer=[],e.bindFramebuffer(r.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let pt=0;pt<tt.length;pt++){let lt=tt[pt];F.__webglColorRenderbuffer[pt]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,F.__webglColorRenderbuffer[pt]);let Lt=s.convert(lt.format,lt.colorSpace),ht=s.convert(lt.type),vt=b(lt.internalFormat,Lt,ht,lt.colorSpace,A.isXRRenderTarget===!0),Yt=bt(A);r.renderbufferStorageMultisample(r.RENDERBUFFER,Yt,vt,A.width,A.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+pt,r.RENDERBUFFER,F.__webglColorRenderbuffer[pt])}r.bindRenderbuffer(r.RENDERBUFFER,null),A.depthBuffer&&(F.__webglDepthRenderbuffer=r.createRenderbuffer(),ot(F.__webglDepthRenderbuffer,A,!0)),e.bindFramebuffer(r.FRAMEBUFFER,null)}}if(it){e.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture),R(r.TEXTURE_CUBE_MAP,x);for(let pt=0;pt<6;pt++)if(x.mipmaps&&x.mipmaps.length>0)for(let lt=0;lt<x.mipmaps.length;lt++)X(F.__webglFramebuffer[pt][lt],A,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,lt);else X(F.__webglFramebuffer[pt],A,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0);m(x)&&g(r.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(yt){for(let pt=0,lt=tt.length;pt<lt;pt++){let Lt=tt[pt],ht=n.get(Lt);e.bindTexture(r.TEXTURE_2D,ht.__webglTexture),R(r.TEXTURE_2D,Lt),X(F.__webglFramebuffer,A,Lt,r.COLOR_ATTACHMENT0+pt,r.TEXTURE_2D,0),m(Lt)&&g(r.TEXTURE_2D)}e.unbindTexture()}else{let pt=r.TEXTURE_2D;if((A.isWebGL3DRenderTarget||A.isWebGLArrayRenderTarget)&&(pt=A.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),e.bindTexture(pt,Y.__webglTexture),R(pt,x),x.mipmaps&&x.mipmaps.length>0)for(let lt=0;lt<x.mipmaps.length;lt++)X(F.__webglFramebuffer[lt],A,x,r.COLOR_ATTACHMENT0,pt,lt);else X(F.__webglFramebuffer,A,x,r.COLOR_ATTACHMENT0,pt,0);m(x)&&g(pt),e.unbindTexture()}A.depthBuffer&&ct(A)}function q(A){let x=A.textures;for(let F=0,Y=x.length;F<Y;F++){let tt=x[F];if(m(tt)){let it=A.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,yt=n.get(tt).__webglTexture;e.bindTexture(it,yt),g(it),e.unbindTexture()}}}let Jt=[],It=[];function Ft(A){if(A.samples>0){if(Et(A)===!1){let x=A.textures,F=A.width,Y=A.height,tt=r.COLOR_BUFFER_BIT,it=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,yt=n.get(A),pt=x.length>1;if(pt)for(let lt=0;lt<x.length;lt++)e.bindFramebuffer(r.FRAMEBUFFER,yt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.RENDERBUFFER,null),e.bindFramebuffer(r.FRAMEBUFFER,yt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.TEXTURE_2D,null,0);e.bindFramebuffer(r.READ_FRAMEBUFFER,yt.__webglMultisampledFramebuffer),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,yt.__webglFramebuffer);for(let lt=0;lt<x.length;lt++){if(A.resolveDepthBuffer&&(A.depthBuffer&&(tt|=r.DEPTH_BUFFER_BIT),A.stencilBuffer&&A.resolveStencilBuffer&&(tt|=r.STENCIL_BUFFER_BIT)),pt){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,yt.__webglColorRenderbuffer[lt]);let Lt=n.get(x[lt]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Lt,0)}r.blitFramebuffer(0,0,F,Y,0,0,F,Y,tt,r.NEAREST),l===!0&&(Jt.length=0,It.length=0,Jt.push(r.COLOR_ATTACHMENT0+lt),A.depthBuffer&&A.resolveDepthBuffer===!1&&(Jt.push(it),It.push(it),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,It)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Jt))}if(e.bindFramebuffer(r.READ_FRAMEBUFFER,null),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),pt)for(let lt=0;lt<x.length;lt++){e.bindFramebuffer(r.FRAMEBUFFER,yt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.RENDERBUFFER,yt.__webglColorRenderbuffer[lt]);let Lt=n.get(x[lt]).__webglTexture;e.bindFramebuffer(r.FRAMEBUFFER,yt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.TEXTURE_2D,Lt,0)}e.bindFramebuffer(r.DRAW_FRAMEBUFFER,yt.__webglMultisampledFramebuffer)}else if(A.depthBuffer&&A.resolveDepthBuffer===!1&&l){let x=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[x])}}}function bt(A){return Math.min(i.maxSamples,A.samples)}function Et(A){let x=n.get(A);return A.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function Ht(A){let x=o.render.frame;h.get(A)!==x&&(h.set(A,x),A.update())}function G(A,x){let F=A.colorSpace,Y=A.format,tt=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||F!==Or&&F!==Ar&&(Se.getTransfer(F)===Te?(Y!==Fi||tt!==Fr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",F)),x}function $t(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement?(c.width=A.naturalWidth||A.width,c.height=A.naturalHeight||A.height):typeof VideoFrame<"u"&&A instanceof VideoFrame?(c.width=A.displayWidth,c.height=A.displayHeight):(c.width=A.width,c.height=A.height),c}this.allocateTextureUnit=I,this.resetTextureUnits=v,this.setTexture2D=C,this.setTexture2DArray=V,this.setTexture3D=$,this.setTextureCube=W,this.rebindTextures=Rt,this.setupRenderTarget=kt,this.updateRenderTargetMipmap=q,this.updateMultisampleRenderTarget=Ft,this.setupDepthRenderbuffer=ct,this.setupFrameBufferTexture=X,this.useMultisampledRTT=Et}function Q1(r,t){function e(n,i=Ar){let s,o=Se.getTransfer(i);if(n===Fr)return r.UNSIGNED_BYTE;if(n===F_)return r.UNSIGNED_SHORT_4_4_4_4;if(n===N_)return r.UNSIGNED_SHORT_5_5_5_1;if(n===qy)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===Xy)return r.BYTE;if(n===Yy)return r.SHORT;if(n===I_)return r.UNSIGNED_SHORT;if(n===L_)return r.INT;if(n===Io)return r.UNSIGNED_INT;if(n===Dr)return r.FLOAT;if(n===Xc)return r.HALF_FLOAT;if(n===Zy)return r.ALPHA;if(n===Jy)return r.RGB;if(n===Fi)return r.RGBA;if(n===$y)return r.LUMINANCE;if(n===Ky)return r.LUMINANCE_ALPHA;if(n===Ao)return r.DEPTH_COMPONENT;if(n===La)return r.DEPTH_STENCIL;if(n===jy)return r.RED;if(n===U_)return r.RED_INTEGER;if(n===Qy)return r.RG;if(n===O_)return r.RG_INTEGER;if(n===B_)return r.RGBA_INTEGER;if(n===Ph||n===Ih||n===Lh||n===Fh)if(o===Te)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Ph)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ih)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Lh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Fh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Ph)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ih)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Lh)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Fh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===ag||n===lg||n===cg||n===ug)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===ag)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===lg)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===cg)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ug)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===hg||n===fg||n===dg)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===hg||n===fg)return o===Te?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===dg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===pg||n===mg||n===gg||n===_g||n===xg||n===vg||n===yg||n===Sg||n===Mg||n===bg||n===wg||n===Eg||n===Tg||n===Ag)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===pg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===mg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===gg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===_g)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===xg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===vg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===yg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Sg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Mg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===bg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===wg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Eg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Tg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Ag)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Nh||n===Dg||n===Cg)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===Nh)return o===Te?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Dg)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Cg)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===tS||n===Rg||n===Pg||n===Ig)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===Nh)return s.COMPRESSED_RED_RGTC1_EXT;if(n===Rg)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Pg)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Ig)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Oa?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:e}}var Pf=class extends An{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},Cr=class extends mn{constructor(){super(),this.isGroup=!0,this.type="Group"}},tE={type:"move"},Ia=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Cr,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 Cr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new nt,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new nt),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Cr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new nt,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new nt),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 p of t.hand.values()){let m=e.getJointPose(p,n),g=this._getHandJoint(c,p);m!==null&&(g.matrix.fromArray(m.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=m.radius),g.visible=m!==null}let h=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=h.position.distanceTo(f.position),u=.02,_=.005;c.inputState.pinching&&d>u+_?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=u-_&&(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(tE)))}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 Cr;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},eE=`
|
|
3797
|
+
}`;function K1(r,t,e){let n=new Na,i=new _e,s=new _e,o=new Qe,a=new Cf({depthPacking:iS}),l=new Rf,c={},h=e.maxTextureSize,f={[Lr]:Nn,[Nn]:Lr,[tr]:tr},d=new ri({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new _e},radius:{value:4}},vertexShader:J1,fragmentShader:$1}),u=d.clone();u.defines.HORIZONTAL_PASS=1;let _=new Ni;_.setAttribute("position",new ei(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let p=new _i(_,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=C_;let g=this.type;this.render=function(T,w,P){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||T.length===0)return;let M=r.getRenderTarget(),v=r.getActiveCubeFace(),I=r.getActiveMipmapLevel(),N=r.state;N.setBlending(Rr),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);let C=g!==ji&&this.type===ji,V=g===ji&&this.type!==ji;for(let $=0,W=T.length;$<W;$++){let Z=T[$],z=Z.shadow;if(z===void 0){console.warn("THREE.WebGLShadowMap:",Z,"has no shadow.");continue}if(z.autoUpdate===!1&&z.needsUpdate===!1)continue;i.copy(z.mapSize);let U=z.getFrameExtents();if(i.multiply(U),s.copy(z.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/U.x),i.x=s.x*U.x,z.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/U.y),i.y=s.y*U.y,z.mapSize.y=s.y)),z.map===null||C===!0||V===!0){let at=this.type!==ji?{minFilter:ti,magFilter:ti}:{};z.map!==null&&z.map.dispose(),z.map=new nr(i.x,i.y,at),z.map.texture.name=Z.name+".shadowMap",z.camera.updateProjectionMatrix()}r.setRenderTarget(z.map),r.clear();let R=z.getViewportCount();for(let at=0;at<R;at++){let _t=z.getViewport(at);o.set(s.x*_t.x,s.y*_t.y,s.x*_t.z,s.y*_t.w),N.viewport(o),z.updateMatrices(Z,at),n=z.getFrustum(),S(w,P,z.camera,Z,this.type)}z.isPointLightShadow!==!0&&this.type===ji&&b(z,P),z.needsUpdate=!1}g=this.type,m.needsUpdate=!1,r.setRenderTarget(M,v,I)};function b(T,w){let P=t.update(p);d.defines.VSM_SAMPLES!==T.blurSamples&&(d.defines.VSM_SAMPLES=T.blurSamples,u.defines.VSM_SAMPLES=T.blurSamples,d.needsUpdate=!0,u.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new nr(i.x,i.y)),d.uniforms.shadow_pass.value=T.map.texture,d.uniforms.resolution.value=T.mapSize,d.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(w,null,P,d,p,null),u.uniforms.shadow_pass.value=T.mapPass.texture,u.uniforms.resolution.value=T.mapSize,u.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(w,null,P,u,p,null)}function y(T,w,P,M){let v=null,I=P.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(I!==void 0)v=I;else if(v=P.isPointLight===!0?l:a,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 N=v.uuid,C=w.uuid,V=c[N];V===void 0&&(V={},c[N]=V);let $=V[C];$===void 0&&($=v.clone(),V[C]=$,w.addEventListener("dispose",D)),v=$}if(v.visible=w.visible,v.wireframe=w.wireframe,M===ji?v.side=w.shadowSide!==null?w.shadowSide:w.side:v.side=w.shadowSide!==null?w.shadowSide:f[w.side],v.alphaMap=w.alphaMap,v.alphaTest=w.alphaTest,v.map=w.map,v.clipShadows=w.clipShadows,v.clippingPlanes=w.clippingPlanes,v.clipIntersection=w.clipIntersection,v.displacementMap=w.displacementMap,v.displacementScale=w.displacementScale,v.displacementBias=w.displacementBias,v.wireframeLinewidth=w.wireframeLinewidth,v.linewidth=w.linewidth,P.isPointLight===!0&&v.isMeshDistanceMaterial===!0){let N=r.properties.get(v);N.light=P}return v}function S(T,w,P,M,v){if(T.visible===!1)return;if(T.layers.test(w.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&v===ji)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);let C=t.update(T),V=T.material;if(Array.isArray(V)){let $=C.groups;for(let W=0,Z=$.length;W<Z;W++){let z=$[W],U=V[z.materialIndex];if(U&&U.visible){let R=y(T,U,M,v);T.onBeforeShadow(r,T,w,P,C,R,z),r.renderBufferDirect(P,null,C,R,T,z),T.onAfterShadow(r,T,w,P,C,R,z)}}}else if(V.visible){let $=y(T,V,M,v);T.onBeforeShadow(r,T,w,P,C,$,null),r.renderBufferDirect(P,null,C,$,T,null),T.onAfterShadow(r,T,w,P,C,$,null)}}let N=T.children;for(let C=0,V=N.length;C<V;C++)S(N[C],w,P,M,v)}function D(T){T.target.removeEventListener("dispose",D);for(let P in c){let M=c[P],v=T.target.uuid;v in M&&(M[v].dispose(),delete M[v])}}}function j1(r){function t(){let k=!1,Q=new Qe,st=null,mt=new Qe(0,0,0,0);return{setMask:function(gt){st!==gt&&!k&&(r.colorMask(gt,gt,gt,gt),st=gt)},setLocked:function(gt){k=gt},setClear:function(gt,Bt,ee,Mt,L){L===!0&&(gt*=Mt,Bt*=Mt,ee*=Mt),Q.set(gt,Bt,ee,Mt),mt.equals(Q)===!1&&(r.clearColor(gt,Bt,ee,Mt),mt.copy(Q))},reset:function(){k=!1,st=null,mt.set(-1,0,0,0)}}}function e(){let k=!1,Q=null,st=null,mt=null;return{setTest:function(gt){gt?xt(r.DEPTH_TEST):ct(r.DEPTH_TEST)},setMask:function(gt){Q!==gt&&!k&&(r.depthMask(gt),Q=gt)},setFunc:function(gt){if(st!==gt){switch(gt){case Cy:r.depthFunc(r.NEVER);break;case Ry:r.depthFunc(r.ALWAYS);break;case Py:r.depthFunc(r.LESS);break;case _c:r.depthFunc(r.LEQUAL);break;case Iy:r.depthFunc(r.EQUAL);break;case Ly:r.depthFunc(r.GEQUAL);break;case Fy:r.depthFunc(r.GREATER);break;case Ny:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}st=gt}},setLocked:function(gt){k=gt},setClear:function(gt){mt!==gt&&(r.clearDepth(gt),mt=gt)},reset:function(){k=!1,Q=null,st=null,mt=null}}}function n(){let k=!1,Q=null,st=null,mt=null,gt=null,Bt=null,ee=null,Mt=null,L=null;return{setTest:function(rt){k||(rt?xt(r.STENCIL_TEST):ct(r.STENCIL_TEST))},setMask:function(rt){Q!==rt&&!k&&(r.stencilMask(rt),Q=rt)},setFunc:function(rt,O,j){(st!==rt||mt!==O||gt!==j)&&(r.stencilFunc(rt,O,j),st=rt,mt=O,gt=j)},setOp:function(rt,O,j){(Bt!==rt||ee!==O||Mt!==j)&&(r.stencilOp(rt,O,j),Bt=rt,ee=O,Mt=j)},setLocked:function(rt){k=rt},setClear:function(rt){L!==rt&&(r.clearStencil(rt),L=rt)},reset:function(){k=!1,Q=null,st=null,mt=null,gt=null,Bt=null,ee=null,Mt=null,L=null}}}let i=new t,s=new e,o=new n,a=new WeakMap,l=new WeakMap,c={},h={},f=new WeakMap,d=[],u=null,_=!1,p=null,m=null,g=null,b=null,y=null,S=null,D=null,T=new ge(0,0,0),w=0,P=!1,M=null,v=null,I=null,N=null,C=null,V=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS),$=!1,W=0,Z=r.getParameter(r.VERSION);Z.indexOf("WebGL")!==-1?(W=parseFloat(/^WebGL (\d)/.exec(Z)[1]),$=W>=1):Z.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),$=W>=2);let z=null,U={},R=r.getParameter(r.SCISSOR_BOX),at=r.getParameter(r.VIEWPORT),_t=new Qe().fromArray(R),Ut=new Qe().fromArray(at);function X(k,Q,st,mt){let gt=new Uint8Array(4),Bt=r.createTexture();r.bindTexture(k,Bt),r.texParameteri(k,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(k,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let ee=0;ee<st;ee++)k===r.TEXTURE_3D||k===r.TEXTURE_2D_ARRAY?r.texImage3D(Q,0,r.RGBA,1,1,mt,0,r.RGBA,r.UNSIGNED_BYTE,gt):r.texImage2D(Q+ee,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,gt);return Bt}let ot={};ot[r.TEXTURE_2D]=X(r.TEXTURE_2D,r.TEXTURE_2D,1),ot[r.TEXTURE_CUBE_MAP]=X(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),ot[r.TEXTURE_2D_ARRAY]=X(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ot[r.TEXTURE_3D]=X(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),xt(r.DEPTH_TEST),s.setFunc(_c),Et(!1),Ht(ig),xt(r.CULL_FACE),Ft(Rr);function xt(k){c[k]!==!0&&(r.enable(k),c[k]=!0)}function ct(k){c[k]!==!1&&(r.disable(k),c[k]=!1)}function Rt(k,Q){return h[k]!==Q?(r.bindFramebuffer(k,Q),h[k]=Q,k===r.DRAW_FRAMEBUFFER&&(h[r.FRAMEBUFFER]=Q),k===r.FRAMEBUFFER&&(h[r.DRAW_FRAMEBUFFER]=Q),!0):!1}function kt(k,Q){let st=d,mt=!1;if(k){st=f.get(Q),st===void 0&&(st=[],f.set(Q,st));let gt=k.textures;if(st.length!==gt.length||st[0]!==r.COLOR_ATTACHMENT0){for(let Bt=0,ee=gt.length;Bt<ee;Bt++)st[Bt]=r.COLOR_ATTACHMENT0+Bt;st.length=gt.length,mt=!0}}else st[0]!==r.BACK&&(st[0]=r.BACK,mt=!0);mt&&r.drawBuffers(st)}function q(k){return u!==k?(r.useProgram(k),u=k,!0):!1}let Jt={[bs]:r.FUNC_ADD,[fy]:r.FUNC_SUBTRACT,[dy]:r.FUNC_REVERSE_SUBTRACT};Jt[py]=r.MIN,Jt[my]=r.MAX;let It={[gy]:r.ZERO,[_y]:r.ONE,[xy]:r.SRC_COLOR,[hf]:r.SRC_ALPHA,[wy]:r.SRC_ALPHA_SATURATE,[My]:r.DST_COLOR,[yy]:r.DST_ALPHA,[vy]:r.ONE_MINUS_SRC_COLOR,[ff]:r.ONE_MINUS_SRC_ALPHA,[by]:r.ONE_MINUS_DST_COLOR,[Sy]:r.ONE_MINUS_DST_ALPHA,[Ey]:r.CONSTANT_COLOR,[Ty]:r.ONE_MINUS_CONSTANT_COLOR,[Ay]:r.CONSTANT_ALPHA,[Dy]:r.ONE_MINUS_CONSTANT_ALPHA};function Ft(k,Q,st,mt,gt,Bt,ee,Mt,L,rt){if(k===Rr){_===!0&&(ct(r.BLEND),_=!1);return}if(_===!1&&(xt(r.BLEND),_=!0),k!==hy){if(k!==p||rt!==P){if((m!==bs||y!==bs)&&(r.blendEquation(r.FUNC_ADD),m=bs,y=bs),rt)switch(k){case Pr:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case rg:r.blendFunc(r.ONE,r.ONE);break;case sg:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case og:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",k);break}else switch(k){case Pr:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case rg:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case sg:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case og:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",k);break}g=null,b=null,S=null,D=null,T.set(0,0,0),w=0,p=k,P=rt}return}gt=gt||Q,Bt=Bt||st,ee=ee||mt,(Q!==m||gt!==y)&&(r.blendEquationSeparate(Jt[Q],Jt[gt]),m=Q,y=gt),(st!==g||mt!==b||Bt!==S||ee!==D)&&(r.blendFuncSeparate(It[st],It[mt],It[Bt],It[ee]),g=st,b=mt,S=Bt,D=ee),(Mt.equals(T)===!1||L!==w)&&(r.blendColor(Mt.r,Mt.g,Mt.b,L),T.copy(Mt),w=L),p=k,P=!1}function bt(k,Q){k.side===tr?ct(r.CULL_FACE):xt(r.CULL_FACE);let st=k.side===Nn;Q&&(st=!st),Et(st),k.blending===Pr&&k.transparent===!1?Ft(Rr):Ft(k.blending,k.blendEquation,k.blendSrc,k.blendDst,k.blendEquationAlpha,k.blendSrcAlpha,k.blendDstAlpha,k.blendColor,k.blendAlpha,k.premultipliedAlpha),s.setFunc(k.depthFunc),s.setTest(k.depthTest),s.setMask(k.depthWrite),i.setMask(k.colorWrite);let mt=k.stencilWrite;o.setTest(mt),mt&&(o.setMask(k.stencilWriteMask),o.setFunc(k.stencilFunc,k.stencilRef,k.stencilFuncMask),o.setOp(k.stencilFail,k.stencilZFail,k.stencilZPass)),$t(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits),k.alphaToCoverage===!0?xt(r.SAMPLE_ALPHA_TO_COVERAGE):ct(r.SAMPLE_ALPHA_TO_COVERAGE)}function Et(k){M!==k&&(k?r.frontFace(r.CW):r.frontFace(r.CCW),M=k)}function Ht(k){k!==cy?(xt(r.CULL_FACE),k!==v&&(k===ig?r.cullFace(r.BACK):k===uy?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):ct(r.CULL_FACE),v=k}function G(k){k!==I&&($&&r.lineWidth(k),I=k)}function $t(k,Q,st){k?(xt(r.POLYGON_OFFSET_FILL),(N!==Q||C!==st)&&(r.polygonOffset(Q,st),N=Q,C=st)):ct(r.POLYGON_OFFSET_FILL)}function A(k){k?xt(r.SCISSOR_TEST):ct(r.SCISSOR_TEST)}function x(k){k===void 0&&(k=r.TEXTURE0+V-1),z!==k&&(r.activeTexture(k),z=k)}function F(k,Q,st){st===void 0&&(z===null?st=r.TEXTURE0+V-1:st=z);let mt=U[st];mt===void 0&&(mt={type:void 0,texture:void 0},U[st]=mt),(mt.type!==k||mt.texture!==Q)&&(z!==st&&(r.activeTexture(st),z=st),r.bindTexture(k,Q||ot[k]),mt.type=k,mt.texture=Q)}function Y(){let k=U[z];k!==void 0&&k.type!==void 0&&(r.bindTexture(k.type,null),k.type=void 0,k.texture=void 0)}function tt(){try{r.compressedTexImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function it(){try{r.compressedTexImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function yt(){try{r.texSubImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function pt(){try{r.texSubImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function lt(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function Lt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function ht(){try{r.texStorage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function vt(){try{r.texStorage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function Yt(){try{r.texImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function ut(){try{r.texImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function Tt(k){_t.equals(k)===!1&&(r.scissor(k.x,k.y,k.z,k.w),_t.copy(k))}function Wt(k){Ut.equals(k)===!1&&(r.viewport(k.x,k.y,k.z,k.w),Ut.copy(k))}function qt(k,Q){let st=l.get(Q);st===void 0&&(st=new WeakMap,l.set(Q,st));let mt=st.get(k);mt===void 0&&(mt=r.getUniformBlockIndex(Q,k.name),st.set(k,mt))}function ce(k,Q){let mt=l.get(Q).get(k);a.get(Q)!==mt&&(r.uniformBlockBinding(Q,mt,k.__bindingPointIndex),a.set(Q,mt))}function Zt(){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={},z=null,U={},h={},f=new WeakMap,d=[],u=null,_=!1,p=null,m=null,g=null,b=null,y=null,S=null,D=null,T=new ge(0,0,0),w=0,P=!1,M=null,v=null,I=null,N=null,C=null,_t.set(0,0,r.canvas.width,r.canvas.height),Ut.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:xt,disable:ct,bindFramebuffer:Rt,drawBuffers:kt,useProgram:q,setBlending:Ft,setMaterial:bt,setFlipSided:Et,setCullFace:Ht,setLineWidth:G,setPolygonOffset:$t,setScissorTest:A,activeTexture:x,bindTexture:F,unbindTexture:Y,compressedTexImage2D:tt,compressedTexImage3D:it,texImage2D:Yt,texImage3D:ut,updateUBOMapping:qt,uniformBlockBinding:ce,texStorage2D:ht,texStorage3D:vt,texSubImage2D:yt,texSubImage3D:pt,compressedTexSubImage2D:lt,compressedTexSubImage3D:Lt,scissor:Tt,viewport:Wt,reset:Zt}}function Q1(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 _e,h=new WeakMap,f,d=new WeakMap,u=!1;try{u=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(A,x){return u?new OffscreenCanvas(A,x):wc("canvas")}function p(A,x,F){let Y=1,tt=$t(A);if((tt.width>F||tt.height>F)&&(Y=F/Math.max(tt.width,tt.height)),Y<1)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap||typeof VideoFrame<"u"&&A instanceof VideoFrame){let it=Math.floor(Y*tt.width),yt=Math.floor(Y*tt.height);f===void 0&&(f=_(it,yt));let pt=x?_(it,yt):f;return pt.width=it,pt.height=yt,pt.getContext("2d").drawImage(A,0,0,it,yt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+tt.width+"x"+tt.height+") to ("+it+"x"+yt+")."),pt}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+tt.width+"x"+tt.height+")."),A;return A}function m(A){return A.generateMipmaps&&A.minFilter!==ti&&A.minFilter!==gi}function g(A){r.generateMipmap(A)}function b(A,x,F,Y,tt=!1){if(A!==null){if(r[A]!==void 0)return r[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let it=x;if(x===r.RED&&(F===r.FLOAT&&(it=r.R32F),F===r.HALF_FLOAT&&(it=r.R16F),F===r.UNSIGNED_BYTE&&(it=r.R8)),x===r.RED_INTEGER&&(F===r.UNSIGNED_BYTE&&(it=r.R8UI),F===r.UNSIGNED_SHORT&&(it=r.R16UI),F===r.UNSIGNED_INT&&(it=r.R32UI),F===r.BYTE&&(it=r.R8I),F===r.SHORT&&(it=r.R16I),F===r.INT&&(it=r.R32I)),x===r.RG&&(F===r.FLOAT&&(it=r.RG32F),F===r.HALF_FLOAT&&(it=r.RG16F),F===r.UNSIGNED_BYTE&&(it=r.RG8)),x===r.RG_INTEGER&&(F===r.UNSIGNED_BYTE&&(it=r.RG8UI),F===r.UNSIGNED_SHORT&&(it=r.RG16UI),F===r.UNSIGNED_INT&&(it=r.RG32UI),F===r.BYTE&&(it=r.RG8I),F===r.SHORT&&(it=r.RG16I),F===r.INT&&(it=r.RG32I)),x===r.RGB&&F===r.UNSIGNED_INT_5_9_9_9_REV&&(it=r.RGB9_E5),x===r.RGBA){let yt=tt?yc:Se.getTransfer(Y);F===r.FLOAT&&(it=r.RGBA32F),F===r.HALF_FLOAT&&(it=r.RGBA16F),F===r.UNSIGNED_BYTE&&(it=yt===Te?r.SRGB8_ALPHA8:r.RGBA8),F===r.UNSIGNED_SHORT_4_4_4_4&&(it=r.RGBA4),F===r.UNSIGNED_SHORT_5_5_5_1&&(it=r.RGB5_A1)}return(it===r.R16F||it===r.R32F||it===r.RG16F||it===r.RG32F||it===r.RGBA16F||it===r.RGBA32F)&&t.get("EXT_color_buffer_float"),it}function y(A,x){return m(A)===!0||A.isFramebufferTexture&&A.minFilter!==ti&&A.minFilter!==gi?Math.log2(Math.max(x.width,x.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?x.mipmaps.length:1}function S(A){let x=A.target;x.removeEventListener("dispose",S),T(x),x.isVideoTexture&&h.delete(x)}function D(A){let x=A.target;x.removeEventListener("dispose",D),P(x)}function T(A){let x=n.get(A);if(x.__webglInit===void 0)return;let F=A.source,Y=d.get(F);if(Y){let tt=Y[x.__cacheKey];tt.usedTimes--,tt.usedTimes===0&&w(A),Object.keys(Y).length===0&&d.delete(F)}n.remove(A)}function w(A){let x=n.get(A);r.deleteTexture(x.__webglTexture);let F=A.source,Y=d.get(F);delete Y[x.__cacheKey],o.memory.textures--}function P(A){let x=n.get(A);if(A.depthTexture&&A.depthTexture.dispose(),A.isWebGLCubeRenderTarget)for(let Y=0;Y<6;Y++){if(Array.isArray(x.__webglFramebuffer[Y]))for(let tt=0;tt<x.__webglFramebuffer[Y].length;tt++)r.deleteFramebuffer(x.__webglFramebuffer[Y][tt]);else r.deleteFramebuffer(x.__webglFramebuffer[Y]);x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer[Y])}else{if(Array.isArray(x.__webglFramebuffer))for(let Y=0;Y<x.__webglFramebuffer.length;Y++)r.deleteFramebuffer(x.__webglFramebuffer[Y]);else r.deleteFramebuffer(x.__webglFramebuffer);if(x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer),x.__webglMultisampledFramebuffer&&r.deleteFramebuffer(x.__webglMultisampledFramebuffer),x.__webglColorRenderbuffer)for(let Y=0;Y<x.__webglColorRenderbuffer.length;Y++)x.__webglColorRenderbuffer[Y]&&r.deleteRenderbuffer(x.__webglColorRenderbuffer[Y]);x.__webglDepthRenderbuffer&&r.deleteRenderbuffer(x.__webglDepthRenderbuffer)}let F=A.textures;for(let Y=0,tt=F.length;Y<tt;Y++){let it=n.get(F[Y]);it.__webglTexture&&(r.deleteTexture(it.__webglTexture),o.memory.textures--),n.remove(F[Y])}n.remove(A)}let M=0;function v(){M=0}function I(){let A=M;return A>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+i.maxTextures),M+=1,A}function N(A){let x=[];return x.push(A.wrapS),x.push(A.wrapT),x.push(A.wrapR||0),x.push(A.magFilter),x.push(A.minFilter),x.push(A.anisotropy),x.push(A.internalFormat),x.push(A.format),x.push(A.type),x.push(A.generateMipmaps),x.push(A.premultiplyAlpha),x.push(A.flipY),x.push(A.unpackAlignment),x.push(A.colorSpace),x.join()}function C(A,x){let F=n.get(A);if(A.isVideoTexture&&Ht(A),A.isRenderTargetTexture===!1&&A.version>0&&F.__version!==A.version){let Y=A.image;if(Y===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Y.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{_t(F,A,x);return}}e.bindTexture(r.TEXTURE_2D,F.__webglTexture,r.TEXTURE0+x)}function V(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){_t(F,A,x);return}e.bindTexture(r.TEXTURE_2D_ARRAY,F.__webglTexture,r.TEXTURE0+x)}function $(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){_t(F,A,x);return}e.bindTexture(r.TEXTURE_3D,F.__webglTexture,r.TEXTURE0+x)}function W(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){Ut(F,A,x);return}e.bindTexture(r.TEXTURE_CUBE_MAP,F.__webglTexture,r.TEXTURE0+x)}let Z={[mf]:r.REPEAT,[Es]:r.CLAMP_TO_EDGE,[gf]:r.MIRRORED_REPEAT},z={[ti]:r.NEAREST,[Xy]:r.NEAREST_MIPMAP_NEAREST,[Yl]:r.NEAREST_MIPMAP_LINEAR,[gi]:r.LINEAR,[Rh]:r.LINEAR_MIPMAP_NEAREST,[Ts]:r.LINEAR_MIPMAP_LINEAR},U={[oS]:r.NEVER,[fS]:r.ALWAYS,[aS]:r.LESS,[k_]:r.LEQUAL,[lS]:r.EQUAL,[hS]:r.GEQUAL,[cS]:r.GREATER,[uS]:r.NOTEQUAL};function R(A,x){if(x.type===Dr&&t.has("OES_texture_float_linear")===!1&&(x.magFilter===gi||x.magFilter===Rh||x.magFilter===Yl||x.magFilter===Ts||x.minFilter===gi||x.minFilter===Rh||x.minFilter===Yl||x.minFilter===Ts)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(A,r.TEXTURE_WRAP_S,Z[x.wrapS]),r.texParameteri(A,r.TEXTURE_WRAP_T,Z[x.wrapT]),(A===r.TEXTURE_3D||A===r.TEXTURE_2D_ARRAY)&&r.texParameteri(A,r.TEXTURE_WRAP_R,Z[x.wrapR]),r.texParameteri(A,r.TEXTURE_MAG_FILTER,z[x.magFilter]),r.texParameteri(A,r.TEXTURE_MIN_FILTER,z[x.minFilter]),x.compareFunction&&(r.texParameteri(A,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(A,r.TEXTURE_COMPARE_FUNC,U[x.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===ti||x.minFilter!==Yl&&x.minFilter!==Ts||x.type===Dr&&t.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||n.get(x).__currentAnisotropy){let F=t.get("EXT_texture_filter_anisotropic");r.texParameterf(A,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,i.getMaxAnisotropy())),n.get(x).__currentAnisotropy=x.anisotropy}}}function at(A,x){let F=!1;A.__webglInit===void 0&&(A.__webglInit=!0,x.addEventListener("dispose",S));let Y=x.source,tt=d.get(Y);tt===void 0&&(tt={},d.set(Y,tt));let it=N(x);if(it!==A.__cacheKey){tt[it]===void 0&&(tt[it]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,F=!0),tt[it].usedTimes++;let yt=tt[A.__cacheKey];yt!==void 0&&(tt[A.__cacheKey].usedTimes--,yt.usedTimes===0&&w(x)),A.__cacheKey=it,A.__webglTexture=tt[it].texture}return F}function _t(A,x,F){let Y=r.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(Y=r.TEXTURE_2D_ARRAY),x.isData3DTexture&&(Y=r.TEXTURE_3D);let tt=at(A,x),it=x.source;e.bindTexture(Y,A.__webglTexture,r.TEXTURE0+F);let yt=n.get(it);if(it.version!==yt.__version||tt===!0){e.activeTexture(r.TEXTURE0+F);let pt=Se.getPrimaries(Se.workingColorSpace),lt=x.colorSpace===Ar?null:Se.getPrimaries(x.colorSpace),Lt=x.colorSpace===Ar||pt===lt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Lt);let ht=p(x.image,!1,i.maxTextureSize);ht=G(x,ht);let vt=s.convert(x.format,x.colorSpace),Yt=s.convert(x.type),ut=b(x.internalFormat,vt,Yt,x.colorSpace,x.isVideoTexture);R(Y,x);let Tt,Wt=x.mipmaps,qt=x.isVideoTexture!==!0,ce=yt.__version===void 0||tt===!0,Zt=it.dataReady,k=y(x,ht);if(x.isDepthTexture)ut=r.DEPTH_COMPONENT16,x.type===Dr?ut=r.DEPTH_COMPONENT32F:x.type===Io?ut=r.DEPTH_COMPONENT24:x.type===Oa&&(ut=r.DEPTH24_STENCIL8),ce&&(qt?e.texStorage2D(r.TEXTURE_2D,1,ut,ht.width,ht.height):e.texImage2D(r.TEXTURE_2D,0,ut,ht.width,ht.height,0,vt,Yt,null));else if(x.isDataTexture)if(Wt.length>0){qt&&ce&&e.texStorage2D(r.TEXTURE_2D,k,ut,Wt[0].width,Wt[0].height);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],qt?Zt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,vt,Yt,Tt.data):e.texImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,vt,Yt,Tt.data);x.generateMipmaps=!1}else qt?(ce&&e.texStorage2D(r.TEXTURE_2D,k,ut,ht.width,ht.height),Zt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,ht.width,ht.height,vt,Yt,ht.data)):e.texImage2D(r.TEXTURE_2D,0,ut,ht.width,ht.height,0,vt,Yt,ht.data);else if(x.isCompressedTexture)if(x.isCompressedArrayTexture){qt&&ce&&e.texStorage3D(r.TEXTURE_2D_ARRAY,k,ut,Wt[0].width,Wt[0].height,ht.depth);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],x.format!==Fi?vt!==null?qt?Zt&&e.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Q,0,0,0,Tt.width,Tt.height,ht.depth,vt,Tt.data,0,0):e.compressedTexImage3D(r.TEXTURE_2D_ARRAY,Q,ut,Tt.width,Tt.height,ht.depth,0,Tt.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):qt?Zt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,Q,0,0,0,Tt.width,Tt.height,ht.depth,vt,Yt,Tt.data):e.texImage3D(r.TEXTURE_2D_ARRAY,Q,ut,Tt.width,Tt.height,ht.depth,0,vt,Yt,Tt.data)}else{qt&&ce&&e.texStorage2D(r.TEXTURE_2D,k,ut,Wt[0].width,Wt[0].height);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],x.format!==Fi?vt!==null?qt?Zt&&e.compressedTexSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,vt,Tt.data):e.compressedTexImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,Tt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):qt?Zt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,vt,Yt,Tt.data):e.texImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,vt,Yt,Tt.data)}else if(x.isDataArrayTexture)qt?(ce&&e.texStorage3D(r.TEXTURE_2D_ARRAY,k,ut,ht.width,ht.height,ht.depth),Zt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,ht.width,ht.height,ht.depth,vt,Yt,ht.data)):e.texImage3D(r.TEXTURE_2D_ARRAY,0,ut,ht.width,ht.height,ht.depth,0,vt,Yt,ht.data);else if(x.isData3DTexture)qt?(ce&&e.texStorage3D(r.TEXTURE_3D,k,ut,ht.width,ht.height,ht.depth),Zt&&e.texSubImage3D(r.TEXTURE_3D,0,0,0,0,ht.width,ht.height,ht.depth,vt,Yt,ht.data)):e.texImage3D(r.TEXTURE_3D,0,ut,ht.width,ht.height,ht.depth,0,vt,Yt,ht.data);else if(x.isFramebufferTexture){if(ce)if(qt)e.texStorage2D(r.TEXTURE_2D,k,ut,ht.width,ht.height);else{let Q=ht.width,st=ht.height;for(let mt=0;mt<k;mt++)e.texImage2D(r.TEXTURE_2D,mt,ut,Q,st,0,vt,Yt,null),Q>>=1,st>>=1}}else if(Wt.length>0){if(qt&&ce){let Q=$t(Wt[0]);e.texStorage2D(r.TEXTURE_2D,k,ut,Q.width,Q.height)}for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],qt?Zt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,vt,Yt,Tt):e.texImage2D(r.TEXTURE_2D,Q,ut,vt,Yt,Tt);x.generateMipmaps=!1}else if(qt){if(ce){let Q=$t(ht);e.texStorage2D(r.TEXTURE_2D,k,ut,Q.width,Q.height)}Zt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,vt,Yt,ht)}else e.texImage2D(r.TEXTURE_2D,0,ut,vt,Yt,ht);m(x)&&g(Y),yt.__version=it.version,x.onUpdate&&x.onUpdate(x)}A.__version=x.version}function Ut(A,x,F){if(x.image.length!==6)return;let Y=at(A,x),tt=x.source;e.bindTexture(r.TEXTURE_CUBE_MAP,A.__webglTexture,r.TEXTURE0+F);let it=n.get(tt);if(tt.version!==it.__version||Y===!0){e.activeTexture(r.TEXTURE0+F);let yt=Se.getPrimaries(Se.workingColorSpace),pt=x.colorSpace===Ar?null:Se.getPrimaries(x.colorSpace),lt=x.colorSpace===Ar||yt===pt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,lt);let Lt=x.isCompressedTexture||x.image[0].isCompressedTexture,ht=x.image[0]&&x.image[0].isDataTexture,vt=[];for(let st=0;st<6;st++)!Lt&&!ht?vt[st]=p(x.image[st],!0,i.maxCubemapSize):vt[st]=ht?x.image[st].image:x.image[st],vt[st]=G(x,vt[st]);let Yt=vt[0],ut=s.convert(x.format,x.colorSpace),Tt=s.convert(x.type),Wt=b(x.internalFormat,ut,Tt,x.colorSpace),qt=x.isVideoTexture!==!0,ce=it.__version===void 0||Y===!0,Zt=tt.dataReady,k=y(x,Yt);R(r.TEXTURE_CUBE_MAP,x);let Q;if(Lt){qt&&ce&&e.texStorage2D(r.TEXTURE_CUBE_MAP,k,Wt,Yt.width,Yt.height);for(let st=0;st<6;st++){Q=vt[st].mipmaps;for(let mt=0;mt<Q.length;mt++){let gt=Q[mt];x.format!==Fi?ut!==null?qt?Zt&&e.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,0,0,gt.width,gt.height,ut,gt.data):e.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,Wt,gt.width,gt.height,0,gt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):qt?Zt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,0,0,gt.width,gt.height,ut,Tt,gt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,Wt,gt.width,gt.height,0,ut,Tt,gt.data)}}}else{if(Q=x.mipmaps,qt&&ce){Q.length>0&&k++;let st=$t(vt[0]);e.texStorage2D(r.TEXTURE_CUBE_MAP,k,Wt,st.width,st.height)}for(let st=0;st<6;st++)if(ht){qt?Zt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,0,0,vt[st].width,vt[st].height,ut,Tt,vt[st].data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,Wt,vt[st].width,vt[st].height,0,ut,Tt,vt[st].data);for(let mt=0;mt<Q.length;mt++){let Bt=Q[mt].image[st].image;qt?Zt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,0,0,Bt.width,Bt.height,ut,Tt,Bt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,Wt,Bt.width,Bt.height,0,ut,Tt,Bt.data)}}else{qt?Zt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,0,0,ut,Tt,vt[st]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,Wt,ut,Tt,vt[st]);for(let mt=0;mt<Q.length;mt++){let gt=Q[mt];qt?Zt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,0,0,ut,Tt,gt.image[st]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,Wt,ut,Tt,gt.image[st])}}}m(x)&&g(r.TEXTURE_CUBE_MAP),it.__version=tt.version,x.onUpdate&&x.onUpdate(x)}A.__version=x.version}function X(A,x,F,Y,tt,it){let yt=s.convert(F.format,F.colorSpace),pt=s.convert(F.type),lt=b(F.internalFormat,yt,pt,F.colorSpace);if(!n.get(x).__hasExternalTextures){let ht=Math.max(1,x.width>>it),vt=Math.max(1,x.height>>it);tt===r.TEXTURE_3D||tt===r.TEXTURE_2D_ARRAY?e.texImage3D(tt,it,lt,ht,vt,x.depth,0,yt,pt,null):e.texImage2D(tt,it,lt,ht,vt,0,yt,pt,null)}e.bindFramebuffer(r.FRAMEBUFFER,A),Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Y,tt,n.get(F).__webglTexture,0,bt(x)):(tt===r.TEXTURE_2D||tt>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&tt<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,Y,tt,n.get(F).__webglTexture,it),e.bindFramebuffer(r.FRAMEBUFFER,null)}function ot(A,x,F){if(r.bindRenderbuffer(r.RENDERBUFFER,A),x.depthBuffer&&!x.stencilBuffer){let Y=r.DEPTH_COMPONENT24;if(F||Et(x)){let tt=x.depthTexture;tt&&tt.isDepthTexture&&(tt.type===Dr?Y=r.DEPTH_COMPONENT32F:tt.type===Io&&(Y=r.DEPTH_COMPONENT24));let it=bt(x);Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,it,Y,x.width,x.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,it,Y,x.width,x.height)}else r.renderbufferStorage(r.RENDERBUFFER,Y,x.width,x.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,A)}else if(x.depthBuffer&&x.stencilBuffer){let Y=bt(x);F&&Et(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Y,r.DEPTH24_STENCIL8,x.width,x.height):Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Y,r.DEPTH24_STENCIL8,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,x.width,x.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,A)}else{let Y=x.textures;for(let tt=0;tt<Y.length;tt++){let it=Y[tt],yt=s.convert(it.format,it.colorSpace),pt=s.convert(it.type),lt=b(it.internalFormat,yt,pt,it.colorSpace),Lt=bt(x);F&&Et(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Lt,lt,x.width,x.height):Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Lt,lt,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,lt,x.width,x.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function xt(A,x){if(x&&x.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(r.FRAMEBUFFER,A),!(x.depthTexture&&x.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(x.depthTexture).__webglTexture||x.depthTexture.image.width!==x.width||x.depthTexture.image.height!==x.height)&&(x.depthTexture.image.width=x.width,x.depthTexture.image.height=x.height,x.depthTexture.needsUpdate=!0),C(x.depthTexture,0);let Y=n.get(x.depthTexture).__webglTexture,tt=bt(x);if(x.depthTexture.format===Ao)Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,Y,0,tt):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,Y,0);else if(x.depthTexture.format===La)Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,Y,0,tt):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,Y,0);else throw new Error("Unknown depthTexture format")}function ct(A){let x=n.get(A),F=A.isWebGLCubeRenderTarget===!0;if(A.depthTexture&&!x.__autoAllocateDepthBuffer){if(F)throw new Error("target.depthTexture not supported in Cube render targets");xt(x.__webglFramebuffer,A)}else if(F){x.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer[Y]),x.__webglDepthbuffer[Y]=r.createRenderbuffer(),ot(x.__webglDepthbuffer[Y],A,!1)}else e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer=r.createRenderbuffer(),ot(x.__webglDepthbuffer,A,!1);e.bindFramebuffer(r.FRAMEBUFFER,null)}function Rt(A,x,F){let Y=n.get(A);x!==void 0&&X(Y.__webglFramebuffer,A,A.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),F!==void 0&&ct(A)}function kt(A){let x=A.texture,F=n.get(A),Y=n.get(x);A.addEventListener("dispose",D);let tt=A.textures,it=A.isWebGLCubeRenderTarget===!0,yt=tt.length>1;if(yt||(Y.__webglTexture===void 0&&(Y.__webglTexture=r.createTexture()),Y.__version=x.version,o.memory.textures++),it){F.__webglFramebuffer=[];for(let pt=0;pt<6;pt++)if(x.mipmaps&&x.mipmaps.length>0){F.__webglFramebuffer[pt]=[];for(let lt=0;lt<x.mipmaps.length;lt++)F.__webglFramebuffer[pt][lt]=r.createFramebuffer()}else F.__webglFramebuffer[pt]=r.createFramebuffer()}else{if(x.mipmaps&&x.mipmaps.length>0){F.__webglFramebuffer=[];for(let pt=0;pt<x.mipmaps.length;pt++)F.__webglFramebuffer[pt]=r.createFramebuffer()}else F.__webglFramebuffer=r.createFramebuffer();if(yt)for(let pt=0,lt=tt.length;pt<lt;pt++){let Lt=n.get(tt[pt]);Lt.__webglTexture===void 0&&(Lt.__webglTexture=r.createTexture(),o.memory.textures++)}if(A.samples>0&&Et(A)===!1){F.__webglMultisampledFramebuffer=r.createFramebuffer(),F.__webglColorRenderbuffer=[],e.bindFramebuffer(r.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let pt=0;pt<tt.length;pt++){let lt=tt[pt];F.__webglColorRenderbuffer[pt]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,F.__webglColorRenderbuffer[pt]);let Lt=s.convert(lt.format,lt.colorSpace),ht=s.convert(lt.type),vt=b(lt.internalFormat,Lt,ht,lt.colorSpace,A.isXRRenderTarget===!0),Yt=bt(A);r.renderbufferStorageMultisample(r.RENDERBUFFER,Yt,vt,A.width,A.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+pt,r.RENDERBUFFER,F.__webglColorRenderbuffer[pt])}r.bindRenderbuffer(r.RENDERBUFFER,null),A.depthBuffer&&(F.__webglDepthRenderbuffer=r.createRenderbuffer(),ot(F.__webglDepthRenderbuffer,A,!0)),e.bindFramebuffer(r.FRAMEBUFFER,null)}}if(it){e.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture),R(r.TEXTURE_CUBE_MAP,x);for(let pt=0;pt<6;pt++)if(x.mipmaps&&x.mipmaps.length>0)for(let lt=0;lt<x.mipmaps.length;lt++)X(F.__webglFramebuffer[pt][lt],A,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,lt);else X(F.__webglFramebuffer[pt],A,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0);m(x)&&g(r.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(yt){for(let pt=0,lt=tt.length;pt<lt;pt++){let Lt=tt[pt],ht=n.get(Lt);e.bindTexture(r.TEXTURE_2D,ht.__webglTexture),R(r.TEXTURE_2D,Lt),X(F.__webglFramebuffer,A,Lt,r.COLOR_ATTACHMENT0+pt,r.TEXTURE_2D,0),m(Lt)&&g(r.TEXTURE_2D)}e.unbindTexture()}else{let pt=r.TEXTURE_2D;if((A.isWebGL3DRenderTarget||A.isWebGLArrayRenderTarget)&&(pt=A.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),e.bindTexture(pt,Y.__webglTexture),R(pt,x),x.mipmaps&&x.mipmaps.length>0)for(let lt=0;lt<x.mipmaps.length;lt++)X(F.__webglFramebuffer[lt],A,x,r.COLOR_ATTACHMENT0,pt,lt);else X(F.__webglFramebuffer,A,x,r.COLOR_ATTACHMENT0,pt,0);m(x)&&g(pt),e.unbindTexture()}A.depthBuffer&&ct(A)}function q(A){let x=A.textures;for(let F=0,Y=x.length;F<Y;F++){let tt=x[F];if(m(tt)){let it=A.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,yt=n.get(tt).__webglTexture;e.bindTexture(it,yt),g(it),e.unbindTexture()}}}let Jt=[],It=[];function Ft(A){if(A.samples>0){if(Et(A)===!1){let x=A.textures,F=A.width,Y=A.height,tt=r.COLOR_BUFFER_BIT,it=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,yt=n.get(A),pt=x.length>1;if(pt)for(let lt=0;lt<x.length;lt++)e.bindFramebuffer(r.FRAMEBUFFER,yt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.RENDERBUFFER,null),e.bindFramebuffer(r.FRAMEBUFFER,yt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.TEXTURE_2D,null,0);e.bindFramebuffer(r.READ_FRAMEBUFFER,yt.__webglMultisampledFramebuffer),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,yt.__webglFramebuffer);for(let lt=0;lt<x.length;lt++){if(A.resolveDepthBuffer&&(A.depthBuffer&&(tt|=r.DEPTH_BUFFER_BIT),A.stencilBuffer&&A.resolveStencilBuffer&&(tt|=r.STENCIL_BUFFER_BIT)),pt){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,yt.__webglColorRenderbuffer[lt]);let Lt=n.get(x[lt]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Lt,0)}r.blitFramebuffer(0,0,F,Y,0,0,F,Y,tt,r.NEAREST),l===!0&&(Jt.length=0,It.length=0,Jt.push(r.COLOR_ATTACHMENT0+lt),A.depthBuffer&&A.resolveDepthBuffer===!1&&(Jt.push(it),It.push(it),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,It)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Jt))}if(e.bindFramebuffer(r.READ_FRAMEBUFFER,null),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),pt)for(let lt=0;lt<x.length;lt++){e.bindFramebuffer(r.FRAMEBUFFER,yt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.RENDERBUFFER,yt.__webglColorRenderbuffer[lt]);let Lt=n.get(x[lt]).__webglTexture;e.bindFramebuffer(r.FRAMEBUFFER,yt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.TEXTURE_2D,Lt,0)}e.bindFramebuffer(r.DRAW_FRAMEBUFFER,yt.__webglMultisampledFramebuffer)}else if(A.depthBuffer&&A.resolveDepthBuffer===!1&&l){let x=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[x])}}}function bt(A){return Math.min(i.maxSamples,A.samples)}function Et(A){let x=n.get(A);return A.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function Ht(A){let x=o.render.frame;h.get(A)!==x&&(h.set(A,x),A.update())}function G(A,x){let F=A.colorSpace,Y=A.format,tt=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||F!==Or&&F!==Ar&&(Se.getTransfer(F)===Te?(Y!==Fi||tt!==Fr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",F)),x}function $t(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement?(c.width=A.naturalWidth||A.width,c.height=A.naturalHeight||A.height):typeof VideoFrame<"u"&&A instanceof VideoFrame?(c.width=A.displayWidth,c.height=A.displayHeight):(c.width=A.width,c.height=A.height),c}this.allocateTextureUnit=I,this.resetTextureUnits=v,this.setTexture2D=C,this.setTexture2DArray=V,this.setTexture3D=$,this.setTextureCube=W,this.rebindTextures=Rt,this.setupRenderTarget=kt,this.updateRenderTargetMipmap=q,this.updateMultisampleRenderTarget=Ft,this.setupDepthRenderbuffer=ct,this.setupFrameBufferTexture=X,this.useMultisampledRTT=Et}function tE(r,t){function e(n,i=Ar){let s,o=Se.getTransfer(i);if(n===Fr)return r.UNSIGNED_BYTE;if(n===F_)return r.UNSIGNED_SHORT_4_4_4_4;if(n===N_)return r.UNSIGNED_SHORT_5_5_5_1;if(n===Zy)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===Yy)return r.BYTE;if(n===qy)return r.SHORT;if(n===I_)return r.UNSIGNED_SHORT;if(n===L_)return r.INT;if(n===Io)return r.UNSIGNED_INT;if(n===Dr)return r.FLOAT;if(n===Xc)return r.HALF_FLOAT;if(n===Jy)return r.ALPHA;if(n===$y)return r.RGB;if(n===Fi)return r.RGBA;if(n===Ky)return r.LUMINANCE;if(n===jy)return r.LUMINANCE_ALPHA;if(n===Ao)return r.DEPTH_COMPONENT;if(n===La)return r.DEPTH_STENCIL;if(n===Qy)return r.RED;if(n===U_)return r.RED_INTEGER;if(n===tS)return r.RG;if(n===O_)return r.RG_INTEGER;if(n===B_)return r.RGBA_INTEGER;if(n===Ph||n===Ih||n===Lh||n===Fh)if(o===Te)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Ph)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ih)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Lh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Fh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Ph)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ih)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Lh)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Fh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===ag||n===lg||n===cg||n===ug)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===ag)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===lg)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===cg)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ug)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===hg||n===fg||n===dg)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===hg||n===fg)return o===Te?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===dg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===pg||n===mg||n===gg||n===_g||n===xg||n===vg||n===yg||n===Sg||n===Mg||n===bg||n===wg||n===Eg||n===Tg||n===Ag)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===pg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===mg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===gg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===_g)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===xg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===vg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===yg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Sg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Mg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===bg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===wg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Eg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Tg)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Ag)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Nh||n===Dg||n===Cg)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===Nh)return o===Te?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Dg)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Cg)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===eS||n===Rg||n===Pg||n===Ig)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===Nh)return s.COMPRESSED_RED_RGTC1_EXT;if(n===Rg)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Pg)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Ig)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Oa?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:e}}var Pf=class extends An{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},Cr=class extends mn{constructor(){super(),this.isGroup=!0,this.type="Group"}},eE={type:"move"},Ia=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Cr,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 Cr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new nt,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new nt),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Cr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new nt,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new nt),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 p of t.hand.values()){let m=e.getJointPose(p,n),g=this._getHandJoint(c,p);m!==null&&(g.matrix.fromArray(m.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=m.radius),g.visible=m!==null}let h=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=h.position.distanceTo(f.position),u=.02,_=.005;c.inputState.pinching&&d>u+_?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=u-_&&(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(eE)))}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 Cr;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},nE=`
|
|
3798
3798
|
void main() {
|
|
3799
3799
|
|
|
3800
3800
|
gl_Position = vec4( position, 1.0 );
|
|
3801
3801
|
|
|
3802
|
-
}`,
|
|
3802
|
+
}`,iE=`
|
|
3803
3803
|
uniform sampler2DArray depthColor;
|
|
3804
3804
|
uniform float depthWidth;
|
|
3805
3805
|
uniform float depthHeight;
|
|
@@ -3818,7 +3818,7 @@ void main() {
|
|
|
3818
3818
|
|
|
3819
3819
|
}
|
|
3820
3820
|
|
|
3821
|
-
}`,If=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 ii,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 ri({vertexShader:eE,fragmentShader:nE,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new _i(new Fc(20,20),i)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},Lf=class extends Nr{constructor(t,e){super();let n=this,i=null,s=1,o=null,a="local-floor",l=1,c=null,h=null,f=null,d=null,u=null,_=null,p=new If,m=e.getContextAttributes(),g=null,b=null,y=[],S=[],D=new _e,T=null,w=new An;w.layers.enable(1),w.viewport=new Qe;let P=new An;P.layers.enable(2),P.viewport=new Qe;let M=[w,P],v=new Pf;v.layers.enable(1),v.layers.enable(2);let I=null,N=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let ot=y[X];return ot===void 0&&(ot=new Ia,y[X]=ot),ot.getTargetRaySpace()},this.getControllerGrip=function(X){let ot=y[X];return ot===void 0&&(ot=new Ia,y[X]=ot),ot.getGripSpace()},this.getHand=function(X){let ot=y[X];return ot===void 0&&(ot=new Ia,y[X]=ot),ot.getHandSpace()};function C(X){let ot=S.indexOf(X.inputSource);if(ot===-1)return;let xt=y[ot];xt!==void 0&&(xt.update(X.inputSource,X.frame,c||o),xt.dispatchEvent({type:X.type,data:X.inputSource}))}function V(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",V),i.removeEventListener("inputsourceschange",$);for(let X=0;X<y.length;X++){let ot=S[X];ot!==null&&(S[X]=null,y[X].disconnect(ot))}I=null,N=null,p.reset(),t.setRenderTarget(g),u=null,d=null,f=null,i=null,b=null,Ut.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){a=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(X){c=X},this.getBaseLayer=function(){return d!==null?d:u},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(g=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",V),i.addEventListener("inputsourceschange",$),m.xrCompatible!==!0&&await e.makeXRCompatible(),T=t.getPixelRatio(),t.getSize(D),i.renderState.layers===void 0){let ot={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};u=new XRWebGLLayer(i,e,ot),i.updateRenderState({baseLayer:u}),t.setPixelRatio(1),t.setSize(u.framebufferWidth,u.framebufferHeight,!1),b=new nr(u.framebufferWidth,u.framebufferHeight,{format:Fi,type:Fr,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let ot=null,xt=null,ct=null;m.depth&&(ct=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,ot=m.stencil?La:Ao,xt=m.stencil?Oa:Io);let Rt={colorFormat:e.RGBA8,depthFormat:ct,scaleFactor:s};f=new XRWebGLBinding(i,e),d=f.createProjectionLayer(Rt),i.updateRenderState({layers:[d]}),t.setPixelRatio(1),t.setSize(d.textureWidth,d.textureHeight,!1),b=new nr(d.textureWidth,d.textureHeight,{format:Fi,type:Fr,depthTexture:new Oc(d.textureWidth,d.textureHeight,xt,void 0,void 0,void 0,void 0,void 0,void 0,ot),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await i.requestReferenceSpace(a),Ut.setContext(i),Ut.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function $(X){for(let ot=0;ot<X.removed.length;ot++){let xt=X.removed[ot],ct=S.indexOf(xt);ct>=0&&(S[ct]=null,y[ct].disconnect(xt))}for(let ot=0;ot<X.added.length;ot++){let xt=X.added[ot],ct=S.indexOf(xt);if(ct===-1){for(let kt=0;kt<y.length;kt++)if(kt>=S.length){S.push(xt),ct=kt;break}else if(S[kt]===null){S[kt]=xt,ct=kt;break}if(ct===-1)break}let Rt=y[ct];Rt&&Rt.connect(xt)}}let W=new nt,Z=new nt;function z(X,ot,xt){W.setFromMatrixPosition(ot.matrixWorld),Z.setFromMatrixPosition(xt.matrixWorld);let ct=W.distanceTo(Z),Rt=ot.projectionMatrix.elements,kt=xt.projectionMatrix.elements,q=Rt[14]/(Rt[10]-1),Jt=Rt[14]/(Rt[10]+1),It=(Rt[9]+1)/Rt[5],Ft=(Rt[9]-1)/Rt[5],bt=(Rt[8]-1)/Rt[0],Et=(kt[8]+1)/kt[0],Ht=q*bt,G=q*Et,$t=ct/(-bt+Et),A=$t*-bt;ot.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(A),X.translateZ($t),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert();let x=q+$t,F=Jt+$t,Y=Ht-A,tt=G+(ct-A),it=It*Jt/F*x,yt=Ft*Jt/F*x;X.projectionMatrix.makePerspective(Y,tt,it,yt,x,F),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}function U(X,ot){ot===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(ot.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(i===null)return;p.texture!==null&&(X.near=p.depthNear,X.far=p.depthFar),v.near=P.near=w.near=X.near,v.far=P.far=w.far=X.far,(I!==v.near||N!==v.far)&&(i.updateRenderState({depthNear:v.near,depthFar:v.far}),I=v.near,N=v.far,w.near=I,w.far=N,P.near=I,P.far=N,w.updateProjectionMatrix(),P.updateProjectionMatrix(),X.updateProjectionMatrix());let ot=X.parent,xt=v.cameras;U(v,ot);for(let ct=0;ct<xt.length;ct++)U(xt[ct],ot);xt.length===2?z(v,w,P):v.projectionMatrix.copy(w.projectionMatrix),R(X,v,ot)};function R(X,ot,xt){xt===null?X.matrix.copy(ot.matrixWorld):(X.matrix.copy(xt.matrixWorld),X.matrix.invert(),X.matrix.multiply(ot.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(ot.projectionMatrix),X.projectionMatrixInverse.copy(ot.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=_f*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return v},this.getFoveation=function(){if(!(d===null&&u===null))return l},this.setFoveation=function(X){l=X,d!==null&&(d.fixedFoveation=X),u!==null&&u.fixedFoveation!==void 0&&(u.fixedFoveation=X)},this.hasDepthSensing=function(){return p.texture!==null};let at=null;function _t(X,ot){if(h=ot.getViewerPose(c||o),_=ot,h!==null){let xt=h.views;u!==null&&(t.setRenderTargetFramebuffer(b,u.framebuffer),t.setRenderTarget(b));let ct=!1;xt.length!==v.cameras.length&&(v.cameras.length=0,ct=!0);for(let kt=0;kt<xt.length;kt++){let q=xt[kt],Jt=null;if(u!==null)Jt=u.getViewport(q);else{let Ft=f.getViewSubImage(d,q);Jt=Ft.viewport,kt===0&&(t.setRenderTargetTextures(b,Ft.colorTexture,d.ignoreDepthValues?void 0:Ft.depthStencilTexture),t.setRenderTarget(b))}let It=M[kt];It===void 0&&(It=new An,It.layers.enable(kt),It.viewport=new Qe,M[kt]=It),It.matrix.fromArray(q.transform.matrix),It.matrix.decompose(It.position,It.quaternion,It.scale),It.projectionMatrix.fromArray(q.projectionMatrix),It.projectionMatrixInverse.copy(It.projectionMatrix).invert(),It.viewport.set(Jt.x,Jt.y,Jt.width,Jt.height),kt===0&&(v.matrix.copy(It.matrix),v.matrix.decompose(v.position,v.quaternion,v.scale)),ct===!0&&v.cameras.push(It)}let Rt=i.enabledFeatures;if(Rt&&Rt.includes("depth-sensing")){let kt=f.getDepthInformation(xt[0]);kt&&kt.isValid&&kt.texture&&p.init(t,kt,i.renderState)}}for(let xt=0;xt<y.length;xt++){let ct=S[xt],Rt=y[xt];ct!==null&&Rt!==void 0&&Rt.update(ct,ot,c||o)}p.render(t,v),at&&at(X,ot),ot.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ot}),_=null}let Ut=new G_;Ut.setAnimationLoop(_t),this.setAnimationLoop=function(X){at=X},this.dispose=function(){}}},Ss=new ir,iE=new Ue;function rE(r,t){function e(m,g){m.matrixAutoUpdate===!0&&m.updateMatrix(),g.value.copy(m.matrix)}function n(m,g){g.color.getRGB(m.fogColor.value,H_(r)),g.isFog?(m.fogNear.value=g.near,m.fogFar.value=g.far):g.isFogExp2&&(m.fogDensity.value=g.density)}function i(m,g,b,y,S){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(m,g):g.isMeshToonMaterial?(s(m,g),f(m,g)):g.isMeshPhongMaterial?(s(m,g),h(m,g)):g.isMeshStandardMaterial?(s(m,g),d(m,g),g.isMeshPhysicalMaterial&&u(m,g,S)):g.isMeshMatcapMaterial?(s(m,g),_(m,g)):g.isMeshDepthMaterial?s(m,g):g.isMeshDistanceMaterial?(s(m,g),p(m,g)):g.isMeshNormalMaterial?s(m,g):g.isLineBasicMaterial?(o(m,g),g.isLineDashedMaterial&&a(m,g)):g.isPointsMaterial?l(m,g,b,y):g.isSpriteMaterial?c(m,g):g.isShadowMaterial?(m.color.value.copy(g.color),m.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(m,g){m.opacity.value=g.opacity,g.color&&m.diffuse.value.copy(g.color),g.emissive&&m.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(m.map.value=g.map,e(g.map,m.mapTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,e(g.alphaMap,m.alphaMapTransform)),g.bumpMap&&(m.bumpMap.value=g.bumpMap,e(g.bumpMap,m.bumpMapTransform),m.bumpScale.value=g.bumpScale,g.side===Nn&&(m.bumpScale.value*=-1)),g.normalMap&&(m.normalMap.value=g.normalMap,e(g.normalMap,m.normalMapTransform),m.normalScale.value.copy(g.normalScale),g.side===Nn&&m.normalScale.value.negate()),g.displacementMap&&(m.displacementMap.value=g.displacementMap,e(g.displacementMap,m.displacementMapTransform),m.displacementScale.value=g.displacementScale,m.displacementBias.value=g.displacementBias),g.emissiveMap&&(m.emissiveMap.value=g.emissiveMap,e(g.emissiveMap,m.emissiveMapTransform)),g.specularMap&&(m.specularMap.value=g.specularMap,e(g.specularMap,m.specularMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let b=t.get(g),y=b.envMap,S=b.envMapRotation;if(y&&(m.envMap.value=y,Ss.copy(S),Ss.x*=-1,Ss.y*=-1,Ss.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Ss.y*=-1,Ss.z*=-1),m.envMapRotation.value.setFromMatrix4(iE.makeRotationFromEuler(Ss)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap){m.lightMap.value=g.lightMap;let D=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=g.lightMapIntensity*D,e(g.lightMap,m.lightMapTransform)}g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity,e(g.aoMap,m.aoMapTransform))}function o(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,g.map&&(m.map.value=g.map,e(g.map,m.mapTransform))}function a(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function l(m,g,b,y){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*b,m.scale.value=y*.5,g.map&&(m.map.value=g.map,e(g.map,m.uvTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,e(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function c(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map,e(g.map,m.mapTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,e(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function h(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function f(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function d(m,g){m.metalness.value=g.metalness,g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap,e(g.metalnessMap,m.metalnessMapTransform)),m.roughness.value=g.roughness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap,e(g.roughnessMap,m.roughnessMapTransform)),g.envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function u(m,g,b){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap,e(g.sheenColorMap,m.sheenColorMapTransform)),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap,e(g.sheenRoughnessMap,m.sheenRoughnessMapTransform))),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap,e(g.clearcoatMap,m.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,e(g.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(m.clearcoatNormalMap.value=g.clearcoatNormalMap,e(g.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Nn&&m.clearcoatNormalScale.value.negate())),g.dispersion>0&&(m.dispersion.value=g.dispersion),g.iridescence>0&&(m.iridescence.value=g.iridescence,m.iridescenceIOR.value=g.iridescenceIOR,m.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(m.iridescenceMap.value=g.iridescenceMap,e(g.iridescenceMap,m.iridescenceMapTransform)),g.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=g.iridescenceThicknessMap,e(g.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=b.texture,m.transmissionSamplerSize.value.set(b.width,b.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap,e(g.transmissionMap,m.transmissionMapTransform)),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap,e(g.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(m.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(m.anisotropyMap.value=g.anisotropyMap,e(g.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap,e(g.specularColorMap,m.specularColorMapTransform)),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap,e(g.specularIntensityMap,m.specularIntensityMapTransform))}function _(m,g){g.matcap&&(m.matcap.value=g.matcap)}function p(m,g){let b=t.get(g).light;m.referencePosition.value.setFromMatrixPosition(b.matrixWorld),m.nearDistance.value=b.shadow.camera.near,m.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function sE(r,t,e,n){let i={},s={},o=[],a=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,y){let S=y.program;n.uniformBlockBinding(b,S)}function c(b,y){let S=i[b.id];S===void 0&&(_(b),S=h(b),i[b.id]=S,b.addEventListener("dispose",m));let D=y.program;n.updateUBOMapping(b,D);let T=t.render.frame;s[b.id]!==T&&(d(b),s[b.id]=T)}function h(b){let y=f();b.__bindingPointIndex=y;let S=r.createBuffer(),D=b.__size,T=b.usage;return r.bindBuffer(r.UNIFORM_BUFFER,S),r.bufferData(r.UNIFORM_BUFFER,D,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,y,S),S}function f(){for(let b=0;b<a;b++)if(o.indexOf(b)===-1)return o.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(b){let y=i[b.id],S=b.uniforms,D=b.__cache;r.bindBuffer(r.UNIFORM_BUFFER,y);for(let T=0,w=S.length;T<w;T++){let P=Array.isArray(S[T])?S[T]:[S[T]];for(let M=0,v=P.length;M<v;M++){let I=P[M];if(u(I,T,M,D)===!0){let N=I.__offset,C=Array.isArray(I.value)?I.value:[I.value],V=0;for(let $=0;$<C.length;$++){let W=C[$],Z=p(W);typeof W=="number"||typeof W=="boolean"?(I.__data[0]=W,r.bufferSubData(r.UNIFORM_BUFFER,N+V,I.__data)):W.isMatrix3?(I.__data[0]=W.elements[0],I.__data[1]=W.elements[1],I.__data[2]=W.elements[2],I.__data[3]=0,I.__data[4]=W.elements[3],I.__data[5]=W.elements[4],I.__data[6]=W.elements[5],I.__data[7]=0,I.__data[8]=W.elements[6],I.__data[9]=W.elements[7],I.__data[10]=W.elements[8],I.__data[11]=0):(W.toArray(I.__data,V),V+=Z.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,N,I.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function u(b,y,S,D){let T=b.value,w=y+"_"+S;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 _(b){let y=b.uniforms,S=0,D=16;for(let w=0,P=y.length;w<P;w++){let M=Array.isArray(y[w])?y[w]:[y[w]];for(let v=0,I=M.length;v<I;v++){let N=M[v],C=Array.isArray(N.value)?N.value:[N.value];for(let V=0,$=C.length;V<$;V++){let W=C[V],Z=p(W),z=S%D;z!==0&&D-z<Z.boundary&&(S+=D-z),N.__data=new Float32Array(Z.storage/Float32Array.BYTES_PER_ELEMENT),N.__offset=S,S+=Z.storage}}}let T=S%D;return T>0&&(S+=D-T),b.__size=S,b.__cache={},this}function p(b){let y={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(y.boundary=4,y.storage=4):b.isVector2?(y.boundary=8,y.storage=8):b.isVector3||b.isColor?(y.boundary=16,y.storage=12):b.isVector4?(y.boundary=16,y.storage=16):b.isMatrix3?(y.boundary=48,y.storage=48):b.isMatrix4?(y.boundary=64,y.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),y}function m(b){let y=b.target;y.removeEventListener("dispose",m);let S=o.indexOf(y.__bindingPointIndex);o.splice(S,1),r.deleteBuffer(i[y.id]),delete i[y.id],delete s[y.id]}function g(){for(let b in i)r.deleteBuffer(i[b]);o=[],i={},s={}}return{bind:l,update:c,dispose:g}}var Bc=class{constructor(t={}){let{canvas:e=dS(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:f=!1}=t;this.isWebGLRenderer=!0;let d;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=o;let u=new Uint32Array(4),_=new Int32Array(4),p=null,m=null,g=[],b=[];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=Qn,this._useLegacyLights=!1,this.toneMapping=Ir,this.toneMappingExposure=1;let y=this,S=!1,D=0,T=0,w=null,P=-1,M=null,v=new Qe,I=new Qe,N=null,C=new ge(0),V=0,$=e.width,W=e.height,Z=1,z=null,U=null,R=new Qe(0,0,$,W),at=new Qe(0,0,$,W),_t=!1,Ut=new Na,X=!1,ot=!1,xt=new Ue,ct=new nt,Rt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function kt(){return w===null?Z:1}let q=n;function Jt(E,B){return e.getContext(E,B)}try{let E={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:f};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Zf}`),e.addEventListener("webglcontextlost",k,!1),e.addEventListener("webglcontextrestored",Q,!1),e.addEventListener("webglcontextcreationerror",st,!1),q===null){let B="webgl2";if(q=Jt(B,E),q===null)throw Jt(B)?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 It,Ft,bt,Et,Ht,G,$t,A,x,F,Y,tt,it,yt,pt,lt,Lt,ht,vt,Yt,ut,Tt,Wt,qt;function ce(){It=new ww(q),It.init(),Tt=new Q1(q,It),Ft=new xw(q,It,t,Tt),bt=new K1(q),Et=new Aw(q),Ht=new k1,G=new j1(q,It,bt,Ht,Ft,Tt,Et),$t=new yw(y),A=new bw(y),x=new FS(q),Wt=new gw(q,x),F=new Ew(q,x,Et,Wt),Y=new Cw(q,F,x,Et),vt=new Dw(q,Ft,G),lt=new vw(Ht),tt=new B1(y,$t,A,It,Ft,Wt,lt),it=new rE(y,Ht),yt=new V1,pt=new q1(It),ht=new mw(y,$t,A,bt,Y,d,l),Lt=new $1(y,Y,Ft),qt=new sE(q,Et,Ft,bt),Yt=new _w(q,It,Et),ut=new Tw(q,It,Et),Et.programs=tt.programs,y.capabilities=Ft,y.extensions=It,y.properties=Ht,y.renderLists=yt,y.shadowMap=Lt,y.state=bt,y.info=Et}ce();let Zt=new Lf(y,q);this.xr=Zt,this.getContext=function(){return q},this.getContextAttributes=function(){return q.getContextAttributes()},this.forceContextLoss=function(){let E=It.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){let E=It.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(E){E!==void 0&&(Z=E,this.setSize($,W,!1))},this.getSize=function(E){return E.set($,W)},this.setSize=function(E,B,H=!0){if(Zt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=E,W=B,e.width=Math.floor(E*Z),e.height=Math.floor(B*Z),H===!0&&(e.style.width=E+"px",e.style.height=B+"px"),this.setViewport(0,0,E,B)},this.getDrawingBufferSize=function(E){return E.set($*Z,W*Z).floor()},this.setDrawingBufferSize=function(E,B,H){$=E,W=B,Z=H,e.width=Math.floor(E*H),e.height=Math.floor(B*H),this.setViewport(0,0,E,B)},this.getCurrentViewport=function(E){return E.copy(v)},this.getViewport=function(E){return E.copy(R)},this.setViewport=function(E,B,H,K){E.isVector4?R.set(E.x,E.y,E.z,E.w):R.set(E,B,H,K),bt.viewport(v.copy(R).multiplyScalar(Z).round())},this.getScissor=function(E){return E.copy(at)},this.setScissor=function(E,B,H,K){E.isVector4?at.set(E.x,E.y,E.z,E.w):at.set(E,B,H,K),bt.scissor(I.copy(at).multiplyScalar(Z).round())},this.getScissorTest=function(){return _t},this.setScissorTest=function(E){bt.setScissorTest(_t=E)},this.setOpaqueSort=function(E){z=E},this.setTransparentSort=function(E){U=E},this.getClearColor=function(E){return E.copy(ht.getClearColor())},this.setClearColor=function(){ht.setClearColor.apply(ht,arguments)},this.getClearAlpha=function(){return ht.getClearAlpha()},this.setClearAlpha=function(){ht.setClearAlpha.apply(ht,arguments)},this.clear=function(E=!0,B=!0,H=!0){let K=0;if(E){let J=!1;if(w!==null){let St=w.texture.format;J=St===B_||St===O_||St===U_}if(J){let St=w.texture.type,At=St===Fr||St===Io||St===I_||St===Oa||St===F_||St===N_,Pt=ht.getClearColor(),Xt=ht.getClearAlpha(),jt=Pt.r,Gt=Pt.g,Vt=Pt.b;At?(u[0]=jt,u[1]=Gt,u[2]=Vt,u[3]=Xt,q.clearBufferuiv(q.COLOR,0,u)):(_[0]=jt,_[1]=Gt,_[2]=Vt,_[3]=Xt,q.clearBufferiv(q.COLOR,0,_))}else K|=q.COLOR_BUFFER_BIT}B&&(K|=q.DEPTH_BUFFER_BIT),H&&(K|=q.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),q.clear(K)},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",k,!1),e.removeEventListener("webglcontextrestored",Q,!1),e.removeEventListener("webglcontextcreationerror",st,!1),yt.dispose(),pt.dispose(),Ht.dispose(),$t.dispose(),A.dispose(),Y.dispose(),Wt.dispose(),qt.dispose(),tt.dispose(),Zt.dispose(),Zt.removeEventListener("sessionstart",rt),Zt.removeEventListener("sessionend",O),j.stop()};function k(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function Q(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;let E=Et.autoReset,B=Lt.enabled,H=Lt.autoUpdate,K=Lt.needsUpdate,J=Lt.type;ce(),Et.autoReset=E,Lt.enabled=B,Lt.autoUpdate=H,Lt.needsUpdate=K,Lt.type=J}function st(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function mt(E){let B=E.target;B.removeEventListener("dispose",mt),gt(B)}function gt(E){Bt(E),Ht.remove(E)}function Bt(E){let B=Ht.get(E).programs;B!==void 0&&(B.forEach(function(H){tt.releaseProgram(H)}),E.isShaderMaterial&&tt.releaseShaderCache(E))}this.renderBufferDirect=function(E,B,H,K,J,St){B===null&&(B=Rt);let At=J.isMesh&&J.matrixWorld.determinant()<0,Pt=he(E,B,H,K,J);bt.setMaterial(K,At);let Xt=H.index,jt=1;if(K.wireframe===!0){if(Xt=F.getWireframeAttribute(H),Xt===void 0)return;jt=2}let Gt=H.drawRange,Vt=H.attributes.position,xe=Gt.start*jt,Be=(Gt.start+Gt.count)*jt;St!==null&&(xe=Math.max(xe,St.start*jt),Be=Math.min(Be,(St.start+St.count)*jt)),Xt!==null?(xe=Math.max(xe,0),Be=Math.min(Be,Xt.count)):Vt!=null&&(xe=Math.max(xe,0),Be=Math.min(Be,Vt.count));let sn=Be-xe;if(sn<0||sn===1/0)return;Wt.setup(J,K,Pt,H,Xt);let gn,ne=Yt;if(Xt!==null&&(gn=x.get(Xt),ne=ut,ne.setIndex(gn)),J.isMesh)K.wireframe===!0?(bt.setLineWidth(K.wireframeLinewidth*kt()),ne.setMode(q.LINES)):ne.setMode(q.TRIANGLES);else if(J.isLine){let Kt=K.linewidth;Kt===void 0&&(Kt=1),bt.setLineWidth(Kt*kt()),J.isLineSegments?ne.setMode(q.LINES):J.isLineLoop?ne.setMode(q.LINE_LOOP):ne.setMode(q.LINE_STRIP)}else J.isPoints?ne.setMode(q.POINTS):J.isSprite&&ne.setMode(q.TRIANGLES);if(J.isBatchedMesh)J._multiDrawInstances!==null?ne.renderMultiDrawInstances(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount,J._multiDrawInstances):ne.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else if(J.isInstancedMesh)ne.renderInstances(xe,sn,J.count);else if(H.isInstancedBufferGeometry){let Kt=H._maxInstanceCount!==void 0?H._maxInstanceCount:1/0,bi=Math.min(H.instanceCount,Kt);ne.renderInstances(xe,sn,bi)}else ne.render(xe,sn)};function ee(E,B,H){E.transparent===!0&&E.side===tr&&E.forceSinglePass===!1?(E.side=Nn,E.needsUpdate=!0,zt(E,B,H),E.side=Lr,E.needsUpdate=!0,zt(E,B,H),E.side=tr):zt(E,B,H)}this.compile=function(E,B,H=null){H===null&&(H=E),m=pt.get(H),m.init(B),b.push(m),H.traverseVisible(function(J){J.isLight&&J.layers.test(B.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),E!==H&&E.traverseVisible(function(J){J.isLight&&J.layers.test(B.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),m.setupLights(y._useLegacyLights);let K=new Set;return E.traverse(function(J){let St=J.material;if(St)if(Array.isArray(St))for(let At=0;At<St.length;At++){let Pt=St[At];ee(Pt,H,J),K.add(Pt)}else ee(St,H,J),K.add(St)}),b.pop(),m=null,K},this.compileAsync=function(E,B,H=null){let K=this.compile(E,B,H);return new Promise(J=>{function St(){if(K.forEach(function(At){Ht.get(At).currentProgram.isReady()&&K.delete(At)}),K.size===0){J(E);return}setTimeout(St,10)}It.get("KHR_parallel_shader_compile")!==null?St():setTimeout(St,10)})};let Mt=null;function L(E){Mt&&Mt(E)}function rt(){j.stop()}function O(){j.start()}let j=new G_;j.setAnimationLoop(L),typeof self<"u"&&j.setContext(self),this.setAnimationLoop=function(E){Mt=E,Zt.setAnimationLoop(E),E===null?j.stop():j.start()},Zt.addEventListener("sessionstart",rt),Zt.addEventListener("sessionend",O),this.render=function(E,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),Zt.enabled===!0&&Zt.isPresenting===!0&&(Zt.cameraAutoUpdate===!0&&Zt.updateCamera(B),B=Zt.getCamera()),E.isScene===!0&&E.onBeforeRender(y,E,B,w),m=pt.get(E,b.length),m.init(B),b.push(m),xt.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),Ut.setFromProjectionMatrix(xt),ot=this.localClippingEnabled,X=lt.init(this.clippingPlanes,ot),p=yt.get(E,g.length),p.init(),g.push(p),dt(E,B,0,y.sortObjects),p.finish(),y.sortObjects===!0&&p.sort(z,U);let H=Zt.enabled===!1||Zt.isPresenting===!1||Zt.hasDepthSensing()===!1;H&&ht.addToRenderList(p,E),this.info.render.frame++,X===!0&<.beginShadows();let K=m.state.shadowsArray;Lt.render(K,E,B),X===!0&<.endShadows(),this.info.autoReset===!0&&this.info.reset();let J=p.opaque,St=p.transmissive;if(m.setupLights(y._useLegacyLights),B.isArrayCamera){let At=B.cameras;if(St.length>0)for(let Pt=0,Xt=At.length;Pt<Xt;Pt++){let jt=At[Pt];wt(J,St,E,jt)}H&&ht.render(E);for(let Pt=0,Xt=At.length;Pt<Xt;Pt++){let jt=At[Pt];et(p,E,jt,jt.viewport)}}else St.length>0&&wt(J,St,E,B),H&&ht.render(E),et(p,E,B);w!==null&&(G.updateMultisampleRenderTarget(w),G.updateRenderTargetMipmap(w)),E.isScene===!0&&E.onAfterRender(y,E,B),Wt.resetDefaultState(),P=-1,M=null,b.pop(),b.length>0?(m=b[b.length-1],X===!0&<.setGlobalState(y.clippingPlanes,m.state.camera)):m=null,g.pop(),g.length>0?p=g[g.length-1]:p=null};function dt(E,B,H,K){if(E.visible===!1)return;if(E.layers.test(B.layers)){if(E.isGroup)H=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(B);else if(E.isLight)m.pushLight(E),E.castShadow&&m.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||Ut.intersectsSprite(E)){K&&ct.setFromMatrixPosition(E.matrixWorld).applyMatrix4(xt);let At=Y.update(E),Pt=E.material;Pt.visible&&p.push(E,At,Pt,H,ct.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||Ut.intersectsObject(E))){let At=Y.update(E),Pt=E.material;if(K&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),ct.copy(E.boundingSphere.center)):(At.boundingSphere===null&&At.computeBoundingSphere(),ct.copy(At.boundingSphere.center)),ct.applyMatrix4(E.matrixWorld).applyMatrix4(xt)),Array.isArray(Pt)){let Xt=At.groups;for(let jt=0,Gt=Xt.length;jt<Gt;jt++){let Vt=Xt[jt],xe=Pt[Vt.materialIndex];xe&&xe.visible&&p.push(E,At,xe,H,ct.z,Vt)}}else Pt.visible&&p.push(E,At,Pt,H,ct.z,null)}}let St=E.children;for(let At=0,Pt=St.length;At<Pt;At++)dt(St[At],B,H,K)}function et(E,B,H,K){let J=E.opaque,St=E.transmissive,At=E.transparent;m.setupLightsView(H),X===!0&<.setGlobalState(y.clippingPlanes,H),K&&bt.viewport(v.copy(K)),J.length>0&&ft(J,B,H),St.length>0&&ft(St,B,H),At.length>0&&ft(At,B,H),bt.buffers.depth.setTest(!0),bt.buffers.depth.setMask(!0),bt.buffers.color.setMask(!0),bt.setPolygonOffset(!1)}function wt(E,B,H,K){if((H.isScene===!0?H.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[K.id]===void 0&&(m.state.transmissionRenderTarget[K.id]=new nr(1,1,{generateMipmaps:!0,type:It.has("EXT_color_buffer_half_float")||It.has("EXT_color_buffer_float")?Xc:Fr,minFilter:Ts,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));let St=m.state.transmissionRenderTarget[K.id],At=K.viewport||v;St.setSize(At.z,At.w);let Pt=y.getRenderTarget();y.setRenderTarget(St),y.getClearColor(C),V=y.getClearAlpha(),V<1&&y.setClearColor(16777215,.5),y.clear();let Xt=y.toneMapping;y.toneMapping=Ir;let jt=K.viewport;if(K.viewport!==void 0&&(K.viewport=void 0),m.setupLightsView(K),X===!0&<.setGlobalState(y.clippingPlanes,K),ft(E,H,K),G.updateMultisampleRenderTarget(St),G.updateRenderTargetMipmap(St),It.has("WEBGL_multisampled_render_to_texture")===!1){let Gt=!1;for(let Vt=0,xe=B.length;Vt<xe;Vt++){let Be=B[Vt],sn=Be.object,gn=Be.geometry,ne=Be.material,Kt=Be.group;if(ne.side===tr&&sn.layers.test(K.layers)){let bi=ne.side;ne.side=Nn,ne.needsUpdate=!0,Dt(sn,H,K,gn,ne,Kt),ne.side=bi,ne.needsUpdate=!0,Gt=!0}}Gt===!0&&(G.updateMultisampleRenderTarget(St),G.updateRenderTargetMipmap(St))}y.setRenderTarget(Pt),y.setClearColor(C,V),jt!==void 0&&(K.viewport=jt),y.toneMapping=Xt}function ft(E,B,H){let K=B.isScene===!0?B.overrideMaterial:null;for(let J=0,St=E.length;J<St;J++){let At=E[J],Pt=At.object,Xt=At.geometry,jt=K===null?At.material:K,Gt=At.group;Pt.layers.test(H.layers)&&Dt(Pt,B,H,Xt,jt,Gt)}}function Dt(E,B,H,K,J,St){E.onBeforeRender(y,B,H,K,J,St),E.modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),J.onBeforeRender(y,B,H,K,E,St),J.transparent===!0&&J.side===tr&&J.forceSinglePass===!1?(J.side=Nn,J.needsUpdate=!0,y.renderBufferDirect(H,B,K,J,E,St),J.side=Lr,J.needsUpdate=!0,y.renderBufferDirect(H,B,K,J,E,St),J.side=tr):y.renderBufferDirect(H,B,K,J,E,St),E.onAfterRender(y,B,H,K,J,St)}function zt(E,B,H){B.isScene!==!0&&(B=Rt);let K=Ht.get(E),J=m.state.lights,St=m.state.shadowsArray,At=J.state.version,Pt=tt.getParameters(E,J.state,St,B,H),Xt=tt.getProgramCacheKey(Pt),jt=K.programs;K.environment=E.isMeshStandardMaterial?B.environment:null,K.fog=B.fog,K.envMap=(E.isMeshStandardMaterial?A:$t).get(E.envMap||K.environment),K.envMapRotation=K.environment!==null&&E.envMap===null?B.environmentRotation:E.envMapRotation,jt===void 0&&(E.addEventListener("dispose",mt),jt=new Map,K.programs=jt);let Gt=jt.get(Xt);if(Gt!==void 0){if(K.currentProgram===Gt&&K.lightsStateVersion===At)return Qt(E,Pt),Gt}else Pt.uniforms=tt.getUniforms(E),E.onBuild(H,Pt,y),E.onBeforeCompile(Pt,y),Gt=tt.acquireProgram(Pt,Xt),jt.set(Xt,Gt),K.uniforms=Pt.uniforms;let Vt=K.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(Vt.clippingPlanes=lt.uniform),Qt(E,Pt),K.needsLights=oe(E),K.lightsStateVersion=At,K.needsLights&&(Vt.ambientLightColor.value=J.state.ambient,Vt.lightProbe.value=J.state.probe,Vt.directionalLights.value=J.state.directional,Vt.directionalLightShadows.value=J.state.directionalShadow,Vt.spotLights.value=J.state.spot,Vt.spotLightShadows.value=J.state.spotShadow,Vt.rectAreaLights.value=J.state.rectArea,Vt.ltc_1.value=J.state.rectAreaLTC1,Vt.ltc_2.value=J.state.rectAreaLTC2,Vt.pointLights.value=J.state.point,Vt.pointLightShadows.value=J.state.pointShadow,Vt.hemisphereLights.value=J.state.hemi,Vt.directionalShadowMap.value=J.state.directionalShadowMap,Vt.directionalShadowMatrix.value=J.state.directionalShadowMatrix,Vt.spotShadowMap.value=J.state.spotShadowMap,Vt.spotLightMatrix.value=J.state.spotLightMatrix,Vt.spotLightMap.value=J.state.spotLightMap,Vt.pointShadowMap.value=J.state.pointShadowMap,Vt.pointShadowMatrix.value=J.state.pointShadowMatrix),K.currentProgram=Gt,K.uniformsList=null,Gt}function Nt(E){if(E.uniformsList===null){let B=E.currentProgram.getUniforms();E.uniformsList=Co.seqWithValue(B.seq,E.uniforms)}return E.uniformsList}function Qt(E,B){let H=Ht.get(E);H.outputColorSpace=B.outputColorSpace,H.batching=B.batching,H.instancing=B.instancing,H.instancingColor=B.instancingColor,H.instancingMorph=B.instancingMorph,H.skinning=B.skinning,H.morphTargets=B.morphTargets,H.morphNormals=B.morphNormals,H.morphColors=B.morphColors,H.morphTargetsCount=B.morphTargetsCount,H.numClippingPlanes=B.numClippingPlanes,H.numIntersection=B.numClipIntersection,H.vertexAlphas=B.vertexAlphas,H.vertexTangents=B.vertexTangents,H.toneMapping=B.toneMapping}function he(E,B,H,K,J){B.isScene!==!0&&(B=Rt),G.resetTextureUnits();let St=B.fog,At=K.isMeshStandardMaterial?B.environment:null,Pt=w===null?y.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:Or,Xt=(K.isMeshStandardMaterial?A:$t).get(K.envMap||At),jt=K.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,Gt=!!H.attributes.tangent&&(!!K.normalMap||K.anisotropy>0),Vt=!!H.morphAttributes.position,xe=!!H.morphAttributes.normal,Be=!!H.morphAttributes.color,sn=Ir;K.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(sn=y.toneMapping);let gn=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,ne=gn!==void 0?gn.length:0,Kt=Ht.get(K),bi=m.state.lights;if(X===!0&&(ot===!0||E!==M)){let Wn=E===M&&K.id===P;lt.setState(K,E,Wn)}let ye=!1;K.version===Kt.__version?(Kt.needsLights&&Kt.lightsStateVersion!==bi.state.version||Kt.outputColorSpace!==Pt||J.isBatchedMesh&&Kt.batching===!1||!J.isBatchedMesh&&Kt.batching===!0||J.isInstancedMesh&&Kt.instancing===!1||!J.isInstancedMesh&&Kt.instancing===!0||J.isSkinnedMesh&&Kt.skinning===!1||!J.isSkinnedMesh&&Kt.skinning===!0||J.isInstancedMesh&&Kt.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&Kt.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&Kt.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&Kt.instancingMorph===!1&&J.morphTexture!==null||Kt.envMap!==Xt||K.fog===!0&&Kt.fog!==St||Kt.numClippingPlanes!==void 0&&(Kt.numClippingPlanes!==lt.numPlanes||Kt.numIntersection!==lt.numIntersection)||Kt.vertexAlphas!==jt||Kt.vertexTangents!==Gt||Kt.morphTargets!==Vt||Kt.morphNormals!==xe||Kt.morphColors!==Be||Kt.toneMapping!==sn||Kt.morphTargetsCount!==ne)&&(ye=!0):(ye=!0,Kt.__version=K.version);let Xr=Kt.currentProgram;ye===!0&&(Xr=zt(K,B,J));let Ed=!1,Yo=!1,ou=!1,on=Xr.getUniforms(),lr=Kt.uniforms;if(bt.useProgram(Xr.program)&&(Ed=!0,Yo=!0,ou=!0),K.id!==P&&(P=K.id,Yo=!0),Ed||M!==E){on.setValue(q,"projectionMatrix",E.projectionMatrix),on.setValue(q,"viewMatrix",E.matrixWorldInverse);let Wn=on.map.cameraPosition;Wn!==void 0&&Wn.setValue(q,ct.setFromMatrixPosition(E.matrixWorld)),Ft.logarithmicDepthBuffer&&on.setValue(q,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(K.isMeshPhongMaterial||K.isMeshToonMaterial||K.isMeshLambertMaterial||K.isMeshBasicMaterial||K.isMeshStandardMaterial||K.isShaderMaterial)&&on.setValue(q,"isOrthographic",E.isOrthographicCamera===!0),M!==E&&(M=E,Yo=!0,ou=!0)}if(J.isSkinnedMesh){on.setOptional(q,J,"bindMatrix"),on.setOptional(q,J,"bindMatrixInverse");let Wn=J.skeleton;Wn&&(Wn.boneTexture===null&&Wn.computeBoneTexture(),on.setValue(q,"boneTexture",Wn.boneTexture,G))}J.isBatchedMesh&&(on.setOptional(q,J,"batchingTexture"),on.setValue(q,"batchingTexture",J._matricesTexture,G));let au=H.morphAttributes;if((au.position!==void 0||au.normal!==void 0||au.color!==void 0)&&vt.update(J,H,Xr),(Yo||Kt.receiveShadow!==J.receiveShadow)&&(Kt.receiveShadow=J.receiveShadow,on.setValue(q,"receiveShadow",J.receiveShadow)),K.isMeshGouraudMaterial&&K.envMap!==null&&(lr.envMap.value=Xt,lr.flipEnvMap.value=Xt.isCubeTexture&&Xt.isRenderTargetTexture===!1?-1:1),K.isMeshStandardMaterial&&K.envMap===null&&B.environment!==null&&(lr.envMapIntensity.value=B.environmentIntensity),Yo&&(on.setValue(q,"toneMappingExposure",y.toneMappingExposure),Kt.needsLights&&me(lr,ou),St&&K.fog===!0&&it.refreshFogUniforms(lr,St),it.refreshMaterialUniforms(lr,K,Z,W,m.state.transmissionRenderTarget[E.id]),Co.upload(q,Nt(Kt),lr,G)),K.isShaderMaterial&&K.uniformsNeedUpdate===!0&&(Co.upload(q,Nt(Kt),lr,G),K.uniformsNeedUpdate=!1),K.isSpriteMaterial&&on.setValue(q,"center",J.center),on.setValue(q,"modelViewMatrix",J.modelViewMatrix),on.setValue(q,"normalMatrix",J.normalMatrix),on.setValue(q,"modelMatrix",J.matrixWorld),K.isShaderMaterial||K.isRawShaderMaterial){let Wn=K.uniformsGroups;for(let lu=0,G0=Wn.length;lu<G0;lu++){let Td=Wn[lu];qt.update(Td,Xr),qt.bind(Td,Xr)}}return Xr}function me(E,B){E.ambientLightColor.needsUpdate=B,E.lightProbe.needsUpdate=B,E.directionalLights.needsUpdate=B,E.directionalLightShadows.needsUpdate=B,E.pointLights.needsUpdate=B,E.pointLightShadows.needsUpdate=B,E.spotLights.needsUpdate=B,E.spotLightShadows.needsUpdate=B,E.rectAreaLights.needsUpdate=B,E.hemisphereLights.needsUpdate=B}function oe(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,B,H){Ht.get(E.texture).__webglTexture=B,Ht.get(E.depthTexture).__webglTexture=H;let K=Ht.get(E);K.__hasExternalTextures=!0,K.__autoAllocateDepthBuffer=H===void 0,K.__autoAllocateDepthBuffer||It.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),K.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(E,B){let H=Ht.get(E);H.__webglFramebuffer=B,H.__useDefaultFramebuffer=B===void 0},this.setRenderTarget=function(E,B=0,H=0){w=E,D=B,T=H;let K=!0,J=null,St=!1,At=!1;if(E){let Xt=Ht.get(E);Xt.__useDefaultFramebuffer!==void 0?(bt.bindFramebuffer(q.FRAMEBUFFER,null),K=!1):Xt.__webglFramebuffer===void 0?G.setupRenderTarget(E):Xt.__hasExternalTextures&&G.rebindTextures(E,Ht.get(E.texture).__webglTexture,Ht.get(E.depthTexture).__webglTexture);let jt=E.texture;(jt.isData3DTexture||jt.isDataArrayTexture||jt.isCompressedArrayTexture)&&(At=!0);let Gt=Ht.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(Gt[B])?J=Gt[B][H]:J=Gt[B],St=!0):E.samples>0&&G.useMultisampledRTT(E)===!1?J=Ht.get(E).__webglMultisampledFramebuffer:Array.isArray(Gt)?J=Gt[H]:J=Gt,v.copy(E.viewport),I.copy(E.scissor),N=E.scissorTest}else v.copy(R).multiplyScalar(Z).floor(),I.copy(at).multiplyScalar(Z).floor(),N=_t;if(bt.bindFramebuffer(q.FRAMEBUFFER,J)&&K&&bt.drawBuffers(E,J),bt.viewport(v),bt.scissor(I),bt.setScissorTest(N),St){let Xt=Ht.get(E.texture);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,q.TEXTURE_CUBE_MAP_POSITIVE_X+B,Xt.__webglTexture,H)}else if(At){let Xt=Ht.get(E.texture),jt=B||0;q.framebufferTextureLayer(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,Xt.__webglTexture,H||0,jt)}P=-1},this.readRenderTargetPixels=function(E,B,H,K,J,St,At){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Pt=Ht.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&At!==void 0&&(Pt=Pt[At]),Pt){bt.bindFramebuffer(q.FRAMEBUFFER,Pt);try{let Xt=E.texture,jt=Xt.format,Gt=Xt.type;if(!Ft.textureFormatReadable(jt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ft.textureTypeReadable(Gt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=E.width-K&&H>=0&&H<=E.height-J&&q.readPixels(B,H,K,J,Tt.convert(jt),Tt.convert(Gt),St)}finally{let Xt=w!==null?Ht.get(w).__webglFramebuffer:null;bt.bindFramebuffer(q.FRAMEBUFFER,Xt)}}},this.copyFramebufferToTexture=function(E,B,H=0){let K=Math.pow(2,-H),J=Math.floor(B.image.width*K),St=Math.floor(B.image.height*K);G.setTexture2D(B,0),q.copyTexSubImage2D(q.TEXTURE_2D,H,0,0,E.x,E.y,J,St),bt.unbindTexture()},this.copyTextureToTexture=function(E,B,H,K=0){let J=B.image.width,St=B.image.height,At=Tt.convert(H.format),Pt=Tt.convert(H.type);G.setTexture2D(H,0),q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,H.flipY),q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),q.pixelStorei(q.UNPACK_ALIGNMENT,H.unpackAlignment),B.isDataTexture?q.texSubImage2D(q.TEXTURE_2D,K,E.x,E.y,J,St,At,Pt,B.image.data):B.isCompressedTexture?q.compressedTexSubImage2D(q.TEXTURE_2D,K,E.x,E.y,B.mipmaps[0].width,B.mipmaps[0].height,At,B.mipmaps[0].data):q.texSubImage2D(q.TEXTURE_2D,K,E.x,E.y,At,Pt,B.image),K===0&&H.generateMipmaps&&q.generateMipmap(q.TEXTURE_2D),bt.unbindTexture()},this.copyTextureToTexture3D=function(E,B,H,K,J=0){let St=E.max.x-E.min.x,At=E.max.y-E.min.y,Pt=E.max.z-E.min.z,Xt=Tt.convert(K.format),jt=Tt.convert(K.type),Gt;if(K.isData3DTexture)G.setTexture3D(K,0),Gt=q.TEXTURE_3D;else if(K.isDataArrayTexture||K.isCompressedArrayTexture)G.setTexture2DArray(K,0),Gt=q.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,K.flipY),q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),q.pixelStorei(q.UNPACK_ALIGNMENT,K.unpackAlignment);let Vt=q.getParameter(q.UNPACK_ROW_LENGTH),xe=q.getParameter(q.UNPACK_IMAGE_HEIGHT),Be=q.getParameter(q.UNPACK_SKIP_PIXELS),sn=q.getParameter(q.UNPACK_SKIP_ROWS),gn=q.getParameter(q.UNPACK_SKIP_IMAGES),ne=H.isCompressedTexture?H.mipmaps[J]:H.image;q.pixelStorei(q.UNPACK_ROW_LENGTH,ne.width),q.pixelStorei(q.UNPACK_IMAGE_HEIGHT,ne.height),q.pixelStorei(q.UNPACK_SKIP_PIXELS,E.min.x),q.pixelStorei(q.UNPACK_SKIP_ROWS,E.min.y),q.pixelStorei(q.UNPACK_SKIP_IMAGES,E.min.z),H.isDataTexture||H.isData3DTexture?q.texSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,jt,ne.data):K.isCompressedArrayTexture?q.compressedTexSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,ne.data):q.texSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,jt,ne),q.pixelStorei(q.UNPACK_ROW_LENGTH,Vt),q.pixelStorei(q.UNPACK_IMAGE_HEIGHT,xe),q.pixelStorei(q.UNPACK_SKIP_PIXELS,Be),q.pixelStorei(q.UNPACK_SKIP_ROWS,sn),q.pixelStorei(q.UNPACK_SKIP_IMAGES,gn),J===0&&K.generateMipmaps&&q.generateMipmap(Gt),bt.unbindTexture()},this.initTexture=function(E){E.isCubeTexture?G.setTextureCube(E,0):E.isData3DTexture?G.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?G.setTexture2DArray(E,0):G.setTexture2D(E,0),bt.unbindTexture()},this.resetState=function(){D=0,T=0,w=null,bt.reset(),Wt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return er}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===$f?"display-p3":"srgb",e.unpackColorSpace=Se.workingColorSpace===Yc?"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 kc=class r{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new ge(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}}},zc=class extends mn{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 ir,this.environmentIntensity=1,this.environmentRotation=new ir,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 Ff=class extends Ds{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new ge(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}},E_=new Ue,Nf=new Ac,pc=new Lo,mc=new nt,Vc=class extends mn{constructor(t=new Ni,e=new Ff){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(),pc.copy(n.boundingSphere),pc.applyMatrix4(i),pc.radius+=s,t.ray.intersectsSphere(pc)===!1)return;E_.copy(i).invert(),Nf.copy(t.ray).applyMatrix4(E_);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=n.index,f=n.attributes.position;if(c!==null){let d=Math.max(0,o.start),u=Math.min(c.count,o.start+o.count);for(let _=d,p=u;_<p;_++){let m=c.getX(_);mc.fromBufferAttribute(f,m),T_(mc,m,l,i,t,e,this)}}else{let d=Math.max(0,o.start),u=Math.min(f.count,o.start+o.count);for(let _=d,p=u;_<p;_++)mc.fromBufferAttribute(f,_),T_(mc,_,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 T_(r,t,e,n,i,s,o){let a=Nf.distanceSqToPoint(r);if(a<e){let l=new nt;Nf.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 gc(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 oE(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var No=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_(){}},Uf=class extends No{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:Lg,endingEnd:Lg}}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 Fg:s=t,a=2*e-n;break;case Ng: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 Fg:o=t,l=2*n-e;break;case Ng:o=1,l=n+i[1]-i[0];break;default:o=t-1,l=e}let c=(n-e)*.5,h=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(l-n),this._offsetPrev=s*h,this._offsetNext=o*h}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,h=this._offsetPrev,f=this._offsetNext,d=this._weightPrev,u=this._weightNext,_=(n-e)/(i-e),p=_*_,m=p*_,g=-d*m+2*d*p-d*_,b=(1+d)*m+(-1.5-2*d)*p+(-.5+d)*_+1,y=(-1-u)*m+(1.5+u)*p+.5*_,S=u*m-u*p;for(let D=0;D!==a;++D)s[D]=g*o[h+D]+b*o[c+D]+y*o[l+D]+S*o[f+D];return s}},Of=class extends No{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,h=(n-e)/(i-e),f=1-h;for(let d=0;d!==a;++d)s[d]=o[c+d]*f+o[l+d]*h;return s}},Bf=class extends No{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},xi=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=gc(e,this.TimeBufferType),this.values=gc(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:gc(t.times,Array),values:gc(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new Bf(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Of(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Uf(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case xc:e=this.InterpolantFactoryMethodDiscrete;break;case vc:e=this.InterpolantFactoryMethodLinear;break;case Uh: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 xc;case this.InterpolantFactoryMethodLinear:return vc;case this.InterpolantFactoryMethodSmooth:return Uh}}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&&oE(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()===Uh,s=t.length-1,o=1;for(let a=1;a<s;++a){let l=!1,c=t[a],h=t[a+1];if(c!==h&&(a!==1||c!==t[0]))if(i)l=!0;else{let f=a*n,d=f-n,u=f+n;for(let _=0;_!==n;++_){let p=e[f+_];if(p!==e[d+_]||p!==e[u+_]){l=!0;break}}}if(l){if(a!==o){t[o]=t[a];let f=a*n,d=o*n;for(let u=0;u!==n;++u)e[d+u]=e[f+u]}++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}};xi.prototype.TimeBufferType=Float32Array;xi.prototype.ValueBufferType=Float32Array;xi.prototype.DefaultInterpolation=vc;var Cs=class extends xi{};Cs.prototype.ValueTypeName="bool";Cs.prototype.ValueBufferType=Array;Cs.prototype.DefaultInterpolation=xc;Cs.prototype.InterpolantFactoryMethodLinear=void 0;Cs.prototype.InterpolantFactoryMethodSmooth=void 0;var kf=class extends xi{};kf.prototype.ValueTypeName="color";var zf=class extends xi{};zf.prototype.ValueTypeName="number";var Vf=class extends No{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 h=c+a;c!==h;c+=4)Ur.slerpFlat(s,0,o,c-a,o,c,l);return s}},Ua=class extends xi{InterpolantFactoryMethodLinear(t){return new Vf(this.times,this.values,this.getValueSize(),t)}};Ua.prototype.ValueTypeName="quaternion";Ua.prototype.DefaultInterpolation=vc;Ua.prototype.InterpolantFactoryMethodSmooth=void 0;var Rs=class extends xi{};Rs.prototype.ValueTypeName="string";Rs.prototype.ValueBufferType=Array;Rs.prototype.DefaultInterpolation=xc;Rs.prototype.InterpolantFactoryMethodLinear=void 0;Rs.prototype.InterpolantFactoryMethodSmooth=void 0;var Hf=class extends xi{};Hf.prototype.ValueTypeName="vector";var Gf=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(h){a++,s===!1&&i.onStart!==void 0&&i.onStart(h,o,a),s=!0},this.itemEnd=function(h){o++,i.onProgress!==void 0&&i.onProgress(h,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,f){return c.push(h,f),this},this.removeHandler=function(h){let f=c.indexOf(h);return f!==-1&&c.splice(f,2),this},this.getHandler=function(h){for(let f=0,d=c.length;f<d;f+=2){let u=c[f],_=c[f+1];if(u.global&&(u.lastIndex=0),u.test(h))return _}return null}}},aE=new Gf,Wf=class{constructor(t){this.manager=t!==void 0?t:aE,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}};Wf.DEFAULT_MATERIAL_NAME="__DEFAULT";var Hc=class extends mn{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new ge(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}},Gc=class extends Hc{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(mn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ge(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}},uf=new Ue,A_=new nt,D_=new nt,Xf=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new _e(512,512),this.map=null,this.mapPass=null,this.matrix=new Ue,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Na,this._frameExtents=new _e(1,1),this._viewportCount=1,this._viewports=[new Qe(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;A_.setFromMatrixPosition(t.matrixWorld),e.position.copy(A_),D_.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(D_),e.updateMatrixWorld(),uf.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(uf),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(uf)}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 Yf=class extends Xf{constructor(){super(new Nc(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},Ps=class extends Hc{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(mn.DEFAULT_UP),this.updateMatrix(),this.target=new mn,this.shadow=new Yf}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}};var jf="\\[\\]\\.:\\/",lE=new RegExp("["+jf+"]","g"),Qf="[^"+jf+"]",cE="[^"+jf.replace("\\.","")+"]",uE=/((?:WC+[\/:])*)/.source.replace("WC",Qf),hE=/(WCOD+)?/.source.replace("WCOD",cE),fE=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Qf),dE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Qf),pE=new RegExp("^"+uE+hE+fE+dE+"$"),mE=["material","materials","bones","map"],qf=class{constructor(t,e,n){let i=n||De.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()}},De=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(lE,"")}static parseTrackName(t){let e=pE.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);mE.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 h=0;h<t.length;h++)if(t[h].name===c){c=h;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}};De.Composite=qf;De.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};De.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};De.prototype.GetterByBindingType=[De.prototype._getValue_direct,De.prototype._getValue_array,De.prototype._getValue_arrayElement,De.prototype._getValue_toArray];De.prototype.SetterByBindingTypeAndVersioning=[[De.prototype._setValue_direct,De.prototype._setValue_direct_setNeedsUpdate,De.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[De.prototype._setValue_array,De.prototype._setValue_array_setNeedsUpdate,De.prototype._setValue_array_setMatrixWorldNeedsUpdate],[De.prototype._setValue_arrayElement,De.prototype._setValue_arrayElement_setNeedsUpdate,De.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[De.prototype._setValue_fromArray,De.prototype._setValue_fromArray_setNeedsUpdate,De.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var tA=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Zf}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Zf);var J_=()=>{var r=new Cr;function t(){let e=document.querySelector("#canvas"),n=new Bc({canvas:e,antialias:!0,alpha:!0}),i=new zc,s=new An(18);s.near=1,s.far=2e3,s.position.z=-10,n.outputColorSpace=Qn,n.shadowMap.enabled=!0,n.shadowMap.type=Jf,i.fog=new kc(3741705,9,15),i.add(r);function o(){let h=new Gc(16777215,41378,1),f=new Ps(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(h);let d=[];d[0]=new Ps(16777215,1),d[0].position.set(1,0,0),d[1]=new Ps(11460838,1),d[1].position.set(.75,1,.5),d[2]=new Ps(14277490,1),d[2].position.set(-.75,-1,.5),i.add(d[0]),i.add(d[1]),i.add(d[2])}function a(h,f){let d=new Ni,u=[],_=[],p=f||25,m=p/2;for(let y=0;y<(h||7e3);y++){let S=Math.random()*p-m,D=Math.random()*p-m,T=Math.random()*p-m;u.push(S,D,T),_.push(Math.random()*.9+.1)}d.setAttribute("position",new ni(u,3)),d.setAttribute("opacity",new ni(_,1)),d.computeBoundingSphere();let g=new ri({vertexShader:`
|
|
3821
|
+
}`,If=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 ii,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 ri({vertexShader:nE,fragmentShader:iE,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new _i(new Fc(20,20),i)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},Lf=class extends Nr{constructor(t,e){super();let n=this,i=null,s=1,o=null,a="local-floor",l=1,c=null,h=null,f=null,d=null,u=null,_=null,p=new If,m=e.getContextAttributes(),g=null,b=null,y=[],S=[],D=new _e,T=null,w=new An;w.layers.enable(1),w.viewport=new Qe;let P=new An;P.layers.enable(2),P.viewport=new Qe;let M=[w,P],v=new Pf;v.layers.enable(1),v.layers.enable(2);let I=null,N=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let ot=y[X];return ot===void 0&&(ot=new Ia,y[X]=ot),ot.getTargetRaySpace()},this.getControllerGrip=function(X){let ot=y[X];return ot===void 0&&(ot=new Ia,y[X]=ot),ot.getGripSpace()},this.getHand=function(X){let ot=y[X];return ot===void 0&&(ot=new Ia,y[X]=ot),ot.getHandSpace()};function C(X){let ot=S.indexOf(X.inputSource);if(ot===-1)return;let xt=y[ot];xt!==void 0&&(xt.update(X.inputSource,X.frame,c||o),xt.dispatchEvent({type:X.type,data:X.inputSource}))}function V(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",V),i.removeEventListener("inputsourceschange",$);for(let X=0;X<y.length;X++){let ot=S[X];ot!==null&&(S[X]=null,y[X].disconnect(ot))}I=null,N=null,p.reset(),t.setRenderTarget(g),u=null,d=null,f=null,i=null,b=null,Ut.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){a=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(X){c=X},this.getBaseLayer=function(){return d!==null?d:u},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(g=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",V),i.addEventListener("inputsourceschange",$),m.xrCompatible!==!0&&await e.makeXRCompatible(),T=t.getPixelRatio(),t.getSize(D),i.renderState.layers===void 0){let ot={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};u=new XRWebGLLayer(i,e,ot),i.updateRenderState({baseLayer:u}),t.setPixelRatio(1),t.setSize(u.framebufferWidth,u.framebufferHeight,!1),b=new nr(u.framebufferWidth,u.framebufferHeight,{format:Fi,type:Fr,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let ot=null,xt=null,ct=null;m.depth&&(ct=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,ot=m.stencil?La:Ao,xt=m.stencil?Oa:Io);let Rt={colorFormat:e.RGBA8,depthFormat:ct,scaleFactor:s};f=new XRWebGLBinding(i,e),d=f.createProjectionLayer(Rt),i.updateRenderState({layers:[d]}),t.setPixelRatio(1),t.setSize(d.textureWidth,d.textureHeight,!1),b=new nr(d.textureWidth,d.textureHeight,{format:Fi,type:Fr,depthTexture:new Oc(d.textureWidth,d.textureHeight,xt,void 0,void 0,void 0,void 0,void 0,void 0,ot),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await i.requestReferenceSpace(a),Ut.setContext(i),Ut.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function $(X){for(let ot=0;ot<X.removed.length;ot++){let xt=X.removed[ot],ct=S.indexOf(xt);ct>=0&&(S[ct]=null,y[ct].disconnect(xt))}for(let ot=0;ot<X.added.length;ot++){let xt=X.added[ot],ct=S.indexOf(xt);if(ct===-1){for(let kt=0;kt<y.length;kt++)if(kt>=S.length){S.push(xt),ct=kt;break}else if(S[kt]===null){S[kt]=xt,ct=kt;break}if(ct===-1)break}let Rt=y[ct];Rt&&Rt.connect(xt)}}let W=new nt,Z=new nt;function z(X,ot,xt){W.setFromMatrixPosition(ot.matrixWorld),Z.setFromMatrixPosition(xt.matrixWorld);let ct=W.distanceTo(Z),Rt=ot.projectionMatrix.elements,kt=xt.projectionMatrix.elements,q=Rt[14]/(Rt[10]-1),Jt=Rt[14]/(Rt[10]+1),It=(Rt[9]+1)/Rt[5],Ft=(Rt[9]-1)/Rt[5],bt=(Rt[8]-1)/Rt[0],Et=(kt[8]+1)/kt[0],Ht=q*bt,G=q*Et,$t=ct/(-bt+Et),A=$t*-bt;ot.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(A),X.translateZ($t),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert();let x=q+$t,F=Jt+$t,Y=Ht-A,tt=G+(ct-A),it=It*Jt/F*x,yt=Ft*Jt/F*x;X.projectionMatrix.makePerspective(Y,tt,it,yt,x,F),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}function U(X,ot){ot===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(ot.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(i===null)return;p.texture!==null&&(X.near=p.depthNear,X.far=p.depthFar),v.near=P.near=w.near=X.near,v.far=P.far=w.far=X.far,(I!==v.near||N!==v.far)&&(i.updateRenderState({depthNear:v.near,depthFar:v.far}),I=v.near,N=v.far,w.near=I,w.far=N,P.near=I,P.far=N,w.updateProjectionMatrix(),P.updateProjectionMatrix(),X.updateProjectionMatrix());let ot=X.parent,xt=v.cameras;U(v,ot);for(let ct=0;ct<xt.length;ct++)U(xt[ct],ot);xt.length===2?z(v,w,P):v.projectionMatrix.copy(w.projectionMatrix),R(X,v,ot)};function R(X,ot,xt){xt===null?X.matrix.copy(ot.matrixWorld):(X.matrix.copy(xt.matrixWorld),X.matrix.invert(),X.matrix.multiply(ot.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(ot.projectionMatrix),X.projectionMatrixInverse.copy(ot.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=_f*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return v},this.getFoveation=function(){if(!(d===null&&u===null))return l},this.setFoveation=function(X){l=X,d!==null&&(d.fixedFoveation=X),u!==null&&u.fixedFoveation!==void 0&&(u.fixedFoveation=X)},this.hasDepthSensing=function(){return p.texture!==null};let at=null;function _t(X,ot){if(h=ot.getViewerPose(c||o),_=ot,h!==null){let xt=h.views;u!==null&&(t.setRenderTargetFramebuffer(b,u.framebuffer),t.setRenderTarget(b));let ct=!1;xt.length!==v.cameras.length&&(v.cameras.length=0,ct=!0);for(let kt=0;kt<xt.length;kt++){let q=xt[kt],Jt=null;if(u!==null)Jt=u.getViewport(q);else{let Ft=f.getViewSubImage(d,q);Jt=Ft.viewport,kt===0&&(t.setRenderTargetTextures(b,Ft.colorTexture,d.ignoreDepthValues?void 0:Ft.depthStencilTexture),t.setRenderTarget(b))}let It=M[kt];It===void 0&&(It=new An,It.layers.enable(kt),It.viewport=new Qe,M[kt]=It),It.matrix.fromArray(q.transform.matrix),It.matrix.decompose(It.position,It.quaternion,It.scale),It.projectionMatrix.fromArray(q.projectionMatrix),It.projectionMatrixInverse.copy(It.projectionMatrix).invert(),It.viewport.set(Jt.x,Jt.y,Jt.width,Jt.height),kt===0&&(v.matrix.copy(It.matrix),v.matrix.decompose(v.position,v.quaternion,v.scale)),ct===!0&&v.cameras.push(It)}let Rt=i.enabledFeatures;if(Rt&&Rt.includes("depth-sensing")){let kt=f.getDepthInformation(xt[0]);kt&&kt.isValid&&kt.texture&&p.init(t,kt,i.renderState)}}for(let xt=0;xt<y.length;xt++){let ct=S[xt],Rt=y[xt];ct!==null&&Rt!==void 0&&Rt.update(ct,ot,c||o)}p.render(t,v),at&&at(X,ot),ot.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ot}),_=null}let Ut=new G_;Ut.setAnimationLoop(_t),this.setAnimationLoop=function(X){at=X},this.dispose=function(){}}},Ss=new ir,rE=new Ue;function sE(r,t){function e(m,g){m.matrixAutoUpdate===!0&&m.updateMatrix(),g.value.copy(m.matrix)}function n(m,g){g.color.getRGB(m.fogColor.value,H_(r)),g.isFog?(m.fogNear.value=g.near,m.fogFar.value=g.far):g.isFogExp2&&(m.fogDensity.value=g.density)}function i(m,g,b,y,S){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(m,g):g.isMeshToonMaterial?(s(m,g),f(m,g)):g.isMeshPhongMaterial?(s(m,g),h(m,g)):g.isMeshStandardMaterial?(s(m,g),d(m,g),g.isMeshPhysicalMaterial&&u(m,g,S)):g.isMeshMatcapMaterial?(s(m,g),_(m,g)):g.isMeshDepthMaterial?s(m,g):g.isMeshDistanceMaterial?(s(m,g),p(m,g)):g.isMeshNormalMaterial?s(m,g):g.isLineBasicMaterial?(o(m,g),g.isLineDashedMaterial&&a(m,g)):g.isPointsMaterial?l(m,g,b,y):g.isSpriteMaterial?c(m,g):g.isShadowMaterial?(m.color.value.copy(g.color),m.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(m,g){m.opacity.value=g.opacity,g.color&&m.diffuse.value.copy(g.color),g.emissive&&m.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(m.map.value=g.map,e(g.map,m.mapTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,e(g.alphaMap,m.alphaMapTransform)),g.bumpMap&&(m.bumpMap.value=g.bumpMap,e(g.bumpMap,m.bumpMapTransform),m.bumpScale.value=g.bumpScale,g.side===Nn&&(m.bumpScale.value*=-1)),g.normalMap&&(m.normalMap.value=g.normalMap,e(g.normalMap,m.normalMapTransform),m.normalScale.value.copy(g.normalScale),g.side===Nn&&m.normalScale.value.negate()),g.displacementMap&&(m.displacementMap.value=g.displacementMap,e(g.displacementMap,m.displacementMapTransform),m.displacementScale.value=g.displacementScale,m.displacementBias.value=g.displacementBias),g.emissiveMap&&(m.emissiveMap.value=g.emissiveMap,e(g.emissiveMap,m.emissiveMapTransform)),g.specularMap&&(m.specularMap.value=g.specularMap,e(g.specularMap,m.specularMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let b=t.get(g),y=b.envMap,S=b.envMapRotation;if(y&&(m.envMap.value=y,Ss.copy(S),Ss.x*=-1,Ss.y*=-1,Ss.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Ss.y*=-1,Ss.z*=-1),m.envMapRotation.value.setFromMatrix4(rE.makeRotationFromEuler(Ss)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap){m.lightMap.value=g.lightMap;let D=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=g.lightMapIntensity*D,e(g.lightMap,m.lightMapTransform)}g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity,e(g.aoMap,m.aoMapTransform))}function o(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,g.map&&(m.map.value=g.map,e(g.map,m.mapTransform))}function a(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function l(m,g,b,y){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*b,m.scale.value=y*.5,g.map&&(m.map.value=g.map,e(g.map,m.uvTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,e(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function c(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map,e(g.map,m.mapTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,e(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function h(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function f(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function d(m,g){m.metalness.value=g.metalness,g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap,e(g.metalnessMap,m.metalnessMapTransform)),m.roughness.value=g.roughness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap,e(g.roughnessMap,m.roughnessMapTransform)),g.envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function u(m,g,b){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap,e(g.sheenColorMap,m.sheenColorMapTransform)),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap,e(g.sheenRoughnessMap,m.sheenRoughnessMapTransform))),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap,e(g.clearcoatMap,m.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,e(g.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(m.clearcoatNormalMap.value=g.clearcoatNormalMap,e(g.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Nn&&m.clearcoatNormalScale.value.negate())),g.dispersion>0&&(m.dispersion.value=g.dispersion),g.iridescence>0&&(m.iridescence.value=g.iridescence,m.iridescenceIOR.value=g.iridescenceIOR,m.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(m.iridescenceMap.value=g.iridescenceMap,e(g.iridescenceMap,m.iridescenceMapTransform)),g.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=g.iridescenceThicknessMap,e(g.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=b.texture,m.transmissionSamplerSize.value.set(b.width,b.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap,e(g.transmissionMap,m.transmissionMapTransform)),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap,e(g.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(m.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(m.anisotropyMap.value=g.anisotropyMap,e(g.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap,e(g.specularColorMap,m.specularColorMapTransform)),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap,e(g.specularIntensityMap,m.specularIntensityMapTransform))}function _(m,g){g.matcap&&(m.matcap.value=g.matcap)}function p(m,g){let b=t.get(g).light;m.referencePosition.value.setFromMatrixPosition(b.matrixWorld),m.nearDistance.value=b.shadow.camera.near,m.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function oE(r,t,e,n){let i={},s={},o=[],a=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,y){let S=y.program;n.uniformBlockBinding(b,S)}function c(b,y){let S=i[b.id];S===void 0&&(_(b),S=h(b),i[b.id]=S,b.addEventListener("dispose",m));let D=y.program;n.updateUBOMapping(b,D);let T=t.render.frame;s[b.id]!==T&&(d(b),s[b.id]=T)}function h(b){let y=f();b.__bindingPointIndex=y;let S=r.createBuffer(),D=b.__size,T=b.usage;return r.bindBuffer(r.UNIFORM_BUFFER,S),r.bufferData(r.UNIFORM_BUFFER,D,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,y,S),S}function f(){for(let b=0;b<a;b++)if(o.indexOf(b)===-1)return o.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(b){let y=i[b.id],S=b.uniforms,D=b.__cache;r.bindBuffer(r.UNIFORM_BUFFER,y);for(let T=0,w=S.length;T<w;T++){let P=Array.isArray(S[T])?S[T]:[S[T]];for(let M=0,v=P.length;M<v;M++){let I=P[M];if(u(I,T,M,D)===!0){let N=I.__offset,C=Array.isArray(I.value)?I.value:[I.value],V=0;for(let $=0;$<C.length;$++){let W=C[$],Z=p(W);typeof W=="number"||typeof W=="boolean"?(I.__data[0]=W,r.bufferSubData(r.UNIFORM_BUFFER,N+V,I.__data)):W.isMatrix3?(I.__data[0]=W.elements[0],I.__data[1]=W.elements[1],I.__data[2]=W.elements[2],I.__data[3]=0,I.__data[4]=W.elements[3],I.__data[5]=W.elements[4],I.__data[6]=W.elements[5],I.__data[7]=0,I.__data[8]=W.elements[6],I.__data[9]=W.elements[7],I.__data[10]=W.elements[8],I.__data[11]=0):(W.toArray(I.__data,V),V+=Z.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,N,I.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function u(b,y,S,D){let T=b.value,w=y+"_"+S;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 _(b){let y=b.uniforms,S=0,D=16;for(let w=0,P=y.length;w<P;w++){let M=Array.isArray(y[w])?y[w]:[y[w]];for(let v=0,I=M.length;v<I;v++){let N=M[v],C=Array.isArray(N.value)?N.value:[N.value];for(let V=0,$=C.length;V<$;V++){let W=C[V],Z=p(W),z=S%D;z!==0&&D-z<Z.boundary&&(S+=D-z),N.__data=new Float32Array(Z.storage/Float32Array.BYTES_PER_ELEMENT),N.__offset=S,S+=Z.storage}}}let T=S%D;return T>0&&(S+=D-T),b.__size=S,b.__cache={},this}function p(b){let y={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(y.boundary=4,y.storage=4):b.isVector2?(y.boundary=8,y.storage=8):b.isVector3||b.isColor?(y.boundary=16,y.storage=12):b.isVector4?(y.boundary=16,y.storage=16):b.isMatrix3?(y.boundary=48,y.storage=48):b.isMatrix4?(y.boundary=64,y.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),y}function m(b){let y=b.target;y.removeEventListener("dispose",m);let S=o.indexOf(y.__bindingPointIndex);o.splice(S,1),r.deleteBuffer(i[y.id]),delete i[y.id],delete s[y.id]}function g(){for(let b in i)r.deleteBuffer(i[b]);o=[],i={},s={}}return{bind:l,update:c,dispose:g}}var Bc=class{constructor(t={}){let{canvas:e=pS(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:f=!1}=t;this.isWebGLRenderer=!0;let d;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=o;let u=new Uint32Array(4),_=new Int32Array(4),p=null,m=null,g=[],b=[];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=Qn,this._useLegacyLights=!1,this.toneMapping=Ir,this.toneMappingExposure=1;let y=this,S=!1,D=0,T=0,w=null,P=-1,M=null,v=new Qe,I=new Qe,N=null,C=new ge(0),V=0,$=e.width,W=e.height,Z=1,z=null,U=null,R=new Qe(0,0,$,W),at=new Qe(0,0,$,W),_t=!1,Ut=new Na,X=!1,ot=!1,xt=new Ue,ct=new nt,Rt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function kt(){return w===null?Z:1}let q=n;function Jt(E,B){return e.getContext(E,B)}try{let E={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:f};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Zf}`),e.addEventListener("webglcontextlost",k,!1),e.addEventListener("webglcontextrestored",Q,!1),e.addEventListener("webglcontextcreationerror",st,!1),q===null){let B="webgl2";if(q=Jt(B,E),q===null)throw Jt(B)?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 It,Ft,bt,Et,Ht,G,$t,A,x,F,Y,tt,it,yt,pt,lt,Lt,ht,vt,Yt,ut,Tt,Wt,qt;function ce(){It=new Ew(q),It.init(),Tt=new tE(q,It),Ft=new vw(q,It,t,Tt),bt=new j1(q),Et=new Dw(q),Ht=new z1,G=new Q1(q,It,bt,Ht,Ft,Tt,Et),$t=new Sw(y),A=new ww(y),x=new NS(q),Wt=new _w(q,x),F=new Tw(q,x,Et,Wt),Y=new Rw(q,F,x,Et),vt=new Cw(q,Ft,G),lt=new yw(Ht),tt=new k1(y,$t,A,It,Ft,Wt,lt),it=new sE(y,Ht),yt=new H1,pt=new Z1(It),ht=new gw(y,$t,A,bt,Y,d,l),Lt=new K1(y,Y,Ft),qt=new oE(q,Et,Ft,bt),Yt=new xw(q,It,Et),ut=new Aw(q,It,Et),Et.programs=tt.programs,y.capabilities=Ft,y.extensions=It,y.properties=Ht,y.renderLists=yt,y.shadowMap=Lt,y.state=bt,y.info=Et}ce();let Zt=new Lf(y,q);this.xr=Zt,this.getContext=function(){return q},this.getContextAttributes=function(){return q.getContextAttributes()},this.forceContextLoss=function(){let E=It.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){let E=It.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(E){E!==void 0&&(Z=E,this.setSize($,W,!1))},this.getSize=function(E){return E.set($,W)},this.setSize=function(E,B,H=!0){if(Zt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=E,W=B,e.width=Math.floor(E*Z),e.height=Math.floor(B*Z),H===!0&&(e.style.width=E+"px",e.style.height=B+"px"),this.setViewport(0,0,E,B)},this.getDrawingBufferSize=function(E){return E.set($*Z,W*Z).floor()},this.setDrawingBufferSize=function(E,B,H){$=E,W=B,Z=H,e.width=Math.floor(E*H),e.height=Math.floor(B*H),this.setViewport(0,0,E,B)},this.getCurrentViewport=function(E){return E.copy(v)},this.getViewport=function(E){return E.copy(R)},this.setViewport=function(E,B,H,K){E.isVector4?R.set(E.x,E.y,E.z,E.w):R.set(E,B,H,K),bt.viewport(v.copy(R).multiplyScalar(Z).round())},this.getScissor=function(E){return E.copy(at)},this.setScissor=function(E,B,H,K){E.isVector4?at.set(E.x,E.y,E.z,E.w):at.set(E,B,H,K),bt.scissor(I.copy(at).multiplyScalar(Z).round())},this.getScissorTest=function(){return _t},this.setScissorTest=function(E){bt.setScissorTest(_t=E)},this.setOpaqueSort=function(E){z=E},this.setTransparentSort=function(E){U=E},this.getClearColor=function(E){return E.copy(ht.getClearColor())},this.setClearColor=function(){ht.setClearColor.apply(ht,arguments)},this.getClearAlpha=function(){return ht.getClearAlpha()},this.setClearAlpha=function(){ht.setClearAlpha.apply(ht,arguments)},this.clear=function(E=!0,B=!0,H=!0){let K=0;if(E){let J=!1;if(w!==null){let St=w.texture.format;J=St===B_||St===O_||St===U_}if(J){let St=w.texture.type,At=St===Fr||St===Io||St===I_||St===Oa||St===F_||St===N_,Pt=ht.getClearColor(),Xt=ht.getClearAlpha(),jt=Pt.r,Gt=Pt.g,Vt=Pt.b;At?(u[0]=jt,u[1]=Gt,u[2]=Vt,u[3]=Xt,q.clearBufferuiv(q.COLOR,0,u)):(_[0]=jt,_[1]=Gt,_[2]=Vt,_[3]=Xt,q.clearBufferiv(q.COLOR,0,_))}else K|=q.COLOR_BUFFER_BIT}B&&(K|=q.DEPTH_BUFFER_BIT),H&&(K|=q.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),q.clear(K)},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",k,!1),e.removeEventListener("webglcontextrestored",Q,!1),e.removeEventListener("webglcontextcreationerror",st,!1),yt.dispose(),pt.dispose(),Ht.dispose(),$t.dispose(),A.dispose(),Y.dispose(),Wt.dispose(),qt.dispose(),tt.dispose(),Zt.dispose(),Zt.removeEventListener("sessionstart",rt),Zt.removeEventListener("sessionend",O),j.stop()};function k(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function Q(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;let E=Et.autoReset,B=Lt.enabled,H=Lt.autoUpdate,K=Lt.needsUpdate,J=Lt.type;ce(),Et.autoReset=E,Lt.enabled=B,Lt.autoUpdate=H,Lt.needsUpdate=K,Lt.type=J}function st(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function mt(E){let B=E.target;B.removeEventListener("dispose",mt),gt(B)}function gt(E){Bt(E),Ht.remove(E)}function Bt(E){let B=Ht.get(E).programs;B!==void 0&&(B.forEach(function(H){tt.releaseProgram(H)}),E.isShaderMaterial&&tt.releaseShaderCache(E))}this.renderBufferDirect=function(E,B,H,K,J,St){B===null&&(B=Rt);let At=J.isMesh&&J.matrixWorld.determinant()<0,Pt=he(E,B,H,K,J);bt.setMaterial(K,At);let Xt=H.index,jt=1;if(K.wireframe===!0){if(Xt=F.getWireframeAttribute(H),Xt===void 0)return;jt=2}let Gt=H.drawRange,Vt=H.attributes.position,xe=Gt.start*jt,Be=(Gt.start+Gt.count)*jt;St!==null&&(xe=Math.max(xe,St.start*jt),Be=Math.min(Be,(St.start+St.count)*jt)),Xt!==null?(xe=Math.max(xe,0),Be=Math.min(Be,Xt.count)):Vt!=null&&(xe=Math.max(xe,0),Be=Math.min(Be,Vt.count));let sn=Be-xe;if(sn<0||sn===1/0)return;Wt.setup(J,K,Pt,H,Xt);let gn,ne=Yt;if(Xt!==null&&(gn=x.get(Xt),ne=ut,ne.setIndex(gn)),J.isMesh)K.wireframe===!0?(bt.setLineWidth(K.wireframeLinewidth*kt()),ne.setMode(q.LINES)):ne.setMode(q.TRIANGLES);else if(J.isLine){let Kt=K.linewidth;Kt===void 0&&(Kt=1),bt.setLineWidth(Kt*kt()),J.isLineSegments?ne.setMode(q.LINES):J.isLineLoop?ne.setMode(q.LINE_LOOP):ne.setMode(q.LINE_STRIP)}else J.isPoints?ne.setMode(q.POINTS):J.isSprite&&ne.setMode(q.TRIANGLES);if(J.isBatchedMesh)J._multiDrawInstances!==null?ne.renderMultiDrawInstances(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount,J._multiDrawInstances):ne.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else if(J.isInstancedMesh)ne.renderInstances(xe,sn,J.count);else if(H.isInstancedBufferGeometry){let Kt=H._maxInstanceCount!==void 0?H._maxInstanceCount:1/0,bi=Math.min(H.instanceCount,Kt);ne.renderInstances(xe,sn,bi)}else ne.render(xe,sn)};function ee(E,B,H){E.transparent===!0&&E.side===tr&&E.forceSinglePass===!1?(E.side=Nn,E.needsUpdate=!0,zt(E,B,H),E.side=Lr,E.needsUpdate=!0,zt(E,B,H),E.side=tr):zt(E,B,H)}this.compile=function(E,B,H=null){H===null&&(H=E),m=pt.get(H),m.init(B),b.push(m),H.traverseVisible(function(J){J.isLight&&J.layers.test(B.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),E!==H&&E.traverseVisible(function(J){J.isLight&&J.layers.test(B.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),m.setupLights(y._useLegacyLights);let K=new Set;return E.traverse(function(J){let St=J.material;if(St)if(Array.isArray(St))for(let At=0;At<St.length;At++){let Pt=St[At];ee(Pt,H,J),K.add(Pt)}else ee(St,H,J),K.add(St)}),b.pop(),m=null,K},this.compileAsync=function(E,B,H=null){let K=this.compile(E,B,H);return new Promise(J=>{function St(){if(K.forEach(function(At){Ht.get(At).currentProgram.isReady()&&K.delete(At)}),K.size===0){J(E);return}setTimeout(St,10)}It.get("KHR_parallel_shader_compile")!==null?St():setTimeout(St,10)})};let Mt=null;function L(E){Mt&&Mt(E)}function rt(){j.stop()}function O(){j.start()}let j=new G_;j.setAnimationLoop(L),typeof self<"u"&&j.setContext(self),this.setAnimationLoop=function(E){Mt=E,Zt.setAnimationLoop(E),E===null?j.stop():j.start()},Zt.addEventListener("sessionstart",rt),Zt.addEventListener("sessionend",O),this.render=function(E,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),Zt.enabled===!0&&Zt.isPresenting===!0&&(Zt.cameraAutoUpdate===!0&&Zt.updateCamera(B),B=Zt.getCamera()),E.isScene===!0&&E.onBeforeRender(y,E,B,w),m=pt.get(E,b.length),m.init(B),b.push(m),xt.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),Ut.setFromProjectionMatrix(xt),ot=this.localClippingEnabled,X=lt.init(this.clippingPlanes,ot),p=yt.get(E,g.length),p.init(),g.push(p),dt(E,B,0,y.sortObjects),p.finish(),y.sortObjects===!0&&p.sort(z,U);let H=Zt.enabled===!1||Zt.isPresenting===!1||Zt.hasDepthSensing()===!1;H&&ht.addToRenderList(p,E),this.info.render.frame++,X===!0&<.beginShadows();let K=m.state.shadowsArray;Lt.render(K,E,B),X===!0&<.endShadows(),this.info.autoReset===!0&&this.info.reset();let J=p.opaque,St=p.transmissive;if(m.setupLights(y._useLegacyLights),B.isArrayCamera){let At=B.cameras;if(St.length>0)for(let Pt=0,Xt=At.length;Pt<Xt;Pt++){let jt=At[Pt];wt(J,St,E,jt)}H&&ht.render(E);for(let Pt=0,Xt=At.length;Pt<Xt;Pt++){let jt=At[Pt];et(p,E,jt,jt.viewport)}}else St.length>0&&wt(J,St,E,B),H&&ht.render(E),et(p,E,B);w!==null&&(G.updateMultisampleRenderTarget(w),G.updateRenderTargetMipmap(w)),E.isScene===!0&&E.onAfterRender(y,E,B),Wt.resetDefaultState(),P=-1,M=null,b.pop(),b.length>0?(m=b[b.length-1],X===!0&<.setGlobalState(y.clippingPlanes,m.state.camera)):m=null,g.pop(),g.length>0?p=g[g.length-1]:p=null};function dt(E,B,H,K){if(E.visible===!1)return;if(E.layers.test(B.layers)){if(E.isGroup)H=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(B);else if(E.isLight)m.pushLight(E),E.castShadow&&m.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||Ut.intersectsSprite(E)){K&&ct.setFromMatrixPosition(E.matrixWorld).applyMatrix4(xt);let At=Y.update(E),Pt=E.material;Pt.visible&&p.push(E,At,Pt,H,ct.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||Ut.intersectsObject(E))){let At=Y.update(E),Pt=E.material;if(K&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),ct.copy(E.boundingSphere.center)):(At.boundingSphere===null&&At.computeBoundingSphere(),ct.copy(At.boundingSphere.center)),ct.applyMatrix4(E.matrixWorld).applyMatrix4(xt)),Array.isArray(Pt)){let Xt=At.groups;for(let jt=0,Gt=Xt.length;jt<Gt;jt++){let Vt=Xt[jt],xe=Pt[Vt.materialIndex];xe&&xe.visible&&p.push(E,At,xe,H,ct.z,Vt)}}else Pt.visible&&p.push(E,At,Pt,H,ct.z,null)}}let St=E.children;for(let At=0,Pt=St.length;At<Pt;At++)dt(St[At],B,H,K)}function et(E,B,H,K){let J=E.opaque,St=E.transmissive,At=E.transparent;m.setupLightsView(H),X===!0&<.setGlobalState(y.clippingPlanes,H),K&&bt.viewport(v.copy(K)),J.length>0&&ft(J,B,H),St.length>0&&ft(St,B,H),At.length>0&&ft(At,B,H),bt.buffers.depth.setTest(!0),bt.buffers.depth.setMask(!0),bt.buffers.color.setMask(!0),bt.setPolygonOffset(!1)}function wt(E,B,H,K){if((H.isScene===!0?H.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[K.id]===void 0&&(m.state.transmissionRenderTarget[K.id]=new nr(1,1,{generateMipmaps:!0,type:It.has("EXT_color_buffer_half_float")||It.has("EXT_color_buffer_float")?Xc:Fr,minFilter:Ts,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));let St=m.state.transmissionRenderTarget[K.id],At=K.viewport||v;St.setSize(At.z,At.w);let Pt=y.getRenderTarget();y.setRenderTarget(St),y.getClearColor(C),V=y.getClearAlpha(),V<1&&y.setClearColor(16777215,.5),y.clear();let Xt=y.toneMapping;y.toneMapping=Ir;let jt=K.viewport;if(K.viewport!==void 0&&(K.viewport=void 0),m.setupLightsView(K),X===!0&<.setGlobalState(y.clippingPlanes,K),ft(E,H,K),G.updateMultisampleRenderTarget(St),G.updateRenderTargetMipmap(St),It.has("WEBGL_multisampled_render_to_texture")===!1){let Gt=!1;for(let Vt=0,xe=B.length;Vt<xe;Vt++){let Be=B[Vt],sn=Be.object,gn=Be.geometry,ne=Be.material,Kt=Be.group;if(ne.side===tr&&sn.layers.test(K.layers)){let bi=ne.side;ne.side=Nn,ne.needsUpdate=!0,Dt(sn,H,K,gn,ne,Kt),ne.side=bi,ne.needsUpdate=!0,Gt=!0}}Gt===!0&&(G.updateMultisampleRenderTarget(St),G.updateRenderTargetMipmap(St))}y.setRenderTarget(Pt),y.setClearColor(C,V),jt!==void 0&&(K.viewport=jt),y.toneMapping=Xt}function ft(E,B,H){let K=B.isScene===!0?B.overrideMaterial:null;for(let J=0,St=E.length;J<St;J++){let At=E[J],Pt=At.object,Xt=At.geometry,jt=K===null?At.material:K,Gt=At.group;Pt.layers.test(H.layers)&&Dt(Pt,B,H,Xt,jt,Gt)}}function Dt(E,B,H,K,J,St){E.onBeforeRender(y,B,H,K,J,St),E.modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),J.onBeforeRender(y,B,H,K,E,St),J.transparent===!0&&J.side===tr&&J.forceSinglePass===!1?(J.side=Nn,J.needsUpdate=!0,y.renderBufferDirect(H,B,K,J,E,St),J.side=Lr,J.needsUpdate=!0,y.renderBufferDirect(H,B,K,J,E,St),J.side=tr):y.renderBufferDirect(H,B,K,J,E,St),E.onAfterRender(y,B,H,K,J,St)}function zt(E,B,H){B.isScene!==!0&&(B=Rt);let K=Ht.get(E),J=m.state.lights,St=m.state.shadowsArray,At=J.state.version,Pt=tt.getParameters(E,J.state,St,B,H),Xt=tt.getProgramCacheKey(Pt),jt=K.programs;K.environment=E.isMeshStandardMaterial?B.environment:null,K.fog=B.fog,K.envMap=(E.isMeshStandardMaterial?A:$t).get(E.envMap||K.environment),K.envMapRotation=K.environment!==null&&E.envMap===null?B.environmentRotation:E.envMapRotation,jt===void 0&&(E.addEventListener("dispose",mt),jt=new Map,K.programs=jt);let Gt=jt.get(Xt);if(Gt!==void 0){if(K.currentProgram===Gt&&K.lightsStateVersion===At)return Qt(E,Pt),Gt}else Pt.uniforms=tt.getUniforms(E),E.onBuild(H,Pt,y),E.onBeforeCompile(Pt,y),Gt=tt.acquireProgram(Pt,Xt),jt.set(Xt,Gt),K.uniforms=Pt.uniforms;let Vt=K.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(Vt.clippingPlanes=lt.uniform),Qt(E,Pt),K.needsLights=oe(E),K.lightsStateVersion=At,K.needsLights&&(Vt.ambientLightColor.value=J.state.ambient,Vt.lightProbe.value=J.state.probe,Vt.directionalLights.value=J.state.directional,Vt.directionalLightShadows.value=J.state.directionalShadow,Vt.spotLights.value=J.state.spot,Vt.spotLightShadows.value=J.state.spotShadow,Vt.rectAreaLights.value=J.state.rectArea,Vt.ltc_1.value=J.state.rectAreaLTC1,Vt.ltc_2.value=J.state.rectAreaLTC2,Vt.pointLights.value=J.state.point,Vt.pointLightShadows.value=J.state.pointShadow,Vt.hemisphereLights.value=J.state.hemi,Vt.directionalShadowMap.value=J.state.directionalShadowMap,Vt.directionalShadowMatrix.value=J.state.directionalShadowMatrix,Vt.spotShadowMap.value=J.state.spotShadowMap,Vt.spotLightMatrix.value=J.state.spotLightMatrix,Vt.spotLightMap.value=J.state.spotLightMap,Vt.pointShadowMap.value=J.state.pointShadowMap,Vt.pointShadowMatrix.value=J.state.pointShadowMatrix),K.currentProgram=Gt,K.uniformsList=null,Gt}function Nt(E){if(E.uniformsList===null){let B=E.currentProgram.getUniforms();E.uniformsList=Co.seqWithValue(B.seq,E.uniforms)}return E.uniformsList}function Qt(E,B){let H=Ht.get(E);H.outputColorSpace=B.outputColorSpace,H.batching=B.batching,H.instancing=B.instancing,H.instancingColor=B.instancingColor,H.instancingMorph=B.instancingMorph,H.skinning=B.skinning,H.morphTargets=B.morphTargets,H.morphNormals=B.morphNormals,H.morphColors=B.morphColors,H.morphTargetsCount=B.morphTargetsCount,H.numClippingPlanes=B.numClippingPlanes,H.numIntersection=B.numClipIntersection,H.vertexAlphas=B.vertexAlphas,H.vertexTangents=B.vertexTangents,H.toneMapping=B.toneMapping}function he(E,B,H,K,J){B.isScene!==!0&&(B=Rt),G.resetTextureUnits();let St=B.fog,At=K.isMeshStandardMaterial?B.environment:null,Pt=w===null?y.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:Or,Xt=(K.isMeshStandardMaterial?A:$t).get(K.envMap||At),jt=K.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,Gt=!!H.attributes.tangent&&(!!K.normalMap||K.anisotropy>0),Vt=!!H.morphAttributes.position,xe=!!H.morphAttributes.normal,Be=!!H.morphAttributes.color,sn=Ir;K.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(sn=y.toneMapping);let gn=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,ne=gn!==void 0?gn.length:0,Kt=Ht.get(K),bi=m.state.lights;if(X===!0&&(ot===!0||E!==M)){let Wn=E===M&&K.id===P;lt.setState(K,E,Wn)}let ye=!1;K.version===Kt.__version?(Kt.needsLights&&Kt.lightsStateVersion!==bi.state.version||Kt.outputColorSpace!==Pt||J.isBatchedMesh&&Kt.batching===!1||!J.isBatchedMesh&&Kt.batching===!0||J.isInstancedMesh&&Kt.instancing===!1||!J.isInstancedMesh&&Kt.instancing===!0||J.isSkinnedMesh&&Kt.skinning===!1||!J.isSkinnedMesh&&Kt.skinning===!0||J.isInstancedMesh&&Kt.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&Kt.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&Kt.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&Kt.instancingMorph===!1&&J.morphTexture!==null||Kt.envMap!==Xt||K.fog===!0&&Kt.fog!==St||Kt.numClippingPlanes!==void 0&&(Kt.numClippingPlanes!==lt.numPlanes||Kt.numIntersection!==lt.numIntersection)||Kt.vertexAlphas!==jt||Kt.vertexTangents!==Gt||Kt.morphTargets!==Vt||Kt.morphNormals!==xe||Kt.morphColors!==Be||Kt.toneMapping!==sn||Kt.morphTargetsCount!==ne)&&(ye=!0):(ye=!0,Kt.__version=K.version);let Xr=Kt.currentProgram;ye===!0&&(Xr=zt(K,B,J));let Ed=!1,Yo=!1,ou=!1,on=Xr.getUniforms(),lr=Kt.uniforms;if(bt.useProgram(Xr.program)&&(Ed=!0,Yo=!0,ou=!0),K.id!==P&&(P=K.id,Yo=!0),Ed||M!==E){on.setValue(q,"projectionMatrix",E.projectionMatrix),on.setValue(q,"viewMatrix",E.matrixWorldInverse);let Wn=on.map.cameraPosition;Wn!==void 0&&Wn.setValue(q,ct.setFromMatrixPosition(E.matrixWorld)),Ft.logarithmicDepthBuffer&&on.setValue(q,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(K.isMeshPhongMaterial||K.isMeshToonMaterial||K.isMeshLambertMaterial||K.isMeshBasicMaterial||K.isMeshStandardMaterial||K.isShaderMaterial)&&on.setValue(q,"isOrthographic",E.isOrthographicCamera===!0),M!==E&&(M=E,Yo=!0,ou=!0)}if(J.isSkinnedMesh){on.setOptional(q,J,"bindMatrix"),on.setOptional(q,J,"bindMatrixInverse");let Wn=J.skeleton;Wn&&(Wn.boneTexture===null&&Wn.computeBoneTexture(),on.setValue(q,"boneTexture",Wn.boneTexture,G))}J.isBatchedMesh&&(on.setOptional(q,J,"batchingTexture"),on.setValue(q,"batchingTexture",J._matricesTexture,G));let au=H.morphAttributes;if((au.position!==void 0||au.normal!==void 0||au.color!==void 0)&&vt.update(J,H,Xr),(Yo||Kt.receiveShadow!==J.receiveShadow)&&(Kt.receiveShadow=J.receiveShadow,on.setValue(q,"receiveShadow",J.receiveShadow)),K.isMeshGouraudMaterial&&K.envMap!==null&&(lr.envMap.value=Xt,lr.flipEnvMap.value=Xt.isCubeTexture&&Xt.isRenderTargetTexture===!1?-1:1),K.isMeshStandardMaterial&&K.envMap===null&&B.environment!==null&&(lr.envMapIntensity.value=B.environmentIntensity),Yo&&(on.setValue(q,"toneMappingExposure",y.toneMappingExposure),Kt.needsLights&&me(lr,ou),St&&K.fog===!0&&it.refreshFogUniforms(lr,St),it.refreshMaterialUniforms(lr,K,Z,W,m.state.transmissionRenderTarget[E.id]),Co.upload(q,Nt(Kt),lr,G)),K.isShaderMaterial&&K.uniformsNeedUpdate===!0&&(Co.upload(q,Nt(Kt),lr,G),K.uniformsNeedUpdate=!1),K.isSpriteMaterial&&on.setValue(q,"center",J.center),on.setValue(q,"modelViewMatrix",J.modelViewMatrix),on.setValue(q,"normalMatrix",J.normalMatrix),on.setValue(q,"modelMatrix",J.matrixWorld),K.isShaderMaterial||K.isRawShaderMaterial){let Wn=K.uniformsGroups;for(let lu=0,W0=Wn.length;lu<W0;lu++){let Td=Wn[lu];qt.update(Td,Xr),qt.bind(Td,Xr)}}return Xr}function me(E,B){E.ambientLightColor.needsUpdate=B,E.lightProbe.needsUpdate=B,E.directionalLights.needsUpdate=B,E.directionalLightShadows.needsUpdate=B,E.pointLights.needsUpdate=B,E.pointLightShadows.needsUpdate=B,E.spotLights.needsUpdate=B,E.spotLightShadows.needsUpdate=B,E.rectAreaLights.needsUpdate=B,E.hemisphereLights.needsUpdate=B}function oe(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,B,H){Ht.get(E.texture).__webglTexture=B,Ht.get(E.depthTexture).__webglTexture=H;let K=Ht.get(E);K.__hasExternalTextures=!0,K.__autoAllocateDepthBuffer=H===void 0,K.__autoAllocateDepthBuffer||It.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),K.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(E,B){let H=Ht.get(E);H.__webglFramebuffer=B,H.__useDefaultFramebuffer=B===void 0},this.setRenderTarget=function(E,B=0,H=0){w=E,D=B,T=H;let K=!0,J=null,St=!1,At=!1;if(E){let Xt=Ht.get(E);Xt.__useDefaultFramebuffer!==void 0?(bt.bindFramebuffer(q.FRAMEBUFFER,null),K=!1):Xt.__webglFramebuffer===void 0?G.setupRenderTarget(E):Xt.__hasExternalTextures&&G.rebindTextures(E,Ht.get(E.texture).__webglTexture,Ht.get(E.depthTexture).__webglTexture);let jt=E.texture;(jt.isData3DTexture||jt.isDataArrayTexture||jt.isCompressedArrayTexture)&&(At=!0);let Gt=Ht.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(Gt[B])?J=Gt[B][H]:J=Gt[B],St=!0):E.samples>0&&G.useMultisampledRTT(E)===!1?J=Ht.get(E).__webglMultisampledFramebuffer:Array.isArray(Gt)?J=Gt[H]:J=Gt,v.copy(E.viewport),I.copy(E.scissor),N=E.scissorTest}else v.copy(R).multiplyScalar(Z).floor(),I.copy(at).multiplyScalar(Z).floor(),N=_t;if(bt.bindFramebuffer(q.FRAMEBUFFER,J)&&K&&bt.drawBuffers(E,J),bt.viewport(v),bt.scissor(I),bt.setScissorTest(N),St){let Xt=Ht.get(E.texture);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,q.TEXTURE_CUBE_MAP_POSITIVE_X+B,Xt.__webglTexture,H)}else if(At){let Xt=Ht.get(E.texture),jt=B||0;q.framebufferTextureLayer(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,Xt.__webglTexture,H||0,jt)}P=-1},this.readRenderTargetPixels=function(E,B,H,K,J,St,At){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Pt=Ht.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&At!==void 0&&(Pt=Pt[At]),Pt){bt.bindFramebuffer(q.FRAMEBUFFER,Pt);try{let Xt=E.texture,jt=Xt.format,Gt=Xt.type;if(!Ft.textureFormatReadable(jt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ft.textureTypeReadable(Gt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=E.width-K&&H>=0&&H<=E.height-J&&q.readPixels(B,H,K,J,Tt.convert(jt),Tt.convert(Gt),St)}finally{let Xt=w!==null?Ht.get(w).__webglFramebuffer:null;bt.bindFramebuffer(q.FRAMEBUFFER,Xt)}}},this.copyFramebufferToTexture=function(E,B,H=0){let K=Math.pow(2,-H),J=Math.floor(B.image.width*K),St=Math.floor(B.image.height*K);G.setTexture2D(B,0),q.copyTexSubImage2D(q.TEXTURE_2D,H,0,0,E.x,E.y,J,St),bt.unbindTexture()},this.copyTextureToTexture=function(E,B,H,K=0){let J=B.image.width,St=B.image.height,At=Tt.convert(H.format),Pt=Tt.convert(H.type);G.setTexture2D(H,0),q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,H.flipY),q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),q.pixelStorei(q.UNPACK_ALIGNMENT,H.unpackAlignment),B.isDataTexture?q.texSubImage2D(q.TEXTURE_2D,K,E.x,E.y,J,St,At,Pt,B.image.data):B.isCompressedTexture?q.compressedTexSubImage2D(q.TEXTURE_2D,K,E.x,E.y,B.mipmaps[0].width,B.mipmaps[0].height,At,B.mipmaps[0].data):q.texSubImage2D(q.TEXTURE_2D,K,E.x,E.y,At,Pt,B.image),K===0&&H.generateMipmaps&&q.generateMipmap(q.TEXTURE_2D),bt.unbindTexture()},this.copyTextureToTexture3D=function(E,B,H,K,J=0){let St=E.max.x-E.min.x,At=E.max.y-E.min.y,Pt=E.max.z-E.min.z,Xt=Tt.convert(K.format),jt=Tt.convert(K.type),Gt;if(K.isData3DTexture)G.setTexture3D(K,0),Gt=q.TEXTURE_3D;else if(K.isDataArrayTexture||K.isCompressedArrayTexture)G.setTexture2DArray(K,0),Gt=q.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,K.flipY),q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),q.pixelStorei(q.UNPACK_ALIGNMENT,K.unpackAlignment);let Vt=q.getParameter(q.UNPACK_ROW_LENGTH),xe=q.getParameter(q.UNPACK_IMAGE_HEIGHT),Be=q.getParameter(q.UNPACK_SKIP_PIXELS),sn=q.getParameter(q.UNPACK_SKIP_ROWS),gn=q.getParameter(q.UNPACK_SKIP_IMAGES),ne=H.isCompressedTexture?H.mipmaps[J]:H.image;q.pixelStorei(q.UNPACK_ROW_LENGTH,ne.width),q.pixelStorei(q.UNPACK_IMAGE_HEIGHT,ne.height),q.pixelStorei(q.UNPACK_SKIP_PIXELS,E.min.x),q.pixelStorei(q.UNPACK_SKIP_ROWS,E.min.y),q.pixelStorei(q.UNPACK_SKIP_IMAGES,E.min.z),H.isDataTexture||H.isData3DTexture?q.texSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,jt,ne.data):K.isCompressedArrayTexture?q.compressedTexSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,ne.data):q.texSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,jt,ne),q.pixelStorei(q.UNPACK_ROW_LENGTH,Vt),q.pixelStorei(q.UNPACK_IMAGE_HEIGHT,xe),q.pixelStorei(q.UNPACK_SKIP_PIXELS,Be),q.pixelStorei(q.UNPACK_SKIP_ROWS,sn),q.pixelStorei(q.UNPACK_SKIP_IMAGES,gn),J===0&&K.generateMipmaps&&q.generateMipmap(Gt),bt.unbindTexture()},this.initTexture=function(E){E.isCubeTexture?G.setTextureCube(E,0):E.isData3DTexture?G.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?G.setTexture2DArray(E,0):G.setTexture2D(E,0),bt.unbindTexture()},this.resetState=function(){D=0,T=0,w=null,bt.reset(),Wt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return er}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===$f?"display-p3":"srgb",e.unpackColorSpace=Se.workingColorSpace===Yc?"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 kc=class r{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new ge(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}}},zc=class extends mn{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 ir,this.environmentIntensity=1,this.environmentRotation=new ir,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 Ff=class extends Ds{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new ge(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}},E_=new Ue,Nf=new Ac,pc=new Lo,mc=new nt,Vc=class extends mn{constructor(t=new Ni,e=new Ff){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(),pc.copy(n.boundingSphere),pc.applyMatrix4(i),pc.radius+=s,t.ray.intersectsSphere(pc)===!1)return;E_.copy(i).invert(),Nf.copy(t.ray).applyMatrix4(E_);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=n.index,f=n.attributes.position;if(c!==null){let d=Math.max(0,o.start),u=Math.min(c.count,o.start+o.count);for(let _=d,p=u;_<p;_++){let m=c.getX(_);mc.fromBufferAttribute(f,m),T_(mc,m,l,i,t,e,this)}}else{let d=Math.max(0,o.start),u=Math.min(f.count,o.start+o.count);for(let _=d,p=u;_<p;_++)mc.fromBufferAttribute(f,_),T_(mc,_,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 T_(r,t,e,n,i,s,o){let a=Nf.distanceSqToPoint(r);if(a<e){let l=new nt;Nf.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 gc(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 aE(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var No=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_(){}},Uf=class extends No{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:Lg,endingEnd:Lg}}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 Fg:s=t,a=2*e-n;break;case Ng: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 Fg:o=t,l=2*n-e;break;case Ng:o=1,l=n+i[1]-i[0];break;default:o=t-1,l=e}let c=(n-e)*.5,h=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(l-n),this._offsetPrev=s*h,this._offsetNext=o*h}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,h=this._offsetPrev,f=this._offsetNext,d=this._weightPrev,u=this._weightNext,_=(n-e)/(i-e),p=_*_,m=p*_,g=-d*m+2*d*p-d*_,b=(1+d)*m+(-1.5-2*d)*p+(-.5+d)*_+1,y=(-1-u)*m+(1.5+u)*p+.5*_,S=u*m-u*p;for(let D=0;D!==a;++D)s[D]=g*o[h+D]+b*o[c+D]+y*o[l+D]+S*o[f+D];return s}},Of=class extends No{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,h=(n-e)/(i-e),f=1-h;for(let d=0;d!==a;++d)s[d]=o[c+d]*f+o[l+d]*h;return s}},Bf=class extends No{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},xi=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=gc(e,this.TimeBufferType),this.values=gc(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:gc(t.times,Array),values:gc(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new Bf(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Of(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Uf(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case xc:e=this.InterpolantFactoryMethodDiscrete;break;case vc:e=this.InterpolantFactoryMethodLinear;break;case Uh: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 xc;case this.InterpolantFactoryMethodLinear:return vc;case this.InterpolantFactoryMethodSmooth:return Uh}}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&&aE(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()===Uh,s=t.length-1,o=1;for(let a=1;a<s;++a){let l=!1,c=t[a],h=t[a+1];if(c!==h&&(a!==1||c!==t[0]))if(i)l=!0;else{let f=a*n,d=f-n,u=f+n;for(let _=0;_!==n;++_){let p=e[f+_];if(p!==e[d+_]||p!==e[u+_]){l=!0;break}}}if(l){if(a!==o){t[o]=t[a];let f=a*n,d=o*n;for(let u=0;u!==n;++u)e[d+u]=e[f+u]}++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}};xi.prototype.TimeBufferType=Float32Array;xi.prototype.ValueBufferType=Float32Array;xi.prototype.DefaultInterpolation=vc;var Cs=class extends xi{};Cs.prototype.ValueTypeName="bool";Cs.prototype.ValueBufferType=Array;Cs.prototype.DefaultInterpolation=xc;Cs.prototype.InterpolantFactoryMethodLinear=void 0;Cs.prototype.InterpolantFactoryMethodSmooth=void 0;var kf=class extends xi{};kf.prototype.ValueTypeName="color";var zf=class extends xi{};zf.prototype.ValueTypeName="number";var Vf=class extends No{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 h=c+a;c!==h;c+=4)Ur.slerpFlat(s,0,o,c-a,o,c,l);return s}},Ua=class extends xi{InterpolantFactoryMethodLinear(t){return new Vf(this.times,this.values,this.getValueSize(),t)}};Ua.prototype.ValueTypeName="quaternion";Ua.prototype.DefaultInterpolation=vc;Ua.prototype.InterpolantFactoryMethodSmooth=void 0;var Rs=class extends xi{};Rs.prototype.ValueTypeName="string";Rs.prototype.ValueBufferType=Array;Rs.prototype.DefaultInterpolation=xc;Rs.prototype.InterpolantFactoryMethodLinear=void 0;Rs.prototype.InterpolantFactoryMethodSmooth=void 0;var Hf=class extends xi{};Hf.prototype.ValueTypeName="vector";var Gf=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(h){a++,s===!1&&i.onStart!==void 0&&i.onStart(h,o,a),s=!0},this.itemEnd=function(h){o++,i.onProgress!==void 0&&i.onProgress(h,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,f){return c.push(h,f),this},this.removeHandler=function(h){let f=c.indexOf(h);return f!==-1&&c.splice(f,2),this},this.getHandler=function(h){for(let f=0,d=c.length;f<d;f+=2){let u=c[f],_=c[f+1];if(u.global&&(u.lastIndex=0),u.test(h))return _}return null}}},lE=new Gf,Wf=class{constructor(t){this.manager=t!==void 0?t:lE,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}};Wf.DEFAULT_MATERIAL_NAME="__DEFAULT";var Hc=class extends mn{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new ge(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}},Gc=class extends Hc{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(mn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ge(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}},uf=new Ue,A_=new nt,D_=new nt,Xf=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new _e(512,512),this.map=null,this.mapPass=null,this.matrix=new Ue,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Na,this._frameExtents=new _e(1,1),this._viewportCount=1,this._viewports=[new Qe(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;A_.setFromMatrixPosition(t.matrixWorld),e.position.copy(A_),D_.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(D_),e.updateMatrixWorld(),uf.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(uf),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(uf)}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 Yf=class extends Xf{constructor(){super(new Nc(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},Ps=class extends Hc{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(mn.DEFAULT_UP),this.updateMatrix(),this.target=new mn,this.shadow=new Yf}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}};var jf="\\[\\]\\.:\\/",cE=new RegExp("["+jf+"]","g"),Qf="[^"+jf+"]",uE="[^"+jf.replace("\\.","")+"]",hE=/((?:WC+[\/:])*)/.source.replace("WC",Qf),fE=/(WCOD+)?/.source.replace("WCOD",uE),dE=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Qf),pE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Qf),mE=new RegExp("^"+hE+fE+dE+pE+"$"),gE=["material","materials","bones","map"],qf=class{constructor(t,e,n){let i=n||De.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()}},De=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(cE,"")}static parseTrackName(t){let e=mE.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);gE.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 h=0;h<t.length;h++)if(t[h].name===c){c=h;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}};De.Composite=qf;De.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};De.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};De.prototype.GetterByBindingType=[De.prototype._getValue_direct,De.prototype._getValue_array,De.prototype._getValue_arrayElement,De.prototype._getValue_toArray];De.prototype.SetterByBindingTypeAndVersioning=[[De.prototype._setValue_direct,De.prototype._setValue_direct_setNeedsUpdate,De.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[De.prototype._setValue_array,De.prototype._setValue_array_setNeedsUpdate,De.prototype._setValue_array_setMatrixWorldNeedsUpdate],[De.prototype._setValue_arrayElement,De.prototype._setValue_arrayElement_setNeedsUpdate,De.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[De.prototype._setValue_fromArray,De.prototype._setValue_fromArray_setNeedsUpdate,De.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var eA=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Zf}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Zf);var J_=()=>{var r=new Cr;function t(){let e=document.querySelector("#canvas"),n=new Bc({canvas:e,antialias:!0,alpha:!0}),i=new zc,s=new An(18);s.near=1,s.far=2e3,s.position.z=-10,n.outputColorSpace=Qn,n.shadowMap.enabled=!0,n.shadowMap.type=Jf,i.fog=new kc(3741705,9,15),i.add(r);function o(){let h=new Gc(16777215,41378,1),f=new Ps(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(h);let d=[];d[0]=new Ps(16777215,1),d[0].position.set(1,0,0),d[1]=new Ps(11460838,1),d[1].position.set(.75,1,.5),d[2]=new Ps(14277490,1),d[2].position.set(-.75,-1,.5),i.add(d[0]),i.add(d[1]),i.add(d[2])}function a(h,f){let d=new Ni,u=[],_=[],p=f||25,m=p/2;for(let y=0;y<(h||7e3);y++){let S=Math.random()*p-m,D=Math.random()*p-m,T=Math.random()*p-m;u.push(S,D,T),_.push(Math.random()*.9+.1)}d.setAttribute("position",new ni(u,3)),d.setAttribute("opacity",new ni(_,1)),d.computeBoundingSphere();let g=new ri({vertexShader:`
|
|
3822
3822
|
attribute float opacity; // Custom attribute for opacity
|
|
3823
3823
|
varying float vOpacity; // Varying to pass opacity to fragment shader
|
|
3824
3824
|
varying float distanceToCamera; // Varying to pass distance to camera
|
|
@@ -3843,7 +3843,7 @@ void main() {
|
|
|
3843
3843
|
// Combine alpha with opacity and distance factor
|
|
3844
3844
|
gl_FragColor = vec4(1.0, 1.0, 1.0, alpha * vOpacity * opacityFactor);
|
|
3845
3845
|
}
|
|
3846
|
-
`,blending:Pr,transparent:!0});g.needsUpdate=!0;let b=new Vc(d,g);r.add(b)}function l(){requestAnimationFrame(l);let h=Date.now()*.003;r.rotation.z+=.001/4,r.rotation.y+=5e-4/4,r.position.y=Math.sin(h*.05)*.05,s.lookAt(i.position),s.updateMatrixWorld(),n.render(i,s)}function c(){let h=window.innerWidth,f=window.innerHeight;s.aspect=h/f,s.updateProjectionMatrix(),n.setSize(h,f)}a(),o(),c(),n.compile(i,s),l(),window.addEventListener("resize",c,!1)}window.addEventListener("load",t,!1)};var $_=()=>{let r=document.querySelector(".blog-post-image_cover");r&&ue.timeline({delay:1.8}).fromTo(r,{y:"0"},{y:"-100%",duration:.6,ease:"circ.out"})};var rr,Is,id,$c,ka,Zc,Jc,za,vi="transform",nd=vi+"Origin",K_,j_=function(t){var e=t.ownerDocument||t;for(!(vi in t.style)&&("msTransform"in t.style)&&(vi="msTransform",nd=vi+"Origin");e.parentNode&&(e=e.parentNode););if(Is=window,Jc=new Br,e){rr=e,id=e.documentElement,$c=e.body,za=rr.createElementNS("http://www.w3.org/2000/svg","g"),za.style.transform="none";var n=e.createElement("div"),i=e.createElement("div"),s=e&&(e.body||e.firstElementChild);s&&s.appendChild&&(s.appendChild(n),n.appendChild(i),n.setAttribute("style","position:static;transform:translate3d(0,0,1px)"),K_=i.offsetParent!==n,s.removeChild(n))}return e},_E=function(t){for(var e,n;t&&t!==$c;)n=t._gsap,n&&n.uncache&&n.get(t,"x"),n&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),e?e.push(n):e=[n]),t=t.parentNode;return e},Q_=[],t0=[],xE=function(){return Is.pageYOffset||rr.scrollTop||id.scrollTop||$c.scrollTop||0},vE=function(){return Is.pageXOffset||rr.scrollLeft||id.scrollLeft||$c.scrollLeft||0},rd=function(t){return t.ownerSVGElement||((t.tagName+"").toLowerCase()==="svg"?t:null)},yE=function r(t){if(Is.getComputedStyle(t).position==="fixed")return!0;if(t=t.parentNode,t&&t.nodeType===1)return r(t)},td=function r(t,e){if(t.parentNode&&(rr||j_(t))){var n=rd(t),i=n?n.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s=n?e?"rect":"g":"div",o=e!==2?0:100,a=e===3?100:0,l="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",c=rr.createElementNS?rr.createElementNS(i.replace(/^https/,"http"),s):rr.createElement(s);return e&&(n?(Zc||(Zc=r(t)),c.setAttribute("width",.01),c.setAttribute("height",.01),c.setAttribute("transform","translate("+o+","+a+")"),Zc.appendChild(c)):(ka||(ka=r(t),ka.style.cssText=l),c.style.cssText=l+"width:0.1px;height:0.1px;top:"+a+"px;left:"+o+"px",ka.appendChild(c))),c}throw"Need document and parent."},SE=function(t){for(var e=new Br,n=0;n<t.numberOfItems;n++)e.multiply(t.getItem(n).matrix);return e},ME=function(t){var e=t.getCTM(),n;return e||(n=t.style[vi],t.style[vi]="none",t.appendChild(za),e=za.getCTM(),t.removeChild(za),n?t.style[vi]=n:t.style.removeProperty(vi.replace(/([A-Z])/g,"-$1").toLowerCase())),e||Jc.clone()},bE=function(t,e){var n=rd(t),i=t===n,s=n?Q_:t0,o=t.parentNode,a,l,c,h,f,d;if(t===Is)return t;if(s.length||s.push(td(t,1),td(t,2),td(t,3)),a=n?Zc:ka,n)i?(c=ME(t),h=-c.e/c.a,f=-c.f/c.d,l=Jc):t.getBBox?(c=t.getBBox(),l=t.transform?t.transform.baseVal:{},l=l.numberOfItems?l.numberOfItems>1?SE(l):l.getItem(0).matrix:Jc,h=l.a*c.x+l.c*c.y,f=l.b*c.x+l.d*c.y):(l=new Br,h=f=0),e&&t.tagName.toLowerCase()==="g"&&(h=f=0),(i?n:o).appendChild(a),a.setAttribute("transform","matrix("+l.a+","+l.b+","+l.c+","+l.d+","+(l.e+h)+","+(l.f+f)+")");else{if(h=f=0,K_)for(l=t.offsetParent,c=t;c&&(c=c.parentNode)&&c!==l&&c.parentNode;)(Is.getComputedStyle(c)[vi]+"").length>4&&(h=c.offsetLeft,f=c.offsetTop,c=0);if(d=Is.getComputedStyle(t),d.position!=="absolute"&&d.position!=="fixed")for(l=t.offsetParent;o&&o!==l;)h+=o.scrollLeft||0,f+=o.scrollTop||0,o=o.parentNode;c=a.style,c.top=t.offsetTop-f+"px",c.left=t.offsetLeft-h+"px",c[vi]=d[vi],c[nd]=d[nd],c.position=d.position==="fixed"?"fixed":"absolute",t.parentNode.appendChild(a)}return a},ed=function(t,e,n,i,s,o,a){return t.a=e,t.b=n,t.c=i,t.d=s,t.e=o,t.f=a,t},Br=function(){function r(e,n,i,s,o,a){e===void 0&&(e=1),n===void 0&&(n=0),i===void 0&&(i=0),s===void 0&&(s=1),o===void 0&&(o=0),a===void 0&&(a=0),ed(this,e,n,i,s,o,a)}var t=r.prototype;return t.inverse=function(){var n=this.a,i=this.b,s=this.c,o=this.d,a=this.e,l=this.f,c=n*o-i*s||1e-10;return ed(this,o/c,-i/c,-s/c,n/c,(s*l-o*a)/c,-(n*l-i*a)/c)},t.multiply=function(n){var i=this.a,s=this.b,o=this.c,a=this.d,l=this.e,c=this.f,h=n.a,f=n.c,d=n.b,u=n.d,_=n.e,p=n.f;return ed(this,h*i+d*o,h*s+d*a,f*i+u*o,f*s+u*a,l+_*i+p*o,c+_*s+p*a)},t.clone=function(){return new r(this.a,this.b,this.c,this.d,this.e,this.f)},t.equals=function(n){var i=this.a,s=this.b,o=this.c,a=this.d,l=this.e,c=this.f;return i===n.a&&s===n.b&&o===n.c&&a===n.d&&l===n.e&&c===n.f},t.apply=function(n,i){i===void 0&&(i={});var s=n.x,o=n.y,a=this.a,l=this.b,c=this.c,h=this.d,f=this.e,d=this.f;return i.x=s*a+o*c+f||0,i.y=s*l+o*h+d||0,i},r}();function kr(r,t,e,n){if(!r||!r.parentNode||(rr||j_(r)).documentElement===r)return new Br;var i=_E(r),s=rd(r),o=s?Q_:t0,a=bE(r,e),l=o[0].getBoundingClientRect(),c=o[1].getBoundingClientRect(),h=o[2].getBoundingClientRect(),f=a.parentNode,d=!n&&yE(r),u=new Br((c.left-l.left)/100,(c.top-l.top)/100,(h.left-l.left)/100,(h.top-l.top)/100,l.left+(d?0:vE()),l.top+(d?0:xE()));if(f.removeChild(a),i)for(l=i.length;l--;)c=i[l],c.scaleX=c.scaleY=0,c.renderTransform(1,c);return t?u.inverse():u}function e0(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function wE(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var pe,be,Gn,Mi,ar,sd,or,ud,Ha,Gr,f0,hd,qa,md,Ga,yi,Wa,Qc,d0,fd,eu=0,p0=function(){return typeof window<"u"},m0=function(){return pe||p0()&&(pe=window.gsap)&&pe.registerPlugin&&pe},Hr=function(t){return typeof t=="function"},Xa=function(t){return typeof t=="object"},Si=function(t){return typeof t>"u"},tu=function(){return!1},Ya="transform",dd="transformOrigin",zr=function(t){return Math.round(t*1e4)/1e4},Va=Array.isArray,Kc=function(t,e){var n=Gn.createElementNS?Gn.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Gn.createElement(t);return n.style?n:Gn.createElement(t)},n0=180/Math.PI,Ls=1e20,EE=new Br,Vr=Date.now||function(){return new Date().getTime()},Ns=[],ko={},TE=0,AE=/^(?:a|input|textarea|button|select)$/i,i0=0,Oo={},sr={},g0=function(t,e){var n={},i;for(i in t)n[i]=e?t[i]*e:t[i];return n},DE=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},r0=function r(t,e){for(var n=t.length,i;n--;)e?t[n].style.touchAction=e:t[n].style.removeProperty("touch-action"),i=t[n].children,i&&i.length&&r(i,e)},_0=function(){return Ns.forEach(function(t){return t()})},CE=function(t){Ns.push(t),Ns.length===1&&pe.ticker.add(_0)},s0=function(){return!Ns.length&&pe.ticker.remove(_0)},o0=function(t){for(var e=Ns.length;e--;)Ns[e]===t&&Ns.splice(e,1);pe.to(s0,{overwrite:!0,delay:15,duration:0,onComplete:s0,data:"_draggable"})},RE=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},qe=function(t,e,n,i){if(t.addEventListener){var s=qa[e];i=i||(f0?{passive:!1}:null),t.addEventListener(s||e,n,i),s&&e!==s&&t.addEventListener(e,n,i)}},He=function(t,e,n,i){if(t.removeEventListener){var s=qa[e];t.removeEventListener(s||e,n,i),s&&e!==s&&t.removeEventListener(e,n,i)}},si=function(t){t.preventDefault&&t.preventDefault(),t.preventManipulation&&t.preventManipulation()},PE=function(t,e){for(var n=t.length;n--;)if(t[n].identifier===e)return!0},IE=function r(t){md=t.touches&&eu<t.touches.length,He(t.target,"touchend",r)},a0=function(t){md=t.touches&&eu<t.touches.length,qe(t.target,"touchend",IE)},zo=function(t){return be.pageYOffset||t.scrollTop||t.documentElement.scrollTop||t.body.scrollTop||0},Vo=function(t){return be.pageXOffset||t.scrollLeft||t.documentElement.scrollLeft||t.body.scrollLeft||0},l0=function r(t,e){qe(t,"scroll",e),Ho(t.parentNode)||r(t.parentNode,e)},c0=function r(t,e){He(t,"scroll",e),Ho(t.parentNode)||r(t.parentNode,e)},Ho=function(t){return!t||t===Mi||t.nodeType===9||t===Gn.body||t===be||!t.nodeType||!t.parentNode},u0=function(t,e){var n=e==="x"?"Width":"Height",i="scroll"+n,s="client"+n;return Math.max(0,Ho(t)?Math.max(Mi[i],ar[i])-(be["inner"+n]||Mi[s]||ar[s]):t[i]-t[s])},od=function r(t,e){var n=u0(t,"x"),i=u0(t,"y");Ho(t)?t=sr:r(t.parentNode,e),t._gsMaxScrollX=n,t._gsMaxScrollY=i,e||(t._gsScrollX=t.scrollLeft||0,t._gsScrollY=t.scrollTop||0)},ad=function(t,e,n){var i=t.style;i&&(Si(i[e])&&(e=Ha(e,t)||e),n==null?i.removeProperty&&i.removeProperty(e.replace(/([A-Z])/g,"-$1").toLowerCase()):i[e]=n)},Za=function(t){return be.getComputedStyle(t instanceof Element?t:t.host||(t.parentNode||{}).host||t)},Fs={},Bo=function(t){if(t===be)return Fs.left=Fs.top=0,Fs.width=Fs.right=Mi.clientWidth||t.innerWidth||ar.clientWidth||0,Fs.height=Fs.bottom=(t.innerHeight||0)-20<Mi.clientHeight?Mi.clientHeight:t.innerHeight||ar.clientHeight||0,Fs;var e=t.ownerDocument||Gn,n=Si(t.pageX)?!t.nodeType&&!Si(t.left)&&!Si(t.top)?t:Gr(t)[0].getBoundingClientRect():{left:t.pageX-Vo(e),top:t.pageY-zo(e),right:t.pageX-Vo(e)+1,bottom:t.pageY-zo(e)+1};return Si(n.right)&&!Si(n.width)?(n.right=n.left+n.width,n.bottom=n.top+n.height):Si(n.width)&&(n={width:n.right-n.left,height:n.bottom-n.top,right:n.right,left:n.left,bottom:n.bottom,top:n.top}),n},Oe=function(t,e,n){var i=t.vars,s=i[n],o=t._listeners[e],a;return Hr(s)&&(a=s.apply(i.callbackScope||t,i[n+"Params"]||[t.pointerEvent])),o&&t.dispatchEvent(e)===!1&&(a=!1),a},h0=function(t,e){var n=Gr(t)[0],i,s,o;return!n.nodeType&&n!==be?Si(t.left)?(s=t.min||t.minX||t.minRotation||0,i=t.min||t.minY||0,{left:s,top:i,width:(t.max||t.maxX||t.maxRotation||0)-s,height:(t.max||t.maxY||0)-i}):(o={x:0,y:0},{left:t.left-o.x,top:t.top-o.y,width:t.width,height:t.height}):LE(n,e)},oi={},LE=function(t,e){e=Gr(e)[0];var n=t.getBBox&&t.ownerSVGElement,i=t.ownerDocument||Gn,s,o,a,l,c,h,f,d,u,_,p,m,g;if(t===be)a=zo(i),s=Vo(i),o=s+(i.documentElement.clientWidth||t.innerWidth||i.body.clientWidth||0),l=a+((t.innerHeight||0)-20<i.documentElement.clientHeight?i.documentElement.clientHeight:t.innerHeight||i.body.clientHeight||0);else{if(e===be||Si(e))return t.getBoundingClientRect();s=a=0,n?(_=t.getBBox(),p=_.width,m=_.height):(t.viewBox&&(_=t.viewBox.baseVal)&&(s=_.x||0,a=_.y||0,p=_.width,m=_.height),p||(g=Za(t),_=g.boxSizing==="border-box",p=(parseFloat(g.width)||t.clientWidth||0)+(_?0:parseFloat(g.borderLeftWidth)+parseFloat(g.borderRightWidth)),m=(parseFloat(g.height)||t.clientHeight||0)+(_?0:parseFloat(g.borderTopWidth)+parseFloat(g.borderBottomWidth)))),o=p,l=m}return t===e?{left:s,top:a,width:o-s,height:l-a}:(c=kr(e,!0).multiply(kr(t)),h=c.apply({x:s,y:a}),f=c.apply({x:o,y:a}),d=c.apply({x:o,y:l}),u=c.apply({x:s,y:l}),s=Math.min(h.x,f.x,d.x,u.x),a=Math.min(h.y,f.y,d.y,u.y),{left:s,top:a,width:Math.max(h.x,f.x,d.x,u.x)-s,height:Math.max(h.y,f.y,d.y,u.y)-a})},ld=function(t,e,n,i,s,o){var a={},l,c,h;if(e)if(s!==1&&e instanceof Array){if(a.end=l=[],h=e.length,Xa(e[0]))for(c=0;c<h;c++)l[c]=g0(e[c],s);else for(c=0;c<h;c++)l[c]=e[c]*s;n+=1.1,i-=1.1}else Hr(e)?a.end=function(f){var d=e.call(t,f),u,_;if(s!==1)if(Xa(d)){u={};for(_ in d)u[_]=d[_]*s;d=u}else d*=s;return d}:a.end=e;return(n||n===0)&&(a.max=n),(i||i===0)&&(a.min=i),o&&(a.velocity=0),a},FE=function r(t){var e;return!t||!t.getAttribute||t===ar?!1:(e=t.getAttribute("data-clickable"))==="true"||e!=="false"&&(AE.test(t.nodeName+"")||t.getAttribute("contentEditable")==="true")?!0:r(t.parentNode)},jc=function(t,e){for(var n=t.length,i;n--;)i=t[n],i.ondragstart=i.onselectstart=e?null:tu,pe.set(i,{lazy:!0,userSelect:e?"text":"none"})},NE=function r(t){if(Za(t).position==="fixed")return!0;if(t=t.parentNode,t&&t.nodeType===1)return r(t)},x0,pd,UE=function(t,e){t=pe.utils.toArray(t)[0],e=e||{};var n=document.createElement("div"),i=n.style,s=t.firstChild,o=0,a=0,l=t.scrollTop,c=t.scrollLeft,h=t.scrollWidth,f=t.scrollHeight,d=0,u=0,_=0,p,m,g,b,y,S;x0&&e.force3D!==!1?(y="translate3d(",S="px,0px)"):Ya&&(y="translate(",S="px)"),this.scrollTop=function(D,T){if(!arguments.length)return-this.top();this.top(-D,T)},this.scrollLeft=function(D,T){if(!arguments.length)return-this.left();this.left(-D,T)},this.left=function(D,T){if(!arguments.length)return-(t.scrollLeft+a);var w=t.scrollLeft-c,P=a;if((w>2||w<-2)&&!T){c=t.scrollLeft,pe.killTweensOf(this,{left:1,scrollLeft:1}),this.left(-c),e.onKill&&e.onKill();return}D=-D,D<0?(a=D-.5|0,D=0):D>u?(a=D-u|0,D=u):a=0,(a||P)&&(this._skip||(i[Ya]=y+-a+"px,"+-o+S),a+d>=0&&(i.paddingRight=a+d+"px")),t.scrollLeft=D|0,c=t.scrollLeft},this.top=function(D,T){if(!arguments.length)return-(t.scrollTop+o);var w=t.scrollTop-l,P=o;if((w>2||w<-2)&&!T){l=t.scrollTop,pe.killTweensOf(this,{top:1,scrollTop:1}),this.top(-l),e.onKill&&e.onKill();return}D=-D,D<0?(o=D-.5|0,D=0):D>_?(o=D-_|0,D=_):o=0,(o||P)&&(this._skip||(i[Ya]=y+-a+"px,"+-o+S)),t.scrollTop=D|0,l=t.scrollTop},this.maxScrollTop=function(){return _},this.maxScrollLeft=function(){return u},this.disable=function(){for(s=n.firstChild;s;)b=s.nextSibling,t.appendChild(s),s=b;t===n.parentNode&&t.removeChild(n)},this.enable=function(){if(s=t.firstChild,s!==n){for(;s;)b=s.nextSibling,n.appendChild(s),s=b;t.appendChild(n),this.calibrate()}},this.calibrate=function(D){var T=t.clientWidth===p,w,P,M;l=t.scrollTop,c=t.scrollLeft,!(T&&t.clientHeight===m&&n.offsetHeight===g&&h===t.scrollWidth&&f===t.scrollHeight&&!D)&&((o||a)&&(P=this.left(),M=this.top(),this.left(-t.scrollLeft),this.top(-t.scrollTop)),w=Za(t),(!T||D)&&(i.display="block",i.width="auto",i.paddingRight="0px",d=Math.max(0,t.scrollWidth-t.clientWidth),d&&(d+=parseFloat(w.paddingLeft)+(pd?parseFloat(w.paddingRight):0))),i.display="inline-block",i.position="relative",i.overflow="visible",i.verticalAlign="top",i.boxSizing="content-box",i.width="100%",i.paddingRight=d+"px",pd&&(i.paddingBottom=w.paddingBottom),p=t.clientWidth,m=t.clientHeight,h=t.scrollWidth,f=t.scrollHeight,u=t.scrollWidth-p,_=t.scrollHeight-m,g=n.offsetHeight,i.display="block",(P||M)&&(this.left(P),this.top(M)))},this.content=n,this.element=t,this._skip=!1,this.enable()},cd=function(t){if(p0()&&document.body){var e=window&&window.navigator;be=window,Gn=document,Mi=Gn.documentElement,ar=Gn.body,sd=Kc("div"),Qc=!!window.PointerEvent,or=Kc("div"),or.style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab",Wa=or.style.cursor==="grab"?"grab":"move",Ga=e&&e.userAgent.toLowerCase().indexOf("android")!==-1,hd="ontouchstart"in Mi&&"orientation"in be||e&&(e.MaxTouchPoints>0||e.msMaxTouchPoints>0),pd=function(){var n=Kc("div"),i=Kc("div"),s=i.style,o=ar,a;return s.display="inline-block",s.position="relative",n.style.cssText="width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden",n.appendChild(i),o.appendChild(n),a=i.offsetHeight+18>n.scrollHeight,o.removeChild(n),a}(),qa=function(n){for(var i=n.split(","),s=("onpointerdown"in sd?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in sd?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":n).split(","),o={},a=4;--a>-1;)o[i[a]]=s[a],o[s[a]]=i[a];try{Mi.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){f0=1}}))}catch{}return o}("touchstart,touchmove,touchend,touchcancel"),qe(Gn,"touchcancel",tu),qe(be,"touchmove",tu),ar&&ar.addEventListener("touchstart",tu),qe(Gn,"contextmenu",function(){for(var n in ko)ko[n].isPressed&&ko[n].endDrag()}),pe=ud=m0()}pe?(yi=pe.plugins.inertia,d0=pe.core.context||function(){},Ha=pe.utils.checkPrefix,Ya=Ha(Ya),dd=Ha(dd),Gr=pe.utils.toArray,fd=pe.core.getStyleSaver,x0=!!Ha("perspective")):t&&console.warn("Please gsap.registerPlugin(Draggable)")},OE=function(){function r(e){this._listeners={},this.target=e||this}var t=r.prototype;return t.addEventListener=function(n,i){var s=this._listeners[n]||(this._listeners[n]=[]);~s.indexOf(i)||s.push(i)},t.removeEventListener=function(n,i){var s=this._listeners[n],o=s&&s.indexOf(i);o>=0&&s.splice(o,1)},t.dispatchEvent=function(n){var i=this,s;return(this._listeners[n]||[]).forEach(function(o){return o.call(i,{type:n,target:i.target})===!1&&(s=!1)}),s},r}(),Us=function(r){wE(t,r);function t(e,n){var i;i=r.call(this)||this,ud||cd(1),e=Gr(e)[0],i.styles=fd&&fd(e,"transform,left,top"),yi||(yi=pe.plugins.inertia),i.vars=n=g0(n||{}),i.target=e,i.x=i.y=i.rotation=0,i.dragResistance=parseFloat(n.dragResistance)||0,i.edgeResistance=isNaN(n.edgeResistance)?1:parseFloat(n.edgeResistance)||0,i.lockAxis=n.lockAxis,i.autoScroll=n.autoScroll||0,i.lockedAxis=null,i.allowEventDefault=!!n.allowEventDefault,pe.getProperty(e,"x");var s=(n.type||"x,y").toLowerCase(),o=~s.indexOf("x")||~s.indexOf("y"),a=s.indexOf("rotation")!==-1,l=a?"rotation":o?"x":"left",c=o?"y":"top",h=!!(~s.indexOf("x")||~s.indexOf("left")||s==="scroll"),f=!!(~s.indexOf("y")||~s.indexOf("top")||s==="scroll"),d=n.minimumMovement||2,u=e0(i),_=Gr(n.trigger||n.handle||e),p={},m=0,g=!1,b=n.autoScrollMarginTop||40,y=n.autoScrollMarginRight||40,S=n.autoScrollMarginBottom||40,D=n.autoScrollMarginLeft||40,T=n.clickableTest||FE,w=0,P=e._gsap||pe.core.getCache(e),M=NE(e),v=function(L,rt){return parseFloat(P.get(e,L,rt))},I=e.ownerDocument||Gn,N,C,V,$,W,Z,z,U,R,at,_t,Ut,X,ot,xt,ct,Rt,kt,q,Jt,It,Ft,bt,Et,Ht,G,$t,A,x,F,Y,tt,it,yt=function(L){return si(L),L.stopImmediatePropagation&&L.stopImmediatePropagation(),!1},pt=function Mt(L){if(u.autoScroll&&u.isDragging&&(g||Rt)){var rt=e,O=u.autoScroll*15,j,dt,et,wt,ft,Dt,zt,Nt;for(g=!1,sr.scrollTop=be.pageYOffset!=null?be.pageYOffset:I.documentElement.scrollTop!=null?I.documentElement.scrollTop:I.body.scrollTop,sr.scrollLeft=be.pageXOffset!=null?be.pageXOffset:I.documentElement.scrollLeft!=null?I.documentElement.scrollLeft:I.body.scrollLeft,wt=u.pointerX-sr.scrollLeft,ft=u.pointerY-sr.scrollTop;rt&&!dt;)dt=Ho(rt.parentNode),j=dt?sr:rt.parentNode,et=dt?{bottom:Math.max(Mi.clientHeight,be.innerHeight||0),right:Math.max(Mi.clientWidth,be.innerWidth||0),left:0,top:0}:j.getBoundingClientRect(),Dt=zt=0,f&&(Nt=j._gsMaxScrollY-j.scrollTop,Nt<0?zt=Nt:ft>et.bottom-S&&Nt?(g=!0,zt=Math.min(Nt,O*(1-Math.max(0,et.bottom-ft)/S)|0)):ft<et.top+b&&j.scrollTop&&(g=!0,zt=-Math.min(j.scrollTop,O*(1-Math.max(0,ft-et.top)/b)|0)),zt&&(j.scrollTop+=zt)),h&&(Nt=j._gsMaxScrollX-j.scrollLeft,Nt<0?Dt=Nt:wt>et.right-y&&Nt?(g=!0,Dt=Math.min(Nt,O*(1-Math.max(0,et.right-wt)/y)|0)):wt<et.left+D&&j.scrollLeft&&(g=!0,Dt=-Math.min(j.scrollLeft,O*(1-Math.max(0,wt-et.left)/D)|0)),Dt&&(j.scrollLeft+=Dt)),dt&&(Dt||zt)&&(be.scrollTo(j.scrollLeft,j.scrollTop),st(u.pointerX+Dt,u.pointerY+zt)),rt=j}if(Rt){var Qt=u.x,he=u.y;a?(u.deltaX=Qt-parseFloat(P.rotation),u.rotation=Qt,P.rotation=Qt+"deg",P.renderTransform(1,P)):C?(f&&(u.deltaY=he-C.top(),C.top(he)),h&&(u.deltaX=Qt-C.left(),C.left(Qt))):o?(f&&(u.deltaY=he-parseFloat(P.y),P.y=he+"px"),h&&(u.deltaX=Qt-parseFloat(P.x),P.x=Qt+"px"),P.renderTransform(1,P)):(f&&(u.deltaY=he-parseFloat(e.style.top||0),e.style.top=he+"px"),h&&(u.deltaX=Qt-parseFloat(e.style.left||0),e.style.left=Qt+"px")),U&&!L&&!A&&(A=!0,Oe(u,"drag","onDrag")===!1&&(h&&(u.x-=u.deltaX),f&&(u.y-=u.deltaY),Mt(!0)),A=!1)}Rt=!1},lt=function(L,rt){var O=u.x,j=u.y,dt,et;e._gsap||(P=pe.core.getCache(e)),P.uncache&&pe.getProperty(e,"x"),o?(u.x=parseFloat(P.x),u.y=parseFloat(P.y)):a?u.x=u.rotation=parseFloat(P.rotation):C?(u.y=C.top(),u.x=C.left()):(u.y=parseFloat(e.style.top||(et=Za(e))&&et.top)||0,u.x=parseFloat(e.style.left||(et||{}).left)||0),(q||Jt||It)&&!rt&&(u.isDragging||u.isThrowing)&&(It&&(Oo.x=u.x,Oo.y=u.y,dt=It(Oo),dt.x!==u.x&&(u.x=dt.x,Rt=!0),dt.y!==u.y&&(u.y=dt.y,Rt=!0)),q&&(dt=q(u.x),dt!==u.x&&(u.x=dt,a&&(u.rotation=dt),Rt=!0)),Jt&&(dt=Jt(u.y),dt!==u.y&&(u.y=dt),Rt=!0)),Rt&&pt(!0),L||(u.deltaX=u.x-O,u.deltaY=u.y-j,Oe(u,"throwupdate","onThrowUpdate"))},Lt=function(L,rt,O,j){return rt==null&&(rt=-Ls),O==null&&(O=Ls),Hr(L)?function(dt){var et=u.isPressed?1-u.edgeResistance:1;return L.call(u,(dt>O?O+(dt-O)*et:dt<rt?rt+(dt-rt)*et:dt)*j)*j}:Va(L)?function(dt){for(var et=L.length,wt=0,ft=Ls,Dt,zt;--et>-1;)Dt=L[et],zt=Dt-dt,zt<0&&(zt=-zt),zt<ft&&Dt>=rt&&Dt<=O&&(wt=et,ft=zt);return L[wt]}:isNaN(L)?function(dt){return dt}:function(){return L*j}},ht=function(L,rt,O,j,dt,et,wt){return et=et&&et<Ls?et*et:Ls,Hr(L)?function(ft){var Dt=u.isPressed?1-u.edgeResistance:1,zt=ft.x,Nt=ft.y,Qt,he,me;return ft.x=zt=zt>O?O+(zt-O)*Dt:zt<rt?rt+(zt-rt)*Dt:zt,ft.y=Nt=Nt>dt?dt+(Nt-dt)*Dt:Nt<j?j+(Nt-j)*Dt:Nt,Qt=L.call(u,ft),Qt!==ft&&(ft.x=Qt.x,ft.y=Qt.y),wt!==1&&(ft.x*=wt,ft.y*=wt),et<Ls&&(he=ft.x-zt,me=ft.y-Nt,he*he+me*me>et&&(ft.x=zt,ft.y=Nt)),ft}:Va(L)?function(ft){for(var Dt=L.length,zt=0,Nt=Ls,Qt,he,me,oe;--Dt>-1;)me=L[Dt],Qt=me.x-ft.x,he=me.y-ft.y,oe=Qt*Qt+he*he,oe<Nt&&(zt=Dt,Nt=oe);return Nt<=et?L[zt]:ft}:function(ft){return ft}},vt=function(){var L,rt,O,j;z=!1,C?(C.calibrate(),u.minX=_t=-C.maxScrollLeft(),u.minY=X=-C.maxScrollTop(),u.maxX=at=u.maxY=Ut=0,z=!0):n.bounds&&(L=h0(n.bounds,e.parentNode),a?(u.minX=_t=L.left,u.maxX=at=L.left+L.width,u.minY=X=u.maxY=Ut=0):!Si(n.bounds.maxX)||!Si(n.bounds.maxY)?(L=n.bounds,u.minX=_t=L.minX,u.minY=X=L.minY,u.maxX=at=L.maxX,u.maxY=Ut=L.maxY):(rt=h0(e,e.parentNode),u.minX=_t=Math.round(v(l,"px")+L.left-rt.left),u.minY=X=Math.round(v(c,"px")+L.top-rt.top),u.maxX=at=Math.round(_t+(L.width-rt.width)),u.maxY=Ut=Math.round(X+(L.height-rt.height))),_t>at&&(u.minX=at,u.maxX=at=_t,_t=u.minX),X>Ut&&(u.minY=Ut,u.maxY=Ut=X,X=u.minY),a&&(u.minRotation=_t,u.maxRotation=at),z=!0),n.liveSnap&&(O=n.liveSnap===!0?n.snap||{}:n.liveSnap,j=Va(O)||Hr(O),a?(q=Lt(j?O:O.rotation,_t,at,1),Jt=null):O.points?It=ht(j?O:O.points,_t,at,X,Ut,O.radius,C?-1:1):(h&&(q=Lt(j?O:O.x||O.left||O.scrollLeft,_t,at,C?-1:1)),f&&(Jt=Lt(j?O:O.y||O.top||O.scrollTop,X,Ut,C?-1:1))))},Yt=function(){u.isThrowing=!1,Oe(u,"throwcomplete","onThrowComplete")},ut=function(){u.isThrowing=!1},Tt=function(L,rt){var O,j,dt,et;L&&yi?(L===!0&&(O=n.snap||n.liveSnap||{},j=Va(O)||Hr(O),L={resistance:(n.throwResistance||n.resistance||1e3)/(a?10:1)},a?L.rotation=ld(u,j?O:O.rotation,at,_t,1,rt):(h&&(L[l]=ld(u,j?O:O.points||O.x||O.left,at,_t,C?-1:1,rt||u.lockedAxis==="x")),f&&(L[c]=ld(u,j?O:O.points||O.y||O.top,Ut,X,C?-1:1,rt||u.lockedAxis==="y")),(O.points||Va(O)&&Xa(O[0]))&&(L.linkedProps=l+","+c,L.radius=O.radius))),u.isThrowing=!0,et=isNaN(n.overshootTolerance)?n.edgeResistance===1?0:1-u.edgeResistance+.2:n.overshootTolerance,L.duration||(L.duration={max:Math.max(n.minDuration||0,"maxDuration"in n?n.maxDuration:2),min:isNaN(n.minDuration)?et===0||Xa(L)&&L.resistance>1e3?0:.5:n.minDuration,overshoot:et}),u.tween=dt=pe.to(C||e,{inertia:L,data:"_draggable",inherit:!1,onComplete:Yt,onInterrupt:ut,onUpdate:n.fastMode?Oe:lt,onUpdateParams:n.fastMode?[u,"onthrowupdate","onThrowUpdate"]:O&&O.radius?[!1,!0]:[]}),n.fastMode||(C&&(C._skip=!0),dt.render(1e9,!0,!0),lt(!0,!0),u.endX=u.x,u.endY=u.y,a&&(u.endRotation=u.x),dt.play(0),lt(!0,!0),C&&(C._skip=!1))):z&&u.applyBounds()},Wt=function(L){var rt=Et,O;Et=kr(e.parentNode,!0),L&&u.isPressed&&!Et.equals(rt||new Br)&&(O=rt.inverse().apply({x:V,y:$}),Et.apply(O,O),V=O.x,$=O.y),Et.equals(EE)&&(Et=null)},qt=function(){var L=1-u.edgeResistance,rt=M?Vo(I):0,O=M?zo(I):0,j,dt,et;o&&(P.x=v(l,"px")+"px",P.y=v(c,"px")+"px",P.renderTransform()),Wt(!1),oi.x=u.pointerX-rt,oi.y=u.pointerY-O,Et&&Et.apply(oi,oi),V=oi.x,$=oi.y,Rt&&(st(u.pointerX,u.pointerY),pt(!0)),tt=kr(e),C?(vt(),Z=C.top(),W=C.left()):(ce()?(lt(!0,!0),vt()):u.applyBounds(),a?(j=e.ownerSVGElement?[P.xOrigin-e.getBBox().x,P.yOrigin-e.getBBox().y]:(Za(e)[dd]||"0 0").split(" "),ct=u.rotationOrigin=kr(e).apply({x:parseFloat(j[0])||0,y:parseFloat(j[1])||0}),lt(!0,!0),dt=u.pointerX-ct.x-rt,et=ct.y-u.pointerY+O,W=u.x,Z=u.y=Math.atan2(et,dt)*n0):(Z=v(c,"px"),W=v(l,"px"))),z&&L&&(W>at?W=at+(W-at)/L:W<_t&&(W=_t-(_t-W)/L),a||(Z>Ut?Z=Ut+(Z-Ut)/L:Z<X&&(Z=X-(X-Z)/L))),u.startX=W=zr(W),u.startY=Z=zr(Z)},ce=function(){return u.tween&&u.tween.isActive()},Zt=function(){or.parentNode&&!ce()&&!u.isDragging&&or.parentNode.removeChild(or)},k=function(L,rt){var O;if(!N||u.isPressed||!L||(L.type==="mousedown"||L.type==="pointerdown")&&!rt&&Vr()-w<30&&qa[u.pointerEvent.type]){Y&&L&&N&&si(L);return}if(Ht=ce(),it=!1,u.pointerEvent=L,qa[L.type]?(bt=~L.type.indexOf("touch")?L.currentTarget||L.target:I,qe(bt,"touchend",mt),qe(bt,"touchmove",Q),qe(bt,"touchcancel",mt),qe(I,"touchstart",a0)):(bt=null,qe(I,"mousemove",Q)),$t=null,(!Qc||!bt)&&(qe(I,"mouseup",mt),L&&L.target&&qe(L.target,"mouseup",mt)),Ft=T.call(u,L.target)&&n.dragClickables===!1&&!rt,Ft){qe(L.target,"change",mt),Oe(u,"pressInit","onPressInit"),Oe(u,"press","onPress"),jc(_,!0),Y=!1;return}if(G=!bt||h===f||u.vars.allowNativeTouchScrolling===!1||u.vars.allowContextMenu&&L&&(L.ctrlKey||L.which>2)?!1:h?"y":"x",Y=!G&&!u.allowEventDefault,Y&&(si(L),qe(be,"touchforcechange",si)),L.changedTouches?(L=ot=L.changedTouches[0],xt=L.identifier):L.pointerId?xt=L.pointerId:ot=xt=null,eu++,CE(pt),$=u.pointerY=L.pageY,V=u.pointerX=L.pageX,Oe(u,"pressInit","onPressInit"),(G||u.autoScroll)&&od(e.parentNode),e.parentNode&&u.autoScroll&&!C&&!a&&e.parentNode._gsMaxScrollX&&!or.parentNode&&!e.getBBox&&(or.style.width=e.parentNode.scrollWidth+"px",e.parentNode.appendChild(or)),qt(),u.tween&&u.tween.kill(),u.isThrowing=!1,pe.killTweensOf(C||e,p,!0),C&&pe.killTweensOf(e,{scrollTo:1},!0),u.tween=u.lockedAxis=null,(n.zIndexBoost||!a&&!C&&n.zIndexBoost!==!1)&&(e.style.zIndex=t.zIndex++),u.isPressed=!0,U=!!(n.onDrag||u._listeners.drag),R=!!(n.onMove||u._listeners.move),n.cursor!==!1||n.activeCursor)for(O=_.length;--O>-1;)pe.set(_[O],{cursor:n.activeCursor||n.cursor||(Wa==="grab"?"grabbing":Wa)});Oe(u,"press","onPress")},Q=function(L){var rt=L,O,j,dt,et,wt,ft;if(!N||md||!u.isPressed||!L){Y&&L&&N&&si(L);return}if(u.pointerEvent=L,O=L.changedTouches,O){if(L=O[0],L!==ot&&L.identifier!==xt){for(et=O.length;--et>-1&&(L=O[et]).identifier!==xt&&L.target!==e;);if(et<0)return}}else if(L.pointerId&&xt&&L.pointerId!==xt)return;if(bt&&G&&!$t&&(oi.x=L.pageX-(M?Vo(I):0),oi.y=L.pageY-(M?zo(I):0),Et&&Et.apply(oi,oi),j=oi.x,dt=oi.y,wt=Math.abs(j-V),ft=Math.abs(dt-$),(wt!==ft&&(wt>d||ft>d)||Ga&&G===$t)&&($t=wt>ft&&h?"x":"y",G&&$t!==G&&qe(be,"touchforcechange",si),u.vars.lockAxisOnTouchScroll!==!1&&h&&f&&(u.lockedAxis=$t==="x"?"y":"x",Hr(u.vars.onLockAxis)&&u.vars.onLockAxis.call(u,rt)),Ga&&G===$t))){mt(rt);return}!u.allowEventDefault&&(!G||$t&&G!==$t)&&rt.cancelable!==!1?(si(rt),Y=!0):Y&&(Y=!1),u.autoScroll&&(g=!0),st(L.pageX,L.pageY,R)},st=function(L,rt,O){var j=1-u.dragResistance,dt=1-u.edgeResistance,et=u.pointerX,wt=u.pointerY,ft=Z,Dt=u.x,zt=u.y,Nt=u.endX,Qt=u.endY,he=u.endRotation,me=Rt,oe,E,B,H,K,J;u.pointerX=L,u.pointerY=rt,M&&(L-=Vo(I),rt-=zo(I)),a?(H=Math.atan2(ct.y-rt,L-ct.x)*n0,K=u.y-H,K>180?(Z-=360,u.y=H):K<-180&&(Z+=360,u.y=H),u.x!==W||Math.abs(Z-H)>d?(u.y=H,B=W+(Z-H)*j):B=W):(Et&&(J=L*Et.a+rt*Et.c+Et.e,rt=L*Et.b+rt*Et.d+Et.f,L=J),E=rt-$,oe=L-V,E<d&&E>-d&&(E=0),oe<d&&oe>-d&&(oe=0),(u.lockAxis||u.lockedAxis)&&(oe||E)&&(J=u.lockedAxis,J||(u.lockedAxis=J=h&&Math.abs(oe)>Math.abs(E)?"y":f?"x":null,J&&Hr(u.vars.onLockAxis)&&u.vars.onLockAxis.call(u,u.pointerEvent)),J==="y"?E=0:J==="x"&&(oe=0)),B=zr(W+oe*j),H=zr(Z+E*j)),(q||Jt||It)&&(u.x!==B||u.y!==H&&!a)&&(It&&(Oo.x=B,Oo.y=H,J=It(Oo),B=zr(J.x),H=zr(J.y)),q&&(B=zr(q(B))),Jt&&(H=zr(Jt(H)))),z&&(B>at?B=at+Math.round((B-at)*dt):B<_t&&(B=_t+Math.round((B-_t)*dt)),a||(H>Ut?H=Math.round(Ut+(H-Ut)*dt):H<X&&(H=Math.round(X+(H-X)*dt)))),(u.x!==B||u.y!==H&&!a)&&(a?(u.endRotation=u.x=u.endX=B,Rt=!0):(f&&(u.y=u.endY=H,Rt=!0),h&&(u.x=u.endX=B,Rt=!0)),!O||Oe(u,"move","onMove")!==!1?!u.isDragging&&u.isPressed&&(u.isDragging=it=!0,Oe(u,"dragstart","onDragStart")):(u.pointerX=et,u.pointerY=wt,Z=ft,u.x=Dt,u.y=zt,u.endX=Nt,u.endY=Qt,u.endRotation=he,Rt=me))},mt=function Mt(L,rt){if(!N||!u.isPressed||L&&xt!=null&&!rt&&(L.pointerId&&L.pointerId!==xt&&L.target!==e||L.changedTouches&&!PE(L.changedTouches,xt))){Y&&L&&N&&si(L);return}u.isPressed=!1;var O=L,j=u.isDragging,dt=u.vars.allowContextMenu&&L&&(L.ctrlKey||L.which>2),et=pe.delayedCall(.001,Zt),wt,ft,Dt,zt,Nt;if(bt?(He(bt,"touchend",Mt),He(bt,"touchmove",Q),He(bt,"touchcancel",Mt),He(I,"touchstart",a0)):He(I,"mousemove",Q),He(be,"touchforcechange",si),(!Qc||!bt)&&(He(I,"mouseup",Mt),L&&L.target&&He(L.target,"mouseup",Mt)),Rt=!1,j&&(m=i0=Vr(),u.isDragging=!1),o0(pt),Ft&&!dt){L&&(He(L.target,"change",Mt),u.pointerEvent=O),jc(_,!1),Oe(u,"release","onRelease"),Oe(u,"click","onClick"),Ft=!1;return}for(ft=_.length;--ft>-1;)ad(_[ft],"cursor",n.cursor||(n.cursor!==!1?Wa:null));if(eu--,L){if(wt=L.changedTouches,wt&&(L=wt[0],L!==ot&&L.identifier!==xt)){for(ft=wt.length;--ft>-1&&(L=wt[ft]).identifier!==xt&&L.target!==e;);if(ft<0&&!rt)return}u.pointerEvent=O,u.pointerX=L.pageX,u.pointerY=L.pageY}return dt&&O?(si(O),Y=!0,Oe(u,"release","onRelease")):O&&!j?(Y=!1,Ht&&(n.snap||n.bounds)&&Tt(n.inertia||n.throwProps),Oe(u,"release","onRelease"),(!Ga||O.type!=="touchmove")&&O.type.indexOf("cancel")===-1&&(Oe(u,"click","onClick"),Vr()-w<300&&Oe(u,"doubleclick","onDoubleClick"),zt=O.target||e,w=Vr(),Nt=function(){w!==x&&u.enabled()&&!u.isPressed&&!O.defaultPrevented&&(zt.click?zt.click():I.createEvent&&(Dt=I.createEvent("MouseEvents"),Dt.initMouseEvent("click",!0,!0,be,1,u.pointerEvent.screenX,u.pointerEvent.screenY,u.pointerX,u.pointerY,!1,!1,!1,!1,0,null),zt.dispatchEvent(Dt)))},!Ga&&!O.defaultPrevented&&pe.delayedCall(.05,Nt))):(Tt(n.inertia||n.throwProps),!u.allowEventDefault&&O&&(n.dragClickables!==!1||!T.call(u,O.target))&&j&&(!G||$t&&G===$t)&&O.cancelable!==!1?(Y=!0,si(O)):Y=!1,Oe(u,"release","onRelease")),ce()&&et.duration(u.tween.duration()),j&&Oe(u,"dragend","onDragEnd"),!0},gt=function(L){if(L&&u.isDragging&&!C){var rt=L.target||e.parentNode,O=rt.scrollLeft-rt._gsScrollX,j=rt.scrollTop-rt._gsScrollY;(O||j)&&(Et?(V-=O*Et.a+j*Et.c,$-=j*Et.d+O*Et.b):(V-=O,$-=j),rt._gsScrollX+=O,rt._gsScrollY+=j,st(u.pointerX,u.pointerY))}},Bt=function(L){var rt=Vr(),O=rt-w<100,j=rt-m<50,dt=O&&x===w,et=u.pointerEvent&&u.pointerEvent.defaultPrevented,wt=O&&F===w,ft=L.isTrusted||L.isTrusted==null&&O&&dt;if((dt||j&&u.vars.suppressClickOnDrag!==!1)&&L.stopImmediatePropagation&&L.stopImmediatePropagation(),O&&!(u.pointerEvent&&u.pointerEvent.defaultPrevented)&&(!dt||ft&&!wt)){ft&&dt&&(F=w),x=w;return}(u.isPressed||j||O)&&(!ft||!L.detail||!O||et)&&si(L),!O&&!j&&!it&&(L&&L.target&&(u.pointerEvent=L),Oe(u,"click","onClick"))},ee=function(L){return Et?{x:L.x*Et.a+L.y*Et.c+Et.e,y:L.x*Et.b+L.y*Et.d+Et.f}:{x:L.x,y:L.y}};return kt=t.get(e),kt&&kt.kill(),i.startDrag=function(Mt,L){var rt,O,j,dt;k(Mt||u.pointerEvent,!0),L&&!u.hitTest(Mt||u.pointerEvent)&&(rt=Bo(Mt||u.pointerEvent),O=Bo(e),j=ee({x:rt.left+rt.width/2,y:rt.top+rt.height/2}),dt=ee({x:O.left+O.width/2,y:O.top+O.height/2}),V-=j.x-dt.x,$-=j.y-dt.y),u.isDragging||(u.isDragging=it=!0,Oe(u,"dragstart","onDragStart"))},i.drag=Q,i.endDrag=function(Mt){return mt(Mt||u.pointerEvent,!0)},i.timeSinceDrag=function(){return u.isDragging?0:(Vr()-m)/1e3},i.timeSinceClick=function(){return(Vr()-w)/1e3},i.hitTest=function(Mt,L){return t.hitTest(u.target,Mt,L)},i.getDirection=function(Mt,L){var rt=Mt==="velocity"&&yi?Mt:Xa(Mt)&&!a?"element":"start",O,j,dt,et,wt,ft;return rt==="element"&&(wt=Bo(u.target),ft=Bo(Mt)),O=rt==="start"?u.x-W:rt==="velocity"?yi.getVelocity(e,l):wt.left+wt.width/2-(ft.left+ft.width/2),a?O<0?"counter-clockwise":"clockwise":(L=L||2,j=rt==="start"?u.y-Z:rt==="velocity"?yi.getVelocity(e,c):wt.top+wt.height/2-(ft.top+ft.height/2),dt=Math.abs(O/j),et=dt<1/L?"":O<0?"left":"right",dt<L&&(et!==""&&(et+="-"),et+=j<0?"up":"down"),et)},i.applyBounds=function(Mt,L){var rt,O,j,dt,et,wt;if(Mt&&n.bounds!==Mt)return n.bounds=Mt,u.update(!0,L);if(lt(!0),vt(),z&&!ce()){if(rt=u.x,O=u.y,rt>at?rt=at:rt<_t&&(rt=_t),O>Ut?O=Ut:O<X&&(O=X),(u.x!==rt||u.y!==O)&&(j=!0,u.x=u.endX=rt,a?u.endRotation=rt:u.y=u.endY=O,Rt=!0,pt(!0),u.autoScroll&&!u.isDragging))for(od(e.parentNode),dt=e,sr.scrollTop=be.pageYOffset!=null?be.pageYOffset:I.documentElement.scrollTop!=null?I.documentElement.scrollTop:I.body.scrollTop,sr.scrollLeft=be.pageXOffset!=null?be.pageXOffset:I.documentElement.scrollLeft!=null?I.documentElement.scrollLeft:I.body.scrollLeft;dt&&!wt;)wt=Ho(dt.parentNode),et=wt?sr:dt.parentNode,f&&et.scrollTop>et._gsMaxScrollY&&(et.scrollTop=et._gsMaxScrollY),h&&et.scrollLeft>et._gsMaxScrollX&&(et.scrollLeft=et._gsMaxScrollX),dt=et;u.isThrowing&&(j||u.endX>at||u.endX<_t||u.endY>Ut||u.endY<X)&&Tt(n.inertia||n.throwProps,j)}return u},i.update=function(Mt,L,rt){if(L&&u.isPressed){var O=kr(e),j=tt.apply({x:u.x-W,y:u.y-Z}),dt=kr(e.parentNode,!0);dt.apply({x:O.e-j.x,y:O.f-j.y},j),u.x-=j.x-dt.e,u.y-=j.y-dt.f,pt(!0),qt()}var et=u.x,wt=u.y;return Wt(!L),Mt?u.applyBounds():(Rt&&rt&&pt(!0),lt(!0)),L&&(st(u.pointerX,u.pointerY),Rt&&pt(!0)),u.isPressed&&!L&&(h&&Math.abs(et-u.x)>.01||f&&Math.abs(wt-u.y)>.01&&!a)&&qt(),u.autoScroll&&(od(e.parentNode,u.isDragging),g=u.isDragging,pt(!0),c0(e,gt),l0(e,gt)),u},i.enable=function(Mt){var L={lazy:!0},rt,O,j;if(n.cursor!==!1&&(L.cursor=n.cursor||Wa),pe.utils.checkPrefix("touchCallout")&&(L.touchCallout="none"),Mt!=="soft"){for(r0(_,h===f?"none":n.allowNativeTouchScrolling&&e.scrollHeight===e.clientHeight==(e.scrollWidth===e.clientHeight)||n.allowEventDefault?"manipulation":h?"pan-y":"pan-x"),O=_.length;--O>-1;)j=_[O],Qc||qe(j,"mousedown",k),qe(j,"touchstart",k),qe(j,"click",Bt,!0),pe.set(j,L),j.getBBox&&j.ownerSVGElement&&h!==f&&pe.set(j.ownerSVGElement,{touchAction:n.allowNativeTouchScrolling||n.allowEventDefault?"manipulation":h?"pan-y":"pan-x"}),n.allowContextMenu||qe(j,"contextmenu",yt);jc(_,!1)}return l0(e,gt),N=!0,yi&&Mt!=="soft"&&yi.track(C||e,o?"x,y":a?"rotation":"top,left"),e._gsDragID=rt="d"+TE++,ko[rt]=u,C&&(C.enable(),C.element._gsDragID=rt),(n.bounds||a)&&qt(),n.bounds&&u.applyBounds(),u},i.disable=function(Mt){for(var L=u.isDragging,rt=_.length,O;--rt>-1;)ad(_[rt],"cursor",null);if(Mt!=="soft"){for(r0(_,null),rt=_.length;--rt>-1;)O=_[rt],ad(O,"touchCallout",null),He(O,"mousedown",k),He(O,"touchstart",k),He(O,"click",Bt,!0),He(O,"contextmenu",yt);jc(_,!0),bt&&(He(bt,"touchcancel",mt),He(bt,"touchend",mt),He(bt,"touchmove",Q)),He(I,"mouseup",mt),He(I,"mousemove",Q)}return c0(e,gt),N=!1,yi&&Mt!=="soft"&&(yi.untrack(C||e,o?"x,y":a?"rotation":"top,left"),u.tween&&u.tween.kill()),C&&C.disable(),o0(pt),u.isDragging=u.isPressed=Ft=!1,L&&Oe(u,"dragend","onDragEnd"),u},i.enabled=function(Mt,L){return arguments.length?Mt?u.enable(L):u.disable(L):N},i.kill=function(){return u.isThrowing=!1,u.tween&&u.tween.kill(),u.disable(),pe.set(_,{clearProps:"userSelect"}),delete ko[e._gsDragID],u},i.revert=function(){this.kill(),this.styles&&this.styles.revert()},~s.indexOf("scroll")&&(C=i.scrollProxy=new UE(e,DE({onKill:function(){u.isPressed&&mt(null)}},n)),e.style.overflowY=f&&!hd?"auto":"hidden",e.style.overflowX=h&&!hd?"auto":"hidden",e=C.content),a?p.rotation=1:(h&&(p[l]=1),f&&(p[c]=1)),P.force3D="force3D"in n?n.force3D:!0,d0(e0(i)),i.enable(),i}return t.register=function(n){pe=n,cd()},t.create=function(n,i){return ud||cd(!0),Gr(n).map(function(s){return new t(s,i)})},t.get=function(n){return ko[(Gr(n)[0]||{})._gsDragID]},t.timeSinceDrag=function(){return(Vr()-i0)/1e3},t.hitTest=function(n,i,s){if(n===i)return!1;var o=Bo(n),a=Bo(i),l=o.top,c=o.left,h=o.right,f=o.bottom,d=o.width,u=o.height,_=a.left>h||a.right<c||a.top>f||a.bottom<l,p,m,g;return _||!s?!_:(g=(s+"").indexOf("%")!==-1,s=parseFloat(s)||0,p={left:Math.max(c,a.left),top:Math.max(l,a.top)},p.width=Math.min(h,a.right)-p.left,p.height=Math.min(f,a.bottom)-p.top,p.width<0||p.height<0?!1:g?(s*=.01,m=p.width*p.height,m>=d*u*s||m>=a.width*a.height*s):p.width>s&&p.height>s)},t}(OE);RE(Us.prototype,{pointerX:0,pointerY:0,startX:0,startY:0,deltaX:0,deltaY:0,isDragging:!1,isPressed:!1});Us.zIndex=1e3;Us.version="3.12.5";m0()&&pe.registerPlugin(Us);var Ui,_d,$a,y0,Go,Wo,nu,S0,M0,b0=function(){return Ui||typeof window<"u"&&(Ui=window.gsap)},xd={},BE=function(t){return Math.round(t*1e4)/1e4},vd=function(t){return M0(t).id},Ja=function(t){return xd[vd(typeof t=="string"?$a(t)[0]:t)]},v0=function(t){var e=Go,n;if(t-nu>=.05)for(S0=nu,nu=t;e;)n=e.g(e.t,e.p),(n!==e.v1||t-e.t1>.2)&&(e.v2=e.v1,e.v1=n,e.t2=e.t1,e.t1=t),e=e._next},kE={deg:360,rad:Math.PI*2},gd=function(){Ui=b0(),Ui&&($a=Ui.utils.toArray,y0=Ui.utils.getUnit,M0=Ui.core.getCache,Wo=Ui.ticker,_d=1)},zE=function(t,e,n,i){this.t=t,this.p=e,this.g=t._gsap.get,this.rCap=kE[n||y0(this.g(t,e))],this.v1=this.v2=0,this.t1=this.t2=Wo.time,i&&(this._next=i,i._prev=this)},Xo=function(){function r(e,n){_d||gd(),this.target=$a(e)[0],xd[vd(this.target)]=this,this._props={},n&&this.add(n)}r.register=function(n){Ui=n,gd()};var t=r.prototype;return t.get=function(n,i){var s=this._props[n]||console.warn("Not tracking "+n+" velocity."),o,a,l;return o=parseFloat(i?s.v1:s.g(s.t,s.p)),a=o-parseFloat(s.v2),l=s.rCap,l&&(a=a%l,a!==a%(l/2)&&(a=a<0?a+l:a-l)),BE(a/((i?s.t1:Wo.time)-s.t2))},t.getAll=function(){var n={},i=this._props,s;for(s in i)n[s]=this.get(s);return n},t.isTracking=function(n){return n in this._props},t.add=function(n,i){n in this._props||(Go||(Wo.add(v0),nu=S0=Wo.time),Go=this._props[n]=new zE(this.target,n,i,Go))},t.remove=function(n){var i=this._props[n],s,o;i&&(s=i._prev,o=i._next,s&&(s._next=o),o?o._prev=s:Go===i&&(Wo.remove(v0),Go=0),delete this._props[n])},t.kill=function(n){for(var i in this._props)this.remove(i);n||delete xd[vd(this.target)]},r.track=function(n,i,s){_d||gd();for(var o=[],a=$a(n),l=i.split(","),c=(s||"").split(","),h=a.length,f,d;h--;){for(f=Ja(a[h])||new r(a[h]),d=l.length;d--;)f.add(l[d],c[d]||c[0]);o.push(f)}return o},r.untrack=function(n,i){var s=(i||"").split(",");$a(n).forEach(function(o){var a=Ja(o);a&&(s.length?s.forEach(function(l){return a.remove(l)}):a.kill(1))})},r.isTracking=function(n,i){var s=Ja(n);return s&&s.isTracking(i)},r.getVelocity=function(n,i){var s=Ja(n);return!s||!s.isTracking(i)?console.warn("Not tracking velocity of "+i):s.get(i)},r}();Xo.getByTarget=Ja;b0()&&Ui.registerPlugin(Xo);var Ze,C0,w0,R0,yd,Ka,P0,I0,L0,bd,F0,ja,Sd,N0,iu=Xo.getByTarget,U0=function(){return Ze||typeof window<"u"&&(Ze=window.gsap)&&Ze.registerPlugin&&Ze},VE=function(t){return typeof t=="string"},Qa=function(t){return typeof t=="number"},Wr=function(t){return typeof t=="object"},Md=function(t){return typeof t=="function"},HE=1,O0=Array.isArray,GE=function(t){return t},Os=1e10,E0=1/Os,B0=.05,WE=function(t){return Math.round(t*1e4)/1e4},XE=function(t,e,n){for(var i in e)!(i in t)&&i!==n&&(t[i]=e[i]);return t},YE=function r(t){var e={},n,i;for(n in t)e[n]=Wr(i=t[n])&&!O0(i)?r(i):i;return e},T0=function(t,e,n,i,s){var o=e.length,a=0,l=Os,c,h,f,d;if(Wr(t)){for(;o--;){c=e[o],h=0;for(f in t)d=c[f]-t[f],h+=d*d;h<l&&(a=o,l=h)}if((s||Os)<Os&&s<Math.sqrt(l))return t}else for(;o--;)c=e[o],h=c-t,h<0&&(h=-h),h<l&&c>=i&&c<=n&&(a=o,l=h);return e[a]},k0=function(t,e,n,i,s,o,a){if(t.end==="auto")return t;var l=t.end,c,h;if(n=isNaN(n)?Os:n,i=isNaN(i)?-Os:i,Wr(e)){if(c=e.calculated?e:(Md(l)?l(e,a):T0(e,l,n,i,o))||e,!e.calculated){for(h in c)e[h]=c[h];e.calculated=!0}c=c[s]}else c=Md(l)?l(e,a):O0(l)?T0(e,l,n,i,o):parseFloat(l);return c>n?c=n:c<i&&(c=i),{max:c,min:c,unitFactor:t.unitFactor}},ru=function(t,e,n){return isNaN(t[e])?n:+t[e]},wd=function(t,e){return e*B0*t/bd},A0=function(t,e,n){return Math.abs((e-t)*bd/n/B0)},z0={resistance:1,checkpoint:1,preventOvershoot:1,linkedProps:1,radius:1,duration:1},V0=function(t,e,n,i){if(e.linkedProps){var s=e.linkedProps.split(","),o={},a,l,c,h,f,d;for(a=0;a<s.length;a++)l=s[a],c=e[l],c&&(Qa(c.velocity)?h=c.velocity:(f=f||iu(t),h=f&&f.isTracking(l)?f.get(l):0),d=Math.abs(h/ru(c,"resistance",i)),o[l]=parseFloat(n(t,l))+wd(h,d));return o}},qE=function(t,e,n,i,s,o){if(n===void 0&&(n=10),i===void 0&&(i=.2),s===void 0&&(s=1),o===void 0&&(o=0),VE(t)&&(t=R0(t)[0]),!t)return 0;var a=0,l=Os,c=e.inertia||e,h=L0(t).get,f=ru(c,"resistance",Ka.resistance),d,u,_,p,m,g,b,y,S,D;D=V0(t,c,h,f);for(d in c)z0[d]||(u=c[d],Wr(u)||(y=y||iu(t),y&&y.isTracking(d)?u=Qa(u)?{velocity:u}:{velocity:y.get(d)}:(p=+u||0,_=Math.abs(p/f))),Wr(u)&&(Qa(u.velocity)?p=u.velocity:(y=y||iu(t),p=y&&y.isTracking(d)?y.get(d):0),_=F0(i,n,Math.abs(p/ru(u,"resistance",f))),m=parseFloat(h(t,d))||0,g=m+wd(p,_),"end"in u&&(u=k0(u,D&&d in D?D:g,u.max,u.min,d,c.radius,p),o&&(ja===e&&(ja=c=YE(e)),c[d]=XE(u,c[d],"end"))),"max"in u&&g>+u.max+E0?(S=u.unitFactor||Ka.unitFactors[d]||1,b=m>u.max&&u.min!==u.max||p*S>-15&&p*S<45?i+(n-i)*.1:A0(m,u.max,p),b+s<l&&(l=b+s)):"min"in u&&g<+u.min-E0&&(S=u.unitFactor||Ka.unitFactors[d]||1,b=m<u.min&&u.min!==u.max||p*S>-45&&p*S<15?i+(n-i)*.1:A0(m,u.min,p),b+s<l&&(l=b+s)),b>a&&(a=b)),_>a&&(a=_));return a>l&&(a=l),a>n?n:a<i?i:a},D0=function(){Ze=U0(),Ze&&(w0=Ze.parseEase,R0=Ze.utils.toArray,P0=Ze.utils.getUnit,L0=Ze.core.getCache,F0=Ze.utils.clamp,Sd=Ze.core.getStyleSaver,N0=Ze.core.reverting||function(){},yd=w0("power3"),bd=yd(.05),I0=Ze.core.PropTween,Ze.config({resistance:100,unitFactors:{time:1e3,totalTime:1e3,progress:1e3,totalProgress:1e3}}),Ka=Ze.config(),Ze.registerPlugin(Xo),C0=1)},su={version:"3.12.5",name:"inertia",register:function(t){Ze=t,D0()},init:function(t,e,n,i,s){C0||D0();var o=iu(t);if(e==="auto"){if(!o){console.warn("No inertia tracking on "+t+". InertiaPlugin.track(target) first.");return}e=o.getAll()}this.styles=Sd&&typeof t.style=="object"&&Sd(t),this.target=t,this.tween=n,ja=e;var a=t._gsap,l=a.get,c=e.duration,h=Wr(c),f=e.preventOvershoot||h&&c.overshoot===0,d=ru(e,"resistance",Ka.resistance),u=Qa(c)?c:qE(t,e,h&&c.max||10,h&&c.min||.2,h&&"overshoot"in c?+c.overshoot:f?0:1,!0),_,p,m,g,b,y,S,D,T;e=ja,ja=0,T=V0(t,e,l,d);for(_ in e)z0[_]||(p=e[_],Md(p)&&(p=p(i,t,s)),Qa(p)?b=p:Wr(p)&&!isNaN(p.velocity)?b=+p.velocity:o&&o.isTracking(_)?b=o.get(_):console.warn("ERROR: No velocity was defined for "+t+" property: "+_),y=wd(b,u),D=0,m=l(t,_),g=P0(m),m=parseFloat(m),Wr(p)&&(S=m+y,"end"in p&&(p=k0(p,T&&_ in T?T:S,p.max,p.min,_,e.radius,b)),"max"in p&&+p.max<S?f||p.preventOvershoot?y=p.max-m:D=p.max-m-y:"min"in p&&+p.min>S&&(f||p.preventOvershoot?y=p.min-m:D=p.min-m-y)),this._props.push(_),this.styles&&this.styles.save(_),this._pt=new I0(this._pt,t,_,m,0,GE,0,a.set(t,_,this)),this._pt.u=g||0,this._pt.c1=y,this._pt.c2=D);return n.duration(u),HE},render:function(t,e){var n=e._pt;if(t=yd(e.tween._time/e.tween._dur),t||!N0())for(;n;)n.set(n.t,n.p,WE(n.s+n.c1*t+n.c2*t*t)+n.u,n.d,t),n=n._next;else e.styles.revert()}};"track,untrack,isTracking,getVelocity,getByTarget".split(",").forEach(function(r){return su[r]=Xo[r]});U0()&&Ze.registerPlugin(su);var H0=()=>{ue.registerPlugin(te,Us,su);let r=document.querySelector("#posts"),t=document.querySelector(".posts");if(!r||!t)return;let e=ue.matchMedia();e.add("(max-width: 767px)",()=>{Us.create(t,{type:"x",edgeResistance:.65,bounds:{minX:window.innerWidth-t.scrollWidth,maxX:0},inertia:!0}),t.querySelectorAll("*").forEach(i=>{i.style.touchAction="pan-y"})}),e.add("(min-width: 768px) and (max-width: 991px)",()=>{ue.to(t,{xPercent:-170,ease:"none",scrollTrigger:{trigger:"#posts",start:"top top",end:"+=120%",pin:!0,scrub:.5,invalidateOnRefresh:!0}})}),e.add("(min-width: 992px)",()=>{ue.to(t,{xPercent:-30,ease:"none",scrollTrigger:{trigger:"#posts",start:"top top",end:"+=100%",pin:!0,scrub:.5,invalidateOnRefresh:!0}})})};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{Im(),jm(),Wm(),J_(),Nm(),ng(),Qm(),Lm(),Km(),Gm(),Pm(),$_(),H0()});})();
|
|
3846
|
+
`,blending:Pr,transparent:!0});g.needsUpdate=!0;let b=new Vc(d,g);r.add(b)}function l(){requestAnimationFrame(l);let h=Date.now()*.003;r.rotation.z+=.001/4,r.rotation.y+=5e-4/4,r.position.y=Math.sin(h*.05)*.05,s.lookAt(i.position),s.updateMatrixWorld(),n.render(i,s)}function c(){let h=window.innerWidth,f=window.innerHeight;s.aspect=h/f,s.updateProjectionMatrix(),n.setSize(h,f)}a(),o(),c(),n.compile(i,s),l(),window.addEventListener("resize",c,!1)}window.addEventListener("load",t,!1)};var $_=()=>{let r=document.querySelector(".blog-post-image_cover");r&&ue.timeline().fromTo(r,{y:"0"},{y:"-100%",duration:.6,ease:"circ.out"})};var rr,Is,id,$c,ka,Zc,Jc,za,vi="transform",nd=vi+"Origin",K_,j_=function(t){var e=t.ownerDocument||t;for(!(vi in t.style)&&("msTransform"in t.style)&&(vi="msTransform",nd=vi+"Origin");e.parentNode&&(e=e.parentNode););if(Is=window,Jc=new Br,e){rr=e,id=e.documentElement,$c=e.body,za=rr.createElementNS("http://www.w3.org/2000/svg","g"),za.style.transform="none";var n=e.createElement("div"),i=e.createElement("div"),s=e&&(e.body||e.firstElementChild);s&&s.appendChild&&(s.appendChild(n),n.appendChild(i),n.setAttribute("style","position:static;transform:translate3d(0,0,1px)"),K_=i.offsetParent!==n,s.removeChild(n))}return e},xE=function(t){for(var e,n;t&&t!==$c;)n=t._gsap,n&&n.uncache&&n.get(t,"x"),n&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),e?e.push(n):e=[n]),t=t.parentNode;return e},Q_=[],t0=[],vE=function(){return Is.pageYOffset||rr.scrollTop||id.scrollTop||$c.scrollTop||0},yE=function(){return Is.pageXOffset||rr.scrollLeft||id.scrollLeft||$c.scrollLeft||0},rd=function(t){return t.ownerSVGElement||((t.tagName+"").toLowerCase()==="svg"?t:null)},SE=function r(t){if(Is.getComputedStyle(t).position==="fixed")return!0;if(t=t.parentNode,t&&t.nodeType===1)return r(t)},td=function r(t,e){if(t.parentNode&&(rr||j_(t))){var n=rd(t),i=n?n.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s=n?e?"rect":"g":"div",o=e!==2?0:100,a=e===3?100:0,l="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",c=rr.createElementNS?rr.createElementNS(i.replace(/^https/,"http"),s):rr.createElement(s);return e&&(n?(Zc||(Zc=r(t)),c.setAttribute("width",.01),c.setAttribute("height",.01),c.setAttribute("transform","translate("+o+","+a+")"),Zc.appendChild(c)):(ka||(ka=r(t),ka.style.cssText=l),c.style.cssText=l+"width:0.1px;height:0.1px;top:"+a+"px;left:"+o+"px",ka.appendChild(c))),c}throw"Need document and parent."},ME=function(t){for(var e=new Br,n=0;n<t.numberOfItems;n++)e.multiply(t.getItem(n).matrix);return e},bE=function(t){var e=t.getCTM(),n;return e||(n=t.style[vi],t.style[vi]="none",t.appendChild(za),e=za.getCTM(),t.removeChild(za),n?t.style[vi]=n:t.style.removeProperty(vi.replace(/([A-Z])/g,"-$1").toLowerCase())),e||Jc.clone()},wE=function(t,e){var n=rd(t),i=t===n,s=n?Q_:t0,o=t.parentNode,a,l,c,h,f,d;if(t===Is)return t;if(s.length||s.push(td(t,1),td(t,2),td(t,3)),a=n?Zc:ka,n)i?(c=bE(t),h=-c.e/c.a,f=-c.f/c.d,l=Jc):t.getBBox?(c=t.getBBox(),l=t.transform?t.transform.baseVal:{},l=l.numberOfItems?l.numberOfItems>1?ME(l):l.getItem(0).matrix:Jc,h=l.a*c.x+l.c*c.y,f=l.b*c.x+l.d*c.y):(l=new Br,h=f=0),e&&t.tagName.toLowerCase()==="g"&&(h=f=0),(i?n:o).appendChild(a),a.setAttribute("transform","matrix("+l.a+","+l.b+","+l.c+","+l.d+","+(l.e+h)+","+(l.f+f)+")");else{if(h=f=0,K_)for(l=t.offsetParent,c=t;c&&(c=c.parentNode)&&c!==l&&c.parentNode;)(Is.getComputedStyle(c)[vi]+"").length>4&&(h=c.offsetLeft,f=c.offsetTop,c=0);if(d=Is.getComputedStyle(t),d.position!=="absolute"&&d.position!=="fixed")for(l=t.offsetParent;o&&o!==l;)h+=o.scrollLeft||0,f+=o.scrollTop||0,o=o.parentNode;c=a.style,c.top=t.offsetTop-f+"px",c.left=t.offsetLeft-h+"px",c[vi]=d[vi],c[nd]=d[nd],c.position=d.position==="fixed"?"fixed":"absolute",t.parentNode.appendChild(a)}return a},ed=function(t,e,n,i,s,o,a){return t.a=e,t.b=n,t.c=i,t.d=s,t.e=o,t.f=a,t},Br=function(){function r(e,n,i,s,o,a){e===void 0&&(e=1),n===void 0&&(n=0),i===void 0&&(i=0),s===void 0&&(s=1),o===void 0&&(o=0),a===void 0&&(a=0),ed(this,e,n,i,s,o,a)}var t=r.prototype;return t.inverse=function(){var n=this.a,i=this.b,s=this.c,o=this.d,a=this.e,l=this.f,c=n*o-i*s||1e-10;return ed(this,o/c,-i/c,-s/c,n/c,(s*l-o*a)/c,-(n*l-i*a)/c)},t.multiply=function(n){var i=this.a,s=this.b,o=this.c,a=this.d,l=this.e,c=this.f,h=n.a,f=n.c,d=n.b,u=n.d,_=n.e,p=n.f;return ed(this,h*i+d*o,h*s+d*a,f*i+u*o,f*s+u*a,l+_*i+p*o,c+_*s+p*a)},t.clone=function(){return new r(this.a,this.b,this.c,this.d,this.e,this.f)},t.equals=function(n){var i=this.a,s=this.b,o=this.c,a=this.d,l=this.e,c=this.f;return i===n.a&&s===n.b&&o===n.c&&a===n.d&&l===n.e&&c===n.f},t.apply=function(n,i){i===void 0&&(i={});var s=n.x,o=n.y,a=this.a,l=this.b,c=this.c,h=this.d,f=this.e,d=this.f;return i.x=s*a+o*c+f||0,i.y=s*l+o*h+d||0,i},r}();function kr(r,t,e,n){if(!r||!r.parentNode||(rr||j_(r)).documentElement===r)return new Br;var i=xE(r),s=rd(r),o=s?Q_:t0,a=wE(r,e),l=o[0].getBoundingClientRect(),c=o[1].getBoundingClientRect(),h=o[2].getBoundingClientRect(),f=a.parentNode,d=!n&&SE(r),u=new Br((c.left-l.left)/100,(c.top-l.top)/100,(h.left-l.left)/100,(h.top-l.top)/100,l.left+(d?0:yE()),l.top+(d?0:vE()));if(f.removeChild(a),i)for(l=i.length;l--;)c=i[l],c.scaleX=c.scaleY=0,c.renderTransform(1,c);return t?u.inverse():u}function e0(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function EE(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var pe,be,Gn,Mi,ar,sd,or,ud,Ha,Gr,f0,hd,qa,md,Ga,yi,Wa,Qc,d0,fd,eu=0,p0=function(){return typeof window<"u"},m0=function(){return pe||p0()&&(pe=window.gsap)&&pe.registerPlugin&&pe},Hr=function(t){return typeof t=="function"},Xa=function(t){return typeof t=="object"},Si=function(t){return typeof t>"u"},tu=function(){return!1},Ya="transform",dd="transformOrigin",zr=function(t){return Math.round(t*1e4)/1e4},Va=Array.isArray,Kc=function(t,e){var n=Gn.createElementNS?Gn.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Gn.createElement(t);return n.style?n:Gn.createElement(t)},n0=180/Math.PI,Ls=1e20,TE=new Br,Vr=Date.now||function(){return new Date().getTime()},Ns=[],ko={},AE=0,DE=/^(?:a|input|textarea|button|select)$/i,i0=0,Oo={},sr={},g0=function(t,e){var n={},i;for(i in t)n[i]=e?t[i]*e:t[i];return n},CE=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},r0=function r(t,e){for(var n=t.length,i;n--;)e?t[n].style.touchAction=e:t[n].style.removeProperty("touch-action"),i=t[n].children,i&&i.length&&r(i,e)},_0=function(){return Ns.forEach(function(t){return t()})},RE=function(t){Ns.push(t),Ns.length===1&&pe.ticker.add(_0)},s0=function(){return!Ns.length&&pe.ticker.remove(_0)},o0=function(t){for(var e=Ns.length;e--;)Ns[e]===t&&Ns.splice(e,1);pe.to(s0,{overwrite:!0,delay:15,duration:0,onComplete:s0,data:"_draggable"})},PE=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},qe=function(t,e,n,i){if(t.addEventListener){var s=qa[e];i=i||(f0?{passive:!1}:null),t.addEventListener(s||e,n,i),s&&e!==s&&t.addEventListener(e,n,i)}},He=function(t,e,n,i){if(t.removeEventListener){var s=qa[e];t.removeEventListener(s||e,n,i),s&&e!==s&&t.removeEventListener(e,n,i)}},si=function(t){t.preventDefault&&t.preventDefault(),t.preventManipulation&&t.preventManipulation()},IE=function(t,e){for(var n=t.length;n--;)if(t[n].identifier===e)return!0},LE=function r(t){md=t.touches&&eu<t.touches.length,He(t.target,"touchend",r)},a0=function(t){md=t.touches&&eu<t.touches.length,qe(t.target,"touchend",LE)},zo=function(t){return be.pageYOffset||t.scrollTop||t.documentElement.scrollTop||t.body.scrollTop||0},Vo=function(t){return be.pageXOffset||t.scrollLeft||t.documentElement.scrollLeft||t.body.scrollLeft||0},l0=function r(t,e){qe(t,"scroll",e),Ho(t.parentNode)||r(t.parentNode,e)},c0=function r(t,e){He(t,"scroll",e),Ho(t.parentNode)||r(t.parentNode,e)},Ho=function(t){return!t||t===Mi||t.nodeType===9||t===Gn.body||t===be||!t.nodeType||!t.parentNode},u0=function(t,e){var n=e==="x"?"Width":"Height",i="scroll"+n,s="client"+n;return Math.max(0,Ho(t)?Math.max(Mi[i],ar[i])-(be["inner"+n]||Mi[s]||ar[s]):t[i]-t[s])},od=function r(t,e){var n=u0(t,"x"),i=u0(t,"y");Ho(t)?t=sr:r(t.parentNode,e),t._gsMaxScrollX=n,t._gsMaxScrollY=i,e||(t._gsScrollX=t.scrollLeft||0,t._gsScrollY=t.scrollTop||0)},ad=function(t,e,n){var i=t.style;i&&(Si(i[e])&&(e=Ha(e,t)||e),n==null?i.removeProperty&&i.removeProperty(e.replace(/([A-Z])/g,"-$1").toLowerCase()):i[e]=n)},Za=function(t){return be.getComputedStyle(t instanceof Element?t:t.host||(t.parentNode||{}).host||t)},Fs={},Bo=function(t){if(t===be)return Fs.left=Fs.top=0,Fs.width=Fs.right=Mi.clientWidth||t.innerWidth||ar.clientWidth||0,Fs.height=Fs.bottom=(t.innerHeight||0)-20<Mi.clientHeight?Mi.clientHeight:t.innerHeight||ar.clientHeight||0,Fs;var e=t.ownerDocument||Gn,n=Si(t.pageX)?!t.nodeType&&!Si(t.left)&&!Si(t.top)?t:Gr(t)[0].getBoundingClientRect():{left:t.pageX-Vo(e),top:t.pageY-zo(e),right:t.pageX-Vo(e)+1,bottom:t.pageY-zo(e)+1};return Si(n.right)&&!Si(n.width)?(n.right=n.left+n.width,n.bottom=n.top+n.height):Si(n.width)&&(n={width:n.right-n.left,height:n.bottom-n.top,right:n.right,left:n.left,bottom:n.bottom,top:n.top}),n},Oe=function(t,e,n){var i=t.vars,s=i[n],o=t._listeners[e],a;return Hr(s)&&(a=s.apply(i.callbackScope||t,i[n+"Params"]||[t.pointerEvent])),o&&t.dispatchEvent(e)===!1&&(a=!1),a},h0=function(t,e){var n=Gr(t)[0],i,s,o;return!n.nodeType&&n!==be?Si(t.left)?(s=t.min||t.minX||t.minRotation||0,i=t.min||t.minY||0,{left:s,top:i,width:(t.max||t.maxX||t.maxRotation||0)-s,height:(t.max||t.maxY||0)-i}):(o={x:0,y:0},{left:t.left-o.x,top:t.top-o.y,width:t.width,height:t.height}):FE(n,e)},oi={},FE=function(t,e){e=Gr(e)[0];var n=t.getBBox&&t.ownerSVGElement,i=t.ownerDocument||Gn,s,o,a,l,c,h,f,d,u,_,p,m,g;if(t===be)a=zo(i),s=Vo(i),o=s+(i.documentElement.clientWidth||t.innerWidth||i.body.clientWidth||0),l=a+((t.innerHeight||0)-20<i.documentElement.clientHeight?i.documentElement.clientHeight:t.innerHeight||i.body.clientHeight||0);else{if(e===be||Si(e))return t.getBoundingClientRect();s=a=0,n?(_=t.getBBox(),p=_.width,m=_.height):(t.viewBox&&(_=t.viewBox.baseVal)&&(s=_.x||0,a=_.y||0,p=_.width,m=_.height),p||(g=Za(t),_=g.boxSizing==="border-box",p=(parseFloat(g.width)||t.clientWidth||0)+(_?0:parseFloat(g.borderLeftWidth)+parseFloat(g.borderRightWidth)),m=(parseFloat(g.height)||t.clientHeight||0)+(_?0:parseFloat(g.borderTopWidth)+parseFloat(g.borderBottomWidth)))),o=p,l=m}return t===e?{left:s,top:a,width:o-s,height:l-a}:(c=kr(e,!0).multiply(kr(t)),h=c.apply({x:s,y:a}),f=c.apply({x:o,y:a}),d=c.apply({x:o,y:l}),u=c.apply({x:s,y:l}),s=Math.min(h.x,f.x,d.x,u.x),a=Math.min(h.y,f.y,d.y,u.y),{left:s,top:a,width:Math.max(h.x,f.x,d.x,u.x)-s,height:Math.max(h.y,f.y,d.y,u.y)-a})},ld=function(t,e,n,i,s,o){var a={},l,c,h;if(e)if(s!==1&&e instanceof Array){if(a.end=l=[],h=e.length,Xa(e[0]))for(c=0;c<h;c++)l[c]=g0(e[c],s);else for(c=0;c<h;c++)l[c]=e[c]*s;n+=1.1,i-=1.1}else Hr(e)?a.end=function(f){var d=e.call(t,f),u,_;if(s!==1)if(Xa(d)){u={};for(_ in d)u[_]=d[_]*s;d=u}else d*=s;return d}:a.end=e;return(n||n===0)&&(a.max=n),(i||i===0)&&(a.min=i),o&&(a.velocity=0),a},NE=function r(t){var e;return!t||!t.getAttribute||t===ar?!1:(e=t.getAttribute("data-clickable"))==="true"||e!=="false"&&(DE.test(t.nodeName+"")||t.getAttribute("contentEditable")==="true")?!0:r(t.parentNode)},jc=function(t,e){for(var n=t.length,i;n--;)i=t[n],i.ondragstart=i.onselectstart=e?null:tu,pe.set(i,{lazy:!0,userSelect:e?"text":"none"})},UE=function r(t){if(Za(t).position==="fixed")return!0;if(t=t.parentNode,t&&t.nodeType===1)return r(t)},x0,pd,OE=function(t,e){t=pe.utils.toArray(t)[0],e=e||{};var n=document.createElement("div"),i=n.style,s=t.firstChild,o=0,a=0,l=t.scrollTop,c=t.scrollLeft,h=t.scrollWidth,f=t.scrollHeight,d=0,u=0,_=0,p,m,g,b,y,S;x0&&e.force3D!==!1?(y="translate3d(",S="px,0px)"):Ya&&(y="translate(",S="px)"),this.scrollTop=function(D,T){if(!arguments.length)return-this.top();this.top(-D,T)},this.scrollLeft=function(D,T){if(!arguments.length)return-this.left();this.left(-D,T)},this.left=function(D,T){if(!arguments.length)return-(t.scrollLeft+a);var w=t.scrollLeft-c,P=a;if((w>2||w<-2)&&!T){c=t.scrollLeft,pe.killTweensOf(this,{left:1,scrollLeft:1}),this.left(-c),e.onKill&&e.onKill();return}D=-D,D<0?(a=D-.5|0,D=0):D>u?(a=D-u|0,D=u):a=0,(a||P)&&(this._skip||(i[Ya]=y+-a+"px,"+-o+S),a+d>=0&&(i.paddingRight=a+d+"px")),t.scrollLeft=D|0,c=t.scrollLeft},this.top=function(D,T){if(!arguments.length)return-(t.scrollTop+o);var w=t.scrollTop-l,P=o;if((w>2||w<-2)&&!T){l=t.scrollTop,pe.killTweensOf(this,{top:1,scrollTop:1}),this.top(-l),e.onKill&&e.onKill();return}D=-D,D<0?(o=D-.5|0,D=0):D>_?(o=D-_|0,D=_):o=0,(o||P)&&(this._skip||(i[Ya]=y+-a+"px,"+-o+S)),t.scrollTop=D|0,l=t.scrollTop},this.maxScrollTop=function(){return _},this.maxScrollLeft=function(){return u},this.disable=function(){for(s=n.firstChild;s;)b=s.nextSibling,t.appendChild(s),s=b;t===n.parentNode&&t.removeChild(n)},this.enable=function(){if(s=t.firstChild,s!==n){for(;s;)b=s.nextSibling,n.appendChild(s),s=b;t.appendChild(n),this.calibrate()}},this.calibrate=function(D){var T=t.clientWidth===p,w,P,M;l=t.scrollTop,c=t.scrollLeft,!(T&&t.clientHeight===m&&n.offsetHeight===g&&h===t.scrollWidth&&f===t.scrollHeight&&!D)&&((o||a)&&(P=this.left(),M=this.top(),this.left(-t.scrollLeft),this.top(-t.scrollTop)),w=Za(t),(!T||D)&&(i.display="block",i.width="auto",i.paddingRight="0px",d=Math.max(0,t.scrollWidth-t.clientWidth),d&&(d+=parseFloat(w.paddingLeft)+(pd?parseFloat(w.paddingRight):0))),i.display="inline-block",i.position="relative",i.overflow="visible",i.verticalAlign="top",i.boxSizing="content-box",i.width="100%",i.paddingRight=d+"px",pd&&(i.paddingBottom=w.paddingBottom),p=t.clientWidth,m=t.clientHeight,h=t.scrollWidth,f=t.scrollHeight,u=t.scrollWidth-p,_=t.scrollHeight-m,g=n.offsetHeight,i.display="block",(P||M)&&(this.left(P),this.top(M)))},this.content=n,this.element=t,this._skip=!1,this.enable()},cd=function(t){if(p0()&&document.body){var e=window&&window.navigator;be=window,Gn=document,Mi=Gn.documentElement,ar=Gn.body,sd=Kc("div"),Qc=!!window.PointerEvent,or=Kc("div"),or.style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab",Wa=or.style.cursor==="grab"?"grab":"move",Ga=e&&e.userAgent.toLowerCase().indexOf("android")!==-1,hd="ontouchstart"in Mi&&"orientation"in be||e&&(e.MaxTouchPoints>0||e.msMaxTouchPoints>0),pd=function(){var n=Kc("div"),i=Kc("div"),s=i.style,o=ar,a;return s.display="inline-block",s.position="relative",n.style.cssText="width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden",n.appendChild(i),o.appendChild(n),a=i.offsetHeight+18>n.scrollHeight,o.removeChild(n),a}(),qa=function(n){for(var i=n.split(","),s=("onpointerdown"in sd?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in sd?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":n).split(","),o={},a=4;--a>-1;)o[i[a]]=s[a],o[s[a]]=i[a];try{Mi.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){f0=1}}))}catch{}return o}("touchstart,touchmove,touchend,touchcancel"),qe(Gn,"touchcancel",tu),qe(be,"touchmove",tu),ar&&ar.addEventListener("touchstart",tu),qe(Gn,"contextmenu",function(){for(var n in ko)ko[n].isPressed&&ko[n].endDrag()}),pe=ud=m0()}pe?(yi=pe.plugins.inertia,d0=pe.core.context||function(){},Ha=pe.utils.checkPrefix,Ya=Ha(Ya),dd=Ha(dd),Gr=pe.utils.toArray,fd=pe.core.getStyleSaver,x0=!!Ha("perspective")):t&&console.warn("Please gsap.registerPlugin(Draggable)")},BE=function(){function r(e){this._listeners={},this.target=e||this}var t=r.prototype;return t.addEventListener=function(n,i){var s=this._listeners[n]||(this._listeners[n]=[]);~s.indexOf(i)||s.push(i)},t.removeEventListener=function(n,i){var s=this._listeners[n],o=s&&s.indexOf(i);o>=0&&s.splice(o,1)},t.dispatchEvent=function(n){var i=this,s;return(this._listeners[n]||[]).forEach(function(o){return o.call(i,{type:n,target:i.target})===!1&&(s=!1)}),s},r}(),Us=function(r){EE(t,r);function t(e,n){var i;i=r.call(this)||this,ud||cd(1),e=Gr(e)[0],i.styles=fd&&fd(e,"transform,left,top"),yi||(yi=pe.plugins.inertia),i.vars=n=g0(n||{}),i.target=e,i.x=i.y=i.rotation=0,i.dragResistance=parseFloat(n.dragResistance)||0,i.edgeResistance=isNaN(n.edgeResistance)?1:parseFloat(n.edgeResistance)||0,i.lockAxis=n.lockAxis,i.autoScroll=n.autoScroll||0,i.lockedAxis=null,i.allowEventDefault=!!n.allowEventDefault,pe.getProperty(e,"x");var s=(n.type||"x,y").toLowerCase(),o=~s.indexOf("x")||~s.indexOf("y"),a=s.indexOf("rotation")!==-1,l=a?"rotation":o?"x":"left",c=o?"y":"top",h=!!(~s.indexOf("x")||~s.indexOf("left")||s==="scroll"),f=!!(~s.indexOf("y")||~s.indexOf("top")||s==="scroll"),d=n.minimumMovement||2,u=e0(i),_=Gr(n.trigger||n.handle||e),p={},m=0,g=!1,b=n.autoScrollMarginTop||40,y=n.autoScrollMarginRight||40,S=n.autoScrollMarginBottom||40,D=n.autoScrollMarginLeft||40,T=n.clickableTest||NE,w=0,P=e._gsap||pe.core.getCache(e),M=UE(e),v=function(L,rt){return parseFloat(P.get(e,L,rt))},I=e.ownerDocument||Gn,N,C,V,$,W,Z,z,U,R,at,_t,Ut,X,ot,xt,ct,Rt,kt,q,Jt,It,Ft,bt,Et,Ht,G,$t,A,x,F,Y,tt,it,yt=function(L){return si(L),L.stopImmediatePropagation&&L.stopImmediatePropagation(),!1},pt=function Mt(L){if(u.autoScroll&&u.isDragging&&(g||Rt)){var rt=e,O=u.autoScroll*15,j,dt,et,wt,ft,Dt,zt,Nt;for(g=!1,sr.scrollTop=be.pageYOffset!=null?be.pageYOffset:I.documentElement.scrollTop!=null?I.documentElement.scrollTop:I.body.scrollTop,sr.scrollLeft=be.pageXOffset!=null?be.pageXOffset:I.documentElement.scrollLeft!=null?I.documentElement.scrollLeft:I.body.scrollLeft,wt=u.pointerX-sr.scrollLeft,ft=u.pointerY-sr.scrollTop;rt&&!dt;)dt=Ho(rt.parentNode),j=dt?sr:rt.parentNode,et=dt?{bottom:Math.max(Mi.clientHeight,be.innerHeight||0),right:Math.max(Mi.clientWidth,be.innerWidth||0),left:0,top:0}:j.getBoundingClientRect(),Dt=zt=0,f&&(Nt=j._gsMaxScrollY-j.scrollTop,Nt<0?zt=Nt:ft>et.bottom-S&&Nt?(g=!0,zt=Math.min(Nt,O*(1-Math.max(0,et.bottom-ft)/S)|0)):ft<et.top+b&&j.scrollTop&&(g=!0,zt=-Math.min(j.scrollTop,O*(1-Math.max(0,ft-et.top)/b)|0)),zt&&(j.scrollTop+=zt)),h&&(Nt=j._gsMaxScrollX-j.scrollLeft,Nt<0?Dt=Nt:wt>et.right-y&&Nt?(g=!0,Dt=Math.min(Nt,O*(1-Math.max(0,et.right-wt)/y)|0)):wt<et.left+D&&j.scrollLeft&&(g=!0,Dt=-Math.min(j.scrollLeft,O*(1-Math.max(0,wt-et.left)/D)|0)),Dt&&(j.scrollLeft+=Dt)),dt&&(Dt||zt)&&(be.scrollTo(j.scrollLeft,j.scrollTop),st(u.pointerX+Dt,u.pointerY+zt)),rt=j}if(Rt){var Qt=u.x,he=u.y;a?(u.deltaX=Qt-parseFloat(P.rotation),u.rotation=Qt,P.rotation=Qt+"deg",P.renderTransform(1,P)):C?(f&&(u.deltaY=he-C.top(),C.top(he)),h&&(u.deltaX=Qt-C.left(),C.left(Qt))):o?(f&&(u.deltaY=he-parseFloat(P.y),P.y=he+"px"),h&&(u.deltaX=Qt-parseFloat(P.x),P.x=Qt+"px"),P.renderTransform(1,P)):(f&&(u.deltaY=he-parseFloat(e.style.top||0),e.style.top=he+"px"),h&&(u.deltaX=Qt-parseFloat(e.style.left||0),e.style.left=Qt+"px")),U&&!L&&!A&&(A=!0,Oe(u,"drag","onDrag")===!1&&(h&&(u.x-=u.deltaX),f&&(u.y-=u.deltaY),Mt(!0)),A=!1)}Rt=!1},lt=function(L,rt){var O=u.x,j=u.y,dt,et;e._gsap||(P=pe.core.getCache(e)),P.uncache&&pe.getProperty(e,"x"),o?(u.x=parseFloat(P.x),u.y=parseFloat(P.y)):a?u.x=u.rotation=parseFloat(P.rotation):C?(u.y=C.top(),u.x=C.left()):(u.y=parseFloat(e.style.top||(et=Za(e))&&et.top)||0,u.x=parseFloat(e.style.left||(et||{}).left)||0),(q||Jt||It)&&!rt&&(u.isDragging||u.isThrowing)&&(It&&(Oo.x=u.x,Oo.y=u.y,dt=It(Oo),dt.x!==u.x&&(u.x=dt.x,Rt=!0),dt.y!==u.y&&(u.y=dt.y,Rt=!0)),q&&(dt=q(u.x),dt!==u.x&&(u.x=dt,a&&(u.rotation=dt),Rt=!0)),Jt&&(dt=Jt(u.y),dt!==u.y&&(u.y=dt),Rt=!0)),Rt&&pt(!0),L||(u.deltaX=u.x-O,u.deltaY=u.y-j,Oe(u,"throwupdate","onThrowUpdate"))},Lt=function(L,rt,O,j){return rt==null&&(rt=-Ls),O==null&&(O=Ls),Hr(L)?function(dt){var et=u.isPressed?1-u.edgeResistance:1;return L.call(u,(dt>O?O+(dt-O)*et:dt<rt?rt+(dt-rt)*et:dt)*j)*j}:Va(L)?function(dt){for(var et=L.length,wt=0,ft=Ls,Dt,zt;--et>-1;)Dt=L[et],zt=Dt-dt,zt<0&&(zt=-zt),zt<ft&&Dt>=rt&&Dt<=O&&(wt=et,ft=zt);return L[wt]}:isNaN(L)?function(dt){return dt}:function(){return L*j}},ht=function(L,rt,O,j,dt,et,wt){return et=et&&et<Ls?et*et:Ls,Hr(L)?function(ft){var Dt=u.isPressed?1-u.edgeResistance:1,zt=ft.x,Nt=ft.y,Qt,he,me;return ft.x=zt=zt>O?O+(zt-O)*Dt:zt<rt?rt+(zt-rt)*Dt:zt,ft.y=Nt=Nt>dt?dt+(Nt-dt)*Dt:Nt<j?j+(Nt-j)*Dt:Nt,Qt=L.call(u,ft),Qt!==ft&&(ft.x=Qt.x,ft.y=Qt.y),wt!==1&&(ft.x*=wt,ft.y*=wt),et<Ls&&(he=ft.x-zt,me=ft.y-Nt,he*he+me*me>et&&(ft.x=zt,ft.y=Nt)),ft}:Va(L)?function(ft){for(var Dt=L.length,zt=0,Nt=Ls,Qt,he,me,oe;--Dt>-1;)me=L[Dt],Qt=me.x-ft.x,he=me.y-ft.y,oe=Qt*Qt+he*he,oe<Nt&&(zt=Dt,Nt=oe);return Nt<=et?L[zt]:ft}:function(ft){return ft}},vt=function(){var L,rt,O,j;z=!1,C?(C.calibrate(),u.minX=_t=-C.maxScrollLeft(),u.minY=X=-C.maxScrollTop(),u.maxX=at=u.maxY=Ut=0,z=!0):n.bounds&&(L=h0(n.bounds,e.parentNode),a?(u.minX=_t=L.left,u.maxX=at=L.left+L.width,u.minY=X=u.maxY=Ut=0):!Si(n.bounds.maxX)||!Si(n.bounds.maxY)?(L=n.bounds,u.minX=_t=L.minX,u.minY=X=L.minY,u.maxX=at=L.maxX,u.maxY=Ut=L.maxY):(rt=h0(e,e.parentNode),u.minX=_t=Math.round(v(l,"px")+L.left-rt.left),u.minY=X=Math.round(v(c,"px")+L.top-rt.top),u.maxX=at=Math.round(_t+(L.width-rt.width)),u.maxY=Ut=Math.round(X+(L.height-rt.height))),_t>at&&(u.minX=at,u.maxX=at=_t,_t=u.minX),X>Ut&&(u.minY=Ut,u.maxY=Ut=X,X=u.minY),a&&(u.minRotation=_t,u.maxRotation=at),z=!0),n.liveSnap&&(O=n.liveSnap===!0?n.snap||{}:n.liveSnap,j=Va(O)||Hr(O),a?(q=Lt(j?O:O.rotation,_t,at,1),Jt=null):O.points?It=ht(j?O:O.points,_t,at,X,Ut,O.radius,C?-1:1):(h&&(q=Lt(j?O:O.x||O.left||O.scrollLeft,_t,at,C?-1:1)),f&&(Jt=Lt(j?O:O.y||O.top||O.scrollTop,X,Ut,C?-1:1))))},Yt=function(){u.isThrowing=!1,Oe(u,"throwcomplete","onThrowComplete")},ut=function(){u.isThrowing=!1},Tt=function(L,rt){var O,j,dt,et;L&&yi?(L===!0&&(O=n.snap||n.liveSnap||{},j=Va(O)||Hr(O),L={resistance:(n.throwResistance||n.resistance||1e3)/(a?10:1)},a?L.rotation=ld(u,j?O:O.rotation,at,_t,1,rt):(h&&(L[l]=ld(u,j?O:O.points||O.x||O.left,at,_t,C?-1:1,rt||u.lockedAxis==="x")),f&&(L[c]=ld(u,j?O:O.points||O.y||O.top,Ut,X,C?-1:1,rt||u.lockedAxis==="y")),(O.points||Va(O)&&Xa(O[0]))&&(L.linkedProps=l+","+c,L.radius=O.radius))),u.isThrowing=!0,et=isNaN(n.overshootTolerance)?n.edgeResistance===1?0:1-u.edgeResistance+.2:n.overshootTolerance,L.duration||(L.duration={max:Math.max(n.minDuration||0,"maxDuration"in n?n.maxDuration:2),min:isNaN(n.minDuration)?et===0||Xa(L)&&L.resistance>1e3?0:.5:n.minDuration,overshoot:et}),u.tween=dt=pe.to(C||e,{inertia:L,data:"_draggable",inherit:!1,onComplete:Yt,onInterrupt:ut,onUpdate:n.fastMode?Oe:lt,onUpdateParams:n.fastMode?[u,"onthrowupdate","onThrowUpdate"]:O&&O.radius?[!1,!0]:[]}),n.fastMode||(C&&(C._skip=!0),dt.render(1e9,!0,!0),lt(!0,!0),u.endX=u.x,u.endY=u.y,a&&(u.endRotation=u.x),dt.play(0),lt(!0,!0),C&&(C._skip=!1))):z&&u.applyBounds()},Wt=function(L){var rt=Et,O;Et=kr(e.parentNode,!0),L&&u.isPressed&&!Et.equals(rt||new Br)&&(O=rt.inverse().apply({x:V,y:$}),Et.apply(O,O),V=O.x,$=O.y),Et.equals(TE)&&(Et=null)},qt=function(){var L=1-u.edgeResistance,rt=M?Vo(I):0,O=M?zo(I):0,j,dt,et;o&&(P.x=v(l,"px")+"px",P.y=v(c,"px")+"px",P.renderTransform()),Wt(!1),oi.x=u.pointerX-rt,oi.y=u.pointerY-O,Et&&Et.apply(oi,oi),V=oi.x,$=oi.y,Rt&&(st(u.pointerX,u.pointerY),pt(!0)),tt=kr(e),C?(vt(),Z=C.top(),W=C.left()):(ce()?(lt(!0,!0),vt()):u.applyBounds(),a?(j=e.ownerSVGElement?[P.xOrigin-e.getBBox().x,P.yOrigin-e.getBBox().y]:(Za(e)[dd]||"0 0").split(" "),ct=u.rotationOrigin=kr(e).apply({x:parseFloat(j[0])||0,y:parseFloat(j[1])||0}),lt(!0,!0),dt=u.pointerX-ct.x-rt,et=ct.y-u.pointerY+O,W=u.x,Z=u.y=Math.atan2(et,dt)*n0):(Z=v(c,"px"),W=v(l,"px"))),z&&L&&(W>at?W=at+(W-at)/L:W<_t&&(W=_t-(_t-W)/L),a||(Z>Ut?Z=Ut+(Z-Ut)/L:Z<X&&(Z=X-(X-Z)/L))),u.startX=W=zr(W),u.startY=Z=zr(Z)},ce=function(){return u.tween&&u.tween.isActive()},Zt=function(){or.parentNode&&!ce()&&!u.isDragging&&or.parentNode.removeChild(or)},k=function(L,rt){var O;if(!N||u.isPressed||!L||(L.type==="mousedown"||L.type==="pointerdown")&&!rt&&Vr()-w<30&&qa[u.pointerEvent.type]){Y&&L&&N&&si(L);return}if(Ht=ce(),it=!1,u.pointerEvent=L,qa[L.type]?(bt=~L.type.indexOf("touch")?L.currentTarget||L.target:I,qe(bt,"touchend",mt),qe(bt,"touchmove",Q),qe(bt,"touchcancel",mt),qe(I,"touchstart",a0)):(bt=null,qe(I,"mousemove",Q)),$t=null,(!Qc||!bt)&&(qe(I,"mouseup",mt),L&&L.target&&qe(L.target,"mouseup",mt)),Ft=T.call(u,L.target)&&n.dragClickables===!1&&!rt,Ft){qe(L.target,"change",mt),Oe(u,"pressInit","onPressInit"),Oe(u,"press","onPress"),jc(_,!0),Y=!1;return}if(G=!bt||h===f||u.vars.allowNativeTouchScrolling===!1||u.vars.allowContextMenu&&L&&(L.ctrlKey||L.which>2)?!1:h?"y":"x",Y=!G&&!u.allowEventDefault,Y&&(si(L),qe(be,"touchforcechange",si)),L.changedTouches?(L=ot=L.changedTouches[0],xt=L.identifier):L.pointerId?xt=L.pointerId:ot=xt=null,eu++,RE(pt),$=u.pointerY=L.pageY,V=u.pointerX=L.pageX,Oe(u,"pressInit","onPressInit"),(G||u.autoScroll)&&od(e.parentNode),e.parentNode&&u.autoScroll&&!C&&!a&&e.parentNode._gsMaxScrollX&&!or.parentNode&&!e.getBBox&&(or.style.width=e.parentNode.scrollWidth+"px",e.parentNode.appendChild(or)),qt(),u.tween&&u.tween.kill(),u.isThrowing=!1,pe.killTweensOf(C||e,p,!0),C&&pe.killTweensOf(e,{scrollTo:1},!0),u.tween=u.lockedAxis=null,(n.zIndexBoost||!a&&!C&&n.zIndexBoost!==!1)&&(e.style.zIndex=t.zIndex++),u.isPressed=!0,U=!!(n.onDrag||u._listeners.drag),R=!!(n.onMove||u._listeners.move),n.cursor!==!1||n.activeCursor)for(O=_.length;--O>-1;)pe.set(_[O],{cursor:n.activeCursor||n.cursor||(Wa==="grab"?"grabbing":Wa)});Oe(u,"press","onPress")},Q=function(L){var rt=L,O,j,dt,et,wt,ft;if(!N||md||!u.isPressed||!L){Y&&L&&N&&si(L);return}if(u.pointerEvent=L,O=L.changedTouches,O){if(L=O[0],L!==ot&&L.identifier!==xt){for(et=O.length;--et>-1&&(L=O[et]).identifier!==xt&&L.target!==e;);if(et<0)return}}else if(L.pointerId&&xt&&L.pointerId!==xt)return;if(bt&&G&&!$t&&(oi.x=L.pageX-(M?Vo(I):0),oi.y=L.pageY-(M?zo(I):0),Et&&Et.apply(oi,oi),j=oi.x,dt=oi.y,wt=Math.abs(j-V),ft=Math.abs(dt-$),(wt!==ft&&(wt>d||ft>d)||Ga&&G===$t)&&($t=wt>ft&&h?"x":"y",G&&$t!==G&&qe(be,"touchforcechange",si),u.vars.lockAxisOnTouchScroll!==!1&&h&&f&&(u.lockedAxis=$t==="x"?"y":"x",Hr(u.vars.onLockAxis)&&u.vars.onLockAxis.call(u,rt)),Ga&&G===$t))){mt(rt);return}!u.allowEventDefault&&(!G||$t&&G!==$t)&&rt.cancelable!==!1?(si(rt),Y=!0):Y&&(Y=!1),u.autoScroll&&(g=!0),st(L.pageX,L.pageY,R)},st=function(L,rt,O){var j=1-u.dragResistance,dt=1-u.edgeResistance,et=u.pointerX,wt=u.pointerY,ft=Z,Dt=u.x,zt=u.y,Nt=u.endX,Qt=u.endY,he=u.endRotation,me=Rt,oe,E,B,H,K,J;u.pointerX=L,u.pointerY=rt,M&&(L-=Vo(I),rt-=zo(I)),a?(H=Math.atan2(ct.y-rt,L-ct.x)*n0,K=u.y-H,K>180?(Z-=360,u.y=H):K<-180&&(Z+=360,u.y=H),u.x!==W||Math.abs(Z-H)>d?(u.y=H,B=W+(Z-H)*j):B=W):(Et&&(J=L*Et.a+rt*Et.c+Et.e,rt=L*Et.b+rt*Et.d+Et.f,L=J),E=rt-$,oe=L-V,E<d&&E>-d&&(E=0),oe<d&&oe>-d&&(oe=0),(u.lockAxis||u.lockedAxis)&&(oe||E)&&(J=u.lockedAxis,J||(u.lockedAxis=J=h&&Math.abs(oe)>Math.abs(E)?"y":f?"x":null,J&&Hr(u.vars.onLockAxis)&&u.vars.onLockAxis.call(u,u.pointerEvent)),J==="y"?E=0:J==="x"&&(oe=0)),B=zr(W+oe*j),H=zr(Z+E*j)),(q||Jt||It)&&(u.x!==B||u.y!==H&&!a)&&(It&&(Oo.x=B,Oo.y=H,J=It(Oo),B=zr(J.x),H=zr(J.y)),q&&(B=zr(q(B))),Jt&&(H=zr(Jt(H)))),z&&(B>at?B=at+Math.round((B-at)*dt):B<_t&&(B=_t+Math.round((B-_t)*dt)),a||(H>Ut?H=Math.round(Ut+(H-Ut)*dt):H<X&&(H=Math.round(X+(H-X)*dt)))),(u.x!==B||u.y!==H&&!a)&&(a?(u.endRotation=u.x=u.endX=B,Rt=!0):(f&&(u.y=u.endY=H,Rt=!0),h&&(u.x=u.endX=B,Rt=!0)),!O||Oe(u,"move","onMove")!==!1?!u.isDragging&&u.isPressed&&(u.isDragging=it=!0,Oe(u,"dragstart","onDragStart")):(u.pointerX=et,u.pointerY=wt,Z=ft,u.x=Dt,u.y=zt,u.endX=Nt,u.endY=Qt,u.endRotation=he,Rt=me))},mt=function Mt(L,rt){if(!N||!u.isPressed||L&&xt!=null&&!rt&&(L.pointerId&&L.pointerId!==xt&&L.target!==e||L.changedTouches&&!IE(L.changedTouches,xt))){Y&&L&&N&&si(L);return}u.isPressed=!1;var O=L,j=u.isDragging,dt=u.vars.allowContextMenu&&L&&(L.ctrlKey||L.which>2),et=pe.delayedCall(.001,Zt),wt,ft,Dt,zt,Nt;if(bt?(He(bt,"touchend",Mt),He(bt,"touchmove",Q),He(bt,"touchcancel",Mt),He(I,"touchstart",a0)):He(I,"mousemove",Q),He(be,"touchforcechange",si),(!Qc||!bt)&&(He(I,"mouseup",Mt),L&&L.target&&He(L.target,"mouseup",Mt)),Rt=!1,j&&(m=i0=Vr(),u.isDragging=!1),o0(pt),Ft&&!dt){L&&(He(L.target,"change",Mt),u.pointerEvent=O),jc(_,!1),Oe(u,"release","onRelease"),Oe(u,"click","onClick"),Ft=!1;return}for(ft=_.length;--ft>-1;)ad(_[ft],"cursor",n.cursor||(n.cursor!==!1?Wa:null));if(eu--,L){if(wt=L.changedTouches,wt&&(L=wt[0],L!==ot&&L.identifier!==xt)){for(ft=wt.length;--ft>-1&&(L=wt[ft]).identifier!==xt&&L.target!==e;);if(ft<0&&!rt)return}u.pointerEvent=O,u.pointerX=L.pageX,u.pointerY=L.pageY}return dt&&O?(si(O),Y=!0,Oe(u,"release","onRelease")):O&&!j?(Y=!1,Ht&&(n.snap||n.bounds)&&Tt(n.inertia||n.throwProps),Oe(u,"release","onRelease"),(!Ga||O.type!=="touchmove")&&O.type.indexOf("cancel")===-1&&(Oe(u,"click","onClick"),Vr()-w<300&&Oe(u,"doubleclick","onDoubleClick"),zt=O.target||e,w=Vr(),Nt=function(){w!==x&&u.enabled()&&!u.isPressed&&!O.defaultPrevented&&(zt.click?zt.click():I.createEvent&&(Dt=I.createEvent("MouseEvents"),Dt.initMouseEvent("click",!0,!0,be,1,u.pointerEvent.screenX,u.pointerEvent.screenY,u.pointerX,u.pointerY,!1,!1,!1,!1,0,null),zt.dispatchEvent(Dt)))},!Ga&&!O.defaultPrevented&&pe.delayedCall(.05,Nt))):(Tt(n.inertia||n.throwProps),!u.allowEventDefault&&O&&(n.dragClickables!==!1||!T.call(u,O.target))&&j&&(!G||$t&&G===$t)&&O.cancelable!==!1?(Y=!0,si(O)):Y=!1,Oe(u,"release","onRelease")),ce()&&et.duration(u.tween.duration()),j&&Oe(u,"dragend","onDragEnd"),!0},gt=function(L){if(L&&u.isDragging&&!C){var rt=L.target||e.parentNode,O=rt.scrollLeft-rt._gsScrollX,j=rt.scrollTop-rt._gsScrollY;(O||j)&&(Et?(V-=O*Et.a+j*Et.c,$-=j*Et.d+O*Et.b):(V-=O,$-=j),rt._gsScrollX+=O,rt._gsScrollY+=j,st(u.pointerX,u.pointerY))}},Bt=function(L){var rt=Vr(),O=rt-w<100,j=rt-m<50,dt=O&&x===w,et=u.pointerEvent&&u.pointerEvent.defaultPrevented,wt=O&&F===w,ft=L.isTrusted||L.isTrusted==null&&O&&dt;if((dt||j&&u.vars.suppressClickOnDrag!==!1)&&L.stopImmediatePropagation&&L.stopImmediatePropagation(),O&&!(u.pointerEvent&&u.pointerEvent.defaultPrevented)&&(!dt||ft&&!wt)){ft&&dt&&(F=w),x=w;return}(u.isPressed||j||O)&&(!ft||!L.detail||!O||et)&&si(L),!O&&!j&&!it&&(L&&L.target&&(u.pointerEvent=L),Oe(u,"click","onClick"))},ee=function(L){return Et?{x:L.x*Et.a+L.y*Et.c+Et.e,y:L.x*Et.b+L.y*Et.d+Et.f}:{x:L.x,y:L.y}};return kt=t.get(e),kt&&kt.kill(),i.startDrag=function(Mt,L){var rt,O,j,dt;k(Mt||u.pointerEvent,!0),L&&!u.hitTest(Mt||u.pointerEvent)&&(rt=Bo(Mt||u.pointerEvent),O=Bo(e),j=ee({x:rt.left+rt.width/2,y:rt.top+rt.height/2}),dt=ee({x:O.left+O.width/2,y:O.top+O.height/2}),V-=j.x-dt.x,$-=j.y-dt.y),u.isDragging||(u.isDragging=it=!0,Oe(u,"dragstart","onDragStart"))},i.drag=Q,i.endDrag=function(Mt){return mt(Mt||u.pointerEvent,!0)},i.timeSinceDrag=function(){return u.isDragging?0:(Vr()-m)/1e3},i.timeSinceClick=function(){return(Vr()-w)/1e3},i.hitTest=function(Mt,L){return t.hitTest(u.target,Mt,L)},i.getDirection=function(Mt,L){var rt=Mt==="velocity"&&yi?Mt:Xa(Mt)&&!a?"element":"start",O,j,dt,et,wt,ft;return rt==="element"&&(wt=Bo(u.target),ft=Bo(Mt)),O=rt==="start"?u.x-W:rt==="velocity"?yi.getVelocity(e,l):wt.left+wt.width/2-(ft.left+ft.width/2),a?O<0?"counter-clockwise":"clockwise":(L=L||2,j=rt==="start"?u.y-Z:rt==="velocity"?yi.getVelocity(e,c):wt.top+wt.height/2-(ft.top+ft.height/2),dt=Math.abs(O/j),et=dt<1/L?"":O<0?"left":"right",dt<L&&(et!==""&&(et+="-"),et+=j<0?"up":"down"),et)},i.applyBounds=function(Mt,L){var rt,O,j,dt,et,wt;if(Mt&&n.bounds!==Mt)return n.bounds=Mt,u.update(!0,L);if(lt(!0),vt(),z&&!ce()){if(rt=u.x,O=u.y,rt>at?rt=at:rt<_t&&(rt=_t),O>Ut?O=Ut:O<X&&(O=X),(u.x!==rt||u.y!==O)&&(j=!0,u.x=u.endX=rt,a?u.endRotation=rt:u.y=u.endY=O,Rt=!0,pt(!0),u.autoScroll&&!u.isDragging))for(od(e.parentNode),dt=e,sr.scrollTop=be.pageYOffset!=null?be.pageYOffset:I.documentElement.scrollTop!=null?I.documentElement.scrollTop:I.body.scrollTop,sr.scrollLeft=be.pageXOffset!=null?be.pageXOffset:I.documentElement.scrollLeft!=null?I.documentElement.scrollLeft:I.body.scrollLeft;dt&&!wt;)wt=Ho(dt.parentNode),et=wt?sr:dt.parentNode,f&&et.scrollTop>et._gsMaxScrollY&&(et.scrollTop=et._gsMaxScrollY),h&&et.scrollLeft>et._gsMaxScrollX&&(et.scrollLeft=et._gsMaxScrollX),dt=et;u.isThrowing&&(j||u.endX>at||u.endX<_t||u.endY>Ut||u.endY<X)&&Tt(n.inertia||n.throwProps,j)}return u},i.update=function(Mt,L,rt){if(L&&u.isPressed){var O=kr(e),j=tt.apply({x:u.x-W,y:u.y-Z}),dt=kr(e.parentNode,!0);dt.apply({x:O.e-j.x,y:O.f-j.y},j),u.x-=j.x-dt.e,u.y-=j.y-dt.f,pt(!0),qt()}var et=u.x,wt=u.y;return Wt(!L),Mt?u.applyBounds():(Rt&&rt&&pt(!0),lt(!0)),L&&(st(u.pointerX,u.pointerY),Rt&&pt(!0)),u.isPressed&&!L&&(h&&Math.abs(et-u.x)>.01||f&&Math.abs(wt-u.y)>.01&&!a)&&qt(),u.autoScroll&&(od(e.parentNode,u.isDragging),g=u.isDragging,pt(!0),c0(e,gt),l0(e,gt)),u},i.enable=function(Mt){var L={lazy:!0},rt,O,j;if(n.cursor!==!1&&(L.cursor=n.cursor||Wa),pe.utils.checkPrefix("touchCallout")&&(L.touchCallout="none"),Mt!=="soft"){for(r0(_,h===f?"none":n.allowNativeTouchScrolling&&e.scrollHeight===e.clientHeight==(e.scrollWidth===e.clientHeight)||n.allowEventDefault?"manipulation":h?"pan-y":"pan-x"),O=_.length;--O>-1;)j=_[O],Qc||qe(j,"mousedown",k),qe(j,"touchstart",k),qe(j,"click",Bt,!0),pe.set(j,L),j.getBBox&&j.ownerSVGElement&&h!==f&&pe.set(j.ownerSVGElement,{touchAction:n.allowNativeTouchScrolling||n.allowEventDefault?"manipulation":h?"pan-y":"pan-x"}),n.allowContextMenu||qe(j,"contextmenu",yt);jc(_,!1)}return l0(e,gt),N=!0,yi&&Mt!=="soft"&&yi.track(C||e,o?"x,y":a?"rotation":"top,left"),e._gsDragID=rt="d"+AE++,ko[rt]=u,C&&(C.enable(),C.element._gsDragID=rt),(n.bounds||a)&&qt(),n.bounds&&u.applyBounds(),u},i.disable=function(Mt){for(var L=u.isDragging,rt=_.length,O;--rt>-1;)ad(_[rt],"cursor",null);if(Mt!=="soft"){for(r0(_,null),rt=_.length;--rt>-1;)O=_[rt],ad(O,"touchCallout",null),He(O,"mousedown",k),He(O,"touchstart",k),He(O,"click",Bt,!0),He(O,"contextmenu",yt);jc(_,!0),bt&&(He(bt,"touchcancel",mt),He(bt,"touchend",mt),He(bt,"touchmove",Q)),He(I,"mouseup",mt),He(I,"mousemove",Q)}return c0(e,gt),N=!1,yi&&Mt!=="soft"&&(yi.untrack(C||e,o?"x,y":a?"rotation":"top,left"),u.tween&&u.tween.kill()),C&&C.disable(),o0(pt),u.isDragging=u.isPressed=Ft=!1,L&&Oe(u,"dragend","onDragEnd"),u},i.enabled=function(Mt,L){return arguments.length?Mt?u.enable(L):u.disable(L):N},i.kill=function(){return u.isThrowing=!1,u.tween&&u.tween.kill(),u.disable(),pe.set(_,{clearProps:"userSelect"}),delete ko[e._gsDragID],u},i.revert=function(){this.kill(),this.styles&&this.styles.revert()},~s.indexOf("scroll")&&(C=i.scrollProxy=new OE(e,CE({onKill:function(){u.isPressed&&mt(null)}},n)),e.style.overflowY=f&&!hd?"auto":"hidden",e.style.overflowX=h&&!hd?"auto":"hidden",e=C.content),a?p.rotation=1:(h&&(p[l]=1),f&&(p[c]=1)),P.force3D="force3D"in n?n.force3D:!0,d0(e0(i)),i.enable(),i}return t.register=function(n){pe=n,cd()},t.create=function(n,i){return ud||cd(!0),Gr(n).map(function(s){return new t(s,i)})},t.get=function(n){return ko[(Gr(n)[0]||{})._gsDragID]},t.timeSinceDrag=function(){return(Vr()-i0)/1e3},t.hitTest=function(n,i,s){if(n===i)return!1;var o=Bo(n),a=Bo(i),l=o.top,c=o.left,h=o.right,f=o.bottom,d=o.width,u=o.height,_=a.left>h||a.right<c||a.top>f||a.bottom<l,p,m,g;return _||!s?!_:(g=(s+"").indexOf("%")!==-1,s=parseFloat(s)||0,p={left:Math.max(c,a.left),top:Math.max(l,a.top)},p.width=Math.min(h,a.right)-p.left,p.height=Math.min(f,a.bottom)-p.top,p.width<0||p.height<0?!1:g?(s*=.01,m=p.width*p.height,m>=d*u*s||m>=a.width*a.height*s):p.width>s&&p.height>s)},t}(BE);PE(Us.prototype,{pointerX:0,pointerY:0,startX:0,startY:0,deltaX:0,deltaY:0,isDragging:!1,isPressed:!1});Us.zIndex=1e3;Us.version="3.12.5";m0()&&pe.registerPlugin(Us);var Ui,_d,$a,y0,Go,Wo,nu,S0,M0,b0=function(){return Ui||typeof window<"u"&&(Ui=window.gsap)},xd={},kE=function(t){return Math.round(t*1e4)/1e4},vd=function(t){return M0(t).id},Ja=function(t){return xd[vd(typeof t=="string"?$a(t)[0]:t)]},v0=function(t){var e=Go,n;if(t-nu>=.05)for(S0=nu,nu=t;e;)n=e.g(e.t,e.p),(n!==e.v1||t-e.t1>.2)&&(e.v2=e.v1,e.v1=n,e.t2=e.t1,e.t1=t),e=e._next},zE={deg:360,rad:Math.PI*2},gd=function(){Ui=b0(),Ui&&($a=Ui.utils.toArray,y0=Ui.utils.getUnit,M0=Ui.core.getCache,Wo=Ui.ticker,_d=1)},VE=function(t,e,n,i){this.t=t,this.p=e,this.g=t._gsap.get,this.rCap=zE[n||y0(this.g(t,e))],this.v1=this.v2=0,this.t1=this.t2=Wo.time,i&&(this._next=i,i._prev=this)},Xo=function(){function r(e,n){_d||gd(),this.target=$a(e)[0],xd[vd(this.target)]=this,this._props={},n&&this.add(n)}r.register=function(n){Ui=n,gd()};var t=r.prototype;return t.get=function(n,i){var s=this._props[n]||console.warn("Not tracking "+n+" velocity."),o,a,l;return o=parseFloat(i?s.v1:s.g(s.t,s.p)),a=o-parseFloat(s.v2),l=s.rCap,l&&(a=a%l,a!==a%(l/2)&&(a=a<0?a+l:a-l)),kE(a/((i?s.t1:Wo.time)-s.t2))},t.getAll=function(){var n={},i=this._props,s;for(s in i)n[s]=this.get(s);return n},t.isTracking=function(n){return n in this._props},t.add=function(n,i){n in this._props||(Go||(Wo.add(v0),nu=S0=Wo.time),Go=this._props[n]=new VE(this.target,n,i,Go))},t.remove=function(n){var i=this._props[n],s,o;i&&(s=i._prev,o=i._next,s&&(s._next=o),o?o._prev=s:Go===i&&(Wo.remove(v0),Go=0),delete this._props[n])},t.kill=function(n){for(var i in this._props)this.remove(i);n||delete xd[vd(this.target)]},r.track=function(n,i,s){_d||gd();for(var o=[],a=$a(n),l=i.split(","),c=(s||"").split(","),h=a.length,f,d;h--;){for(f=Ja(a[h])||new r(a[h]),d=l.length;d--;)f.add(l[d],c[d]||c[0]);o.push(f)}return o},r.untrack=function(n,i){var s=(i||"").split(",");$a(n).forEach(function(o){var a=Ja(o);a&&(s.length?s.forEach(function(l){return a.remove(l)}):a.kill(1))})},r.isTracking=function(n,i){var s=Ja(n);return s&&s.isTracking(i)},r.getVelocity=function(n,i){var s=Ja(n);return!s||!s.isTracking(i)?console.warn("Not tracking velocity of "+i):s.get(i)},r}();Xo.getByTarget=Ja;b0()&&Ui.registerPlugin(Xo);var Ze,C0,w0,R0,yd,Ka,P0,I0,L0,bd,F0,ja,Sd,N0,iu=Xo.getByTarget,U0=function(){return Ze||typeof window<"u"&&(Ze=window.gsap)&&Ze.registerPlugin&&Ze},HE=function(t){return typeof t=="string"},Qa=function(t){return typeof t=="number"},Wr=function(t){return typeof t=="object"},Md=function(t){return typeof t=="function"},GE=1,O0=Array.isArray,WE=function(t){return t},Os=1e10,E0=1/Os,B0=.05,XE=function(t){return Math.round(t*1e4)/1e4},YE=function(t,e,n){for(var i in e)!(i in t)&&i!==n&&(t[i]=e[i]);return t},qE=function r(t){var e={},n,i;for(n in t)e[n]=Wr(i=t[n])&&!O0(i)?r(i):i;return e},T0=function(t,e,n,i,s){var o=e.length,a=0,l=Os,c,h,f,d;if(Wr(t)){for(;o--;){c=e[o],h=0;for(f in t)d=c[f]-t[f],h+=d*d;h<l&&(a=o,l=h)}if((s||Os)<Os&&s<Math.sqrt(l))return t}else for(;o--;)c=e[o],h=c-t,h<0&&(h=-h),h<l&&c>=i&&c<=n&&(a=o,l=h);return e[a]},k0=function(t,e,n,i,s,o,a){if(t.end==="auto")return t;var l=t.end,c,h;if(n=isNaN(n)?Os:n,i=isNaN(i)?-Os:i,Wr(e)){if(c=e.calculated?e:(Md(l)?l(e,a):T0(e,l,n,i,o))||e,!e.calculated){for(h in c)e[h]=c[h];e.calculated=!0}c=c[s]}else c=Md(l)?l(e,a):O0(l)?T0(e,l,n,i,o):parseFloat(l);return c>n?c=n:c<i&&(c=i),{max:c,min:c,unitFactor:t.unitFactor}},ru=function(t,e,n){return isNaN(t[e])?n:+t[e]},wd=function(t,e){return e*B0*t/bd},A0=function(t,e,n){return Math.abs((e-t)*bd/n/B0)},z0={resistance:1,checkpoint:1,preventOvershoot:1,linkedProps:1,radius:1,duration:1},V0=function(t,e,n,i){if(e.linkedProps){var s=e.linkedProps.split(","),o={},a,l,c,h,f,d;for(a=0;a<s.length;a++)l=s[a],c=e[l],c&&(Qa(c.velocity)?h=c.velocity:(f=f||iu(t),h=f&&f.isTracking(l)?f.get(l):0),d=Math.abs(h/ru(c,"resistance",i)),o[l]=parseFloat(n(t,l))+wd(h,d));return o}},ZE=function(t,e,n,i,s,o){if(n===void 0&&(n=10),i===void 0&&(i=.2),s===void 0&&(s=1),o===void 0&&(o=0),HE(t)&&(t=R0(t)[0]),!t)return 0;var a=0,l=Os,c=e.inertia||e,h=L0(t).get,f=ru(c,"resistance",Ka.resistance),d,u,_,p,m,g,b,y,S,D;D=V0(t,c,h,f);for(d in c)z0[d]||(u=c[d],Wr(u)||(y=y||iu(t),y&&y.isTracking(d)?u=Qa(u)?{velocity:u}:{velocity:y.get(d)}:(p=+u||0,_=Math.abs(p/f))),Wr(u)&&(Qa(u.velocity)?p=u.velocity:(y=y||iu(t),p=y&&y.isTracking(d)?y.get(d):0),_=F0(i,n,Math.abs(p/ru(u,"resistance",f))),m=parseFloat(h(t,d))||0,g=m+wd(p,_),"end"in u&&(u=k0(u,D&&d in D?D:g,u.max,u.min,d,c.radius,p),o&&(ja===e&&(ja=c=qE(e)),c[d]=YE(u,c[d],"end"))),"max"in u&&g>+u.max+E0?(S=u.unitFactor||Ka.unitFactors[d]||1,b=m>u.max&&u.min!==u.max||p*S>-15&&p*S<45?i+(n-i)*.1:A0(m,u.max,p),b+s<l&&(l=b+s)):"min"in u&&g<+u.min-E0&&(S=u.unitFactor||Ka.unitFactors[d]||1,b=m<u.min&&u.min!==u.max||p*S>-45&&p*S<15?i+(n-i)*.1:A0(m,u.min,p),b+s<l&&(l=b+s)),b>a&&(a=b)),_>a&&(a=_));return a>l&&(a=l),a>n?n:a<i?i:a},D0=function(){Ze=U0(),Ze&&(w0=Ze.parseEase,R0=Ze.utils.toArray,P0=Ze.utils.getUnit,L0=Ze.core.getCache,F0=Ze.utils.clamp,Sd=Ze.core.getStyleSaver,N0=Ze.core.reverting||function(){},yd=w0("power3"),bd=yd(.05),I0=Ze.core.PropTween,Ze.config({resistance:100,unitFactors:{time:1e3,totalTime:1e3,progress:1e3,totalProgress:1e3}}),Ka=Ze.config(),Ze.registerPlugin(Xo),C0=1)},su={version:"3.12.5",name:"inertia",register:function(t){Ze=t,D0()},init:function(t,e,n,i,s){C0||D0();var o=iu(t);if(e==="auto"){if(!o){console.warn("No inertia tracking on "+t+". InertiaPlugin.track(target) first.");return}e=o.getAll()}this.styles=Sd&&typeof t.style=="object"&&Sd(t),this.target=t,this.tween=n,ja=e;var a=t._gsap,l=a.get,c=e.duration,h=Wr(c),f=e.preventOvershoot||h&&c.overshoot===0,d=ru(e,"resistance",Ka.resistance),u=Qa(c)?c:ZE(t,e,h&&c.max||10,h&&c.min||.2,h&&"overshoot"in c?+c.overshoot:f?0:1,!0),_,p,m,g,b,y,S,D,T;e=ja,ja=0,T=V0(t,e,l,d);for(_ in e)z0[_]||(p=e[_],Md(p)&&(p=p(i,t,s)),Qa(p)?b=p:Wr(p)&&!isNaN(p.velocity)?b=+p.velocity:o&&o.isTracking(_)?b=o.get(_):console.warn("ERROR: No velocity was defined for "+t+" property: "+_),y=wd(b,u),D=0,m=l(t,_),g=P0(m),m=parseFloat(m),Wr(p)&&(S=m+y,"end"in p&&(p=k0(p,T&&_ in T?T:S,p.max,p.min,_,e.radius,b)),"max"in p&&+p.max<S?f||p.preventOvershoot?y=p.max-m:D=p.max-m-y:"min"in p&&+p.min>S&&(f||p.preventOvershoot?y=p.min-m:D=p.min-m-y)),this._props.push(_),this.styles&&this.styles.save(_),this._pt=new I0(this._pt,t,_,m,0,WE,0,a.set(t,_,this)),this._pt.u=g||0,this._pt.c1=y,this._pt.c2=D);return n.duration(u),GE},render:function(t,e){var n=e._pt;if(t=yd(e.tween._time/e.tween._dur),t||!N0())for(;n;)n.set(n.t,n.p,XE(n.s+n.c1*t+n.c2*t*t)+n.u,n.d,t),n=n._next;else e.styles.revert()}};"track,untrack,isTracking,getVelocity,getByTarget".split(",").forEach(function(r){return su[r]=Xo[r]});U0()&&Ze.registerPlugin(su);var H0=()=>{ue.registerPlugin(te,Us,su);let r=document.querySelector("#posts"),t=document.querySelector(".posts");if(!r||!t)return;let e=ue.matchMedia();e.add("(max-width: 767px)",()=>{Us.create(t,{type:"x",edgeResistance:.65,bounds:{minX:window.innerWidth-t.scrollWidth,maxX:0},inertia:!0}),t.querySelectorAll("*").forEach(i=>{i.style.touchAction="pan-y"})}),e.add("(min-width: 768px) and (max-width: 991px)",()=>{ue.to(t,{xPercent:-170,ease:"none",scrollTrigger:{trigger:"#posts",start:"top top",end:"+=120%",pin:!0,scrub:.5,invalidateOnRefresh:!0}})}),e.add("(min-width: 992px)",()=>{ue.to(t,{xPercent:-30,ease:"none",scrollTrigger:{trigger:"#posts",start:"top top",end:"+=100%",pin:!0,scrub:.5,invalidateOnRefresh:!0}})})};var G0=()=>{let r=document.querySelectorAll(".swiper-slide.basic-swiperr-item.w-dyn-item"),t=document.querySelector(".author-paragraph");if(!t)return;let e=r.length===1?"Author":"Authors";t.setAttribute("data-content",e),t.textContent=e};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{Im(),jm(),Wm(),J_(),Nm(),ng(),Qm(),Lm(),Km(),Gm(),Pm(),$_(),H0(),G0()});})();
|
|
3847
3847
|
/*! Bundled license information:
|
|
3848
3848
|
|
|
3849
3849
|
gsap/gsap-core.js:
|