1import{c as Cu,M as vf}from"./Menu-Lwy6p8Fn.js";import{l as xf,V as yf}from"./lottie-QLrvLRlV.js";import{_ as Ui,g as ge,F as Dr,r as Ss,d as xt,w as Ln,q as zt,p as fs,o as xi,j as ec,t as Xe,e as Pe,f as be,x as gi,i as Qa,s as Sf,k as Mf,h as Ef,T as Tf,v as bf}from"./index-BcjU0GrN.js";import{L as wf}from"./Loader-DzfMquht.js";const Af={props:["progress"],data(){return{config:Cu,baseUrl:"/"}},computed:{content(){return this.$ml.get("landing")}},methods:{langSwitch(i){this.$router.push({params:{lang:i}}),this.$router.go()}}},Cf={class:"Landing__intro"},Rf=["src"],Pf={class:"Landing__intro-firstBlock"},Lf={class:"Landing__intro-firstBlock-top"},If={class:"Landing__intro-firstBlock-lang button--tertiary"},Df=["onClick"],Uf={class:"Landing__intro-firstBlock-title"},Nf=["src"],Of=["innerHTML"],Ff={class:"Landing__intro-firstBlock-bottom"},zf={class:"Landing__intro-firstBlock-dida"},Bf=["src"],kf={class:"Landing__intro-firstBlock-bottom-wrapper"},Hf={class:"Landing__intro-firstBlock-bottom-box"},Vf=["innerHTML"],Gf={href:"https://thevisualagency.com/",target:"_blank",class:"Landing__intro-firstBlock-bottom__link"},Wf=["src"],Xf={class:"Landing__intro-firstBlock-bottom-box"},qf=["innerHTML"],Yf={href:"https://ladante.it/",target:"_blank",class:"Landing__intro-firstBlock-bottom__link"},$f=["src"],Zf={class:"Landing__intro-text"},Kf=["innerHTML"];function jf(i,t,e,n,r,s){return zt(),ge("div",Cf,[(zt(!0),ge(Dr,null,Ss(r.config.landing.landingImages,(o,a)=>(zt(),ge("img",{key:a,class:"Landing__intro-backgroundImage",src:`${r.baseUrl}images/landing/${o.name}.png`,style:fs({top:o.top+"%",left:o.left+"%",transform:`scale(${o.scale}) translate3d(${e.progress*40*o.parallax}px,0,0)`})},null,12,Rf))),128)),xt("div",Pf,[t[0]||(t[0]=xt("div",{class:"Landing__intro-firstBlock-line"},null,-1)),xt("div",Lf,[xt("div",If,[(zt(!0),ge(Dr,null,Ss(i.$ml.list,(o,a)=>(zt(),ge("div",{key:o,class:xi(i.$ml.current===o?"link Landing__intro-firstBlock-lang-selected":"link "),onClick:l=>s.langSwitch(o)},Ln(o)+Ln(a<i.$ml.list.length-1?" | ":""),11,Df))),128))]),xt("div",Uf,[xt("img",{src:`${r.baseUrl}images/svg/logo-dante.svg`,alt:"Divine Comedy Digital Logo",class:"Landing__intro-firstBlock-title-logo"},null,8,Nf),xt("h1",{innerHTML:s.content.firstBlock.title},null,8,Of)])]),xt("div",Ff,[xt("div",zf,Ln(s.content.firstBlock.dida),1),xt("img",{src:`${r.baseUrl}images/svg/arrow-landing.svg`},null,8,Bf),xt("div",kf,[xt("div",Hf,[xt("div",{class:"Landing__intro-firstBlock-project",innerHTML:s.content.firstBlock.project},null,8,Vf),xt("a",Gf,[xt("img",{class:"Landing__intro-firstBlock-logo",alt:"The Visual Agency",src:`${r.baseUrl}images/logo/logo_tva.svg`,style:{width:"130px",marginTop:"13px"}},null,8,Wf)])]),xt("div",Xf,[xt("div",{class:"Landing__intro-firstBlock-project",innerHTML:s.content.firstBlock.project_1},null,8,qf),xt("a",Yf,[xt("img",{class:"Landing__intro-firstBlock-logo",alt:"Società Dante Alighieri",src:`${r.baseUrl}images/logo/logo_ladante.svg`},null,8,$f)])])])])]),xt("div",Zf,[xt("div",{innerHTML:s.content.intro},null,8,Kf)])])}const Jf=Ui(Af,[["render",jf],["__scopeId","data-v-d07dfb6f"]]),Qf={mounted(){this.getWindowHeight()},data(){return{baseUrl:"/",windowHeight:0}},computed:{content(){return this.$ml.get("landing")}},methods:{getWindowHeight(){let i=window.innerHeight*.01;this.windowHeight=i*100,window.addEventListener("orientationchange",()=>{let t=window.innerHeight*.01;this.windowHeight=t*100})},langSwitch(i){this.$router.push({params:{lang:i}}),this.$router.go(),window.location.reload()}}},tp=["src"],ep={class:"Landing__introMobile-firstBlock-top"},np={class:"Landing__introMobile-firstBlock-lang button--tertiary"},ip=["onClick"],rp={class:"Landing__introMobile-firstBlock-title"},sp=["src"],op=["innerHTML"],ap={class:"Landing__introMobile-firstBlock-bottom"},lp={class:"Landing__introMobile-firstBlock-bottom-wrapper"},cp={class:"Landing__introMobile-firstBlock-bottom-box"},hp=["innerHTML"],up={href:"https://thevisualagency.com/",target:"_blank",class:"Landing__introMobile-firstBlock-bottom__link"},dp=["src"],fp={class:"Landing__introMobile-firstBlock-bottom-box"},pp=["innerHTML"],mp={href:"https://ladante.it/",target:"_blank",class:"Landing__introMobile-firstBlock-bottom__link"},_p=["src"],gp={class:"Landing__introMobile-firstBlock-call"},vp={class:"Landing__introMobile-text"},xp=["innerHTML"];function yp(i,t,e,n,r,s){const o=Xe("svgicon");return zt(),ge("div",{class:xi(["Landing__introMobile",i.$tvaMq])},[xt("img",{class:"Landing__introMobile-backgroundImage",src:`${r.baseUrl}images/landing/image_mobile.png`},null,8,tp),xt("div",{class:"Landing__introMobile-firstBlock",style:fs({height:r.windowHeight+"px"})},[xt("div",ep,[xt("div",np,[(zt(!0),ge(Dr,null,Ss(i.$ml.list,(a,l)=>(zt(),ge("span",{key:a,class:xi(i.$ml.current===a?"button--tertiary-selected":""),onClick:c=>s.langSwitch(a)},Ln(a)+Ln(l<i.$ml.list.length-1?" | ":""),11,ip))),128))]),xt("div",rp,[xt("img",{src:`${r.baseUrl}
1images/svg/logo-dante.svg`,alt:"Divine Comedy Digital Logo",class:"Landing__introMobile-firstBlock-title-logo"},null,8,sp),xt("h1",{innerHTML:s.content.firstBlock.title},null,8,op)])]),xt("div",ap,[xt("div",lp,[xt("div",cp,[xt("div",{class:"Landing__introMobile-firstBlock-project",innerHTML:s.content.firstBlock.project},null,8,hp),xt("a",up,[xt("img",{class:"Landing__introMobile-firstBlock-logo",alt:"The Visual Agency",src:`${r.baseUrl}images/logo/logo_tva.svg`,style:{width:"130px",marginTop:"13px"}},null,8,dp)])]),xt("div",fp,[xt("div",{class:"Landing__introMobile-firstBlock-project",innerHTML:s.content.firstBlock.project_1},null,8,pp),xt("a",mp,[xt("img",{class:"Landing__introMobile-firstBlock-logo",alt:"Società Dante Alighieri",src:`${r.baseUrl}images/logo/logo_ladante.svg`},null,8,_p)])])])]),xt("div",gp,[ec(o,{class:"icon",icon:"icon-arrow-down",width:"15",height:"15"}),t[0]||(t[0]=xt("div",null,"Scroll down",-1))])],4),xt("div",vp,[xt("div",{innerHTML:s.content.intro},null,8,xp)])],2)}const Sp=Ui(Qf,[["render",yp],["__scopeId","data-v-93730944"]]),Mp={props:["content","componentIndex","config"],methods:{scrollForeward(){console.log(`#Landing__foreground-section-${this.componentIndex+2}`),this.$scrollTo(`#Landing__foreground-section-${this.componentIndex+2}`,300)},scrollBackward(){this.$scrollTo(`#Landing__foreground-section-${this.componentIndex}`,300)}},data(){return{baseUrl:"/"}}},Ep={class:"LandingParagraph-container"},Tp={class:"LandingParagraph__nav"},bp={class:"LandingParagraph__nav-numbers"},wp={class:"LandingParagraph-textContainer"},Ap={class:"LandingParagraph__title"},Cp=["innerHTML"];function Rp(i,t,e,n,r,s){const o=Xe("svgicon"),a=Xe("router-link");return zt(),ge("div",{class:xi(["LandingParagraph",i.$tvaMq])},[xt("div",Ep,[xt("div",Tp,[i.$tvaMq==="desktop"&&e.componentIndex>0?(zt(),Pe(o,{key:0,class:"arrow-left",icon:"icon-arrowbig-left",width:"30",height:"10",onClick:t[0]||(t[0]=l=>s.scrollBackward())})):be("",!0),i.$tvaMq==="tablet"?(zt(),Pe(o,{key:1,icon:"icon-arrow-up",width:"20",height:"20"})):be("",!0),xt("span",bp,Ln(e.componentIndex+1)+"/5",1),i.$tvaMq==="desktop"&&e.componentIndex+1!==5?(zt(),Pe(o,{key:2,class:"arrow-right",icon:"icon-arrowbig-right",width:"145",height:"10",onClick:t[1]||(t[1]=l=>s.scrollForeward())})):be("",!0),i.$tvaMq==="tablet"?(zt(),Pe(o,{key:3,icon:"icon-arrow-down",width:"20",height:"20"})):be("",!0)]),xt("div",wp,[xt("h2",Ap,Ln(e.content.title),1),xt("p",{class:"LandingParagraph__paragraph",innerHTML:e.content.paragraph},null,8,Cp)]),i.$tvaMq==="desktop"&&e.componentIndex+1!==5?(zt(),Pe(a,{key:0,class:"LandingParagraph__button button--tertiary-underline",to:{name:e.config.link}},{default:gi(()=>[Qa(Ln(e.content.button),1)]),_:1},8,["to"])):be("",!0),i.$tvaMq==="desktop"&&e.componentIndex+1===5?(zt(),Pe(a,{key:1,style:{opacity:0,pointerEvents:"none"},class:"LandingParagraph__button button--primary-text-square",to:{name:e.config.link}},{default:gi(()=>[Qa(Ln(e.content.button),1)]),_:1},8,["to"])):be("",!0)])],2)}const Pp=Ui(Mp,[["render",Rp],["__scopeId","data-v-849aa4a2"]]);/** 2 * @license 3 * Copyright 2010-2024 Three.js Authors 4 * SPDX-License-Identifier: MIT 5 */const nc="169",Ei={ROTATE:0,DOLLY:1,PAN:2},Lp=0,th=1,Ip=2,Ru=1,Dp=2,Kn=3,Ci=0,$e=1,Qn=2,Ti=0,Ur=1,eh=2,nh=3,ih=4,Up=5,Ji=100,Np=101,Op=102,Fp=103,zp=104,Bp=200,kp=201,Hp=202,Vp=203,tl=204,el=205,Gp=206,Wp=207,Xp=208,qp=209,Yp=210,$p=211,Zp=212,Kp=213,jp=214,nl=0,il=1,rl=2,kr=3,sl=4,ol
vendor: 7,793 bytes, line 5
5=5,al=6,ll=7,Pu=0,Jp=1,Qp=2,bi=0,tm=1,em=2,nm=3,im=4,rm=5,sm=6,om=7,Lu=300,Hr=301,Vr=302,cl=303,hl=304,Yo=306,ul=1e3,tr=1001,dl=1002,xn=1003,am=1004,Gs=1005,qe=1006,ca=1007,er=1008,ii=1009,Iu=1010,Du=1011,Ms=1012,ic=1013,ar=1014,ti=1015,Ds=1016,rc=1017,sc=1018,Gr=1020,Uu=35902,Nu=1021,Ou=1022,In=1023,Fu=1024,zu=1025,Nr=1026,Wr=1027,Bu=1028,oc=1029,ku=1030,ac=1031,lc=1033,Mo=33776,Eo=33777,To=33778,bo=33779,fl=35840,pl=35841,ml=35842,_l=35843,gl=36196,vl=37492,xl=37496,yl=37808,Sl=37809,Ml=37810,El=37811,Tl=37812,bl=37813,wl=37814,Al=37815,Cl=37816,Rl=37817,Pl=37818,Ll=37819,Il=37820,Dl=37821,wo=36492,Ul=36494,Nl=36495,Hu=36283,Ol=36284,Fl=36285,zl=36286,lm=3200,cm=3201,hm=0,um=1,vi="",Un="srgb",Ni="srgb-linear",cc="display-p3",$o="display-p3-linear",Do="linear",ce="srgb",Uo="rec709",No="p3",dr=7680,rh=519,dm=512,fm=513,pm=514,Vu=515,mm=516,_m=517,gm=518,vm=519,sh=35044,ki=35048,oh="300 es",ei=2e3,Oo=2001;class lr{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const 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;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const r=this._listeners[t];if(r!==void 0){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const n=this._listeners[t.type];if(n!==void 0){t.target=this;const r=n.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,t);t.target=null}}}const Ne=["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"];let ah=1234567;const ps=Math.PI/180,Es=180/Math.PI;function cr(){const i=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Ne[i&255]+Ne[i>>8&255]+Ne[i>>16&255]+Ne[i>>24&255]+"-"+Ne[t&255]+Ne[t>>8&255]+"-"+Ne[t>>16&15|64]+Ne[t>>24&255]+"-"+Ne[e&63|128]+Ne[e>>8&255]+"-"+Ne[e>>16&255]+Ne[e>>24&255]+Ne[n&255]+Ne[n>>8&255]+Ne[n>>16&255]+Ne[n>>24&255]).toLowerCase()}function De(i,t,e){return Math.max(t,Math.min(e,i))}function hc(i,t){return(i%t+t)%t}function xm(i,t,e,n,r){return n+(i-t)*(r-n)/(e-t)}function ym(i,t,e){return i!==t?(e-i)/(t-i):0}function ms(i,t,e){return(1-e)*i+e*t}function Sm(i,t,e,n){return ms(i,t,1-Math.exp(-e*n))}function Mm(i,t=1){return t-Math.abs(hc(i,t*2)-t)}function Em(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*(3-2*i))}function Tm(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*i*(i*(i*6-15)+10))}function bm(i,t){return i+Math.floor(Math.random()*(t-i+1))}function wm(i,t){return i+Math.random()*(t-i)}function Am(i){return i*(.5-Math.random())}function Cm(i){i!==void 0&&(ah=i);let t=ah+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Rm(i){return i*ps}function Pm(i){return i*Es}function Lm(i){return(i&i-1)===0&&i!==0}function Im(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function Dm(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function Um(i,t,e,n,r){const s=Math.cos,o=Math.sin,a=s(e/2),l=o(e/2),c=s((t+n)/2),h=o((t+n)/2),u=s((t-n)/2),f=o((t-n)/2),p=s((n-t)/2),x=o((n-t)/2);switch(r){case"XYX":i.set(a*h,l*u,l*f,a*c);break;case"YZY":i.set(l*f,a*h,l*u,a*c);break;case"ZXZ":i.set(l*u,l*f,a*h,a*c);break;case"XZX":i.set(a*h,l*x,l*p,a*c);break;case"YXY":i.set(l*p,a*h,l*x,a*c);break;case"ZYZ":i.set(l*x,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Cr(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Be(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const lh={DEG2RAD:ps,RAD2DEG:Es,generateUUID:cr,clamp:De,euclideanModulo:hc,mapLinear:xm,inverseLerp:ym,lerp:ms,damp:Sm,pingpong:Mm,smoothstep:Em,smootherstep:Tm,randInt:bm,randFloat:wm,randFloatSpread:Am,seededRandom:Cm,degToRad:Rm,radToDeg:Pm,isPowerOfTwo:Lm,ceilPowerOfTwo:Im,floorPowerOfTwo:Dm,setQuaternionFromProperEuler:Um,normalize:Be,denormalize:Cr};class St{constructor(t=0,e=0){St.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){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=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){const 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}
vendor: 4,774 bytes, line 5
5round(){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){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(De(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const 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){const n=Math.cos(e),r=Math.sin(e),s=this.x-t.x,o=this.y-t.y;return this.x=s*n-o*r+t.x,this.y=s*r+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Bt{constructor(t,e,n,r,s,o,a,l,c){Bt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,r,s,o,a,l,c)}set(t,e,n,r,s,o,a,l,c){const h=this.elements;return h[0]=t,h[1]=r,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){const 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){const 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){const n=t.elements,r=e.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],h=n[4],u=n[7],f=n[2],p=n[5],x=n[8],v=r[0],m=r[3],g=r[6],E=r[1],S=r[4],w=r[7],P=r[2],R=r[5],A=r[8];return s[0]=o*v+a*E+l*P,s[3]=o*m+a*S+l*R,s[6]=o*g+a*w+l*A,s[1]=c*v+h*E+u*P,s[4]=c*m+h*S+u*R,s[7]=c*g+h*w+u*A,s[2]=f*v+p*E+x*P,s[5]=f*m+p*S+x*R,s[8]=f*g+p*w+x*A,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],n=t[1],r=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+r*s*c-r*o*l}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=h*o-a*c,f=a*l-h*s,p=c*s-o*l,x=e*u+n*f+r*p;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/x;return t[0]=u*v,t[1]=(r*c-h*n)*v,t[2]=(a*n-r*o)*v,t[3]=f*v,t[4]=(h*e-r*l)*v,t[5]=(r*s-a*e)*v,t[6]=p*v,t[7]=(n*l-c*e)*v,t[8]=(o*e-n*s)*v,this}transpose(){let t;const 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){const 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,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+t,-r*c,r*l,-r*(-c*o+l*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(ha.makeScale(t,e)),this}rotate(t){return this.premultiply(ha.makeRotation(-t)),this}translate(t,e){return this.premultiply(ha.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){const 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){const e=this.elements,n=t.elements;for(let r=0;r<9;r++)if(e[r]!==n[r])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){const 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)}}const ha=new Bt;function Gu(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function Fo(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}
5function Nm(){const i=Fo("canvas");return i.style.display="block",i}const ch={};function Ao(i){i in ch||(ch[i]=!0,console.warn(i))}function Om(i,t,e){return new Promise(function(n,r){function s(){switch(i.clientWaitSync(t,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(s,e);break;default:n()}}setTimeout(s,e)})}function Fm(i){const t=i.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function zm(i){const t=i.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const hh=new Bt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),uh=new Bt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),is={[Ni]:{transfer:Do,primaries:Uo,luminanceCoefficients:[.2126,.7152,.0722],toReference:i=>i,fromReference:i=>i},[Un]:{transfer:ce,primaries:Uo,luminanceCoefficients:[.2126,.7152,.0722],toReference:i=>i.convertSRGBToLinear(),fromReference:i=>i.convertLinearToSRGB()},[$o]:{transfer:Do,primaries:No,luminanceCoefficients:[.2289,.6917,.0793],toReference:i=>i.applyMatrix3(uh),fromReference:i=>i.applyMatrix3(hh)},[cc]:{transfer:ce,primaries:No,luminanceCoefficients:[.2289,.6917,.0793],toReference:i=>i.convertSRGBToLinear().applyMatrix3(uh),fromReference:i=>i.applyMatrix3(hh).convertLinearToSRGB()}},Bm=new Set([Ni,$o]),ee={enabled:!0,_workingColorSpace:Ni,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(i){if(!Bm.has(i))throw new Error(`Unsupported working color space, "${i}".`);this._workingColorSpace=i},convert:function(i,t,e){if(this.enabled===!1||t===e||!t||!e)return i;const n=is[t].toReference,r=is[e].fromReference;return r(n(i))},fromWorkingColorSpace:function(i,t){return this.convert(i,this._workingColorSpace,t)},toWorkingColorSpace:function(i,t){return this.convert(i,t,this._workingColorSpace)},getPrimaries:function(i){return is[i].primaries},getTransfer:function(i){return i===vi?Do:is[i].transfer},getLuminanceCoefficients:function(i,t=this._workingColorSpace){return i.fromArray(is[t].luminanceCoefficients)}};function Or(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function ua(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let fr;class km{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{fr===void 0&&(fr=Fo("canvas")),fr.width=t.width,fr.height=t.height;const n=fr.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=fr}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){const e=Fo("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Or(s[o]/255)*255;return n.putImageData(r,0,0),e}else if(t.data){const e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(Or(e[n]/255)*255):e[n]=Or(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}}let Hm=0;class Wu{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Hm++}),this.uuid=cr(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(da(r[o].image)):s.push(da(r[o]))}else s=da(r);n.url=s}return e||(t.images[this.uuid]=n),n}}function da(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?km.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Vm=0,Mn=class Co extends lr{constructor(t=Co.DEFAULT_IMAGE,e=Co.DEFAULT_MAPPING,n=tr,r=tr,s=qe,o=er,a=In,l=ii,c=Co.DEFAULT_ANISOTROPY,h=vi){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Vm++}),this.uuid=cr(),this.name="",this.source=new Wu(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new St(0,0),this.repeat=new St(1,1),this.center=new St(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Bt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace
vendor: 4,378 bytes, line 5
5=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){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const 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!==Lu)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ul:t.x=t.x-Math.floor(t.x);break;case tr:t.x=t.x<0?0:1;break;case dl: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 ul:t.y=t.y-Math.floor(t.y);break;case tr:t.y=t.y<0?0:1;break;case dl: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++}};Mn.DEFAULT_IMAGE=null;Mn.DEFAULT_MAPPING=Lu;Mn.DEFAULT_ANISOTROPY=1;class Me{constructor(t=0,e=0,n=0,r=1){Me.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw 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){const e=this.x,n=this.y,r=this.z,s=this.w,o=t.elements;
vendor: 15,746 bytes, line 5
5return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*s,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*s,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*s,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const 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,r,s;const l=t.elements,c=l[0],h=l[4],u=l[8],f=l[1],p=l[5],x=l[9],v=l[2],m=l[6],g=l[10];if(Math.abs(h-f)<.01&&Math.abs(u-v)<.01&&Math.abs(x-m)<.01){if(Math.abs(h+f)<.1&&Math.abs(u+v)<.1&&Math.abs(x+m)<.1&&Math.abs(c+p+g-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const S=(c+1)/2,w=(p+1)/2,P=(g+1)/2,R=(h+f)/4,A=(u+v)/4,L=(x+m)/4;return S>w&&S>P?S<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(S),r=R/n,s=A/n):w>P?w<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(w),n=R/r,s=L/r):P<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(P),n=A/s,r=L/s),this.set(n,r,s,e),this}let E=Math.sqrt((m-x)*(m-x)+(u-v)*(u-v)+(f-h)*(f-h));return Math.abs(E)<.001&&(E=1),this.x=(m-x)/E,this.y=(u-v)/E,this.z=(f-h)/E,this.w=Math.acos((c+p+g-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=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){const 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}}class Gm extends lr{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Me(0,0,t,e),this.scissorTest=!1,this.viewport=new Me(0,0,t,e);const r={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:qe,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const s=new Mn(r,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=[];const 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 r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=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,r=t.textures.length;n<r;n++)this.textures[n]=t.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new Wu(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"})}}class Ri extends Gm{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class Xu extends Mn{constructor(t=null,e=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=xn,this.minFilter=xn,this.wrapR=tr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class Wm extends Mn{constructor(t=null,e=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=xn,this.minFilter=xn,this.wrapR=tr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Jr{constructor(t=0,e=0,n=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=r}static slerpFlat(t,e,n,r,s,o,a){let l=n[r+0],c=n[r+1],h=n[r+2],u=n[r+3];const f=s[o+0],p=s[o+1],x=s[o+2],v=s[o+3];if(a===0){t[e+0]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u;return}if(a===1){t[e+0]=f,t[e+1]=p,t[e+2]=x,t[e+3]=v;return}if(u!==v||l!==f||c!==p||h!==x){let m=1-a;const g=l*f+c*p+h*x+u*v,E=g>=0?1:-1,S=1-g*g;if(S>Number.EPSILON){const P=Math.sqrt(S),R=Math.atan2(P,g*E);m=Math.sin(m*R)/P,a=Math.sin(a*R)/P}const w=a*E;if(l=l*m+f*w,c=c*m+p*w,h=h*m+x*w,u=u*m+v*w,m===1-a){const P=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=P,c*=P,h*=P,u*=P}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,r,s,o){const a=n[r],l=n[r+1],c=n[r+2],h=n[r+3],u=s[o],f=s[o+1],p=s[o+2],x=s[o+3];return t[e]=a*x+h*u+l*p-c*f,t[e+1]=l*x+h*f+c*u-a*p,t[e+2]=c*x+h*p+a*f-l*u,t[e+3]=h*x-a*u-l*f-c*p,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,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,r=t._y,s=t._z,o=t._order,a=Math.cos,l=Math.sin,c=a(n/2),h=a(r/2),u=a(s/2),f=l(n/2),p=l(r/2),x=l(s/2);switch(o){case"XYZ":this._x=f*h*u+c*p*x,this._y=c*p*u-f*h*x,this._z=c*h*x+f*p*u,this._w=c*h*u-f*p*x;break;case"YXZ":this._x=f*h*u+c*p*x,this._y=c*p*u-f*h*x,this._z=c*h*x-f*p*u,this._w=c*h*u+f*p*x;break;case"ZXY":this._x=f*h*u-c*p*x,this._y=c*p*u+f*h*x,this._z=c*h*x+f*p*u,this._w=c*h*u-f*p*x;break;case"ZYX":this._x=f*h*u-c*p*x,this._y=c*p*u+f*h*x,this._z=c*h*x-f*p*u,this._w=c*h*u+f*p*x;break;case"YZX":this._x=f*h*u+c*p*x,this._y=c*p*u+f*h*x,this._z=c*h*x-f*p*u,this._w=c*h*u-f*p*x;break;case"XZY":this._x=f*h*u-c*p*x,this._y=c*p*u-f*h*x,this._z=c*h*x+f*p*u,this._w=c*h*u+f*p*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],s=e[8],o=e[1],a=e[5],l=e[9],c=e[2],h=e[6],u=e[10],f=n+a+u;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(h-l)*p,this._y=(s-c)*p,this._z=(o-r)*p}else if(n>a&&n>u){const p=2*Math.sqrt(1+n-a-u);this._w=(h-l)/p,this._x=.25*p,this._y=(r+o)/p,this._z=(s+c)/p}else if(a>u){const p=2*Math.sqrt(1+a-n-u);this._w=(s-c)/p,this._x=(r+o)/p,this._y=.25*p,this._z=(l+h)/p}else{const p=2*Math.sqrt(1+u-n-a);this._w=(o-r)/p,this._x=(s+c)/p,this._y=(l+h)/p,this._z=.25*p}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(De(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 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){const n=t._x,r=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+r*c-s*l,this._y=r*h+o*l+s*a-n*c,this._z=s*h+o*c+n*l-r*a,this._w=o*h-n*a-r*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,r=this._y,s=this._z,o=this._w;let a=o*t._w+n*t._x+r*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=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const p=1-e;return this._w=p*o+e*this._w,this._x=p*n+e*this._x,this._y=p*r+e*this._y,this._z=p*s+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,a),u=Math.sin((1-e)*h)/c,f=Math.sin(e*h)/c;return this._w=o*u+this._w*f,this._x=n*u+this._x*f,this._y=r*u+this._y*f,this._z=s*u+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class U{constructor(t=0,e=0,n=0){U.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(dh.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(dh.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*r,this.y=s[1]*e+s[4]*n+s[7]*r,this.z=s[2]*e+s[5]*n+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,s=t.elements,o=1/(s[3]*e+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*r+s[12])*o,this.y=(s[1]*e+s[5]*n+s[9]*r+s[13])*o,this.z=(s[2]*e+s[6]*n+s[10]*r+s[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,s=t.x,o=t.y,a=t.z,l=t.w,c=2*(o*r-a*n),h=2*(a*e-s*r),u=2*(s*n-o*e);return this.x=e+l*c+o*u-a*h,this.y=n+l*h+a*c-s*u,this.z=r+l*u+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){const e=this.x,n=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*r,this.y=s[1]*e+s[5]*n+s[9]*r,this.z=s[2]*e+s[6]*n+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=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){const 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}
vendor: 6,929 bytes, line 5
5round(){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){const n=t.x,r=t.y,s=t.z,o=e.x,a=e.y,l=e.z;return this.x=r*l-s*a,this.y=s*o-n*l,this.z=n*a-r*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return fa.copy(this).projectOnVector(t),this.sub(fa)}reflect(t){return this.sub(fa.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(De(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*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){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,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(){const 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}}const fa=new U,dh=new Jr;class Us{constructor(t=new U(1/0,1/0,1/0),e=new U(-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(An.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(An.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){const n=An.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);const n=t.geometry;if(n!==void 0){const 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,An):An.fromBufferAttribute(s,o),An.applyMatrix4(t.matrixWorld),this.expandByPoint(An);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Ws.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Ws.copy(n.boundingBox)),Ws.applyMatrix4(t.matrixWorld),this.union(Ws)}const r=t.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[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,An),An.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(rs),Xs.subVectors(this.max,rs),pr.subVectors(t.a,rs),mr.subVectors(t.b,rs),_r.subVectors(t.c,rs),ci.subVectors(mr,pr),hi.subVectors(_r,mr),Hi.subVectors(pr,_r);let e=[0,-ci.z,ci.y,0,-hi.z,hi.y,0,-Hi.z,Hi.y,ci.z,0,-ci.x,hi.z,0,-hi.x,Hi.z,0,-Hi.x,-ci.y,ci.x,0,-hi.y,hi.x,0,-Hi.y,Hi.x,0];return!pa(e,pr,mr,_r,Xs)||(e=[1,0,0,0,1,0,0,0,1],!pa(e,pr,mr,_r,Xs))?!1:(qs.crossVectors(ci,hi),e=[qs.x,qs.y,qs.z],pa(e,pr,mr,_r,Xs))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,An).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radiu
vendor: 22,672 bytes, line 5
5s=this.getSize(An).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:(Xn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Xn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Xn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Xn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Xn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Xn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Xn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Xn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Xn),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)}}const Xn=[new U,new U,new U,new U,new U,new U,new U,new U],An=new U,Ws=new Us,pr=new U,mr=new U,_r=new U,ci=new U,hi=new U,Hi=new U,rs=new U,Xs=new U,qs=new U,Vi=new U;function pa(i,t,e,n,r){for(let s=0,o=i.length-3;s<=o;s+=3){Vi.fromArray(i,s);const a=r.x*Math.abs(Vi.x)+r.y*Math.abs(Vi.y)+r.z*Math.abs(Vi.z),l=t.dot(Vi),c=e.dot(Vi),h=n.dot(Vi);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>a)return!1}return!0}const Xm=new Us,ss=new U,ma=new U;class Ns{constructor(t=new U,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){const n=this.center;e!==void 0?n.copy(e):Xm.setFromPoints(t).getCenter(n);let r=0;for(let s=0,o=t.length;s<o;s++)r=Math.max(r,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const 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){const 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;ss.subVectors(t,this.center);const e=ss.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),r=(n-this.radius)*.5;this.center.addScaledVector(ss,r/n),this.radius+=r}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):(ma.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(ss.copy(t.center).add(ma)),this.expandByPoint(ss.copy(t.center).sub(ma))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const qn=new U,_a=new U,Ys=new U,ui=new U,ga=new U,$s=new U,va=new U;class uc{constructor(t=new U,e=new U(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,qn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const 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){const e=qn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(qn.copy(this.origin).addScaledVector(this.direction,e),qn.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){_a.copy(t).add(e).multiplyScalar(.5),Ys.copy(e).sub(t).normalize(),ui.copy(this.origin).sub(_a);const s=t.distanceTo(e)*.5,o=-this.direction.dot(Ys),a=ui.dot(this.direction),l=-ui.dot(Ys),c=ui.lengthSq(),h=Math.abs(1-o*o);let u,f,p,x;if(h>0)if(u=o*l-a,f=o*a-l,x=s*h,u>=0)if(f>=-x)if(f<=x){const v=1/h;u*=v,f*=v,p=u*(u+o*f+2*a)+f*(o*u+f+2*l)+c}else f=s,u=Math.max(0,-(o*f+a)),p=-u*u+f*(f+2*l)+c;else f=-s,u=Math.max(0,-(o*f+a)),p=-u*u+f*(f+2*l)+c;else f<=-x?(u=Math.max(0,-(-o*s+a)),f=u>0?-s:Math.min(Math.max(-s,-l),s),p=-u*u+f*(f+2*l)+c):f<=x?(u=0,f=Math.min(Math.max(-s,-l),s),p=f*(f+2*l)+c):(u=Math.max(0,-(o*s+a)),f=u>0?s:Math.min(Math.max(-s,-l),s),p=-u*u+f*(f+2*l)+c);else f=o>0?-s:s,u=Math.max(0,-(o*f+a)),p=-u*u+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(_a).addScaledVector(Ys,f),p}intersectSphere(t,e){qn.subVectors(t.center,this.origin);const n=qn.dot(this.direction),r=qn.dot(qn)-n*n,s=t.radius*t.radius;if(r>s)return null;const o=Math.sqrt(s-r),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){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,s,o,a,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,f=this.origin;return c>=0?(n=(t.min.x-f.x)*c,r=(t.max.x-f.x)*c):(n=(t.max.x-f.x)*c,r=(t.min.x-f.x)*c),h>=0?(s=(t.min.y-f.y)*h,o=(t.max.y-f.y)*h):(s=(t.max.y-f.y)*h,o=(t.min.y-f.y)*h),n>o||s>r||((s>n||isNaN(n))&&(n=s),(o<r||isNaN(r))&&(r=o),u>=0?(a=(t.min.z-f.z)*u,l=(t.max.z-f.z)*u):(a=(t.max.z-f.z)*u,l=(t.min.z-f.z)*u),n>l||a>r)||((a>n||n!==n)&&(n=a),(l<r||r!==r)&&(r=l),r<0)?null:this.at(n>=0?n:r,e)}intersectsBox(t){return this.intersectBox(t,qn)!==null}intersectTriangle(t,e,n,r,s){ga.subVectors(e,t),$s.subVectors(n,t),va.crossVectors(ga,$s);let o=this.direction.dot(va),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ui.subVectors(this.origin,t);const l=a*this.direction.dot($s.crossVectors(ui,$s));if(l<0)return null;const c=a*this.direction.dot(ga.cross(ui));if(c<0||l+c>o)return null;const h=-a*ui.dot(va);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)}}class me{constructor(t,e,n,r,s,o,a,l,c,h,u,f,p,x,v,m){me.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,r,s,o,a,l,c,h,u,f,p,x,v,m)}set(t,e,n,r,s,o,a,l,c,h,u,f,p,x,v,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=h,g[10]=u,g[14]=f,g[3]=p,g[7]=x,g[11]=v,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 me().fromArray(this.elements)}copy(t){const 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){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const 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){const e=this.elements,n=t.elements,r=1/gr.setFromMatrixColumn(t,0).length(),s=1/gr.setFromMatrixColumn(t,1).length(),o=1/gr.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,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){const e=this.elements,n=t.x,r=t.y,s=t.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),u=Math.sin(s);if(t.order==="XYZ"){const f=o*h,p=o*u,x=a*h,v=a*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=p+x*c,e[5]=f-v*c,e[9]=-a*l,e[2]=v-f*c,e[6]=x+p*c,e[10]=o*l}else if(t.order==="YXZ"){const f=l*h,p=l*u,x=c*h,v=c*u;e[0]=f+v*a,e[4]=x*a-p,e[8]=o*c,e[1]=o*u,e[5]=o*h,e[9]=-a,e[2]=p*a-x,e[6]=v+f*a,e[10]=o*l}else if(t.order==="ZXY"){const f=l*h,p=l*u,x=c*h,v=c*u;e[0]=f-v*a,e[4]=-o*u,e[8]=x+p*a,e[1]=p+x*a,e[5]=o*h,e[9]=v-f*a,e[2]=-o*c,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){const f=o*h,p=o*u,x=a*h,v=a*u;e[0]=l*h,e[4]=x*c-p,e[8]=f*c+v,e[1]=l*u,e[5]=v*c+f,e[9]=p*c-x,e[2]=-c,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){const f=o*l,p=o*c,x=a*l,v=a*c;e[0]=l*h,e[4]=v-f*u,e[8]=x*u+p,e[1]=u,e[5]=o*h,e[9]=-a*h,e[2]=-c*h,e[6]=p*u+x,e[10]=f-v*u}else if(t.order==="XZY"){const f=o*l,p=o*c,x=a*l,v=a*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=f*u+v,e[5]=o*h,e[9]=p*u-x,e[2]=x*u-p,e[6]=a*h,e[10]=v*u+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(qm,t,Ym)}lookAt(t,e,n){const r=this.elements;return rn.subVectors(t,e),rn.lengthSq()===0&&(rn.z=1),rn.normalize(),di.crossVectors(n,rn),di.lengthSq()===0&&(Math.abs(n.z)===1?rn.x+=1e-4:rn.z+=1e-4,rn.normalize(),di.crossVectors(n,rn)),di.normalize(),Zs.crossVectors(rn,di),r[0]=di.x,r[4]=Zs.x,r[8]=rn.x,r[1]=di.y,r[5]=Zs.y,r[9]=rn.y,r[2]=di.z,r[6]=Zs.z,r[10]=rn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],h=n[1],u=n[5],f=n[9],p=n[13],x=n[2],v=n[6],m=n[10],g=n[14],E=n[3],S=n[7],w=n[11],P=n[15],R=r[0],A=r[4],L=r[8],F=r[12],y=r[1],b=r[5],G=r[9],z=r[13],W=r[2],K=r[6],k=r[10],j=r[14],X=r[3],lt=r[7],ct=r[11],pt=r[15];return s[0]=o*R+a*y+l*W+c*X,s[4]=o*A+a*b+l*K+c*lt,s[8]=o*L+a*G+l*k+c*ct,s[12]=o*F+a*z+l*j+c*pt,s[1]=h*R+u*y+f*W+p*X,s[5]=h*A+u*b+f*K+p*lt,s[9]=h*L+u*G+f*k+p*ct,s[13]=h*F+u*z+f*j+p*pt,s[2]=x*R+v*y+m*W+g*X,s[6]=x*A+v*b+m*K+g*lt,s[10]=x*L+v*G+m*k+g*ct,s[14]=x*F+v*z+m*j+g*pt,s[3]=E*R+S*y+w*W+P*X,s[7]=E*A+S*b+w*K+P*lt,s[11]=E*L+S*G+w*k+P*ct,s[15]=E*F+S*z+w*j+P*pt,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],n=t[4],r=t[8],s=t[12],o=t[1],a=t[5],l=t[9],c=t[13],h=t[2],u=t[6],f=t[10],p=t[14],x=t[3],v=t[7],m=t[11],g=t[15];return x*(+s*l*u-r*c*u-s*a*f+n*c*f+r*a*p-n*l*p)+v*(+e*l*p-e*c*f+s*o*f-r*o*p+r*c*h-s*l*h)+m*(+e*c*u-e*a*p-s*o*u+n*o*p+s*a*h-n*c*h)+g*(-r*a*h-e*l*u+e*a*f+r*o*u-n*o*f+n*l*h)}transpose(){const t=this.elements;let 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){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=t[9],f=t[10],p=t[11],x=t[12],v=t[13],m=t[14],g=t[15],E=u*m*c-v*f*c+v*l*p-a*m*p-u*l*g+a*f*g,S=x*f*c-h*m*c-x*l*p+o*m*p+h*l*g-o*f*g,w=h*v*c-x*u*c+x*a*p-o*v*p-h*a*g+o*u*g,P=x*u*l-h*v*l-x*a*f+o*v*f+h*a*m-o*u*m,R=e*E+n*S+r*w+s*P;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/R;return t[0]=E*A,t[1]=(v*f*s-u*m*s-v*r*p+n*m*p+u*r*g-n*f*g)*A,t[2]=(a*m*s-v*l*s+v*r*c-n*m*c-a*r*g+n*l*g)*A,t[3]=(u*l*s-a*f*s-u*r*c+n*f*c+a*r*p-n*l*p)*A,t[4]=S*A,t[5]=(h*m*s-x*f*s+x*r*p-e*m*p-h*r*g+e*f*g)*A,t[6]=(x*l*s-o*m*s-x*r*c+e*m*c+o*r*g-e*l*g)*A,t[7]=(o*f*s-h*l*s+h*r*c-e*f*c-o*r*p+e*l*p)*A,t[8]=w*A,t[9]=(x*u*s-h*v*s-x*n*p+e*v*p+h*n*g-e*u*g)*A,t[10]=(o*v*s-x*a*s+x*n*c-e*v*c-o*n*g+e*a*g)*A,t[11]=(h*a*s-o*u*s-h*n*c+e*u*c+o*n*p-e*a*p)*A,t[12]=P*A,t[13]=(h*v*r-x*u*r+x*n*f-e*v*f-h*n*m+e*u*m)*A,t[14]=(x*a*r-o*v*r-x*n*l+e*v*l+o*n*m-e*a*m)*A,t[15]=(o*u*r-h*a*r+h*n*l-e*u*l-o*n*f+e*a*f)*A,this}scale(t){const e=this.elements,n=t.x,r=t.y,s=t.z;return e[0]*=n,e[4]*=r,e[8]*=s,e[1]*=n,e[5]*=r,e[9]*=s,e[2]*=n,e[6]*=r,e[10]*=s,e[3]*=n,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const 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],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}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){const 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){const 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){const 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){const n=Math.cos(e),r=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-r*l,c*l+r*a,0,c*a+r*l,h*a+n,h*l-r*o,0,c*l-r*a,h*l+r*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,r,s,o){return this.set(1,n,s,0,t,1,o,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,s=e._x,o=e._y,a=e._z,l=e._w,c=s+s,h=o+o,u=a+a,f=s*c,p=s*h,x=s*u,v=o*h,m=o*u,g=a*u,E=l*c,S=l*h,w=l*u,P=n.x,R=n.y,A=n.z;return r[0]=(1-(v+g))*P,r[1]=(p+w)*P,r[2]=(x-S)*P,r[3]=0,r[4]=(p-w)*R,r[5]=(1-(f+g))*R,r[6]=(m+E)*R,r[7]=0,r[8]=(x+S)*A,r[9]=(m-E)*A,r[10]=(1-(f+v))*A,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let s=gr.set(r[0],r[1],r[2]).length();const o=gr.set(r[4],r[5],r[6]).length(),a=gr.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],Cn.copy(this);const c=1/s,h=1/o,u=1/a;return Cn.elements[0]*=c,Cn.elements[1]*=c,Cn.elements[2]*=c,Cn.elements[4]*=h,Cn.elements[5]*=h,Cn.elements[6]*=h,Cn.elements[8]*=u,Cn.elements[9]*=u,Cn.elements[10]*=u,e.setFromRotationMatrix(Cn),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,r,s,o,a=ei){const l=this.elements,c=2*s/(e-t),h=2*s/(n-r),u=(e+t)/(e-t),f=(n+r)/(n-r);let p,x;if(a===ei)p=-(o+s)/(o-s),x=-2*o*s/(o-s);else if(a===Oo)p=-o/(o-s),x=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=x,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,r,s,o,a=ei){const l=this.elements,c=1/(e-t),h=1/(n-r),u=1/(o-s),f=(e+t)*c,p=(n+r)*h;let x,v;if(a===ei)x=(o+s)*u,v=-2*u;else if(a===Oo)x=s*u,v=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=v,l[14]=-x,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let r=0;r<16;r++)if(e[r]!==n[r])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){const 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}}const gr=new U,Cn=new me,qm=new U(0,0,0),Ym=new U(1,1,1),di=new U,Zs=new U,rn=new U,fh=new me,ph=new Jr;class ri{constructor(t=0,e=0,n=0,r=ri.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],f=r[6],p=r[10];switch(e){case"XYZ":this._y=Math.asin(De(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-De(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(De(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-De(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(De(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-De(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,p),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 fh.makeRotationFromQuaternion(t),this.setFromRotationMatrix(fh,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return ph.setFromEuler(this),this.setFromQuaternion(ph,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}}ri.DEFAULT_ORDER="XYZ";class qu{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}}let $m=0;const mh=new U,vr=new Jr,Yn=new me,Ks=new U,os=new U,Zm=new U,Km=new Jr,_h=new U(1,0,0),gh=new U(0,1,0),vh=new U(0,0,1),xh={type:"added"},jm={type:"removed"},xr={type:"childadded",child:null},xa={type:"childremoved",child:null};class Ve extends lr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:$m++}),this.uuid=cr(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ve.DEFAULT_UP.clone();const t=new U,e=new ri,n=new Jr,r=new U(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:r},modelViewMatrix:{value:new me},normalMatrix:{value:new Bt}}),this.matrix=new me,this.matrixWorld=new me,this.matrixAutoUpdate=Ve.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Ve.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new qu,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 vr.setFromAxisAngle(t,e),this.quaternion.multiply(vr),this}rotateOnWorldAxis(t,e){return vr.setFromAxisAngle(t,e),this.quaternion.premultiply(vr),this}rotateX(t){return this.rotateOnAxis(_h,t)}rotateY(t){return this.rotateOnAxis(gh,t)}rotateZ(t){return this.rotateOnAxis(vh,t)}translateOnAxis(t,e){return mh.copy(t).applyQuaternion(this.quaternion),this.position.add(mh.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(_h,t)}translateY(t){return this.translateOnAxis(gh,t)}translateZ(t){return this.translateOnAxis(vh,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Yn.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Ks.copy(t):Ks.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),os.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Yn.lookAt(os,Ks,this.up):Yn.lookAt(Ks,os,this.up),this.quaternion.setFromRotationMatrix(Yn),r&&(Yn.extractRotation(r.matrixWorld),vr.setFromRotationMatrix(Yn),this.quaternion.premultiply(vr.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(xh),xr.child=t,this.dispatchEvent(xr),xr.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}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(jm),xa.child=t,this.dispatchEvent(xa),xa.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Yn.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Yn.multiply(t.parent.matrixWorld)),t.applyM
vendor: 4,115 bytes, line 5
5atrix4(Yn),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(xh),xr.child=t,this.dispatchEvent(xr),xr.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,r=this.children.length;n<r;n++){const o=this.children[n].getObjectByProperty(t,e);if(o!==void 0)return o}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[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(os,t,Zm),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(os,Km,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}traverseAncestors(t){const 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.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)}updateWorldMatrix(t,e){const n=this.parent;if(t===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),e===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(t){const 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"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.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()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boun
vendor: 57,986 bytes, lines 5-44
5dingBox.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?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const u=l[c];s(t.shapes,u)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(t.materials,this.material[l]));r.material=a}else r.material=s(t.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(t.animations,l))}}if(e){const a=o(t.geometries),l=o(t.materials),c=o(t.textures),h=o(t.images),u=o(t.shapes),f=o(t.skeletons),p=o(t.animations),x=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),u.length>0&&(n.shapes=u),f.length>0&&(n.skeletons=f),p.length>0&&(n.animations=p),x.length>0&&(n.nodes=x)}return n.object=r,n;function o(a){const l=[];for(const c in a){const 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++){const r=t.children[n];this.add(r.clone())}return this}}Ve.DEFAULT_UP=new U(0,1,0);Ve.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ve.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Rn=new U,$n=new U,ya=new U,Zn=new U,yr=new U,Sr=new U,yh=new U,Sa=new U,Ma=new U,Ea=new U,Ta=new Me,ba=new Me,wa=new Me;class Pn{constructor(t=new U,e=new U,n=new U){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),Rn.subVectors(t,e),r.cross(Rn);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,n,r,s){Rn.subVectors(r,e),$n.subVectors(n,e),ya.subVectors(t,e);const o=Rn.dot(Rn),a=Rn.dot($n),l=Rn.dot(ya),c=$n.dot($n),h=$n.dot(ya),u=o*c-a*a;if(u===0)return s.set(0,0,0),null;const f=1/u,p=(c*l-a*h)*f,x=(o*h-a*l)*f;return s.set(1-p-x,x,p)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,Zn)===null?!1:Zn.x>=0&&Zn.y>=0&&Zn.x+Zn.y<=1}static getInterpolation(t,e,n,r,s,o,a,l){return this.getBarycoord(t,e,n,r,Zn)===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,Zn.x),l.addScaledVector(o,Zn.y),l.addScaledVector(a,Zn.z),l)}static getInterpolatedAttribute(t,e,n,r,s,o){return Ta.setScalar(0),ba.setScalar(0),wa.setScalar(0),Ta.fromBufferAttribute(t,e),ba.fromBufferAttribute(t,n),wa.fromBufferAttribute(t,r),o.setScalar(0),o.addScaledVector(Ta,s.x),o.addScaledVector(ba,s.y),o.addScaledVector(wa,s.z),o}static isFrontFacing(t,e,n,r){return Rn.subVectors(n,e),$n.subVectors(t,e),Rn.cross($n).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,n,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Rn.subVectors(this.c,this.b),$n.subVectors(this.a,this.b),Rn.cross($n).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Pn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Pn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,r,s){return Pn.getInterpolation(t,this.a,this.b,this.c,e,n,r,s)}containsPoint(t){return Pn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Pn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,s=this.c;let o,a;yr.subVectors(r,n),Sr.subVectors(s,n),Sa.subVectors(t,n);const l=yr.dot(Sa),c=Sr.dot(Sa);if(l<=0&&c<=0)return e.copy(n);Ma.subVectors(t,r);const h=yr.dot(Ma),u=Sr.dot(Ma);if(h>=0&&u<=h)return e.copy(r);const f=l*u-h*c;if(f<=0&&l>=0&&h<=0)return o=l/(l-h),e.copy(n).addScaledVector(yr,o);Ea.subVectors(t,s);const p=yr.dot(Ea),x=Sr.dot(Ea);if(x>=0&&p<=x)return e.copy(s);const v=p*c-l*x;if(v<=0&&c>=0&&x<=0)return a=c/(c-x),e.copy(n).addScaledVector(Sr,a);const m=h*x-p*u;if(m<=0&&u-h>=0&&p-x>=0)return yh.subVectors(s,r),a=(u-h)/(u-h+(p-x)),e.copy(r).addScaledVector(yh,a);const g=1/(m+v+f);return o=v*g,a=f*g,e.copy(n).addScaledVector(yr,o).addScaledVector(Sr,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Yu={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},fi={h:0,s:0,l:0},js={h:0,s:0,l:0};function Aa(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}class Kt{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){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Un){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,ee.toWorkingColorSpace(this,e),this}setRGB(t,e,n,r=ee.workingColorSpace){return this.r=t,this.g=e,this.b=n,ee.toWorkingColorSpace(this,r),this}setHSL(t,e,n,r=ee.workingColorSpace){if(t=hc(t,1),e=De(e,0,1),n=De(n,0,1),e===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+e):n+e-n*e,o=2*n-s;this.r=Aa(o,s,t+1/3),this.g=Aa(o,s,t),this.b=Aa(o,s,t-1/3)}return ee.toWorkingColorSpace(this,r),this}setStyle(t,e=Un){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const o=r[1],a=r[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(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[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=Un){const n=Yu[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=Or(t.r),this.g=Or(t.g),this.b=Or(t.b),this}copyLinearToSRGB(t){return this.r=ua(t.r),this.g=ua(t.g),this.b=ua(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Un){return ee.fromWorkingColorSpace(Oe.copy(this),t),Math.round(De(Oe.r*255,0,255))*65536+Math.round(De(Oe.g*255,0,255))*256+Math.round(De(Oe.b*255,0,255))}getHexString(t=Un){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=ee.workingColorSpace){ee.fromWorkingColorSpace(Oe.copy(this),e);const n=Oe.r,r=Oe.g,s=Oe.b,o=Math.max(n,r,s),a=Math.min(n,r,s);let l,c;const h=(a+o)/2;if(a===o)l=0,c=0;else{const u=o-a;switch(c=h<=.5?u/(o+a):u/(2-o-a),o){case n:l=(r-s)/u+(r<s?6:0);break;case r:l=(s-n)/u+2;break;case s:l=(n-r)/u+4;break}l/=6}return t.h=l,t.s=c,t.l=h,t}getRGB(t,e=ee.workingColorSpace){return ee.fromWorkingColorSpace(Oe.copy(this),e),t.r=Oe.r,t.g=Oe.g,t.b=Oe.b,t}getStyle(t=Un){ee.fromWorkingColorSpace(Oe.copy(this),t);const e=Oe.r,n=Oe.g,r=Oe.b;return t!==Un?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(t,e,n){return this.getHSL(fi),this.setHSL(fi.h+t,fi.s+e,fi.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(fi),t.getHSL(js);const n=ms(fi.h,js.h,e),r=ms(fi.s,js.s,e),s=ms(fi.l,js.l,e);return this.setHSL(n,r,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,r=this.b,s=t.elements;return this.r=s[0]*e+s[3]*n+s[6]*r,this.g=s[1]*e+s[4]*n+s[7]*r,this.b=s[2]*e+s[5]*n+s[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Oe=new Kt;Kt.NAMES=Yu;let Jm=0;class Qr extends lr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Jm++}),this.uuid=cr(),this.name="",this.type="Material",this.blending=Ur,this.side=Ci,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=tl,this.blendDst=el,this.blendEquation=Ji,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Kt(0,0,0),this.blendAlpha=0,this.depthFunc=kr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=rh,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=dr,this.stencilZFail=dr,this.stencilZPass=dr,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}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const 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!==Ur&&(n.blending=this.blending),this.side!==Ci&&(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!==tl&&(n.blendSrc=this.blendSrc),this.blendDst!==el&&(n.blendDst=this.blendDst),this.blendEquation!==Ji&&(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!==kr&&(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!==rh&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==dr&&(n.stencilFail=this.stencilFail),this.stencilZFail!==dr&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==dr&&(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 r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(e){const s=r(t.textures),o=r(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;const e=t.clippingPlanes;let n=null;if(e!==null){const r=e.length;n=new Array(r);for(let s=0;s!==r;++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++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class dc extends Qr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Kt(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 ri,this.combine=Pu,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}}const Te=new U,Js=new St;class we{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=sh,this.updateRanges=[],this.gpuType=ti,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[t+r]=e.array[n+r];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++)Js.fromBufferAttribute(this,e),Js.applyMatrix3(t),this.setXY(e,Js.x,Js.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Te.fromBufferAttribute(this,e),Te.applyMatrix3(t),this.setXYZ(e,Te.x,Te.y,Te.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Te.fromBufferAttribute(this,e),Te.applyMatrix4(t),this.setXYZ(e,Te.x,Te.y,Te.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Te.fromBufferAttribute(this,e),Te.applyNormalMatrix(t),this.setXYZ(e,Te.x,Te.y,Te.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Te.fromBufferAttribute(this,e),Te.transformDirection(t),this.setXYZ(e,Te.x,Te.y,Te.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=Cr(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Be(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Cr(e,this.array)),e}setX(t,e){return this.normalized&&(e=Be(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Cr(e,this.array)),e}setY(t,e){return this.normalized&&(e=Be(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=Cr(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Be(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=Cr(e,this.array)),e}setW(t,e){return this.normalized&&(e=Be(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Be(e,this.array),n=Be(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.normalized&&(e=Be(e,this.array),n=Be(n,this.array),r=Be(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,s){return t*=this.itemSize,this.normalized&&(e=Be(e,this.array),n=Be(n,this.array),r=Be(r,this.array),s=Be(s,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const 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!==sh&&(t.usage=this.usage),t}}class Qm extends we{constructor(t,e,n){super(new Int8Array(t),e,n)}}class Qs extends we{constructor(t,e,n){super(new Uint8Array(t),e,n)}}class fc extends we{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class $u extends we{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class ni extends we{constructor(t,e,n){super(new Float32Array(t),e,n)}}let t_=0;const _n=new me,Ca=new Ve,Mr=new U,sn=new Us,as=new Us,Re=new U;class En extends lr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:t_++}),this.uuid=cr(),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(Gu(t)?$u:fc)(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){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new Bt().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return _n.makeRotationFromQuaternion(t),this.applyMatrix4(_n),this}rotateX(t){return _n.makeRotationX(t),this.applyMatrix4(_n),this}rotateY(t){return _n.makeRotationY(t),this.applyMatrix4(_n),this}rotateZ(t){return _n.makeRotationZ(t),this.applyMatrix4(_n),this}translate(t,e,n){return _n.makeTranslation(t,e,n),this.applyMatrix4(_n),this}scale(t,e,n){return _n.makeScale(t,e,n),this.applyMatrix4(_n),this}lookAt(t){return Ca.lookAt(t),Ca.updateMatrix(),this.applyMatrix4(Ca.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Mr).negate(),this.translate(Mr.x,Mr.y,Mr.z),this}setFromPoints(t){const e=[];for(let n=0,r=t.length;n<r;n++){const 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 Us);const 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 U(-1/0,-1/0,-1/0),new U(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,r=e.length;n<r;n++){const s=e[n];sn.setFromBufferAttribute(s),this.morphTargetsRelative?(Re.addVectors(this.boundingBox.min,sn.min),this.boundingBox.expandByPoint(Re),Re.addVectors(this.boundingBox.max,sn.max),this.boundingBox.expandByPoint(Re)):(this.boundingBox.expandByPoint(sn.min),this.boundingBox.expandByPoint(sn.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 Ns);const 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 U,1/0);return}if(t){const n=this.boundingSphere.center;if(sn.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){const a=e[s];as.setFromBufferAttribute(a),this.morphTargetsRelative?(Re.addVectors(sn.min,as.min),sn.expandByPoint(Re),Re.addVectors(sn.max,as.max),sn.expandByPoint(Re)):(sn.expandByPoint(as.min),sn.expandByPoint(as.max))}sn.getCenter(n);let r=0;for(let s=0,o=t.count;s<o;s++)Re.fromBufferAttribute(t,s),r=Math.max(r,n.distanceToSquared(Re));if(e)for(let s=0,o=e.length;s<o;s++){const a=e[s],l=this.morphTargetsRelative;for(let c=0,h=a.count;c<h;c++)Re.fromBufferAttribute(a,c),l&&(Mr.fromBufferAttribute(t,c),Re.add(Mr)),r=Math.max(r,n.distanceToSquared(Re))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const 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}const n=e.position,r=e.normal,s=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new we(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),a=[],l=[];for(let L=0;L<n.count;L++)a[L]=new U,l[L]=new U;const c=new U,h=new U,u=new U,f=new St,p=new St,x=new St,v=new U,m=new U;function g(L,F,y){c.fromBufferAttribute(n,L),h.fromBufferAttribute(n,F),u.fromBufferAttribute(n,y),f.fromBufferAttribute(s,L),p.fromBufferAttribute(s,F),x.fromBufferAttribute(s,y),h.sub(c),u.sub(c),p.sub(f),x.sub(f);const b=1/(p.x*x.y-x.x*p.y);isFinite(b)&&(v.copy(h).multiplyScalar(x.y).addScaledVector(u,-p.y).multiplyScalar(b),m.copy(u).multiplyScalar(p.x).addScaledVector(h,-x.x).multiplyScalar(b),a[L].add(v),a[F].add(v),a[y].add(v),l[L].add(m),l[F].add(m),l[y].add(m))}let E=this.groups;E.length===0&&(E=[{start:0,count:t.count}]);for(let L=0,F=E.length;L<F;++L){const y=E[L],b=y.start,G=y.count;for(let z=b,W=b+G;z<W;z+=3)g(t.getX(z+0),t.getX(z+1),t.getX(z+2))}const S=new U,w=new U,P=new U,R=new U;function A(L){P.fromBufferAttribute(r,L),R.copy(P);const F=a[L];S.copy(F),S.sub(P.multiplyScalar(P.dot(F))).normalize(),w.crossVectors(R,F);const b=w.dot(l[L])<0?-1:1;o.setXYZW(L,S.x,S.y,S.z,b)}for(let L=0,F=E.length;L<F;++L){const y=E[L],b=y.start,G=y.count;for(let z=b,W=b+G;z<W;z+=3)A(t.getX(z+0)),A(t.getX(z+1)),A(t.getX(z+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new we(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let f=0,p=n.count;f<p;f++)n.setXYZ(f,0,0,0);const r=new U,s=new U,o=new U,a=new U,l=new U,c=new U,h=new U,u=new U;if(t)for(let f=0,p=t.count;f<p;f+=3){const x=t.getX(f+0),v=t.getX(f+1),m=t.getX(f+2);r.fromBufferAttribute(e,x),s.fromBufferAttribute(e,v),o.fromBufferAttribute(e,m),h.subVectors(o,s),u.subVectors(r,s),h.cross(u),a.fromBufferAttribute(n,x),l.fromBufferAttribute(n,v),c.fromBufferAttribute(n,m),a.add(h),l.add(h),c.add(h),n.setXYZ(x,a.x,a.y,a.z),n.setXYZ(v,l.x,l.y,l.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let f=0,p=e.count;f<p;f+=3)r.fromBufferAttribute(e,f+0),s.fromBufferAttribute(e,f+1),o.fromBufferAttribute(e,f+2),h.subVectors(o,s),u.subVectors(r,s),h.cross(u),n.setXYZ(f+0,h.x,h.y,h.z),n.setXYZ(f+1,h.x,h.y,h.z),n.setXYZ(f+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Re.fromBufferAttribute(t,e),Re.normalize(),t.setXYZ(e,Re.x,Re.y,Re.z)}toNonIndexed(){function t(a,l){const c=a.array,h=a.itemSize,u=a.normalized,f=new c.constructor(l.length*h);let p=0,x=0;for(let v=0,m=l.length;v<m;v++){a.isInterleavedBufferAttribute?p=l[v]*a.data.stride+a.offset:p=l[v]*h;for(let g=0;g<h;g++)f[x++]=c[p++]}return new we(f,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new En,n=this.index.array,r=this.attributes;for(const a in r){const l=r[a],c=t(l,n);e.setAttribute(a,c)}const s=this.morphAttributes;for(const a in s){const l=[],c=s[a];for(let h=0,u=c.length;h<u;h++){const f=c[h],p=t(f,n);l.push(p)}e.morphAttributes[a]=l}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const c=o[a];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){const 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){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const c=n[l];t.data.attributes[l]=c.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,f=c.length;u<f;u++){const p=c[u];h.push(p.toJSON(t.data))}h.length>0&&(r[l]=h,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const 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;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone(e));const r=t.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(e))}const s=t.morphAttributes;for(const c in s){const h=[],u=s[c];for(let f=0,p=u.length;f<p;f++)h.push(u[f].clone(e));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let c=0,h=o.length;c<h;c++){const u=o[c];this.addGroup(u.start,u.count,u.materialIndex)}const a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());const 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"})}}const Sh=new me,Gi=new uc,to=new Ns,Mh=new U,eo=new U,no=new U,io=new U,Ra=new U,ro=new U,Eh=new U,so=new U;class zn extends Ve{constructor(t=new En,e=new dc){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(){const e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(t,e){const n=this.geometry,r=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;e.fromBufferAttribute(r,t);const a=this.morphTargetInfluences;if(s&&a){ro.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const h=a[l],u=s[l];h!==0&&(Ra.fromBufferAttribute(u,t),o?ro.addScaledVector(Ra,h):ro.addScaledVector(Ra.sub(e),h))}e.add(ro)}return e}raycast(t,e){const n=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),to.copy(n.boundingSphere),to.applyMatrix4(s),Gi.copy(t.ray).recast(t.near),!(to.containsPoint(Gi.origin)===!1&&(Gi.intersectSphere(to,Mh)===null||Gi.origin.distanceToSquared(Mh)>(t.far-t.near)**2))&&(Sh.copy(s).invert(),Gi.copy(t.ray).applyMatrix4(Sh),!(n.boundingBox!==null&&Gi.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Gi)))}_computeIntersections(t,e,n){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,f=s.groups,p=s.drawRange;if(a!==null)if(Array.isArray(o))for(let x=0,v=f.length;x<v;x++){const m=f[x],g=o[m.materialIndex],E=Math.max(m.start,p.start),S=Math.min(a.count,Math.min(m.start+m.count,p.start+p.count));for(let w=E,P=S;w<P;w+=3){const R=a.getX(w),A=a.getX(w+1),L=a.getX(w+2);r=oo(this,g,t,n,c,h,u,R,A,L),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=m.materialIndex,e.push(r))}}else{const x=Math.max(0,p.start),v=Math.min(a.count,p.start+p.count);for(let m=x,g=v;m<g;m+=3){const E=a.getX(m),S=a.getX(m+1),w=a.getX(m+2);r=oo(this,o,t,n,c,h,u,E,S,w),r&&(r.faceIndex=Math.floor(m/3),e.push(r))}}else if(l!==void 0)if(Array.isArray(o))for(let x=0,v=f.length;x<v;x++){const m=f[x],g=o[m.materialIndex],E=Math.max(m.start,p.start),S=Math.min(l.count,Math.min(m.start+m.count,p.start+p.count));for(let w=E,P=S;w<P;w+=3){const R=w,A=w+1,L=w+2;r=oo(this,g,t,n,c,h,u,R,A,L),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=m.materialIndex,e.push(r))}}else{const x=Math.max(0,p.start),v=Math.min(l.count,p.start+p.count);for(let m=x,g=v;m<g;m+=3){const E=m,S=m+1,w=m+2;r=oo(this,o,t,n,c,h,u,E,S,w),r&&(r.faceIndex=Math.floor(m/3),e.push(r))}}}}function e_(i,t,e,n,r,s,o,a){let l;if(t.side===$e?l=n.intersectTriangle(o,s,r,!0,a):l=n.intersectTriangle(r,s,o,t.side===Ci,a),l===null)return null;so.copy(a),so.applyMatrix4(i.matrixWorld);const c=e.ray.origin.distanceTo(so);return c<e.near||c>e.far?null:{distance:c,point:so.clone(),object:i}}function oo(i,t,e,n,r,s,o,a,l,c){i.getVertexPosition(a,eo),i.getVertexPosition(l,no),i.getVertexPosition(c,io);const h=e_(i,t,e,n,eo,no,io,Eh);if(h){const u=new U;Pn.getBarycoord(Eh,eo,no,io,u),r&&(h.uv=Pn.getInterpolatedAttribute(r,a,l,c,u,new St)),s&&(h.uv1=Pn.getInterpolatedAttribute(s,a,l,c,u,new St)),o&&(h.normal=Pn.getInterpolatedAttribute(o,a,l,c,u,new U),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const f={a,b:l,c,normal:new U,materialIndex:0};Pn.getNormal(eo,no,io,f.normal),h.face=f,h.barycoord=u}return h}class Os extends En{constructor(t=1,e=1,n=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],h=[],u=[];let f=0,p=0;x("z","y","x",-1,-1,n,e,t,o,s,0),x("z","y","x",1,-1,n,e,-t,o,s,1),x("x","z","y",1,1,t,n,e,r,o,2),x("x","z","y",1,-1,t,n,-e,r,o,3),x("x","y","z",1,-1,t,e,n,r,s,4),x("x","y","z",-1,-1,t,e,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new ni(c,3)),this.setAttribute("normal",new ni(h,3)),this.setAttribute("uv",new ni(u,2));function x(v,m,g,E,S,w,P,R,A,L,F){const y=w/A,b=P/L,G=w/2,z=P/2,W=R/2,K=A+1,k=L+1;let j=0,X=0;const lt=new U;for(let ct=0;ct<k;ct++){const pt=ct*b-z;for(let kt=0;kt<K;kt++){const Yt=kt*y-G;lt[v]=Yt*E,lt[m]=pt*S,lt[g]=W,c.push(lt.x,lt.y,lt.z),lt[v]=0,lt[m]=0,lt[g]=R>0?1:-1,h.push(lt.x,lt.y,lt.z),u.push(kt/A),u.push(1-ct/L),j+=1}}for(let ct=0;ct<L;ct++)for(let pt=0;pt<A;pt++){const kt=f+pt+K*ct,Yt=f+pt+K*(ct+1),Y=f+(pt+1)+K*(ct+1),Q=f+(pt+1)+K*ct;l.push(kt,Yt,Q),l.push(Yt,Y,Q),X+=6}a.addGroup(p,X,F),p+=X,f+=j}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Os(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Xr(i){const t={};for(const e in i){t[e]={};for(const n in i[e]){const r=i[e][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=r.clone():Array.isArray(r)?t[e][n]=r.slice():t[e][n]=r}}return t}function ke(i){const t={};for(let e=0;e<i.length;e++){const n=Xr(i[e]);for(const r in n)t[r]=n[r]}return t}function n_(i){const t=[];for(let e=0;e<i.length;e++)t.push(i[e].clone());return t}function Zu(i){const t=i.getRenderTarget();return t===null?i.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:ee.workingColorSpace}const i_={clone:Xr,merge:ke};var r_=`void main() { 6 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 7}`,s_=`void main() { 8 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 9}`;class si extends Qr{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=r_,this.fragmentShader=s_,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=Xr(t.uniforms),this.uniformsGroups=n_(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){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?e.uniforms[r]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?e.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?e.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?e.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?e.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?e.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?e.uniforms[r]={type:"m4",value:o.toArray()}:e.uniforms[r]={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;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Ku extends Ve{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me,this.coordinateSystem=ei}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)}}const pi=new U,Th=new St,bh=new St;class vn extends Ku{constructor(t=50,e=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=Es*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(ps*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Es*2*Math.atan(Math.tan(ps*.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){pi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(pi.x,pi.y).multiplyScalar(-t/pi.z),pi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(pi.x,pi.y).multiplyScalar(-t/pi.z)}getViewSize(t,e){return this.getViewBounds(t,Th,bh),e.subVectors(bh,Th)}setViewOffset(t,e,n,r,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=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(ps*.5*this.fov)/this.zoom,n=2*e,r=this.aspect*n,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,e-=o.offsetY*n/c,r*=o.width/l,n*=o.height/c}const a=this.filmOffset;a!==0&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const 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}}const Er=-90,Tr=1;class o_ extends Ve{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new vn(Er,Tr,t,e);r.layers=this.layers,this.add(r);const s=new vn(Er,Tr,t,e);s.layers=this.layers,this.add(s);const o=new vn(Er,Tr,t,e);o.layers=this.layers,this.add(o);const a=new vn(Er,Tr,t,e);a.layers=this.layers,this.add(a);const l=new vn(Er,Tr,t,e);l.layers=this.layers,this.add(l);const c=new vn(Er,Tr,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,r,s,o,a,l]=e;for(const c of e)this.remove(c);if(t===ei)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),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===Oo)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),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(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,h]=this.children,u=t.getRenderTarget(),f=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),x=t.xr.enabled;t.xr.enabled=!1;const v=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,r),t.render(e,s),t.setRenderTarget(n,1,r),t.render(e,o),t.setRenderTarget(n,2,r),t.render(e,a),t.setRenderTarget(n,3,r),t.render(e,l),t.setRenderTarget(n,4,r),t.render(e,c),n.texture.generateMipmaps=v,t.setRenderTarget(n,5,r),t.render(e,h),t.setRenderTarget(u,f,p),t.xr.enabled=x,n.texture.needsPMREMUpdate=!0}}class ju extends Mn{constructor(t,e,n,r,s,o,a,l,c,h){t=t!==void 0?t:[],e=e!==void 0?e:Hr,super(t,e,n,r,s,o,a,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class a_ extends Ri{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},r=[n,n,n,n,n,n];this.texture=new ju(r,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:qe}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;const n={uniforms:{tEquirect:{value:null}},vertexShader:` 10 11 varying vec3 vWorldDirection; 12 13 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 14 15 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 16 17 } 18 19 void main() { 20 21 vWorldDirection = transformDirection( position, modelMatrix ); 22 23 #include <begin_vertex> 24 #include <project_vertex> 25 26 } 27 `,fragmentShader:` 28 29 uniform sampler2D tEquirect; 30 31 varying vec3 vWorldDirection; 32 33 #include <common> 34 35 void main() { 36 37 vec3 direction = normalize( vWorldDirection ); 38 39 vec2 sampleUV = equirectUv( direction ); 40 41 gl_FragColor = texture2D( tEquirect, sampleUV ); 42 43 } 44 `},r=new Os(5,5,5),s=new si({name:"CubemapFromEquirect",uniforms:Xr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:$e,blending:Ti});s.uniforms.tEquirect.value=e;const o=new zn(r,s),a=e.minFilter;return e.minFilter===er&&(e.minFilter=qe),new o_(1,10,this).update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,r){const s=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,n,r);t.setRenderTarget(s)}}const Pa=new U,l_=new U,c_=new Bt;class Zi{constructor(t=new U(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,r){return this.normal.set(t,e,n),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const r=Pa.subVectors(n,e).cross(l_.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const 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){const n=t.delta(Pa),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const s=-(t.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:e.copy(t.start).addScaledVector(n,s)}intersectsLine(t){const 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){const n=e||c_.getNormalMatrix(t),r=this.coplanarPoint(Pa).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Wi=new Ns,ao=new U;class Ju{constructor(t=new Zi,e=new Zi,n=new Zi,r=new Zi,s=new Zi,o=new Zi){this.planes=[t,e,n,r,s,o]}set(t,e,n,r,s,o){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=ei){const n=this.planes,r=t.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6],f=r[7],p=r[8],x=r[9],v=r[10],m=r[11],g=r[12],E=r[13],S=r[14],w=r[15];if(n[0].setComponents(l-s,f-c,m-p,w-g).normalize(),n[1].setComponents(l+s,f+c,m+p,w+g).normalize(),n[2].setComponents(l+o,f+h,m+x,w+E).normalize(),n[3].setComponents(l-o,f-h,m-x,w-E).normalize(),n[4].setComponents(l-a,f-u,m-v,w-S).normalize(),e===ei)n[5].setComponents(l+a,f+u,m+v,w+S).normalize();else if(e===Oo)n[5].setComponents(a,u,v,S).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}
vendor: 6,158 bytes, lines 44-103
44intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Wi.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Wi.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Wi)}intersectsSprite(t){return Wi.center.set(0,0,0),Wi.radius=.7071067811865476,Wi.applyMatrix4(t.matrixWorld),this.intersectsSphere(Wi)}intersectsSphere(t){const e=this.planes,n=t.center,r=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)<r)return!1;return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const r=e[n];if(ao.x=r.normal.x>0?t.max.x:t.min.x,ao.y=r.normal.y>0?t.max.y:t.min.y,ao.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(ao)<0)return!1}return!0}containsPoint(t){const 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 Qu(){let i=null,t=!1,e=null,n=null;function r(s,o){e(s,o),n=i.requestAnimationFrame(r)}return{start:function(){t!==!0&&e!==null&&(n=i.requestAnimationFrame(r),t=!0)},stop:function(){i.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){i=s}}}function h_(i){const t=new WeakMap;function e(a,l){const c=a.array,h=a.usage,u=c.byteLength,f=i.createBuffer();i.bindBuffer(l,f),i.bufferData(l,c,h),a.onUploadCallback();let p;if(c instanceof Float32Array)p=i.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?p=i.HALF_FLOAT:p=i.UNSIGNED_SHORT;else if(c instanceof Int16Array)p=i.SHORT;else if(c instanceof Uint32Array)p=i.UNSIGNED_INT;else if(c instanceof Int32Array)p=i.INT;else if(c instanceof Int8Array)p=i.BYTE;else if(c instanceof Uint8Array)p=i.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)p=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:f,type:p,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:u}}function n(a,l,c){const h=l.array,u=l.updateRanges;if(i.bindBuffer(c,a),u.length===0)i.bufferSubData(c,0,h);else{u.sort((p,x)=>p.start-x.start);let f=0;for(let p=1;p<u.length;p++){const x=u[f],v=u[p];v.start<=x.start+x.count+1?x.count=Math.max(x.count,v.start+v.count-x.start):(++f,u[f]=v)}u.length=f+1;for(let p=0,x=u.length;p<x;p++){const v=u[p];i.bufferSubData(c,v.start*h.BYTES_PER_ELEMENT,h,v.start,v.count)}l.clearUpdateRanges()}l.onUploadCallback()}function r(a){return a.isInterleavedBufferAttribute&&(a=a.data),t.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);const l=t.get(a);l&&(i.deleteBuffer(l.buffer),t.delete(a))}function o(a,l){if(a.isInterleavedBufferAttribute&&(a=a.data),a.isGLBufferAttribute){const 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}const 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:r,remove:s,update:o}}class Zo extends En{constructor(t=1,e=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};const s=t/2,o=e/2,a=Math.floor(n),l=Math.floor(r),c=a+1,h=l+1,u=t/a,f=e/l,p=[],x=[],v=[],m=[];for(let g=0;g<h;g++){const E=g*f-o;for(let S=0;S<c;S++){const w=S*u-s;x.push(w,-E,0),v.push(0,0,1),m.push(S/a),m.push(1-g/l)}}for(let g=0;g<l;g++)for(let E=0;E<a;E++){const S=E+c*g,w=E+c*(g+1),P=E+1+c*(g+1),R=E+1+c*g;p.push(S,w,R),p.push(w,P,R)}this.setIndex(p),this.setAttribute("position",new ni(x,3)),this.setAttribute("normal",new ni(v,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 Zo(t.width,t.height,t.widthSegments,t.heightSegments)}}var u_=`#ifdef USE_ALPHAHASH 45 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 46#endif`,d_=`#ifdef USE_ALPHAHASH 47 const float ALPHA_HASH_SCALE = 0.05; 48 float hash2D( vec2 value ) { 49 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 50 } 51 float hash3D( vec3 value ) { 52 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 53 } 54 float getAlphaHashThreshold( vec3 position ) { 55 float maxDeriv = max( 56 length( dFdx( position.xyz ) ), 57 length( dFdy( position.xyz ) ) 58 ); 59 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 60 vec2 pixScales = vec2( 61 exp2( floor( log2( pixScale ) ) ), 62 exp2( ceil( log2( pixScale ) ) ) 63 ); 64 vec2 alpha = vec2( 65 hash3D( floor( pixScales.x * position.xyz ) ), 66 hash3D( floor( pixScales.y * position.xyz ) ) 67 ); 68 float lerpFactor = fract( log2( pixScale ) ); 69 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 70 float a = min( lerpFactor, 1.0 - lerpFactor ); 71 vec3 cases = vec3( 72 x * x / ( 2.0 * a * ( 1.0 - a ) ), 73 ( x - 0.5 * a ) / ( 1.0 - a ), 74 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 75 ); 76 float threshold = ( x < ( 1.0 - a ) ) 77 ? ( ( x < a ) ? cases.x : cases.y ) 78 : cases.z; 79 return clamp( threshold , 1.0e-6, 1.0 ); 80 } 81#endif`,f_=`#ifdef USE_ALPHAMAP 82 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 83#endif`,p_=`#ifdef USE_ALPHAMAP 84 uniform sampler2D alphaMap; 85#endif`,m_=`#ifdef USE_ALPHATEST 86 #ifdef ALPHA_TO_COVERAGE 87 diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); 88 if ( diffuseColor.a == 0.0 ) discard; 89 #else 90 if ( diffuseColor.a < alphaTest ) discard; 91 #endif 92#endif`,__=`#ifdef USE_ALPHATEST 93 uniform float alphaTest; 94#endif`,g_=`#ifdef USE_AOMAP 95 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 96 reflectedLight.indirectDiffuse *= ambientOcclusion; 97 #if defined( USE_CLEARCOAT ) 98 clearcoatSpecularIndirect *= ambientOcclusion; 99 #endif 100 #if defined( USE_SHEEN ) 101 sheenSpecularIndirect *= ambientOcclusion; 102 #endif 103 #if defined( USE_ENVMAP ) && defined( STANDARD )
104 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 105 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 106 #endif 107#endif`,v_=`#ifdef USE_AOMAP 108 uniform sampler2D aoMap; 109 uniform float aoMapIntensity; 110#endif`,x_=`#ifdef USE_BATCHING 111 #if ! defined( GL_ANGLE_multi_draw ) 112 #define gl_DrawID _gl_DrawID 113 uniform int _gl_DrawID; 114 #endif 115 uniform highp sampler2D batchingTexture; 116 uniform highp usampler2D batchingIdTexture; 117 mat4 getBatchingMatrix( const in float i ) { 118 int size = textureSize( batchingTexture, 0 ).x; 119 int j = int( i ) * 4; 120 int x = j % size; 121 int y = j / size; 122 vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 ); 123 vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 ); 124 vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 ); 125 vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); 126 return mat4( v1, v2, v3, v4 ); 127 } 128 float getIndirectIndex( const in int i ) { 129 int size = textureSize( batchingIdTexture, 0 ).x; 130 int x = i % size; 131 int y = i / size; 132 return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r ); 133 } 134#endif 135#ifdef USE_BATCHING_COLOR 136 uniform sampler2D batchingColorTexture; 137 vec3 getBatchingColor( const in float i ) { 138 int size = textureSize( batchingColorTexture, 0 ).x; 139 int j = int( i ); 140 int x = j % size; 141 int y = j / size; 142 return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb; 143 } 144#endif`,y_=`#ifdef USE_BATCHING 145 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 146#endif`,S_=`vec3 transformed = vec3( position ); 147#ifdef USE_ALPHAHASH 148 vPosition = vec3( position ); 149#endif`,M_=`vec3 objectNormal = vec3( normal ); 150#ifdef USE_TANGENT 151 vec3 objectTangent = vec3( tangent.xyz ); 152#endif`,E_=`float G_BlinnPhong_Implicit( ) { 153 return 0.25; 154} 155float D_BlinnPhong( const in float shininess, const in float dotNH ) { 156 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 157} 158vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 159 vec3 halfDir = normalize( lightDir + viewDir ); 160 float dotNH = saturate( dot( normal, halfDir ) ); 161 float dotVH = saturate( dot( viewDir, halfDir ) ); 162 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 163 float G = G_BlinnPhong_Implicit( ); 164 float D = D_BlinnPhong( shininess, dotNH ); 165 return F * ( G * D ); 166} // validated`,T_=`#ifdef USE_IRIDESCENCE 167 const mat3 XYZ_TO_REC709 = mat3( 168 3.2404542, -0.9692660, 0.0556434, 169 -1.5371385, 1.8760108, -0.2040259, 170 -0.4985314, 0.0415560, 1.0572252 171 ); 172 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 173 vec3 sqrtF0 = sqrt( fresnel0 ); 174 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 175 } 176 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 177 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 178 } 179 float IorToFresnel0( float transmittedIor, float incidentIor ) { 180 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 181 } 182 vec3 evalSensitivity( float OPD, vec3 shift ) { 183 float phase = 2.0 * PI * OPD * 1.0e-9; 184 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 185 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 186 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 187 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 188 xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) ); 189 xyz /= 1.0685e-7; 190 vec3 rgb = XYZ_TO_REC709 * xyz; 191 return rgb; 192 } 193 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 194 vec3 I; 195 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 196 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 197 float cosTheta2Sq = 1.0 - sinTheta2Sq; 198 if ( cosTheta2Sq < 0.0 ) { 199 return vec3( 1.0 ); 200 } 201 float cosTheta2 = sqrt( cosTheta2Sq ); 202 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
203 float R12 = F_Schlick( R0, 1.0, cosTheta1 ); 204 float T121 = 1.0 - R12; 205 float phi12 = 0.0; 206 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 207 float phi21 = PI - phi12; 208 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 209 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 210 vec3 phi23 = vec3( 0.0 ); 211 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 212 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 213 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 214 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 215 vec3 phi = vec3( phi21 ) + phi23; 216 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 217 vec3 r123 = sqrt( R123 ); 218 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 219 vec3 C0 = R12 + Rs; 220 I = C0; 221 vec3 Cm = Rs - T121; 222 for ( int m = 1; m <= 2; ++ m ) { 223 Cm *= r123; 224 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 225 I += Cm * Sm; 226 } 227 return max( I, vec3( 0.0 ) ); 228 } 229#endif`,b_=`#ifdef USE_BUMPMAP 230 uniform sampler2D bumpMap; 231 uniform float bumpScale; 232 vec2 dHdxy_fwd() { 233 vec2 dSTdx = dFdx( vBumpMapUv ); 234 vec2 dSTdy = dFdy( vBumpMapUv ); 235 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 236 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 237 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 238 return vec2( dBx, dBy ); 239 } 240 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 241 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 242 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 243 vec3 vN = surf_norm; 244 vec3 R1 = cross( vSigmaY, vN ); 245 vec3 R2 = cross( vN, vSigmaX ); 246 float fDet = dot( vSigmaX, R1 ) * faceDirection; 247 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 248 return normalize( abs( fDet ) * surf_norm - vGrad ); 249 } 250#endif`,w_=`#if NUM_CLIPPING_PLANES > 0 251 vec4 plane; 252 #ifdef ALPHA_TO_COVERAGE 253 float distanceToPlane, distanceGradient; 254 float clipOpacity = 1.0; 255 #pragma unroll_loop_start 256 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 257 plane = clippingPlanes[ i ]; 258 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 259 distanceGradient = fwidth( distanceToPlane ) / 2.0; 260 clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 261 if ( clipOpacity == 0.0 ) discard; 262 } 263 #pragma unroll_loop_end 264 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 265 float unionClipOpacity = 1.0; 266 #pragma unroll_loop_start 267 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 268 plane = clippingPlanes[ i ]; 269 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 270 distanceGradient = fwidth( distanceToPlane ) / 2.0; 271 unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 272 } 273 #pragma unroll_loop_end 274 clipOpacity *= 1.0 - unionClipOpacity; 275 #endif 276 diffuseColor.a *= clipOpacity; 277 if ( diffuseColor.a == 0.0 ) discard; 278 #else 279 #pragma unroll_loop_start 280 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 281 plane = clippingPlanes[ i ]; 282 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 283 } 284 #pragma unroll_loop_end 285 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 286 bool clipped = true; 287 #pragma unroll_loop_start 288 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 289 plane = clippingPlanes[ i ]; 290 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 291 } 292 #pragma unroll_loop_end 293 if ( clipped ) discard; 294 #endif 295 #endif 296#endif`,A_=`#if NUM_CLIPPING_PLANES > 0 297 varying vec3 vClipPosition; 298 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 299#endif`,C_=`#if NUM_CLIPPING_PLANES > 0 300 varying vec3 vClipPosition; 301#endif`,R_=`#if NUM_CLIPPING_PLANES > 0 302 vClipPosition = - mvPosition.xyz; 303#endif`,P_=`#if defined( USE_COLOR_ALPHA ) 304 diffuseColor *= vColor; 305#elif defined( USE_COLOR ) 306 diffuseColor.rgb *= vColor; 307#endif`,L_=`#if defined( USE_COLOR_ALPHA ) 308 varying vec4 vColor; 309#elif defined( USE_COLOR ) 310 varying vec3 vColor; 311#endif`,I_=`#if defined( USE_COLOR_ALPHA ) 312 varying vec4 vColor; 313#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 314 varying vec3 vColor; 315#endif`,D_=`#if defined( USE_COLOR_ALPHA ) 316 vColor = vec4( 1.0 ); 317#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 318 vColor = vec3( 1.0 ); 319#endif 320#ifdef USE_COLOR 321 vColor *= color; 322#endif 323#ifdef USE_INSTANCING_COLOR 324 vColor.xyz *= instanceColor.xyz; 325#endif 326#ifdef USE_BATCHING_COLOR 327 vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); 328 vColor.xyz *= batchingColor.xyz; 329#endif`,U_=`#define PI 3.141592653589793 330#define PI2 6.283185307179586 331#define PI_HALF 1.5707963267948966 332#define RECIPROCAL_PI 0.3183098861837907 333#define RECIPROCAL_PI2 0.15915494309189535 334#define EPSILON 1e-6 335#ifndef saturate 336#define saturate( a ) clamp( a, 0.0, 1.0 ) 337#endif 338#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 339float pow2( const in float x ) { return x*x; } 340vec3 pow2( const in vec3 x ) { return x*x; } 341float pow3( const in float x ) { return x*x*x; } 342float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 343float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 344float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 345highp float rand( const in vec2 uv ) { 346 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 347 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 348 return fract( sin( sn ) * c ); 349} 350#ifdef HIGH_PRECISION 351 float precisionSafeLength( vec3 v ) { return length( v ); } 352#else 353 float precisionSafeLength( vec3 v ) { 354 float maxComponent = max3( abs( v ) ); 355 return length( v / maxComponent ) * maxComponent; 356 } 357#endif 358struct IncidentLight { 359 vec3 color; 360 vec3 direction; 361 bool visible; 362}; 363struct ReflectedLight { 364 vec3 directDiffuse; 365 vec3 directSpecular; 366 vec3 indirectDiffuse; 367 vec3 indirectSpecular; 368}; 369#ifdef USE_ALPHAHASH 370 varying vec3 vPosition; 371#endif 372vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 373 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 374} 375vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 376 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 377} 378mat3 transposeMat3( const in mat3 m ) { 379 mat3 tmp; 380 tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); 381 tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); 382 tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); 383 return tmp; 384} 385bool isPerspectiveMatrix( mat4 m ) { 386 return m[ 2 ][ 3 ] == - 1.0; 387} 388vec2 equirectUv( in vec3 dir ) { 389 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 390 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 391 return vec2( u, v ); 392}
393vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 394 return RECIPROCAL_PI * diffuseColor; 395} 396vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 397 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 398 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 399} 400float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 401 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 402 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 403} // validated`,N_=`#ifdef ENVMAP_TYPE_CUBE_UV 404 #define cubeUV_minMipLevel 4.0 405 #define cubeUV_minTileSize 16.0 406 float getFace( vec3 direction ) { 407 vec3 absDirection = abs( direction ); 408 float face = - 1.0; 409 if ( absDirection.x > absDirection.z ) { 410 if ( absDirection.x > absDirection.y ) 411 face = direction.x > 0.0 ? 0.0 : 3.0; 412 else 413 face = direction.y > 0.0 ? 1.0 : 4.0; 414 } else { 415 if ( absDirection.z > absDirection.y ) 416 face = direction.z > 0.0 ? 2.0 : 5.0; 417 else 418 face = direction.y > 0.0 ? 1.0 : 4.0; 419 } 420 return face; 421 } 422 vec2 getUV( vec3 direction, float face ) { 423 vec2 uv; 424 if ( face == 0.0 ) { 425 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 426 } else if ( face == 1.0 ) { 427 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 428 } else if ( face == 2.0 ) { 429 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 430 } else if ( face == 3.0 ) { 431 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 432 } else if ( face == 4.0 ) { 433 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 434 } else { 435 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 436 } 437 return 0.5 * ( uv + 1.0 ); 438 } 439 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 440 float face = getFace( direction ); 441 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 442 mipInt = max( mipInt, cubeUV_minMipLevel ); 443 float faceSize = exp2( mipInt ); 444 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 445 if ( face > 2.0 ) { 446 uv.y += faceSize; 447 face -= 3.0; 448 } 449 uv.x += face * faceSize; 450 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 451 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 452 uv.x *= CUBEUV_TEXEL_WIDTH; 453 uv.y *= CUBEUV_TEXEL_HEIGHT; 454 #ifdef texture2DGradEXT 455 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 456 #else 457 return texture2D( envMap, uv ).rgb; 458 #endif 459 } 460 #define cubeUV_r0 1.0 461 #define cubeUV_m0 - 2.0 462 #define cubeUV_r1 0.8 463 #define cubeUV_m1 - 1.0 464 #define cubeUV_r4 0.4 465 #define cubeUV_m4 2.0 466 #define cubeUV_r5 0.305 467 #define cubeUV_m5 3.0 468 #define cubeUV_r6 0.21 469 #define cubeUV_m6 4.0 470 float roughnessToMip( float roughness ) { 471 float mip = 0.0; 472 if ( roughness >= cubeUV_r1 ) { 473 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 474 } else if ( roughness >= cubeUV_r4 ) { 475 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 476 } else if ( roughness >= cubeUV_r5 ) { 477 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 478 } else if ( roughness >= cubeUV_r6 ) { 479 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 480 } else { 481 mip = - 2.0 * log2( 1.16 * roughness ); } 482 return mip; 483 } 484 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 485 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 486 float mipF = fract( mip ); 487 float mipInt = floor( mip ); 488 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 489 if ( mipF == 0.0 ) { 490 return vec4( color0, 1.0 ); 491 } else { 492 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 493 return vec4( mix( color0, color1, mipF ), 1.0 ); 494 } 495 } 496#endif`,O_=`vec3 transformedNormal = objectNormal; 497#ifdef USE_TANGENT 498 vec3 transformedTangent = objectTangent; 499#endif 500#ifdef USE_BATCHING 501 mat3 bm = mat3( batchingMatrix ); 502 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 503 transformedNormal = bm * transformedNormal; 504 #ifdef USE_TANGENT 505 transformedTangent = bm * transformedTangent; 506 #endif 507#endif 508#ifdef USE_INSTANCING 509 mat3 im = mat3( instanceMatrix ); 510 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 511 transformedNormal = im * transformedNormal; 512 #ifdef USE_TANGENT 513 transformedTangent = im * transformedTangent; 514 #endif 515#endif 516transformedNormal = normalMatrix * transformedNormal; 517#ifdef FLIP_SIDED 518 transformedNormal = - transformedNormal; 519#endif 520#ifdef USE_TANGENT 521 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 522 #ifdef FLIP_SIDED 523 transformedTangent = - transformedTangent; 524 #endif 525#endif`,F_=`#ifdef USE_DISPLACEMENTMAP 526 uniform sampler2D displacementMap; 527 uniform float displacementScale; 528 uniform float displacementBias; 529#endif`,z_=`#ifdef USE_DISPLACEMENTMAP 530 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
530placementBias ); 531#endif`,B_=`#ifdef USE_EMISSIVEMAP 532 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 533 totalEmissiveRadiance *= emissiveColor.rgb; 534#endif`,k_=`#ifdef USE_EMISSIVEMAP 535 uniform sampler2D emissiveMap; 536#endif`,H_="gl_FragColor = linearToOutputTexel( gl_FragColor );",V_=` 537const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( 538 vec3( 0.8224621, 0.177538, 0.0 ), 539 vec3( 0.0331941, 0.9668058, 0.0 ), 540 vec3( 0.0170827, 0.0723974, 0.9105199 ) 541); 542const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( 543 vec3( 1.2249401, - 0.2249404, 0.0 ), 544 vec3( - 0.0420569, 1.0420571, 0.0 ), 545 vec3( - 0.0196376, - 0.0786361, 1.0982735 ) 546); 547vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { 548 return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); 549} 550vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { 551 return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); 552} 553vec4 LinearTransferOETF( in vec4 value ) { 554 return value; 555} 556vec4 sRGBTransferOETF( in vec4 value ) { 557 return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); 558}`,G_=`#ifdef USE_ENVMAP 559 #ifdef ENV_WORLDPOS 560 vec3 cameraToFrag; 561 if ( isOrthographic ) { 562 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 563 } else { 564 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 565 } 566 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 567 #ifdef ENVMAP_MODE_REFLECTION 568 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 569 #else 570 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 571 #endif 572 #else 573 vec3 reflectVec = vReflect; 574 #endif 575 #ifdef ENVMAP_TYPE_CUBE 576 vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); 577 #else 578 vec4 envColor = vec4( 0.0 ); 579 #endif 580 #ifdef ENVMAP_BLENDING_MULTIPLY 581 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 582 #elif defined( ENVMAP_BLENDING_MIX ) 583 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 584 #elif defined( ENVMAP_BLENDING_ADD ) 585 outgoingLight += envColor.xyz * specularStrength * reflectivity; 586 #endif 587#endif`,W_=`#ifdef USE_ENVMAP 588 uniform float envMapIntensity; 589 uniform float flipEnvMap; 590 uniform mat3 envMapRotation; 591 #ifdef ENVMAP_TYPE_CUBE 592 uniform samplerCube envMap; 593 #else 594 uniform sampler2D envMap; 595 #endif 596 597#endif`,X_=`#ifdef USE_ENVMAP 598 uniform float reflectivity; 599 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 600 #define ENV_WORLDPOS 601 #endif 602 #ifdef ENV_WORLDPOS 603 varying vec3 vWorldPosition; 604 uniform float refractionRatio; 605 #else 606 varying vec3 vReflect; 607 #endif 608#endif`,q_=`#ifdef USE_ENVMAP 609 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 610 #define ENV_WORLDPOS 611 #endif 612 #ifdef ENV_WORLDPOS 613 614 varying vec3 vWorldPosition; 615 #else 616 varying vec3 vReflect; 617 uniform float refractionRatio; 618 #endif 619#endif`,Y_=`#ifdef USE_ENVMAP 620 #ifdef ENV_WORLDPOS 621 vWorldPosition = worldPosition.xyz; 622 #else 623 vec3 cameraToVertex; 624 if ( isOrthographic ) { 625 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 626 } else {
627 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 628 } 629 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 630 #ifdef ENVMAP_MODE_REFLECTION 631 vReflect = reflect( cameraToVertex, worldNormal ); 632 #else 633 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 634 #endif 635 #endif 636#endif`,$_=`#ifdef USE_FOG 637 vFogDepth = - mvPosition.z; 638#endif`,Z_=`#ifdef USE_FOG 639 varying float vFogDepth; 640#endif`,K_=`#ifdef USE_FOG 641 #ifdef FOG_EXP2 642 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 643 #else 644 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 645 #endif 646 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 647#endif`,j_=`#ifdef USE_FOG 648 uniform vec3 fogColor; 649 varying float vFogDepth; 650 #ifdef FOG_EXP2 651 uniform float fogDensity; 652 #else 653 uniform float fogNear; 654 uniform float fogFar; 655 #endif 656#endif`,J_=`#ifdef USE_GRADIENTMAP 657 uniform sampler2D gradientMap; 658#endif 659vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 660 float dotNL = dot( normal, lightDirection ); 661 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 662 #ifdef USE_GRADIENTMAP 663 return vec3( texture2D( gradientMap, coord ).r ); 664 #else 665 vec2 fw = fwidth( coord ) * 0.5; 666 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 667 #endif 668}`,Q_=`#ifdef USE_LIGHTMAP 669 uniform sampler2D lightMap; 670 uniform float lightMapIntensity; 671#endif`,tg=`LambertMaterial material; 672material.diffuseColor = diffuseColor.rgb; 673material.specularStrength = specularStrength;`,eg=`varying vec3 vViewPosition; 674struct LambertMaterial { 675 vec3 diffuseColor; 676 float specularStrength; 677}; 678void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 679 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 680 vec3 irradiance = dotNL * directLight.color; 681 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 682} 683void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 684 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 685} 686#define RE_Direct RE_Direct_Lambert 687#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,ng=`uniform bool receiveShadow; 688uniform vec3 ambientLightColor; 689#if defined( USE_LIGHT_PROBES ) 690 uniform vec3 lightProbe[ 9 ]; 691#endif 692vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 693 float x = normal.x, y = normal.y, z = normal.z; 694 vec3 result = shCoefficients[ 0 ] * 0.886227; 695 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 696 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 697 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 698 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 699 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 700 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 701 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 702 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 703 return result; 704} 705vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 706 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 707 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 708 return irradiance; 709} 710vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 711 vec3 irradiance = ambientLightColor; 712 return irradiance; 713} 714float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 715 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 716 if ( cutoffDistance > 0.0 ) { 717 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 718 } 719 return distanceFalloff; 720} 721float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 722 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 723} 724#if NUM_DIR_LIGHTS > 0 725 struct DirectionalLight { 726 vec3 direction; 727 vec3 color; 728 }; 729 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 730 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 731 light.color = directionalLight.color; 732 light.direction = directionalLight.direction; 733 light.visible = true; 734 } 735#endif 736#if NUM_POINT_LIGHTS > 0 737 struct PointLight { 738 vec3 position; 739 vec3 color; 740 float distance; 741 float decay; 742 }; 743 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 744 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 745 vec3 lVector = pointLight.position - geometryPosition; 746 light.direction = normalize( lVector ); 747 float lightDistance = length( lVector ); 748 light.color = pointLight.color; 749 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 750 light.visible = ( light.color != vec3( 0.0 ) ); 751 } 752#endif
753#if NUM_SPOT_LIGHTS > 0 754 struct SpotLight { 755 vec3 position; 756 vec3 direction; 757 vec3 color; 758 float distance; 759 float decay; 760 float coneCos; 761 float penumbraCos; 762 }; 763 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 764 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 765 vec3 lVector = spotLight.position - geometryPosition; 766 light.direction = normalize( lVector ); 767 float angleCos = dot( light.direction, spotLight.direction ); 768 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 769 if ( spotAttenuation > 0.0 ) { 770 float lightDistance = length( lVector ); 771 light.color = spotLight.color * spotAttenuation; 772 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 773 light.visible = ( light.color != vec3( 0.0 ) ); 774 } else { 775 light.color = vec3( 0.0 ); 776 light.visible = false; 777 } 778 } 779#endif 780#if NUM_RECT_AREA_LIGHTS > 0 781 struct RectAreaLight { 782 vec3 color; 783 vec3 position; 784 vec3 halfWidth; 785 vec3 halfHeight; 786 }; 787 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 788 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 789#endif 790#if NUM_HEMI_LIGHTS > 0 791 struct HemisphereLight { 792 vec3 direction; 793 vec3 skyColor; 794 vec3 groundColor; 795 }; 796 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 797 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 798 float dotNL = dot( normal, hemiLight.direction ); 799 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 800 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 801 return irradiance; 802 } 803#endif`,ig=`#ifdef USE_ENVMAP 804 vec3 getIBLIrradiance( const in vec3 normal ) { 805 #ifdef ENVMAP_TYPE_CUBE_UV 806 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 807 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); 808 return PI * envMapColor.rgb * envMapIntensity; 809 #else 810 return vec3( 0.0 ); 811 #endif 812 } 813 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 814 #ifdef ENVMAP_TYPE_CUBE_UV 815 vec3 reflectVec = reflect( - viewDir, normal ); 816 reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); 817 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 818 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); 819 return envMapColor.rgb * envMapIntensity; 820 #else 821 return vec3( 0.0 ); 822 #endif 823 } 824 #ifdef USE_ANISOTROPY 825 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 826 #ifdef ENVMAP_TYPE_CUBE_UV 827 vec3 bentNormal = cross( bitangent, viewDir ); 828 bentNormal = normalize( cross( bentNormal, bitangent ) ); 829 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 830 return getIBLRadiance( viewDir, bentNormal, roughness ); 831 #else 832 return vec3( 0.0 ); 833 #endif 834 } 835 #endif 836#endif`,rg=`ToonMaterial material; 837material.diffuseColor = diffuseColor.rgb;`,sg=`varying vec3 vViewPosition; 838struct ToonMaterial { 839 vec3 diffuseColor; 840}; 841void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 842 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 843 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 844} 845void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 846 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 847} 848#define RE_Direct RE_Direct_Toon 849#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,og=`BlinnPhongMaterial material; 850material.diffuseColor = diffuseColor.rgb; 851material.specularColor = specular; 852material.specularShininess = shininess; 853material.specularStrength = specularStrength;`,ag=`varying vec3 vViewPosition; 854struct BlinnPhongMaterial { 855 vec3 diffuseColor; 856 vec3 specularColor; 857 float specularShininess; 858 float specularStrength; 859}; 860void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
861 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 862 vec3 irradiance = dotNL * directLight.color; 863 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 864 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 865} 866void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { 867 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 868} 869#define RE_Direct RE_Direct_BlinnPhong 870#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,lg=`PhysicalMaterial material; 871material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 872vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 873float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 874material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 875material.roughness = min( material.roughness, 1.0 ); 876#ifdef IOR 877 material.ior = ior; 878 #ifdef USE_SPECULAR 879 float specularIntensityFactor = specularIntensity; 880 vec3 specularColorFactor = specularColor; 881 #ifdef USE_SPECULAR_COLORMAP 882 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 883 #endif 884 #ifdef USE_SPECULAR_INTENSITYMAP 885 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 886 #endif 887 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 888 #else 889 float specularIntensityFactor = 1.0; 890 vec3 specularColorFactor = vec3( 1.0 ); 891 material.specularF90 = 1.0; 892 #endif 893 material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); 894#else 895 material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); 896 material.specularF90 = 1.0; 897#endif 898#ifdef USE_CLEARCOAT 899 material.clearcoat = clearcoat; 900 material.clearcoatRoughness = clearcoatRoughness; 901 material.clearcoatF0 = vec3( 0.04 ); 902 material.clearcoatF90 = 1.0; 903 #ifdef USE_CLEARCOATMAP 904 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 905 #endif 906 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 907 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 908 #endif 909 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 910 material.clearcoatRoughness += geometryRoughness; 911 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 912#endif 913#ifdef USE_DISPERSION 914 material.dispersion = dispersion; 915#endif 916#ifdef USE_IRIDESCENCE 917 material.iridescence = iridescence; 918 material.iridescenceIOR = iridescenceIOR; 919 #ifdef USE_IRIDESCENCEMAP 920 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 921 #endif 922 #ifdef USE_IRIDESCENCE_THICKNESSMAP 923 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 924 #else 925 material.iridescenceThickness = iridescenceThicknessMaximum; 926 #endif 927#endif 928#ifdef USE_SHEEN 929 material.sheenColor = sheenColor; 930 #ifdef USE_SHEEN_COLORMAP 931 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 932 #endif 933 material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); 934 #ifdef USE_SHEEN_ROUGHNESSMAP 935 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 936 #endif 937#endif 938#ifdef USE_ANISOTROPY 939 #ifdef USE_ANISOTROPYMAP 940 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 941 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 942 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 943 #else 944 vec2 anisotropyV = anisotropyVector; 945 #endif 946 material.anisotropy = length( anisotropyV ); 947 if( material.anisotropy == 0.0 ) { 948 anisotropyV = vec2( 1.0, 0.0 ); 949 } else { 950 anisotropyV /= material.anisotropy; 951 material.anisotropy = saturate( material.anisotropy ); 952 } 953 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
954 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 955 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 956#endif`,cg
vendor: 14,687 bytes, lines 956-1257
956=`struct PhysicalMaterial { 957 vec3 diffuseColor; 958 float roughness; 959 vec3 specularColor; 960 float specularF90; 961 float dispersion; 962 #ifdef USE_CLEARCOAT 963 float clearcoat; 964 float clearcoatRoughness; 965 vec3 clearcoatF0; 966 float clearcoatF90; 967 #endif 968 #ifdef USE_IRIDESCENCE 969 float iridescence; 970 float iridescenceIOR; 971 float iridescenceThickness; 972 vec3 iridescenceFresnel; 973 vec3 iridescenceF0; 974 #endif 975 #ifdef USE_SHEEN 976 vec3 sheenColor; 977 float sheenRoughness; 978 #endif 979 #ifdef IOR 980 float ior; 981 #endif 982 #ifdef USE_TRANSMISSION 983 float transmission; 984 float transmissionAlpha; 985 float thickness; 986 float attenuationDistance; 987 vec3 attenuationColor; 988 #endif 989 #ifdef USE_ANISOTROPY 990 float anisotropy; 991 float alphaT; 992 vec3 anisotropyT; 993 vec3 anisotropyB; 994 #endif 995}; 996vec3 clearcoatSpecularDirect = vec3( 0.0 ); 997vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 998vec3 sheenSpecularDirect = vec3( 0.0 ); 999vec3 sheenSpecularIndirect = vec3(0.0 ); 1000vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 1001 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 1002 float x2 = x * x; 1003 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 1004 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 1005} 1006float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 1007 float a2 = pow2( alpha ); 1008 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 1009 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 1010 return 0.5 / max( gv + gl, EPSILON ); 1011} 1012float D_GGX( const in float alpha, const in float dotNH ) { 1013 float a2 = pow2( alpha ); 1014 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 1015 return RECIPROCAL_PI * a2 / pow2( denom ); 1016} 1017#ifdef USE_ANISOTROPY 1018 float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { 1019 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 1020 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 1021 float v = 0.5 / ( gv + gl ); 1022 return saturate(v); 1023 } 1024 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 1025 float a2 = alphaT * alphaB; 1026 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 1027 highp float v2 = dot( v, v ); 1028 float w2 = a2 / v2; 1029 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 1030 } 1031#endif 1032#ifdef USE_CLEARCOAT 1033 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 1034 vec3 f0 = material.clearcoatF0; 1035 float f90 = material.clearcoatF90; 1036 float roughness = material.clearcoatRoughness; 1037 float alpha = pow2( roughness ); 1038 vec3 halfDir = normalize( lightDir + viewDir ); 1039 float dotNL = saturate( dot( normal, lightDir ) ); 1040 float dotNV = saturate( dot( normal, viewDir ) ); 1041 float dotNH = saturate( dot( normal, halfDir ) ); 1042 float dotVH = saturate( dot( viewDir, halfDir ) ); 1043 vec3 F = F_Schlick( f0, f90, dotVH ); 1044 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1045 float D = D_GGX( alpha, dotNH ); 1046 return F * ( V * D ); 1047 } 1048#endif 1049vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1050 vec3 f0 = material.specularColor; 1051 float f90 = material.specularF90; 1052 float roughness = material.roughness; 1053 float alpha = pow2( roughness ); 1054 vec3 halfDir = normalize( lightDir + viewDir ); 1055 float dotNL = saturate( dot( normal, lightDir ) ); 1056 float dotNV = saturate( dot( normal, viewDir ) ); 1057 float dotNH = saturate( dot( normal, halfDir ) ); 1058 float dotVH = saturate( dot( viewDir, halfDir ) ); 1059 vec3 F = F_Schlick( f0, f90, dotVH ); 1060 #ifdef USE_IRIDESCENCE 1061 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1062 #endif 1063 #ifdef USE_ANISOTROPY 1064 float dotTL = dot( material.anisotropyT, lightDir ); 1065 float dotTV = dot( material.anisotropyT, viewDir ); 1066 float dotTH = dot( material.anisotropyT, halfDir ); 1067 float dotBL = dot( material.anisotropyB, lightDir ); 1068 float dotBV = dot( material.anisotropyB, viewDir ); 1069 float dotBH = dot( material.anisotropyB, halfDir ); 1070 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1071 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1072 #else 1073 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1074 float D = D_GGX( alpha, dotNH ); 1075 #endif 1076 return F * ( V * D ); 1077} 1078vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1079 const float LUT_SIZE = 64.0; 1080 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1081 const float LUT_BIAS = 0.5 / LUT_SIZE; 1082 float dotNV = saturate( dot( N, V ) ); 1083 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1084 uv = uv * LUT_SCALE + LUT_BIAS; 1085 return uv; 1086} 1087float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1088 float l = length( f ); 1089 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1090} 1091vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1092 float x = dot( v1, v2 ); 1093 float y = abs( x ); 1094 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1095 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1096 float v = a / b; 1097 float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1098 return cross( v1, v2 ) * theta_sintheta; 1099} 1100vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1101 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1102 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1103 vec3 lightNormal = cross( v1, v2 ); 1104 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1105 vec3 T1, T2; 1106 T1 = normalize( V - N * dot( V, N ) ); 1107 T2 = - cross( N, T1 ); 1108 mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); 1109 vec3 coords[ 4 ]; 1110 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1111 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1112 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1113 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1114 coords[ 0 ] = normalize( coords[ 0 ] ); 1115 coords[ 1 ] = normalize( coords[ 1 ] ); 1116 coords[ 2 ] = normalize( coords[ 2 ] ); 1117 coords[ 3 ] = normalize( coords[ 3 ] ); 1118 vec3 vectorFormFactor = vec3( 0.0 ); 1119 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1120 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1121 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1122 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1123 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1124 return vec3( result ); 1125} 1126#if defined( USE_SHEEN ) 1127float D_Charlie( float roughness, float dotNH ) { 1128 float alpha = pow2( roughness ); 1129 float invAlpha = 1.0 / alpha; 1130 float cos2h = dotNH * dotNH; 1131 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1132 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1133} 1134float V_Neubelt( float dotNV, float dotNL ) { 1135 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1136} 1137vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1138 vec3 halfDir = normalize( lightDir + viewDir ); 1139 float dotNL = saturate( dot( normal, lightDir ) ); 1140 float dotNV = saturate( dot( normal, viewDir ) ); 1141 float dotNH = saturate( dot( normal, halfDir ) ); 1142 float D = D_Charlie( sheenRoughness, dotNH ); 1143 float V = V_Neubelt( dotNV, dotNL ); 1144 return sheenColor * ( D * V ); 1145} 1146#endif 1147float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1148 float dotNV = saturate( dot( normal, viewDir ) ); 1149 float r2 = roughness * roughness; 1150 float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; 1151 float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; 1152 float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); 1153 return saturate( DG * RECIPROCAL_PI ); 1154} 1155vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1156 float dotNV = saturate( dot( normal, viewDir ) ); 1157 const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); 1158 const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); 1159 vec4 r = roughness * c0 + c1; 1160 float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; 1161 vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; 1162 return fab; 1163} 1164vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1165 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1166 return specularColor * fab.x + specularF90 * fab.y; 1167} 1168#ifdef USE_IRIDESCENCE 1169void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { 1170#else 1171void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { 1172#endif 1173 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1174 #ifdef USE_IRIDESCENCE 1175 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1176 #else 1177 vec3 Fr = specularColor; 1178 #endif 1179 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1180 float Ess = fab.x + fab.y; 1181 float Ems = 1.0 - Ess; 1182 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1183 singleScatter += FssEss; 1184 multiScatter += Fms * Ems; 1185} 1186#if NUM_RECT_AREA_LIGHTS > 0 1187 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1188 vec3 normal = geometryNormal; 1189 vec3 viewDir = geometryViewDir; 1190 vec3 position = geometryPosition; 1191 vec3 lightPos = rectAreaLight.position; 1192 vec3 halfWidth = rectAreaLight.halfWidth; 1193 vec3 halfHeight = rectAreaLight.halfHeight; 1194 vec3 lightColor = rectAreaLight.color; 1195 float roughness = material.roughness; 1196 vec3 rectCoords[ 4 ]; 1197 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1198 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1199 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1200 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1201 vec4 t1 = texture2D( ltc_1, uv ); 1202 vec4 t2 = texture2D( ltc_2, uv ); 1203 mat3 mInv = mat3( 1204 vec3( t1.x, 0, t1.y ), 1205 vec3( 0, 1, 0 ), 1206 vec3( t1.z, 0, t1.w ) 1207 ); 1208 vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); 1209 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1210 reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1211 } 1212#endif 1213void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1214 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1215 vec3 irradiance = dotNL * directLight.color; 1216 #ifdef USE_CLEARCOAT 1217 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1218 vec3 ccIrradiance = dotNLcc * directLight.color; 1219 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1220 #endif 1221 #ifdef USE_SHEEN 1222 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1223 #endif 1224 reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); 1225 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1226} 1227void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1228 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1229} 1230void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { 1231 #ifdef USE_CLEARCOAT 1232 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1233 #endif 1234 #ifdef USE_SHEEN 1235 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1236 #endif 1237 vec3 singleScattering = vec3( 0.0 ); 1238 vec3 multiScattering = vec3( 0.0 ); 1239 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1240 #ifdef USE_IRIDESCENCE 1241 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); 1242 #else 1243 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); 1244 #endif 1245 vec3 totalScattering = singleScattering + multiScattering; 1246 vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); 1247 reflectedLight.indirectSpecular += radiance * singleScattering; 1248 reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; 1249 reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; 1250} 1251#define RE_Direct RE_Direct_Physical 1252#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1253#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1254#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1255float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1256 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1257}`,
1257hg=` 1258vec3 geometryPosition = - vViewPosition; 1259vec3 geometryNormal = normal; 1260vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1261vec3 geometryClearcoatNormal = vec3( 0.0 ); 1262#ifdef USE_CLEARCOAT 1263 geometryClearcoatNormal = clearcoatNormal; 1264#endif 1265#ifdef USE_IRIDESCENCE 1266 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1267 if ( material.iridescenceThickness == 0.0 ) { 1268 material.iridescence = 0.0; 1269 } else { 1270 material.iridescence = saturate( material.iridescence ); 1271 } 1272 if ( material.iridescence > 0.0 ) { 1273 material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1274 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1275 } 1276#endif 1277IncidentLight directLight; 1278#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1279 PointLight pointLight; 1280 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1281 PointLightShadow pointLightShadow; 1282 #endif 1283 #pragma unroll_loop_start 1284 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1285 pointLight = pointLights[ i ]; 1286 getPointLightInfo( pointLight, geometryPosition, directLight ); 1287 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) 1288 pointLightShadow = pointLightShadows[ i ]; 1289 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1290 #endif 1291 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1292 } 1293 #pragma unroll_loop_end 1294#endif 1295#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1296 SpotLight spotLight; 1297 vec4 spotColor; 1298 vec3 spotLightCoord; 1299 bool inSpotLightMap; 1300 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1301 SpotLightShadow spotLightShadow; 1302 #endif 1303 #pragma unroll_loop_start 1304 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1305 spotLight = spotLights[ i ]; 1306 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1307 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1308 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1309 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1310 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1311 #else 1312 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1313 #endif 1314 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1315 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1316 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1317 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1318 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1319 #endif 1320 #undef SPOT_LIGHT_MAP_INDEX 1321 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1322 spotLightShadow = spotLightShadows[ i ]; 1323 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1324 #endif 1325 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1326 } 1327 #pragma unroll_loop_end 1328#endif 1329#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1330 DirectionalLight directionalLight; 1331 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1332 DirectionalLightShadow directionalLightShadow; 1333 #endif 1334 #pragma unroll_loop_start 1335 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1336 directionalLight = directionalLights[ i ]; 1337 getDirectionalLightInfo( directionalLight, directLight ); 1338 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1339 directionalLightShadow = directionalLightShadows[ i ]; 1340 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1341 #endif 1342 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1343 } 1344 #pragma unroll_loop_end 1345#endif 1346#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1347 RectAreaLight rectAreaLight; 1348 #pragma unroll_loop_start 1349 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1350 rectAreaLight = rectAreaLights[ i ]; 1351 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1352 } 1353 #pragma unroll_loop_end 1354#endif 1355#if defined( RE_IndirectDiffuse ) 1356 vec3 iblIrradiance = vec3( 0.0 ); 1357 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1358 #if defined( USE_LIGHT_PROBES ) 1359 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1360 #endif 1361 #if ( NUM_HEMI_LIGHTS > 0 ) 1362 #pragma unroll_loop_start 1363 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1364 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1365 } 1366 #pragma unroll_loop_end 1367 #endif 1368#endif 1369#if defined( RE_IndirectSpecular ) 1370 vec3 radiance = vec3( 0.0 ); 1371 vec3 clearcoatRadiance = vec3( 0.0 ); 1372#endif`,ug=`#if defined( RE_IndirectDiffuse ) 1373 #ifdef USE_LIGHTMAP 1374 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1375 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1376 irradiance += lightMapIrradiance; 1377 #endif 1378 #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) 1379 iblIrradiance += getIBLIrradiance( geometryNormal ); 1380 #endif 1381#endif 1382#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1383 #ifdef USE_ANISOTROPY 1384 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1385 #else 1386 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1387 #endif 1388 #ifdef USE_CLEARCOAT 1389 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1390 #endif 1391#endif`,dg=`#if defined( RE_IndirectDiffuse ) 1392 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1393#endif 1394#if defined( RE_IndirectSpecular ) 1395 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1396#endif`,fg=`#if defined( USE_LOGDEPTHBUF ) 1397 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1398#endif`,pg=`#if defined( USE_LOGDEPTHBUF ) 1399 uniform float logDepthBufFC; 1400 varying float vFragDepth; 1401 varying float vIsPerspective; 1402#endif`,mg=`#ifdef USE_LOGDEPTHBUF 1403 varying float vFragDepth; 1404 varying float vIsPerspective; 1405#endif`,_g=`#ifdef USE_LOGDEPTHBUF 1406 vFragDepth = 1.0 + gl_Position.w; 1407 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1408#endif`,gg=`#ifdef USE_MAP 1409 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1410 #ifdef DECODE_VIDEO_TEXTURE 1411 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 ); 1412 1413 #endif 1414 diffuseColor *= sampledDiffuseColor; 1415#endif`,vg=`#ifdef USE_MAP 1416 uniform sampler2D map; 1417#endif`,xg=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1418 #if defined( USE_POINTS_UV ) 1419 vec2 uv = vUv; 1420 #else 1421 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1422 #endif 1423#endif 1424#ifdef USE_MAP 1425 diffuseColor *= texture2D( map, uv ); 1426#endif 1427#ifdef USE_ALPHAMAP 1428 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1429#endif`,yg=`#if defined( USE_POINTS_UV ) 1430 varying vec2 vUv; 1431#else 1432 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1433 uniform mat3 uvTransform; 1434 #endif 1435#endif 1436#ifdef USE_MAP 1437 uniform sampler2D map; 1438#endif 1439#ifdef USE_ALPHAMAP 1440 uniform sampler2D alphaMap; 1441#endif`,Sg=`float metalnessFactor = metalness; 1442#ifdef USE_METALNESSMAP 1443 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1444 metalnessFactor *= texelMetalness.b; 1445#endif`,Mg=`#ifdef USE_METALNESSMAP 1446 uniform sampler2D metalnessMap; 1447#endif`,Eg=`#ifdef USE_INSTANCING_MORPH 1448 float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1449 float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; 1450 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1451 morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; 1452 } 1453#endif`,Tg=`#if defined( USE_MORPHCOLORS ) 1454 vColor *= morphTargetBaseInfluence; 1455 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1456 #if defined( USE_COLOR_ALPHA ) 1457 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1458 #elif defined( USE_COLOR ) 1459 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1460 #endif 1461 } 1462#endif`,bg=`#ifdef USE_MORPHNORMALS 1463 objectNormal *= morphTargetBaseInfluence; 1464 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1465 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1466 } 1467#endif`,wg=`#ifdef USE_MORPHTARGETS 1468 #ifndef USE_INSTANCING_MORPH 1469 uniform float morphTargetBaseInfluence; 1470 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1471 #endif 1472 uniform sampler2DArray morphTargetsTexture; 1473 uniform ivec2 morphTargetsTextureSize; 1474 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1475 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1476 int y = texelIndex / morphTargetsTextureSize.x; 1477 int x = texelIndex - y * morphTargetsTextureSize.x; 1478 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1479 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1480 } 1481#endif`,Ag=`#ifdef USE_MORPHTARGETS 1482 transformed *= morphTargetBaseInfluence; 1483 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1484 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1485 } 1486#endif`,Cg=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1487#ifdef FLAT_SHADED 1488 vec3 fdx = dFdx( vViewPosition ); 1489 vec3 fdy = dFdy( vViewPosition ); 1490 vec3 normal = normalize( cross( fdx, fdy ) ); 1491#else 1492 vec3 normal = normalize( vNormal ); 1493 #ifdef DOUBLE_SIDED 1494 normal *= faceDirection; 1495 #endif 1496#endif 1497#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1498 #ifdef USE_TANGENT 1499 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1500 #else 1501 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1502 #if defined( USE_NORMALMAP ) 1503 vNormalMapUv 1504 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1505 vClearcoatNormalMapUv 1506 #else 1507 vUv 1508 #endif 1509 ); 1510 #endif 1511 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1512 tbn[0] *= faceDirection; 1513 tbn[1] *= faceDirection; 1514 #endif 1515#endif 1516#ifdef USE_CLEARCOAT_NORMALMAP 1517 #ifdef USE_TANGENT 1518 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1519 #else 1520 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1521 #endif 1522 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1523 tbn2[0] *= faceDirection; 1524 tbn2[1] *= faceDirection; 1525 #endif 1526#endif 1527vec3 nonPerturbedNormal = normal;`,Rg=`#ifdef USE_NORMALMAP_OBJECTSPACE 1528 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1529 #ifdef FLIP_SIDED 1530 normal = - normal; 1531 #endif 1532 #ifdef DOUBLE_SIDED 1533 normal = normal * faceDirection; 1534 #endif 1535 normal = normalize( normalMatrix * normal ); 1536#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1537 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1538 mapN.xy *= normalScale; 1539 normal = normalize( tbn * mapN ); 1540#elif defined( USE_BUMPMAP )
1541 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1542#endif`,Pg=`#ifndef FLAT_SHADED 1543 varying vec3 vNormal; 1544 #ifdef USE_TANGENT 1545 varying vec3 vTangent; 1546 varying vec3 vBitangent; 1547 #endif 1548#endif`,Lg=`#ifndef FLAT_SHADED 1549 varying vec3 vNormal; 1550 #ifdef USE_TANGENT 1551 varying vec3 vTangent; 1552 varying vec3 vBitangent; 1553 #endif 1554#endif`,Ig=`#ifndef FLAT_SHADED 1555 vNormal = normalize( transformedNormal ); 1556 #ifdef USE_TANGENT 1557 vTangent = normalize( transformedTangent ); 1558 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1559 #endif 1560#endif`,Dg=`#ifdef USE_NORMALMAP 1561 uniform sampler2D normalMap; 1562 uniform vec2 normalScale; 1563#endif 1564#ifdef USE_NORMALMAP_OBJECTSPACE 1565 uniform mat3 normalMatrix; 1566#endif 1567#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1568 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1569 vec3 q0 = dFdx( eye_pos.xyz ); 1570 vec3 q1 = dFdy( eye_pos.xyz ); 1571 vec2 st0 = dFdx( uv.st ); 1572 vec2 st1 = dFdy( uv.st ); 1573 vec3 N = surf_norm; 1574 vec3 q1perp = cross( q1, N ); 1575 vec3 q0perp = cross( N, q0 ); 1576 vec3 T = q1perp * st0.x + q0perp * st1.x; 1577 vec3 B = q1perp * st0.y + q0perp * st1.y; 1578 float det = max( dot( T, T ), dot( B, B ) ); 1579 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1580 return mat3( T * scale, B * scale, N ); 1581 } 1582#endif`,Ug=`#ifdef USE_CLEARCOAT 1583 vec3 clearcoatNormal = nonPerturbedNormal; 1584#endif`,Ng=`#ifdef USE_CLEARCOAT_NORMALMAP 1585 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 1586 clearcoatMapN.xy *= clearcoatNormalScale; 1587 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 1588#endif`,Og=`#ifdef USE_CLEARCOATMAP 1589 uniform sampler2D clearcoatMap; 1590#endif 1591#ifdef USE_CLEARCOAT_NORMALMAP 1592 uniform sampler2D clearcoatNormalMap; 1593 uniform vec2 clearcoatNormalScale; 1594#endif 1595#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1596 uniform sampler2D clearcoatRoughnessMap; 1597#endif`,Fg=`#ifdef USE_IRIDESCENCEMAP 1598 uniform sampler2D iridescenceMap; 1599#endif 1600#ifdef USE_IRIDESCENCE_THICKNESSMAP 1601 uniform sampler2D iridescenceThicknessMap; 1602#endif`,zg=`#ifdef OPAQUE 1603diffuseColor.a = 1.0; 1604#endif 1605#ifdef USE_TRANSMISSION 1606diffuseColor.a *= material.transmissionAlpha; 1607#endif 1608gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Bg=`vec3 packNormalToRGB( const in vec3 normal ) { 1609 return normalize( normal ) * 0.5 + 0.5; 1610} 1611vec3 unpackRGBToNormal( const in vec3 rgb ) { 1612 return 2.0 * rgb.xyz - 1.0; 1613} 1614const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; 1615const float Inv255 = 1. / 255.; 1616const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); 1617const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); 1618const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); 1619const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); 1620vec4 packDepthToRGBA( const in float v ) { 1621 if( v <= 0.0 ) 1622 return vec4( 0., 0., 0., 0. ); 1623 if( v >= 1.0 ) 1624 return vec4( 1., 1., 1., 1. ); 1625 float vuf; 1626 float af = modf( v * PackFactors.a, vuf ); 1627 float bf = modf( vuf * ShiftRight8, vuf ); 1628 float gf = modf( vuf * ShiftRight8, vuf ); 1629 return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); 1630} 1631vec3 packDepthToRGB( const in float v ) { 1632 if( v <= 0.0 ) 1633 return vec3( 0., 0., 0. ); 1634 if( v >= 1.0 ) 1635 return vec3( 1., 1., 1. ); 1636 float vuf; 1637 float bf = modf( v * PackFactors.b, vuf ); 1638 float gf = modf( vuf * ShiftRight8, vuf ); 1639 return vec3( vuf * Inv255, gf * PackUpscale, bf ); 1640} 1641vec2 packDepthToRG( const in float v ) { 1642 if( v <= 0.0 ) 1643 return vec2( 0., 0. ); 1644 if( v >= 1.0 ) 1645 return vec2( 1., 1. ); 1646 float vuf; 1647 float gf = modf( v * 256., vuf ); 1648 return vec2( vuf * Inv255, gf ); 1649} 1650float unpackRGBAToDepth( const in vec4 v ) { 1651 return dot( v, UnpackFactors4 ); 1652} 1653float unpackRGBToDepth( const in vec3 v ) { 1654 return dot( v, UnpackFactors3 ); 1655} 1656float unpackRGToDepth( const in vec2 v ) { 1657 return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; 1658} 1659vec4 pack2HalfToRGBA( const in vec2 v ) {
1660 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1661 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1662} 1663vec2 unpackRGBATo2Half( const in vec4 v ) { 1664 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1665} 1666float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1667 return ( viewZ + near ) / ( near - far ); 1668} 1669float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 1670 return depth * ( near - far ) - near; 1671} 1672float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1673 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1674} 1675float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 1676 return ( near * far ) / ( ( far - near ) * depth - far ); 1677}`,kg=`#ifdef PREMULTIPLIED_ALPHA 1678 gl_FragColor.rgb *= gl_FragColor.a; 1679#endif`,Hg=`vec4 mvPosition = vec4( transformed, 1.0 ); 1680#ifdef USE_BATCHING 1681 mvPosition = batchingMatrix * mvPosition; 1682#endif 1683#ifdef USE_INSTANCING 1684 mvPosition = instanceMatrix * mvPosition; 1685#endif 1686mvPosition = modelViewMatrix * mvPosition; 1687gl_Position = projectionMatrix * mvPosition;`,Vg=`#ifdef DITHERING 1688 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1689#endif`,Gg=`#ifdef DITHERING 1690 vec3 dithering( vec3 color ) { 1691 float grid_position = rand( gl_FragCoord.xy ); 1692 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1693 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1694 return color + dither_shift_RGB; 1695 } 1696#endif`,Wg=`float roughnessFactor = roughness; 1697#ifdef USE_ROUGHNESSMAP 1698 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1699 roughnessFactor *= texelRoughness.g; 1700#endif`,Xg=`#ifdef USE_ROUGHNESSMAP 1701 uniform sampler2D roughnessMap; 1702#endif`,qg
vendor: 8,888 bytes, lines 1702-1888
1702=`#if NUM_SPOT_LIGHT_COORDS > 0 1703 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1704#endif 1705#if NUM_SPOT_LIGHT_MAPS > 0 1706 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 1707#endif 1708#ifdef USE_SHADOWMAP 1709 #if NUM_DIR_LIGHT_SHADOWS > 0 1710 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1711 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1712 struct DirectionalLightShadow { 1713 float shadowIntensity; 1714 float shadowBias; 1715 float shadowNormalBias; 1716 float shadowRadius; 1717 vec2 shadowMapSize; 1718 }; 1719 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1720 #endif 1721 #if NUM_SPOT_LIGHT_SHADOWS > 0 1722 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1723 struct SpotLightShadow { 1724 float shadowIntensity; 1725 float shadowBias; 1726 float shadowNormalBias; 1727 float shadowRadius; 1728 vec2 shadowMapSize; 1729 }; 1730 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1731 #endif 1732 #if NUM_POINT_LIGHT_SHADOWS > 0 1733 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1734 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1735 struct PointLightShadow { 1736 float shadowIntensity; 1737 float shadowBias; 1738 float shadowNormalBias; 1739 float shadowRadius; 1740 vec2 shadowMapSize; 1741 float shadowCameraNear; 1742 float shadowCameraFar; 1743 }; 1744 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1745 #endif 1746 float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { 1747 return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); 1748 } 1749 vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { 1750 return unpackRGBATo2Half( texture2D( shadow, uv ) ); 1751 } 1752 float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ 1753 float occlusion = 1.0; 1754 vec2 distribution = texture2DDistribution( shadow, uv ); 1755 float hard_shadow = step( compare , distribution.x ); 1756 if (hard_shadow != 1.0 ) { 1757 float distance = compare - distribution.x ; 1758 float variance = max( 0.00000, distribution.y * distribution.y ); 1759 float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); 1760 } 1761 return occlusion; 1762 } 1763 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1764 float shadow = 1.0; 1765 shadowCoord.xyz /= shadowCoord.w; 1766 shadowCoord.z += shadowBias; 1767 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1768 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1769 if ( frustumTest ) { 1770 #if defined( SHADOWMAP_TYPE_PCF ) 1771 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1772 float dx0 = - texelSize.x * shadowRadius; 1773 float dy0 = - texelSize.y * shadowRadius; 1774 float dx1 = + texelSize.x * shadowRadius; 1775 float dy1 = + texelSize.y * shadowRadius; 1776 float dx2 = dx0 / 2.0; 1777 float dy2 = dy0 / 2.0; 1778 float dx3 = dx1 / 2.0; 1779 float dy3 = dy1 / 2.0; 1780 shadow = ( 1781 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + 1782 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + 1783 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + 1784 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + 1785 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + 1786 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + 1787 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + 1788 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + 1789 texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + 1790 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + 1791 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + 1792 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + 1793 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + 1794 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + 1795 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + 1796 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + 1797 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) 1798 ) * ( 1.0 / 17.0 ); 1799 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 1800 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1801 float dx = texelSize.x; 1802 float dy = texelSize.y; 1803 vec2 uv = shadowCoord.xy; 1804 vec2 f = fract( uv * shadowMapSize + 0.5 ); 1805 uv -= f * texelSize; 1806 shadow = ( 1807 texture2DCompare( shadowMap, uv, shadowCoord.z ) + 1808 texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + 1809 texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + 1810 texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + 1811 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 1812 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), 1813 f.x ) + 1814 mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 1815 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), 1816 f.x ) + 1817 mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 1818 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), 1819 f.y ) + 1820 mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 1821 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), 1822 f.y ) + 1823 mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 1824 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), 1825 f.x ), 1826 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 1827 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), 1828 f.x ), 1829 f.y ) 1830 ) * ( 1.0 / 9.0 ); 1831 #elif defined( SHADOWMAP_TYPE_VSM ) 1832 shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); 1833 #else 1834 shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); 1835 #endif 1836 } 1837 return mix( 1.0, shadow, shadowIntensity ); 1838 } 1839 vec2 cubeToUV( vec3 v, float texelSizeY ) { 1840 vec3 absV = abs( v ); 1841 float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); 1842 absV *= scaleToCube; 1843 v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); 1844 vec2 planar = v.xy; 1845 float almostATexel = 1.5 * texelSizeY; 1846 float almostOne = 1.0 - almostATexel; 1847 if ( absV.z >= almostOne ) { 1848 if ( v.z > 0.0 ) 1849 planar.x = 4.0 - v.x; 1850 } else if ( absV.x >= almostOne ) { 1851 float signX = sign( v.x ); 1852 planar.x = v.z * signX + 2.0 * signX; 1853 } else if ( absV.y >= almostOne ) { 1854 float signY = sign( v.y ); 1855 planar.x = v.x + 2.0 * signY + 2.0; 1856 planar.y = v.z * signY - 2.0; 1857 } 1858 return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); 1859 } 1860 float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1861 float shadow = 1.0; 1862 vec3 lightToPosition = shadowCoord.xyz; 1863 1864 float lightToPositionLength = length( lightToPosition ); 1865 if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { 1866 float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; 1867 vec3 bd3D = normalize( lightToPosition ); 1868 vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); 1869 #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) 1870 vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; 1871 shadow = ( 1872 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + 1873 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + 1874 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + 1875 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + 1876 texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + 1877 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + 1878 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + 1879 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + 1880 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) 1881 ) * ( 1.0 / 9.0 ); 1882 #else 1883 shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); 1884 #endif 1885 } 1886 return mix( 1.0, shadow, shadowIntensity ); 1887 } 1888#endif`,
1888Yg=`#if NUM_SPOT_LIGHT_COORDS > 0 1889 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 1890 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1891#endif 1892#ifdef USE_SHADOWMAP 1893 #if NUM_DIR_LIGHT_SHADOWS > 0 1894 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 1895 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1896 struct DirectionalLightShadow { 1897 float shadowIntensity; 1898 float shadowBias; 1899 float shadowNormalBias; 1900 float shadowRadius; 1901 vec2 shadowMapSize; 1902 }; 1903 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1904 #endif 1905 #if NUM_SPOT_LIGHT_SHADOWS > 0 1906 struct SpotLightShadow { 1907 float shadowIntensity; 1908 float shadowBias; 1909 float shadowNormalBias; 1910 float shadowRadius; 1911 vec2 shadowMapSize; 1912 }; 1913 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1914 #endif 1915 #if NUM_POINT_LIGHT_SHADOWS > 0 1916 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 1917 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1918 struct PointLightShadow { 1919 float shadowIntensity; 1920 float shadowBias; 1921 float shadowNormalBias; 1922 float shadowRadius; 1923 vec2 shadowMapSize; 1924 float shadowCameraNear; 1925 float shadowCameraFar; 1926 }; 1927 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1928 #endif 1929#endif`,$g=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 1930 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 1931 vec4 shadowWorldPosition; 1932#endif 1933#if defined( USE_SHADOWMAP ) 1934 #if NUM_DIR_LIGHT_SHADOWS > 0 1935 #pragma unroll_loop_start 1936 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1937 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 1938 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 1939 } 1940 #pragma unroll_loop_end 1941 #endif 1942 #if NUM_POINT_LIGHT_SHADOWS > 0 1943 #pragma unroll_loop_start 1944 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 1945 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 1946 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 1947 } 1948 #pragma unroll_loop_end 1949 #endif 1950#endif 1951#if NUM_SPOT_LIGHT_COORDS > 0 1952 #pragma unroll_loop_start 1953 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 1954 shadowWorldPosition = worldPosition; 1955 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1956 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 1957 #endif 1958 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 1959 } 1960 #pragma unroll_loop_end 1961#endif`,Zg=`float getShadowMask() { 1962 float shadow = 1.0; 1963 #ifdef USE_SHADOWMAP 1964 #if NUM_DIR_LIGHT_SHADOWS > 0 1965 DirectionalLightShadow directionalLight; 1966 #pragma unroll_loop_start 1967 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1968 directionalLight = directionalLightShadows[ i ]; 1969 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1970 } 1971 #pragma unroll_loop_end 1972 #endif 1973 #if NUM_SPOT_LIGHT_SHADOWS > 0 1974 SpotLightShadow spotLight; 1975 #pragma unroll_loop_start 1976 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 1977 spotLight = spotLightShadows[ i ]; 1978 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1979 } 1980 #pragma unroll_loop_end 1981 #endif 1982 #if NUM_POINT_LIGHT_SHADOWS > 0 1983 PointLightShadow pointLight; 1984 #pragma unroll_loop_start 1985 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 1986 pointLight = pointLightShadows[ i ]; 1987 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 1988 } 1989 #pragma unroll_loop_end 1990 #endif 1991 #endif 1992 return shadow; 1993}`,Kg=`#ifdef USE_SKINNING 1994 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 1995 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 1996 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 1997 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 1998#endif`,jg=`#ifdef USE_SKINNING 1999 uniform mat4 bindMatrix; 2000 uniform mat4 bindMatrixInverse; 2001 uniform highp sampler2D boneTexture; 2002 mat4 getBoneMatrix( const in float i ) { 2003 int size = textureSize( boneTexture, 0 ).x; 2004 int j = int( i ) * 4; 2005 int x = j % size; 2006 int y = j / size; 2007 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2008 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2009 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2010 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2011 return mat4( v1, v2, v3, v4 ); 2012 } 2013#endif`,Jg=`#ifdef USE_SKINNING 2014 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2015 vec4 skinned = vec4( 0.0 ); 2016 skinned += boneMatX * skinVertex * skinWeight.x; 2017 skinned += boneMatY * skinVertex * skinWeight.y; 2018 skinned += boneMatZ * skinVertex * skinWeight.z; 2019 skinned += boneMatW * skinVertex * skinWeight.w; 2020 transformed = ( bindMatrixInverse * skinned ).xyz; 2021#endif`,Qg=`#ifdef USE_SKINNING 2022 mat4 skinMatrix = mat4( 0.0 ); 2023 skinMatrix += skinWeight.x * boneMatX; 2024 skinMatrix += skinWeight.y * boneMatY; 2025 skinMatrix += skinWeight.z * boneMatZ; 2026 skinMatrix += skinWeight.w * boneMatW; 2027 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2028 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2029 #ifdef USE_TANGENT 2030 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2031 #endif 2032#endif`,tv=`float specularStrength; 2033#ifdef USE_SPECULARMAP 2034 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2035 specularStrength = texelSpecular.r; 2036#else 2037 specularStrength = 1.0; 2038#endif`,ev=`#ifdef USE_SPECULARMAP 2039 uniform sampler2D specularMap; 2040#endif`,nv=`#if defined( TONE_MAPPING ) 2041 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2042#endif`,iv=`#ifndef saturate 2043#define saturate( a ) clamp( a, 0.0, 1.0 ) 2044#endif 2045uniform float toneMappingExposure; 2046vec3 LinearToneMapping( vec3 color ) { 2047 return saturate( toneMappingExposure * color ); 2048} 2049vec3 ReinhardToneMapping( vec3 color ) { 2050 color *= toneMappingExposure; 2051 return saturate( color / ( vec3( 1.0 ) + color ) ); 2052} 2053vec3 CineonToneMapping( vec3 color ) { 2054 color *= toneMappingExposure; 2055 color = max( vec3( 0.0 ), color - 0.004 ); 2056 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2057} 2058vec3 RRTAndODTFit( vec3 v ) { 2059 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2060 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2061 return a / b; 2062} 2063vec3 ACESFilmicToneMapping( vec3 color ) { 2064 const mat3 ACESInputMat = mat3( 2065 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2066 vec3( 0.04823, 0.01566, 0.83777 ) 2067 ); 2068 const mat3 ACESOutputMat = mat3( 2069 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2070 vec3( -0.07367, -0.00605, 1.07602 ) 2071 ); 2072 color *= toneMappingExposure / 0.6; 2073 color = ACESInputMat * color; 2074 color = RRTAndODTFit( color ); 2075 color = ACESOutputMat * color; 2076 return saturate( color ); 2077} 2078const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2079 vec3( 1.6605, - 0.1246, - 0.0182 ), 2080 vec3( - 0.5876, 1.1329, - 0.1006 ), 2081 vec3( - 0.0728, - 0.0083, 1.1187 ) 2082); 2083const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2084 vec3( 0.6274, 0.0691, 0.0164 ), 2085 vec3( 0.3293, 0.9195, 0.0880 ), 2086 vec3( 0.0433, 0.0113, 0.8956 ) 2087); 2088vec3 agxDefaultContrastApprox( vec3 x ) { 2089 vec3 x2 = x * x; 2090 vec3 x4 = x2 * x2; 2091 return + 15.5 * x4 * x2 2092 - 40.14 * x4 * x 2093 + 31.96 * x4 2094 - 6.868 * x2 * x 2095 + 0.4298 * x2 2096 + 0.1191 * x 2097 - 0.00232; 2098} 2099vec3 AgXToneMapping( vec3 color ) { 2100 const mat3 AgXInsetMatrix = mat3( 2101 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2102 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2103 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2104 );
2105 const mat3 AgXOutsetMatrix = mat3( 2106 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2107 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2108 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2109 ); 2110 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2111 color *= toneMappingExposure; 2112 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2113 color = AgXInsetMatrix * color; 2114 color = max( color, 1e-10 ); color = log2( color ); 2115 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2116 color = clamp( color, 0.0, 1.0 ); 2117 color = agxDefaultContrastApprox( color ); 2118 color = AgXOutsetMatrix * color; 2119 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2120 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2121 color = clamp( color, 0.0, 1.0 ); 2122 return color; 2123} 2124vec3 NeutralToneMapping( vec3 color ) { 2125 const float StartCompression = 0.8 - 0.04; 2126 const float Desaturation = 0.15; 2127 color *= toneMappingExposure; 2128 float x = min( color.r, min( color.g, color.b ) ); 2129 float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; 2130 color -= offset; 2131 float peak = max( color.r, max( color.g, color.b ) ); 2132 if ( peak < StartCompression ) return color; 2133 float d = 1. - StartCompression; 2134 float newPeak = 1. - d * d / ( peak + d - StartCompression ); 2135 color *= newPeak / peak; 2136 float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); 2137 return mix( color, vec3( newPeak ), g ); 2138} 2139vec3 CustomToneMapping( vec3 color ) { return color; }`,rv=`#ifdef USE_TRANSMISSION 2140 material.transmission = transmission; 2141 material.transmissionAlpha = 1.0; 2142 material.thickness = thickness; 2143 material.attenuationDistance = attenuationDistance; 2144 material.attenuationColor = attenuationColor; 2145 #ifdef USE_TRANSMISSIONMAP 2146 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2147 #endif 2148 #ifdef USE_THICKNESSMAP 2149 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2150 #endif 2151 vec3 pos = vWorldPosition; 2152 vec3 v = normalize( cameraPosition - pos ); 2153 vec3 n = inverseTransformDirection( normal, viewMatrix ); 2154 vec4 transmitted = getIBLVolumeRefraction( 2155 n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, 2156 pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, 2157 material.attenuationColor, material.attenuationDistance ); 2158 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2159 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2160#endif`,sv=`#ifdef USE_TRANSMISSION 2161 uniform float transmission; 2162 uniform float thickness; 2163 uniform float attenuationDistance; 2164 uniform vec3 attenuationColor; 2165 #ifdef USE_TRANSMISSIONMAP 2166 uniform sampler2D transmissionMap; 2167 #endif 2168 #ifdef USE_THICKNESSMAP 2169 uniform sampler2D thicknessMap; 2170 #endif 2171 uniform vec2 transmissionSamplerSize; 2172 uniform sampler2D transmissionSamplerMap; 2173 uniform mat4 modelMatrix; 2174 uniform mat4 projectionMatrix; 2175 varying vec3 vWorldPosition; 2176 float w0( float a ) { 2177 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2178 } 2179 float w1( float a ) { 2180 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2181 } 2182 float w2( float a ){ 2183 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2184 } 2185 float w3( float a ) { 2186 return ( 1.0 / 6.0 ) * ( a * a * a ); 2187 } 2188 float g0( float a ) { 2189 return w0( a ) + w1( a ); 2190 } 2191 float g1( float a ) { 2192 return w2( a ) + w3( a ); 2193 } 2194 float h0( float a ) { 2195 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2196 } 2197 float h1( float a ) { 2198 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2199 } 2200 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2201 uv = uv * texelSize.zw + 0.5; 2202 vec2 iuv = floor( uv ); 2203 vec2 fuv = fract( uv ); 2204 float g0x = g0( fuv.x ); 2205 float g1x = g1( fuv.x ); 2206 float h0x = h0( fuv.x ); 2207 float h1x = h1( fuv.x ); 2208 float h0y = h0( fuv.y ); 2209 float h1y = h1( fuv.y ); 2210 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2211 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2212 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2213 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2214 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2215 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2216 } 2217 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2218 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2219 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2220 vec2 fLodSizeInv = 1.0 / fLodSize; 2221 vec2 cLodSizeInv = 1.0 / cLodSize; 2222 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2223 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2224 return mix( fSample, cSample, fract( lod ) ); 2225 } 2226 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2227 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2228 vec3 modelScale; 2229 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2230 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2231 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2232 return normalize( refractionVector ) * thickness * modelScale; 2233 } 2234 float applyIorToRoughness( const in float roughness, const in float ior ) { 2235 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2236 } 2237 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2238 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2239 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2240 } 2241 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2242 if ( isinf( attenuationDistance ) ) { 2243 return vec3( 1.0 ); 2244 } else { 2245 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2246 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2247 } 2248 } 2249 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2250 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2251 const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, 2252 const in vec3 attenuationColor, const in float attenuationDistance ) { 2253 vec4 transmittedLight; 2254 vec3 transmittance; 2255 #ifdef USE_DISPERSION 2256 float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; 2257 vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); 2258 for ( int i = 0; i < 3; i ++ ) { 2259 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); 2260 vec3 refractedRayExit = position + transmissionRay; 2261 2262 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2263 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2264 refractionCoords += 1.0; 2265 refractionCoords /= 2.0; 2266 2267 vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); 2268 transmittedLight[ i ] = transmissionSample[ i ]; 2269 transmittedLight.a += transmissionSample.a; 2270 transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; 2271 } 2272 transmittedLight.a /= 3.0; 2273 2274 #else 2275 2276 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2277 vec3 refractedRayExit = position + transmissionRay; 2278 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2279 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2280 refractionCoords += 1.0; 2281 refractionCoords /= 2.0; 2282 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2283 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2284 2285 #endif 2286 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2287 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2288 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2289 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2290 } 2291#endif`,ov=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2292 varying vec2 vUv; 2293#endif 2294#ifdef USE_MAP 2295 varying vec2 vMapUv; 2296#endif 2297#ifdef USE_ALPHAMAP
2298 varying vec2 vAlphaMapUv; 2299#endif 2300#ifdef USE_LIGHTMAP 2301 varying vec2 vLightMapUv; 2302#endif 2303#ifdef USE_AOMAP 2304 varying vec2 vAoMapUv; 2305#endif 2306#ifdef USE_BUMPMAP 2307 varying vec2 vBumpMapUv; 2308#endif 2309#ifdef USE_NORMALMAP 2310 varying vec2 vNormalMapUv; 2311#endif 2312#ifdef USE_EMISSIVEMAP 2313 varying vec2 vEmissiveMapUv; 2314#endif 2315#ifdef USE_METALNESSMAP 2316 varying vec2 vMetalnessMapUv; 2317#endif 2318#ifdef USE_ROUGHNESSMAP 2319 varying vec2 vRoughnessMapUv; 2320#endif 2321#ifdef USE_ANISOTROPYMAP 2322 varying vec2 vAnisotropyMapUv; 2323#endif 2324#ifdef USE_CLEARCOATMAP 2325 varying vec2 vClearcoatMapUv; 2326#endif 2327#ifdef USE_CLEARCOAT_NORMALMAP 2328 varying vec2 vClearcoatNormalMapUv; 2329#endif 2330#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2331 varying vec2 vClearcoatRoughnessMapUv; 2332#endif 2333#ifdef USE_IRIDESCENCEMAP 2334 varying vec2 vIridescenceMapUv; 2335#endif 2336#ifdef USE_IRIDESCENCE_THICKNESSMAP 2337 varying vec2 vIridescenceThicknessMapUv; 2338#endif 2339#ifdef USE_SHEEN_COLORMAP 2340 varying vec2 vSheenColorMapUv; 2341#endif 2342#ifdef USE_SHEEN_ROUGHNESSMAP 2343 varying vec2 vSheenRoughnessMapUv; 2344#endif 2345#ifdef USE_SPECULARMAP 2346 varying vec2 vSpecularMapUv; 2347#endif 2348#ifdef USE_SPECULAR_COLORMAP 2349 varying vec2 vSpecularColorMapUv; 2350#endif 2351#ifdef USE_SPECULAR_INTENSITYMAP 2352 varying vec2 vSpecularIntensityMapUv; 2353#endif 2354#ifdef USE_TRANSMISSIONMAP 2355 uniform mat3 transmissionMapTransform; 2356 varying vec2 vTransmissionMapUv; 2357#endif 2358#ifdef USE_THICKNESSMAP 2359 uniform mat3 thicknessMapTransform; 2360 varying vec2 vThicknessMapUv; 2361#endif`,av=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2362 varying vec2 vUv; 2363#endif 2364#ifdef USE_MAP 2365 uniform mat3 mapTransform; 2366 varying vec2 vMapUv; 2367#endif 2368#ifdef USE_ALPHAMAP 2369 uniform mat3 alphaMapTransform; 2370 varying vec2 vAlphaMapUv; 2371#endif 2372#ifdef USE_LIGHTMAP 2373 uniform mat3 lightMapTransform; 2374 varying vec2 vLightMapUv; 2375#endif 2376#ifdef USE_AOMAP 2377 uniform mat3 aoMapTransform; 2378 varying vec2 vAoMapUv; 2379#endif 2380#ifdef USE_BUMPMAP 2381 uniform mat3 bumpMapTransform; 2382 varying vec2 vBumpMapUv; 2383#endif 2384#ifdef USE_NORMALMAP 2385 uniform mat3 normalMapTransform; 2386 varying vec2 vNormalMapUv; 2387#endif 2388#ifdef USE_DISPLACEMENTMAP 2389 uniform mat3 displacementMapTransform; 2390 varying vec2 vDisplacementMapUv; 2391#endif 2392#ifdef USE_EMISSIVEMAP 2393 uniform mat3 emissiveMapTransform; 2394 varying vec2 vEmissiveMapUv; 2395#endif 2396#ifdef USE_METALNESSMAP 2397 uniform mat3 metalnessMapTransform; 2398 varying vec2 vMetalnessMapUv; 2399#endif 2400#ifdef USE_ROUGHNESSMAP 2401 uniform mat3 roughnessMapTransform; 2402 varying vec2 vRoughnessMapUv; 2403#endif 2404#ifdef USE_ANISOTROPYMAP 2405 uniform mat3 anisotropyMapTransform; 2406 varying vec2 vAnisotropyMapUv; 2407#endif 2408#ifdef USE_CLEARCOATMAP 2409 uniform mat3 clearcoatMapTransform; 2410 varying vec2 vClearcoatMapUv; 2411#endif 2412#ifdef USE_CLEARCOAT_NORMALMAP 2413 uniform mat3 clearcoatNormalMapTransform; 2414 varying vec2 vClearcoatNormalMapUv; 2415#endif 2416#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2417 uniform mat3 clearcoatRoughnessMapTransform; 2418 varying vec2 vClearcoatRoughnessMapUv; 2419#endif 2420#ifdef USE_SHEEN_COLORMAP 2421 uniform mat3 sheenColorMapTransform; 2422 varying vec2 vSheenColorMapUv; 2423#endif 2424#ifdef USE_SHEEN_ROUGHNESSMAP 2425 uniform mat3 sheenRoughnessMapTransform; 2426 varying vec2 vSheenRoughnessMapUv; 2427#endif 2428#ifdef USE_IRIDESCENCEMAP 2429 uniform mat3 iridescenceMapTransform; 2430 varying vec2 vIridescenceMapUv; 2431#endif 2432#ifdef USE_IRIDESCENCE_THICKNESSMAP 2433 uniform mat3 iridescenceThicknessMapTransform; 2434 varying vec2 vIridescenceThicknessMapUv; 2435#endif 2436#ifdef USE_SPECULARMAP 2437 uniform mat3 specularMapTransform; 2438 varying vec2 vSpecularMapUv; 2439#endif 2440#ifdef USE_SPECULAR_COLORMAP 2441 uniform mat3 specularColorMapTransform; 2442 varying vec2 vSpecularColorMapUv; 2443#endif 2444#ifdef USE_SPECULAR_INTENSITYMAP 2445 uniform mat3 specularIntensityMapTransform; 2446 varying vec2 vSpecularIntensityMapUv; 2447#endif 2448#ifdef USE_TRANSMISSIONMAP 2449 uniform mat3 transmissionMapTransform; 2450 varying vec2 vTransmissionMapUv; 2451#endif 2452#ifdef USE_THICKNESSMAP 2453 uniform mat3 thicknessMapTransform; 2454 varying vec2 vThicknessMapUv; 2455#endif`,lv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2456 vUv = vec3( uv, 1 ).xy; 2457#endif 2458#ifdef USE_MAP 2459 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2460#endif 2461#ifdef USE_ALPHAMAP 2462 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2463#endif 2464#ifdef USE_LIGHTMAP 2465 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2466#endif 2467#ifdef USE_AOMAP 2468 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2469#endif 2470#ifdef USE_BUMPMAP 2471 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2472#endif 2473#ifdef USE_NORMALMAP 2474 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2475#endif 2476#ifdef USE_DISPLACEMENTMAP 2477 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2478#endif 2479#ifdef USE_EMISSIVEMAP 2480 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2481#endif 2482#ifdef USE_METALNESSMAP 2483 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2484#endif 2485#ifdef USE_ROUGHNESSMAP 2486 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2487#endif 2488#ifdef USE_ANISOTROPYMAP 2489 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2490#endif 2491#ifdef USE_CLEARCOATMAP 2492 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2493#endif 2494#ifdef USE_CLEARCOAT_NORMALMAP 2495 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2496#endif 2497#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2498 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2499#endif
2500#ifdef USE_IRIDESCENCEMAP 2501 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2502#endif 2503#ifdef USE_IRIDESCENCE_THICKNESSMAP 2504 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2505#endif 2506#ifdef USE_SHEEN_COLORMAP 2507 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2508#endif 2509#ifdef USE_SHEEN_ROUGHNESSMAP 2510 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2511#endif 2512#ifdef USE_SPECULARMAP 2513 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2514#endif 2515#ifdef USE_SPECULAR_COLORMAP 2516 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2517#endif 2518#ifdef USE_SPECULAR_INTENSITYMAP 2519 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2520#endif 2521#ifdef USE_TRANSMISSIONMAP 2522 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2523#endif 2524#ifdef USE_THICKNESSMAP 2525 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2526#endif`,cv=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2527 vec4 worldPosition = vec4( transformed, 1.0 ); 2528 #ifdef USE_BATCHING 2529 worldPosition = batchingMatrix * worldPosition; 2530 #endif 2531 #ifdef USE_INSTANCING 2532 worldPosition = instanceMatrix * worldPosition; 2533 #endif 2534 worldPosition = modelMatrix * worldPosition; 2535#endif`;const hv=`varying vec2 vUv; 2536uniform mat3 uvTransform; 2537void main() { 2538 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2539 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2540}`,uv=`uniform sampler2D t2D; 2541uniform float backgroundIntensity; 2542varying vec2 vUv; 2543void main() { 2544 vec4 texColor = texture2D( t2D, vUv ); 2545 #ifdef DECODE_VIDEO_TEXTURE 2546 texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); 2547 #endif 2548 texColor.rgb *= backgroundIntensity; 2549 gl_FragColor = texColor; 2550 #include <tonemapping_fragment> 2551 #include <colorspace_fragment> 2552}`,dv=`varying vec3 vWorldDirection; 2553#include <common> 2554void main() { 2555 vWorldDirection = transformDirection( position, modelMatrix ); 2556 #include <begin_vertex> 2557 #include <project_vertex> 2558 gl_Position.z = gl_Position.w; 2559}`,fv=`#ifdef ENVMAP_TYPE_CUBE 2560 uniform samplerCube envMap; 2561#elif defined( ENVMAP_TYPE_CUBE_UV ) 2562 uniform sampler2D envMap; 2563#endif 2564uniform float flipEnvMap; 2565uniform float backgroundBlurriness; 2566uniform float backgroundIntensity; 2567uniform mat3 backgroundRotation; 2568varying vec3 vWorldDirection; 2569#include <cube_uv_reflection_fragment> 2570void main() { 2571 #ifdef ENVMAP_TYPE_CUBE 2572 vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); 2573 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2574 vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); 2575 #else 2576 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2577 #endif 2578 texColor.rgb *= backgroundIntensity; 2579 gl_FragColor = texColor; 2580 #include <tonemapping_fragment> 2581 #include <colorspace_fragment> 2582}`,pv=`varying vec3 vWorldDirection; 2583#include <common> 2584void main() { 2585 vWorldDirection = transformDirection( position, modelMatrix ); 2586 #include <begin_vertex> 2587 #include <project_vertex> 2588 gl_Position.z = gl_Position.w; 2589}`,mv=`uniform samplerCube tCube; 2590uniform float tFlip; 2591uniform float opacity; 2592varying vec3 vWorldDirection; 2593void main() { 2594 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 2595 gl_FragColor = texColor; 2596 gl_FragColor.a *= opacity; 2597 #include <tonemapping_fragment> 2598 #include <colorspace_fragment> 2599}`,_v=`#include <common> 2600#include <batching_pars_vertex> 2601#include <uv_pars_vertex> 2602#include <displacementmap_pars_vertex> 2603#include <morphtarget_pars_vertex> 2604#include <skinning_pars_vertex> 2605#include <logdepthbuf_pars_vertex> 2606#include <clipping_planes_pars_vertex> 2607varying vec2 vHighPrecisionZW; 2608void main() { 2609 #include <uv_vertex> 2610 #include <batching_vertex> 2611 #include <skinbase_vertex> 2612 #include <morphinstance_vertex> 2613 #ifdef USE_DISPLACEMENTMAP 2614 #include <beginnormal_vertex> 2615 #include <morphnormal_vertex> 2616 #include <skinnormal_vertex> 2617 #endif 2618 #include <begin_vertex> 2619 #include <morphtarget_vertex> 2620 #include <skinning_vertex> 2621 #include <displacementmap_vertex> 2622 #include <project_vertex> 2623 #include <logdepthbuf_vertex> 2624 #include <clipping_planes_vertex> 2625 vHighPrecisionZW = gl_Position.zw; 2626}`,gv=`#if DEPTH_PACKING == 3200 2627 uniform float opacity; 2628#endif 2629#include <common> 2630#include <packing> 2631#include <uv_pars_fragment> 2632#include <map_pars_fragment> 2633#include <alphamap_pars_fragment> 2634#include <alphatest_pars_fragment> 2635#include <alphahash_pars_fragment> 2636#include <logdepthbuf_pars_fragment> 2637#include <clipping_planes_pars_fragment> 2638varying vec2 vHighPrecisionZW; 2639void main() { 2640 vec4 diffuseColor = vec4( 1.0 ); 2641 #include <clipping_planes_fragment> 2642 #if DEPTH_PACKING == 3200 2643 diffuseColor.a = opacity; 2644 #endif 2645 #include <map_fragment> 2646 #include <alphamap_fragment> 2647 #include <alphatest_fragment> 2648 #include <alphahash_fragment> 2649 #include <logdepthbuf_fragment> 2650 float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; 2651 #if DEPTH_PACKING == 3200 2652 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 2653 #elif DEPTH_PACKING == 3201 2654 gl_FragColor = packDepthToRGBA( fragCoordZ ); 2655 #elif DEPTH_PACKING == 3202 2656 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); 2657 #elif DEPTH_PACKING == 3203 2658 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); 2659 #endif 2660}`,vv=`#define DISTANCE 2661varying vec3 vWorldPosition; 2662#include <common> 2663#include <batching_pars_vertex> 2664#include <uv_pars_vertex> 2665#include <displacementmap_pars_vertex> 2666#include <morphtarget_pars_vertex> 2667#include <skinning_pars_vertex> 2668#include <clipping_planes_pars_vertex> 2669void main() { 2670 #include <uv_vertex> 2671 #include <batching_vertex> 2672 #include <skinbase_vertex> 2673 #include <morphinstance_vertex> 2674 #ifdef USE_DISPLACEMENTMAP 2675 #include <beginnormal_vertex> 2676 #include <morphnormal_vertex> 2677 #include <skinnormal_vertex> 2678 #endif 2679 #include <begin_vertex> 2680 #include <morphtarget_vertex> 2681 #include <skinning_vertex> 2682 #include <displacementmap_vertex> 2683 #include <project_vertex> 2684 #include <worldpos_vertex> 2685 #include <clipping_planes_vertex> 2686 vWorldPosition = worldPosition.xyz; 2687}`,xv=`#define DISTANCE 2688uniform vec3 referencePosition; 2689uniform float nearDistance; 2690uniform float farDistance; 2691varying vec3 vWorldPosition; 2692#include <common> 2693#include <packing> 2694#include <uv_pars_fragment> 2695#include <map_pars_fragment> 2696#include <alphamap_pars_fragment> 2697#include <alphatest_pars_fragment> 2698#include <alphahash_pars_fragment> 2699#include <clipping_planes_pars_fragment> 2700void main () { 2701 vec4 diffuseColor = vec4( 1.0 ); 2702 #include <clipping_planes_fragment> 2703 #include <map_fragment> 2704 #include <alphamap_fragment> 2705 #include <alphatest_fragment> 2706 #include <alphahash_fragment> 2707 float dist = length( vWorldPosition - referencePosition ); 2708 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 2709 dist = saturate( dist ); 2710 gl_FragColor = packDepthToRGBA( dist ); 2711}`,yv=`varying vec3 vWorldDirection; 2712#include <common> 2713void main() { 2714 vWorldDirection = transformDirection( position, modelMatrix ); 2715 #include <begin_vertex> 2716 #include <project_vertex> 2717}`,Sv=`uniform sampler2D tEquirect; 2718varying vec3 vWorldDirection; 2719#include <common> 2720void main() { 2721 vec3 direction = normalize( vWorldDirection ); 2722 vec2 sampleUV = equirectUv( direction ); 2723 gl_FragColor = texture2D( tEquirect, sampleUV ); 2724 #include <tonemapping_fragment> 2725 #include <colorspace_fragment> 2726}`,Mv=`uniform float scale; 2727attribute float lineDistance; 2728varying float vLineDistance; 2729#include <common> 2730#include <uv_pars_vertex> 2731#include <color_pars_vertex> 2732#include <fog_pars_vertex> 2733#include <morphtarget_pars_vertex> 2734#include <logdepthbuf_pars_vertex> 2735#include <clipping_planes_pars_vertex> 2736void main() { 2737 vLineDistance = scale * lineDistance; 2738 #include <uv_vertex> 2739 #include <color_vertex> 2740 #include <morphinstance_vertex> 2741 #include <morphcolor_vertex> 2742 #include <begin_vertex> 2743 #include <morphtarget_vertex> 2744 #include <project_vertex> 2745 #include <logdepthbuf_vertex> 2746 #include <clipping_planes_vertex> 2747 #include <fog_vertex> 2748}`,Ev=`uniform vec3 diffuse; 2749uniform float opacity; 2750uniform float dashSize; 2751uniform float totalSize; 2752varying float vLineDistance; 2753#include <common> 2754#include <color_pars_fragment> 2755#include <uv_pars_fragment> 2756#include <map_pars_fragment> 2757#include <fog_pars_fragment> 2758#include <logdepthbuf_pars_fragment> 2759#include <clipping_planes_pars_fragment> 2760void main() { 2761 vec4 diffuseColor = vec4( diffuse, opacity ); 2762 #include <clipping_planes_fragment> 2763 if ( mod( vLineDistance, totalSize ) > dashSize ) { 2764 discard; 2765 } 2766 vec3 outgoingLight = vec3( 0.0 ); 2767 #include <logdepthbuf_fragment> 2768 #include <map_fragment> 2769 #include <color_fragment> 2770 outgoingLight = diffuseColor.rgb; 2771 #include <opaque_fragment> 2772 #include <tonemapping_fragment> 2773 #include <colorspace_fragment> 2774 #include <fog_fragment> 2775 #include <premultiplied_alpha_fragment> 2776}`,Tv=`#include <common> 2777#include <batching_pars_vertex> 2778#include <uv_pars_vertex> 2779#include <envmap_pars_vertex> 2780#include <color_pars_vertex> 2781#include <fog_pars_vertex> 2782#include <morphtarget_pars_vertex> 2783#include <skinning_pars_vertex> 2784#include <logdepthbuf_pars_vertex> 2785#include <clipping_planes_pars_vertex> 2786void main() { 2787 #include <uv_vertex> 2788 #include <color_vertex> 2789 #include <morphinstance_vertex> 2790 #include <morphcolor_vertex> 2791 #include <batching_vertex> 2792 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 2793 #include <beginnormal_vertex> 2794 #include <morphnormal_vertex> 2795 #include <skinbase_vertex> 2796 #include <skinnormal_vertex> 2797 #include <defaultnormal_vertex> 2798 #endif 2799 #include <begin_vertex> 2800 #include <morphtarget_vertex> 2801 #include <skinning_vertex> 2802 #include <project_vertex> 2803 #include <logdepthbuf_vertex> 2804 #include <clipping_planes_vertex> 2805 #include <worldpos_vertex> 2806 #include <envmap_vertex> 2807 #include <fog_vertex> 2808}`,bv=`uniform vec3 diffuse; 2809uniform float opacity; 2810#ifndef FLAT_SHADED 2811 varying vec3 vNormal; 2812#endif 2813#include <common> 2814#include <dithering_pars_fragment> 2815#include <color_pars_fragment> 2816#include <uv_pars_fragment> 2817#include <map_pars_fragment> 2818#include <alphamap_pars_fragment> 2819#include <alphatest_pars_fragment> 2820#include <alphahash_pars_fragment> 2821#include <aomap_pars_fragment> 2822#include <lightmap_pars_fragment> 2823#include <envmap_common_pars_fragment> 2824#include <envmap_pars_fragment> 2825#include <fog_pars_fragment> 2826#include <specularmap_pars_fragment> 2827#include <logdepthbuf_pars_fragment> 2828#include <clipping_planes_pars_fragment> 2829void main() { 2830 vec4 diffuseColor = vec4( diffuse, opacity ); 2831 #include <clipping_planes_fragment> 2832 #include <logdepthbuf_fragment> 2833 #include <map_fragment> 2834 #include <color_fragment> 2835 #include <alphamap_fragment> 2836 #include <alphatest_fragment> 2837 #include <alphahash_fragment> 2838 #include <specularmap_fragment> 2839 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2840 #ifdef USE_LIGHTMAP 2841 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 2842 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 2843 #else 2844 reflectedLight.indirectDiffuse += vec3( 1.0 ); 2845 #endif 2846 #include <aomap_fragment> 2847 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 2848 vec3 outgoingLight = reflectedLight.indirectDiffuse; 2849 #include <envmap_fragment> 2850 #include <opaque_fragment> 2851 #include <tonemapping_fragment> 2852 #include <colorspace_fragment> 2853 #include <fog_fragment> 2854 #include <premultiplied_alpha_fragment> 2855 #include <dithering_fragment> 2856}`,wv=`#define LAMBERT 2857varying vec3 vViewPosition; 2858#include <common> 2859#include <batching_pars_vertex> 2860#include <uv_pars_vertex> 2861#include <displacementmap_pars_vertex> 2862#include <envmap_pars_vertex> 2863#include <color_pars_vertex> 2864#include <fog_pars_vertex> 2865#include <normal_pars_vertex> 2866#include <morphtarget_pars_vertex> 2867#include <skinning_pars_vertex> 2868#include <shadowmap_pars_vertex> 2869#include <logdepthbuf_pars_vertex> 2870#include <clipping_planes_pars_vertex> 2871void main() { 2872 #include <uv_vertex> 2873 #include <color_vertex> 2874 #include <morphinstance_vertex> 2875 #include <morphcolor_vertex> 2876 #include <batching_vertex> 2877 #include <beginnormal_vertex> 2878 #include <morphnormal_vertex> 2879 #include <skinbase_vertex> 2880 #include <skinnormal_vertex> 2881 #include <defaultnormal_vertex> 2882 #include <normal_vertex> 2883 #include <begin_vertex> 2884 #include <morphtarget_vertex> 2885 #include <skinning_vertex> 2886 #include <displacementmap_vertex> 2887 #include <project_vertex> 2888 #include <logdepthbuf_vertex> 2889 #include <clipping_planes_vertex> 2890 vViewPosition = - mvPosition.xyz; 2891 #include <worldpos_vertex> 2892 #include <envmap_vertex> 2893 #include <shadowmap_vertex> 2894 #include <fog_vertex> 2895}`,Av=`#define LAMBERT 2896uniform vec3 diffuse; 2897uniform vec3 emissive; 2898uniform float opacity; 2899#include <common> 2900#include <packing> 2901#include <dithering_pars_fragment> 2902#include <color_pars_fragment> 2903#include <uv_pars_fragment> 2904#include <map_pars_fragment> 2905#include <alphamap_pars_fragment> 2906#include <alphatest_pars_fragment> 2907#include <alphahash_pars_fragment> 2908#include <aomap_pars_fragment> 2909#include <lightmap_pars_fragment> 2910#include <emissivemap_pars_fragment> 2911#include <envmap_common_pars_fragment> 2912#include <envmap_pars_fragment> 2913#include <fog_pars_fragment> 2914#include <bsdfs> 2915#include <lights_pars_begin> 2916#include <normal_pars_fragment> 2917#include <lights_lambert_pars_fragment> 2918#include <shadowmap_pars_fragment> 2919#include <bumpmap_pars_fragment> 2920#include <normalmap_pars_fragment> 2921#include <specularmap_pars_fragment> 2922#include <logdepthbuf_pars_fragment> 2923#include <clipping_planes_pars_fragment> 2924void main() { 2925 vec4 diffuseColor = vec4( diffuse, opacity ); 2926 #include <clipping_planes_fragment> 2927 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2928 vec3 totalEmissiveRadiance = emissive; 2929 #include <logdepthbuf_fragment> 2930 #include <map_fragment> 2931 #include <color_fragment> 2932 #include <alphamap_fragment> 2933 #include <alphatest_fragment> 2934 #include <alphahash_fragment> 2935 #include <specularmap_fragment> 2936 #include <normal_fragment_begin> 2937 #include <normal_fragment_maps> 2938 #include <emissivemap_fragment> 2939 #include <lights_lambert_fragment> 2940 #include <lights_fragment_begin> 2941 #include <lights_fragment_maps> 2942 #include <lights_fragment_end> 2943 #include <aomap_fragment> 2944 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 2945 #include <envmap_fragment> 2946 #include <opaque_fragment> 2947 #include <tonemapping_fragment> 2948 #include <colorspace_fragment> 2949 #include <fog_fragment> 2950 #include <premultiplied_alpha_fragment> 2951 #include <dithering_fragment> 2952}`,Cv=`#define MATCAP 2953varying vec3 vViewPosition; 2954#include <common> 2955#include <batching_pars_vertex> 2956#include <uv_pars_vertex> 2957#include <color_pars_vertex> 2958#include <displacementmap_pars_vertex> 2959#include <fog_pars_vertex> 2960#include <normal_pars_vertex> 2961#include <morphtarget_pars_vertex> 2962#include <skinning_pars_vertex> 2963#include <logdepthbuf_pars_vertex> 2964#include <clipping_planes_pars_vertex> 2965void main() { 2966 #include <uv_vertex> 2967 #include <color_vertex> 2968 #include <morphinstance_vertex> 2969 #include <morphcolor_vertex> 2970 #include <batching_vertex> 2971 #include <beginnormal_vertex> 2972 #include <morphnormal_vertex> 2973 #include <skinbase_vertex> 2974 #include <skinnormal_vertex> 2975 #include <defaultnormal_vertex> 2976 #include <normal_vertex> 2977 #include <begin_vertex> 2978 #include <morphtarget_vertex> 2979 #include <skinning_vertex> 2980 #include <displacementmap_vertex> 2981 #include <project_vertex> 2982 #include <logdepthbuf_vertex> 2983 #include <clipping_planes_vertex> 2984 #include <fog_vertex> 2985 vViewPosition = - mvPosition.xyz; 2986}`,Rv=`#define MATCAP 2987uniform vec3 diffuse; 2988uniform float opacity; 2989uniform sampler2D matcap; 2990varying vec3 vViewPosition; 2991#include <common> 2992#include <dithering_pars_fragment> 2993#include <color_pars_fragment> 2994#include <uv_pars_fragment> 2995#include <map_pars_fragment> 2996#include <alphamap_pars_fragment> 2997#include <alphatest_pars_fragment> 2998#include <alphahash_pars_fragment> 2999#include <fog_pars_fragment> 3000#include <normal_pars_fragment> 3001#include <bumpmap_pars_fragment> 3002#include <normalmap_pars_fragment> 3003#include <logdepthbuf_pars_fragment> 3004#include <clipping_planes_pars_fragment> 3005void main() { 3006 ve
3006c4 diffuseColor = vec4( diffuse, opacity ); 3007 #include <clipping_planes_fragment> 3008 #include <logdepthbuf_fragment> 3009 #include <map_fragment> 3010 #include <color_fragment> 3011 #include <alphamap_fragment> 3012 #include <alphatest_fragment> 3013 #include <alphahash_fragment> 3014 #include <normal_fragment_begin> 3015 #include <normal_fragment_maps> 3016 vec3 viewDir = normalize( vViewPosition ); 3017 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3018 vec3 y = cross( viewDir, x ); 3019 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3020 #ifdef USE_MATCAP 3021 vec4 matcapColor = texture2D( matcap, uv ); 3022 #else 3023 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3024 #endif 3025 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3026 #include <opaque_fragment> 3027 #include <tonemapping_fragment> 3028 #include <colorspace_fragment> 3029 #include <fog_fragment> 3030 #include <premultiplied_alpha_fragment> 3031 #include <dithering_fragment> 3032}`,Pv=`#define NORMAL 3033#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3034 varying vec3 vViewPosition; 3035#endif 3036#include <common> 3037#include <batching_pars_vertex> 3038#include <uv_pars_vertex> 3039#include <displacementmap_pars_vertex> 3040#include <normal_pars_vertex> 3041#include <morphtarget_pars_vertex> 3042#include <skinning_pars_vertex> 3043#include <logdepthbuf_pars_vertex> 3044#include <clipping_planes_pars_vertex> 3045void main() { 3046 #include <uv_vertex> 3047 #include <batching_vertex> 3048 #include <beginnormal_vertex> 3049 #include <morphinstance_vertex> 3050 #include <morphnormal_vertex> 3051 #include <skinbase_vertex> 3052 #include <skinnormal_vertex> 3053 #include <defaultnormal_vertex> 3054 #include <normal_vertex> 3055 #include <begin_vertex> 3056 #include <morphtarget_vertex> 3057 #include <skinning_vertex> 3058 #include <displacementmap_vertex> 3059 #include <project_vertex> 3060 #include <logdepthbuf_vertex> 3061 #include <clipping_planes_vertex> 3062#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3063 vViewPosition = - mvPosition.xyz; 3064#endif 3065}`,Lv=`#define NORMAL 3066uniform float opacity; 3067#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3068 varying vec3 vViewPosition; 3069#endif 3070#include <packing> 3071#include <uv_pars_fragment> 3072#include <normal_pars_fragment> 3073#include <bumpmap_pars_fragment> 3074#include <normalmap_pars_fragment> 3075#include <logdepthbuf_pars_fragment> 3076#include <clipping_planes_pars_fragment> 3077void main() { 3078 vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); 3079 #include <clipping_planes_fragment> 3080 #include <logdepthbuf_fragment> 3081 #include <normal_fragment_begin> 3082 #include <normal_fragment_maps> 3083 gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); 3084 #ifdef OPAQUE 3085 gl_FragColor.a = 1.0; 3086 #endif 3087}`,Iv=`#define PHONG 3088varying vec3 vViewPosition; 3089#include <common> 3090#include <batching_pars_vertex> 3091#include <uv_pars_vertex> 3092#include <displacementmap_pars_vertex> 3093#include <envmap_pars_vertex> 3094#include <color_pars_vertex> 3095#include <fog_pars_vertex> 3096#include <normal_pars_vertex> 3097#include <morphtarget_pars_vertex> 3098#include <skinning_pars_vertex> 3099#include <shadowmap_pars_vertex> 3100#include <logdepthbuf_pars_vertex> 3101#include <clipping_planes_pars_vertex> 3102void main() { 3103 #include <uv_vertex> 3104 #include <color_vertex> 3105 #include <morphcolor_vertex> 3106 #include <batching_vertex> 3107 #include <beginnormal_vertex> 3108 #include <morphinstance_vertex> 3109 #include <morphnormal_vertex> 3110 #include <skinbase_vertex> 3111 #include <skinnormal_vertex> 3112 #include <defaultnormal_vertex> 3113 #include <normal_vertex> 3114 #include <begin_vertex> 3115 #include <morphtarget_vertex> 3116 #include <skinning_vertex> 3117 #include <displacementmap_vertex> 3118 #include <project_vertex> 3119 #include <logdepthbuf_vertex> 3120 #include <clipping_planes_vertex> 3121 vViewPosition = - mvPosition.xyz; 3122 #include <worldpos_vertex> 3123 #include <envmap_vertex> 3124 #include <shadowmap_vertex> 3125 #include <fog_vertex> 3126}`,Dv=`#define PHONG 3127uniform vec3 diffuse; 3128uniform vec3 emissive; 3129uniform vec3 specular; 3130uniform float shininess; 3131uniform float opacity; 3132#include <common> 3133#include <packing> 3134#include <dithering_pars_fragment> 3135#include <color_pars_fragment> 3136#include <uv_pars_fragment> 3137#include <map_pars_fragment> 3138#include <alphamap_pars_fragment> 3139#include <alphatest_pars_fragment> 3140#include <alphahash_pars_fragment> 3141#include <aomap_pars_fragment> 3142#include <lightmap_pars_fragment> 3143#include <emissivemap_pars_fragment> 3144#include <envmap_common_pars_fragment> 3145#include <envmap_pars_fragment> 3146#include <fog_pars_fragment> 3147#include <bsdfs> 3148#include <lights_pars_begin> 3149#include <normal_pars_fragment> 3150#include <lights_phong_pars_fragment> 3151#include <shadowmap_pars_fragment> 3152#include <bumpmap_pars_fragment> 3153#include <normalmap_pars_fragment> 3154#include <specularmap_pars_fragment> 3155#include <logdepthbuf_pars_fragment> 3156#include <clipping_planes_pars_fragment> 3157void main() { 3158 vec4 diffuseColor = vec4( diffuse, opacity ); 3159 #include <clipping_planes_fragment> 3160 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3161 vec3 totalEmissiveRadiance = emissive; 3162 #include <logdepthbuf_fragment> 3163 #include <map_fragment> 3164 #include <color_fragment> 3165 #include <alphamap_fragment> 3166 #include <alphatest_fragment> 3167 #include <alphahash_fragment> 3168 #include <specularmap_fragment> 3169 #include <normal_fragment_begin> 3170 #include <normal_fragment_maps> 3171 #include <emissivemap_fragment> 3172 #include <lights_phong_fragment> 3173 #include <lights_fragment_begin> 3174 #include <lights_fragment_maps> 3175 #include <lights_fragment_end> 3176 #include <aomap_fragment> 3177 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3178 #include <envmap_fragment> 3179 #include <opaque_fragment> 3180 #include <tonemapping_fragment> 3181 #include <colorspace_fragment> 3182 #include <fog_fragment> 3183 #include <premultiplied_alpha_fragment> 3184 #include <dithering_fragment> 3185}`,Uv=`#define STANDARD 3186varying vec3 vViewPosition; 3187#ifdef USE_TRANSMISSION 3188 varying vec3 vWorldPosition; 3189#endif 3190#include <common> 3191#include <batching_pars_vertex> 3192#include <uv_pars_vertex> 3193#include <displacementmap_pars_vertex> 3194#include <color_pars_vertex> 3195#include <fog_pars_vertex> 3196#include <normal_pars_vertex> 3197#include <morphtarget_pars_vertex> 3198#include <skinning_pars_vertex> 3199#include <shadowmap_pars_vertex> 3200#include <logdepthbuf_pars_vertex> 3201#include <clipping_planes_pars_vertex> 3202void main() { 3203 #include <uv_vertex> 3204 #include <color_vertex> 3205 #include <morphinstance_vertex> 3206 #include <morphcolor_vertex> 3207 #include <batching_vertex> 3208 #include <beginnormal_vertex> 3209 #include <morphnormal_vertex> 3210 #include <skinbase_vertex> 3211 #include <skinnormal_vertex> 3212 #include <defaultnormal_vertex> 3213 #include <normal_vertex> 3214 #include <begin_vertex> 3215 #include <morphtarget_vertex> 3216 #include <skinning_vertex> 3217 #include <displacementmap_vertex> 3218 #include <project_vertex> 3219 #include <logdepthbuf_vertex> 3220 #include <clipping_planes_vertex> 3221 vViewPosition = - mvPosition.xyz; 3222 #include <worldpos_vertex> 3223 #include <shadowmap_vertex> 3224 #include <fog_vertex> 3225#ifdef USE_TRANSMISSION 3226 vWorldPosition = worldPosition.xyz; 3227#endif 3228}`,Nv=`#define STANDARD 3229#ifdef PHYSICAL 3230 #define IOR 3231 #define USE_SPECULAR 3232#endif 3233uniform vec3 diffuse; 3234uniform vec3 emissive; 3235uniform float roughness; 3236uniform float metalness; 3237uniform float opacity; 3238#ifdef IOR 3239 uniform float ior; 3240#endif 3241#ifdef USE_SPECULAR 3242 uniform float specularIntensity; 3243 uniform vec3 specularColor; 3244 #ifdef USE_SPECULAR_COLORMAP 3245 uniform sampler2D specularColorMap; 3246 #endif 3247 #ifdef USE_SPECULAR_INTENSITYMAP 3248 uniform sampler2D specularIntensityMap; 3249 #endif 3250#endif 3251#ifdef USE_CLEARCOAT 3252 uniform float clearcoat; 3253 uniform float clearcoatRoughness; 3254#endif 3255#ifdef USE_DISPERSION 3256 uniform float dispersion; 3257#endif
3258#ifdef USE_IRIDESCENCE 3259 uniform float iridescence; 3260 uniform float iridescenceIOR; 3261 uniform float iridescenceThicknessMinimum; 3262 uniform float iridescenceThicknessMaximum; 3263#endif 3264#ifdef USE_SHEEN 3265 uniform vec3 sheenColor; 3266 uniform float sheenRoughness; 3267 #ifdef USE_SHEEN_COLORMAP 3268 uniform sampler2D sheenColorMap; 3269 #endif 3270 #ifdef USE_SHEEN_ROUGHNESSMAP 3271 uniform sampler2D sheenRoughnessMap; 3272 #endif 3273#endif 3274#ifdef USE_ANISOTROPY 3275 uniform vec2 anisotropyVector; 3276 #ifdef USE_ANISOTROPYMAP 3277 uniform sampler2D anisotropyMap; 3278 #endif 3279#endif 3280varying vec3 vViewPosition; 3281#include <common> 3282#include <packing> 3283#include <dithering_pars_fragment> 3284#include <color_pars_fragment> 3285#include <uv_pars_fragment> 3286#include <map_pars_fragment> 3287#include <alphamap_pars_fragment> 3288#include <alphatest_pars_fragment> 3289#include <alphahash_pars_fragment> 3290#include <aomap_pars_fragment> 3291#include <lightmap_pars_fragment> 3292#include <emissivemap_pars_fragment> 3293#include <iridescence_fragment> 3294#include <cube_uv_reflection_fragment> 3295#include <envmap_common_pars_fragment> 3296#include <envmap_physical_pars_fragment> 3297#include <fog_pars_fragment> 3298#include <lights_pars_begin> 3299#include <normal_pars_fragment> 3300#include <lights_physical_pars_fragment> 3301#include <transmission_pars_fragment> 3302#include <shadowmap_pars_fragment> 3303#include <bumpmap_pars_fragment> 3304#include <normalmap_pars_fragment> 3305#include <clearcoat_pars_fragment> 3306#include <iridescence_pars_fragment> 3307#include <roughnessmap_pars_fragment> 3308#include <metalnessmap_pars_fragment> 3309#include <logdepthbuf_pars_fragment> 3310#include <clipping_planes_pars_fragment> 3311void main() { 3312 vec4 diffuseColor = vec4( diffuse, opacity ); 3313 #include <clipping_planes_fragment> 3314 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3315 vec3 totalEmissiveRadiance = emissive; 3316 #include <logdepthbuf_fragment> 3317 #include <map_fragment> 3318 #include <color_fragment> 3319 #include <alphamap_fragment> 3320 #include <alphatest_fragment> 3321 #include <alphahash_fragment> 3322 #include <roughnessmap_fragment> 3323 #include <metalnessmap_fragment> 3324 #include <normal_fragment_begin> 3325 #include <normal_fragment_maps> 3326 #include <clearcoat_normal_fragment_begin> 3327 #include <clearcoat_normal_fragment_maps> 3328 #include <emissivemap_fragment> 3329 #include <lights_physical_fragment> 3330 #include <lights_fragment_begin> 3331 #include <lights_fragment_maps> 3332 #include <lights_fragment_end> 3333 #include <aomap_fragment> 3334 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3335 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3336 #include <transmission_fragment> 3337 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3338 #ifdef USE_SHEEN 3339 float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); 3340 outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; 3341 #endif 3342 #ifdef USE_CLEARCOAT 3343 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3344 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3345 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3346 #endif 3347 #include <opaque_fragment> 3348 #include <tonemapping_fragment> 3349 #include <colorspace_fragment> 3350 #include <fog_fragment> 3351 #include <premultiplied_alpha_fragment> 3352 #include <dithering_fragment> 3353}`,Ov=`#define TOON 3354varying vec3 vViewPosition; 3355#include <common> 3356#include <batching_pars_vertex> 3357#include <uv_pars_vertex> 3358#include <displacementmap_pars_vertex> 3359#include <color_pars_vertex> 3360#include <fog_pars_vertex> 3361#include <normal_pars_vertex> 3362#include <morphtarget_pars_vertex> 3363#include <skinning_pars_vertex> 3364#include <shadowmap_pars_vertex> 3365#include <logdepthbuf_pars_vertex> 3366#include <clipping_planes_pars_vertex> 3367void main() { 3368 #include <uv_vertex> 3369 #include <color_vertex> 3370 #include <morphinstance_vertex> 3371 #include <morphcolor_vertex> 3372 #include <batching_vertex> 3373 #include <beginnormal_vertex> 3374 #include <morphnormal_vertex> 3375 #include <skinbase_vertex> 3376 #include <skinnormal_vertex> 3377 #include <defaultnormal_vertex> 3378 #include <normal_vertex> 3379 #include <begin_vertex> 3380 #include <morphtarget_vertex> 3381 #include <skinning_vertex> 3382 #include <displacementmap_vertex> 3383 #include <project_vertex> 3384 #include <logdepthbuf_vertex> 3385 #include <clipping_planes_vertex> 3386 vViewPosition = - mvPosition.xyz; 3387 #include <worldpos_vertex> 3388 #include <shadowmap_vertex> 3389 #include <fog_vertex> 3390}`,Fv=`#define TOON 3391uniform vec3 diffuse; 3392uniform vec3 emissive; 3393uniform float opacity; 3394#include <common> 3395#include <packing> 3396#include <dithering_pars_fragment> 3397#include <color_pars_fragment> 3398#include <uv_pars_fragment> 3399#include <map_pars_fragment> 3400#include <alphamap_pars_fragment> 3401#include <alphatest_pars_fragment> 3402#include <alphahash_pars_fragment> 3403#include <aomap_pars_fragment> 3404#include <lightmap_pars_fragment> 3405#include <emissivemap_pars_fragment> 3406#include <gradientmap_pars_fragment> 3407#include <fog_pars_fragment> 3408#include <bsdfs> 3409#include <lights_pars_begin> 3410#include <normal_pars_fragment> 3411#include <lights_toon_pars_fragment> 3412#include <shadowmap_pars_fragment> 3413#include <bumpmap_pars_fragment> 3414#include <normalmap_pars_fragment> 3415#include <logdepthbuf_pars_fragment> 3416#include <clipping_planes_pars_fragment> 3417void main() { 3418 vec4 diffuseColor = vec4( diffuse, opacity ); 3419 #include <clipping_planes_fragment> 3420 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3421 vec3 totalEmissiveRadiance = emissive; 3422 #include <logdepthbuf_fragment> 3423 #include <map_fragment> 3424 #include <color_fragment> 3425 #include <alphamap_fragment> 3426 #include <alphatest_fragment> 3427 #include <alphahash_fragment> 3428 #include <normal_fragment_begin> 3429 #include <normal_fragment_maps> 3430 #include <emissivemap_fragment> 3431 #include <lights_toon_fragment> 3432 #include <lights_fragment_begin> 3433 #include <lights_fragment_maps> 3434 #include <lights_fragment_end> 3435 #include <aomap_fragment> 3436 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3437 #include <opaque_fragment> 3438 #include <tonemapping_fragment> 3439 #include <colorspace_fragment> 3440 #include <fog_fragment> 3441 #include <premultiplied_alpha_fragment> 3442 #include <dithering_fragment> 3443}`,zv=`uniform float size; 3444uniform float scale; 3445#include <common> 3446#include <color_pars_vertex> 3447#include <fog_pars_vertex> 3448#include <morphtarget_pars_vertex> 3449#include <logdepthbuf_pars_vertex> 3450#include <clipping_planes_pars_vertex> 3451#ifdef USE_POINTS_UV 3452 varying vec2 vUv; 3453 uniform mat3 uvTransform; 3454#endif 3455void main() { 3456 #ifdef USE_POINTS_UV 3457 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3458 #endif 3459 #include <color_vertex> 3460 #include <morphinstance_vertex> 3461 #include <morphcolor_vertex> 3462 #include <begin_vertex> 3463 #include <morphtarget_vertex> 3464 #include <project_vertex> 3465 gl_PointSize = size; 3466 #ifdef USE_SIZEATTENUATION 3467 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3468 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3469 #endif 3470 #include <logdepthbuf_vertex> 3471 #include <clipping_planes_vertex> 3472 #include <worldpos_vertex> 3473 #include <fog_vertex> 3474}`,Bv=`uniform vec3 diffuse; 3475uniform float opacity; 3476#include <common> 3477#include <color_pars_fragment> 3478#include <map_particle_pars_fragment> 3479#include <alphatest_pars_fragment> 3480#include <alphahash_pars_fragment> 3481#include <fog_pars_fragment> 3482#include <logdepthbuf_pars_fragment> 3483#include <clipping_planes_pars_fragment> 3484void main() { 3485 vec4 diffuseColor = vec4( diffuse, opacity ); 3486 #include <clipping_planes_fragment> 3487 vec3 outgoingLight = vec3( 0.0 ); 3488 #include <logdepthbuf_fragment> 3489 #include <map_particle_fragment> 3490 #include <color_fragment> 3491 #include <alphatest_fragment> 3492 #include <alphahash_fragment> 3493 outgoingLight = diffuseColor.rgb; 3494 #include <opaque_fragment> 3495 #include <tonemapping_fragment> 3496 #include <colorspace_fragment> 3497 #include <fog_fragment> 3498 #include <premultiplied_alpha_fragment> 3499}`,kv=`#include <common> 3500#include <batching_pars_vertex> 3501#include <fog_pars_vertex> 3502#include <morphtarget_pars_vertex> 3503#include <skinning_pars_vertex> 3504#include <logdepthbuf_pars_vertex> 3505#include <shadowmap_pars_vertex> 3506void main() { 3507 #include <batching_vertex> 3508 #include <beginnormal_vertex> 3509 #include <morphinstance_vertex> 3510 #include <morphnormal_vertex> 3511 #include <skinbase_vertex> 3512 #include <skinnormal_vertex> 3513 #include <defaultnormal_vertex> 3514 #include <begin_vertex> 3515 #include <morphtarget_vertex> 3516 #include <skinning_vertex> 3517 #include <project_vertex> 3518 #include <logdepthbuf_vertex> 3519 #include <worldpos_vertex> 3520 #include <shadowmap_vertex> 3521 #include <fog_vertex> 3522}`,Hv=`uniform vec3 color; 3523uniform float opacity; 3524#include <common> 3525#include <packing> 3526#include <fog_pars_fragment> 3527#include <bsdfs> 3528#include <lights_pars_begin> 3529#include <logdepthbuf_pars_fragment> 3530#include <shadowmap_pars_fragment> 3531#include <shadowmask_pars_fragment> 3532void main() { 3533 #include <logdepthbuf_fragment> 3534 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3535 #include <tonemapping_fragment> 3536 #include <colorspace_fragment> 3537 #include <fog_fragment> 3538}`,Vv=`uniform float rotation; 3539uniform vec2 center; 3540#include <common> 3541#include <uv_pars_vertex> 3542#include <fog_pars_vertex> 3543#include <logdepthbuf_pars_vertex> 3544#include <clipping_planes_pars_vertex> 3545void main() { 3546 #include <uv_vertex> 3547 vec4 mvPosition = modelViewMatrix[ 3 ]; 3548 vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); 3549 #ifndef USE_SIZEATTENUATION 3550 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3551 if ( isPerspective ) scale *= - mvPosition.z; 3552 #endif 3553 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3554 vec2 rotatedPosition; 3555 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3556 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3557 mvPosition.xy += rotatedPosition; 3558 gl_Position = projectionMatrix * mvPosition; 3559 #include <logdepthbuf_vertex> 3560 #include <clipping_planes_vertex> 3561 #include <fog_vertex> 3562}`,Gv=`uniform vec3 diffuse; 3563uniform float opacity; 3564#include <common> 3565#include <uv_pars_fragment> 3566#include <map_pars_fragment> 3567#include <alphamap_pars_fragment> 3568#include <alphatest_pars_fragment> 3569#include <alphahash_pars_fragment> 3570#include <fog_pars_fragment> 3571#include <logdepthbuf_pars_fragment> 3572#include <clipping_planes_pars_fragment> 3573void main() { 3574 vec4 diffuseColor = vec4( diffuse, opacity ); 3575 #include <clipping_planes_fragment> 3576 vec3 outgoingLight = vec3( 0.0 ); 3577 #include <logdepthbuf_fragment> 3578 #include <map_fragment> 3579 #include <alphamap_fragment> 3580 #include <alphatest_fragment> 3581 #include <alphahash_fragment> 3582 outgoingLight = diffuseColor.rgb; 3583 #include <opaque_fragment> 3584 #include <tonemapping_fragment> 3585 #include <colorspace_fragment> 3586 #include <fog_fragment> 3587}`,Ft={alphahash_fragment:u_,alphahash_pars_fragment:d_,alphamap_fragment:f_,alphamap_pars_fragment:p_,alphatest_fragment:m_,alphatest_pars_fragment:__,aomap_fragment:g_,aomap_pars_fragment:v_,batching_pars_vertex:x_,batching_vertex:y_,begin_vertex:S_,beginnormal_vertex:M_,bsdfs:E_,iridescence_fragment:T_,bumpmap_pars_fragment:b_,clipping_planes_fragment:w_,clipping_planes_pars_fragment:A_,clipping_planes_pars_vertex:C_,clipping_planes_vertex:R_,color_fragment:P_,color_pars_fragment:L_,color_pars_vertex:I_,color_vertex:D_,common:U_,cube_uv_reflection_fragment:N_,defaultnormal_vertex:O_,displacementmap_pars_vertex:F_,displacementmap_vertex:z_,emissivemap_fragment:B_,emissivemap_pars_fragment:k_,colorspace_fragment:H_,colorspace_pars_fragment:V_,envmap_fragment:G_,envmap_common_pars_fragment:W_,envmap_pars_fragment:X_,envmap_pars_vertex:q_,envmap_physical_pars_fragment:ig,envmap_vertex:Y_,fog_vertex:$_,fog_pars_vertex:Z_,fog_fragment:K_,fog_pars_fragment:j_,gradientmap_pars_fragment:J_,lightmap_pars_fragment:Q_,lights_lambert_fragment:tg,lights_lambert_pars_fragment:eg,lights_pars_begin:ng,lights_toon_fragment:rg,lights_toon_pars_fragment:sg,lights_phong_fragment:og,lights_phong_pars_fragment:ag,lights_physical_fragment:lg,lights_physical_pars_fragment:cg,lights_fragment_begin:hg,lights_fragment_maps:ug,lights_fragment_end:dg,logdepthbuf_fragment:fg,logdepthbuf_pars_fragment:pg,logdepthbuf_pars_vertex:mg,logdepthbuf_vertex:_g,map_fragment:gg,map_pars_fragment:vg,map_particle_fragment:xg,map_particle_pars_fragment:yg,metalnessmap_fragment:Sg,metalnessmap_pars_fragment:Mg,morphinstance_vertex:Eg,morphcolor_vertex:Tg,morphnormal_vertex:bg,morphtarget_pars_vertex:wg,morphtarget_vertex:Ag,normal_fragment_begin:Cg,normal_fragment_maps:Rg,normal_pars_fragment:Pg,n
vendor: 5,621 bytes, line 3587
3587ormal_pars_vertex:Lg,normal_vertex:Ig,normalmap_pars_fragment:Dg,clearcoat_normal_fragment_begin:Ug,clearcoat_normal_fragment_maps:Ng,clearcoat_pars_fragment:Og,iridescence_pars_fragment:Fg,opaque_fragment:zg,packing:Bg,premultiplied_alpha_fragment:kg,project_vertex:Hg,dithering_fragment:Vg,dithering_pars_fragment:Gg,roughnessmap_fragment:Wg,roughnessmap_pars_fragment:Xg,shadowmap_pars_fragment:qg,shadowmap_pars_vertex:Yg,shadowmap_vertex:$g,shadowmask_pars_fragment:Zg,skinbase_vertex:Kg,skinning_pars_vertex:jg,skinning_vertex:Jg,skinnormal_vertex:Qg,specularmap_fragment:tv,specularmap_pars_fragment:ev,tonemapping_fragment:nv,tonemapping_pars_fragment:iv,transmission_fragment:rv,transmission_pars_fragment:sv,uv_pars_fragment:ov,uv_pars_vertex:av,uv_vertex:lv,worldpos_vertex:cv,background_vert:hv,background_frag:uv,backgroundCube_vert:dv,backgroundCube_frag:fv,cube_vert:pv,cube_frag:mv,depth_vert:_v,depth_frag:gv,distanceRGBA_vert:vv,distanceRGBA_frag:xv,equirect_vert:yv,equirect_frag:Sv,linedashed_vert:Mv,linedashed_frag:Ev,meshbasic_vert:Tv,meshbasic_frag:bv,meshlambert_vert:wv,meshlambert_frag:Av,meshmatcap_vert:Cv,meshmatcap_frag:Rv,meshnormal_vert:Pv,meshnormal_frag:Lv,meshphong_vert:Iv,meshphong_frag:Dv,meshphysical_vert:Uv,meshphysical_frag:Nv,meshtoon_vert:Ov,meshtoon_frag:Fv,points_vert:zv,points_frag:Bv,shadow_vert:kv,shadow_frag:Hv,sprite_vert:Vv,sprite_frag:Gv},st={common:{diffuse:{value:new Kt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Bt},alphaMap:{value:null},alphaMapTransform:{value:new Bt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Bt}},envmap:{envMap:{value:null},envMapRotation:{value:new Bt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Bt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Bt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Bt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Bt},normalScale:{value:new St(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Bt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Bt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Bt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Bt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Kt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Kt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Bt},alphaTest:{value:0},uvTransform:{value:new Bt}},sprite:{diffuse:{value:new Kt(16777215)},opacity:{value:1},center:{value:new St(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Bt},alphaMap:{value:null},alphaMapTransform:{value:new Bt},alphaTest:{value:0}}},On={basic:{uniforms:ke([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.fog]),vertexShader:Ft.meshbasic_vert,fragmentShader:Ft.meshbasic_frag},lambert:{uniforms:ke([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new Kt(0)}}]),vertexShader:Ft.meshlambert_vert,fragmentShader:Ft.meshlambert_frag},phong:{uniforms:ke([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new Kt(0)},specular:{value:new Kt(1118481)},shininess:{value:30}}]),vertexShader:Ft.meshphong_vert,fragmentShader:Ft.meshphong_frag},standard:{uniforms:ke([st.common,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.roughnessmap,st.metalnessmap,st.fog,st.lights,{emissive:{value:new Kt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ft.meshphysical_vert,fragmentShader:Ft.meshphysical_frag},toon:{uniforms:ke([st.common,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.gradientmap,st.fog,st.lights,{emissive:{value:new Kt(0)}}]),vertexShader:Ft.meshtoon_vert,fragmentShader:Ft.meshtoon_frag},matcap:{uniforms:ke([st.common,st.bumpmap,st.normalmap,st.displacementmap,st.fog,{matc
vendor: 5,263 bytes, line 3587
3587ap:{value:null}}]),vertexShader:Ft.meshmatcap_vert,fragmentShader:Ft.meshmatcap_frag},points:{uniforms:ke([st.points,st.fog]),vertexShader:Ft.points_vert,fragmentShader:Ft.points_frag},dashed:{uniforms:ke([st.common,st.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ft.linedashed_vert,fragmentShader:Ft.linedashed_frag},depth:{uniforms:ke([st.common,st.displacementmap]),vertexShader:Ft.depth_vert,fragmentShader:Ft.depth_frag},normal:{uniforms:ke([st.common,st.bumpmap,st.normalmap,st.displacementmap,{opacity:{value:1}}]),vertexShader:Ft.meshnormal_vert,fragmentShader:Ft.meshnormal_frag},sprite:{uniforms:ke([st.sprite,st.fog]),vertexShader:Ft.sprite_vert,fragmentShader:Ft.sprite_frag},background:{uniforms:{uvTransform:{value:new Bt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ft.background_vert,fragmentShader:Ft.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Bt}},vertexShader:Ft.backgroundCube_vert,fragmentShader:Ft.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ft.cube_vert,fragmentShader:Ft.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ft.equirect_vert,fragmentShader:Ft.equirect_frag},distanceRGBA:{uniforms:ke([st.common,st.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ft.distanceRGBA_vert,fragmentShader:Ft.distanceRGBA_frag},shadow:{uniforms:ke([st.lights,st.fog,{color:{value:new Kt(0)},opacity:{value:1}}]),vertexShader:Ft.shadow_vert,fragmentShader:Ft.shadow_frag}};On.physical={uniforms:ke([On.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Bt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Bt},clearcoatNormalScale:{value:new St(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Bt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Bt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Bt},sheen:{value:0},sheenColor:{value:new Kt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Bt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Bt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Bt},transmissionSamplerSize:{value:new St},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Bt},attenuationDistance:{value:0},attenuationColor:{value:new Kt(0)},specularColor:{value:new Kt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Bt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Bt},anisotropyVector:{value:new St},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Bt}}]),vertexShader:Ft.meshphysical_vert,fragmentShader:Ft.meshphysical_frag};const lo={r:0,b:0,g:0},Xi=new ri,Wv=new me;function Xv(i,t,e,n,r,s,o){const a=new Kt(0);let l=s===!0?0:1,c,h,u=null,f=0,p=null;function x(E){let S=E.isScene===!0?E.background:null;return S&&S.isTexture&&(S=(E.backgroundBlurriness>0?e:t).get(S)),S}function v(E){let S=!1;const w=x(E);w===null?g(a,l):w&&w.isColor&&(g(w,1),S=!0);const P=i.xr.getEnvironmentBlendMode();P==="additive"?n.buffers.color.setClear(0,0,0,1,o):P==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(i.autoClear||S)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function m(E,S){const w=x(S);w&&(w.isCubeTexture||w.mapping===Yo)?(h===void 0&&(h=new zn(new Os(1,1,1),new si({name:"BackgroundCubeMaterial",uniforms:Xr(On.backgroundCube.uniforms),vertexShader:On.backgroundCube.vertexShader,fragmentShader:On.backgroundCube.fragmentShader,side:$e,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(P,R,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),Xi.copy(S.backgroundRotation),Xi.x*=-1,Xi.y*=-1,Xi.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Xi.y*=-1,Xi.z*=-1),h.material.uniforms.envMap.value=w,h.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Wv.makeRotationFromEuler(Xi)),h.material.toneMapped=ee.getTransfer(w.colorSpace)!==ce,(u!==w||f!==w.version||p!==i.toneMapping)&&(h.material.needsUpdate=!0,u=w,f=w.version,p=i.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new zn(new Zo(2,2),new si({name:"Backgroun
3587dMaterial",uniforms:Xr(On.background.uniforms),vertexShader:On.background.vertexShader,fragmentShader:On.background.fragmentShader,side:Ci,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=ee.getTransfer(w.colorSpace)!==ce,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(u!==w||f!==w.version||p!==i.toneMapping)&&(c.material.needsUpdate=!0,u=w,f=w.version,p=i.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function g(E,S){E.getRGB(lo,Zu(i)),n.buffers.color.setClear(lo.r,lo.g,lo.b,S,o)}return{getClearColor:function(){return a},setClearColor:function(E,S=1){a.set(E),l=S,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,g(a,l)},render:v,addToRenderList:m}}function qv(i,t){const e=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},r=f(null);let s=r,o=!1;function a(y,b,G,z,W){let K=!1;const k=u(z,G,b);s!==k&&(s=k,c(s.object)),K=p(y,z,G,W),K&&x(y,z,G,W),W!==null&&t.update(W,i.ELEMENT_ARRAY_BUFFER),(K||o)&&(o=!1,w(y,b,G,z),W!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(W).buffer))}function l(){return i.createVertexArray()}function c(y){return i.bindVertexArray(y)}function h(y){return i.deleteVertexArray(y)}function u(y,b,G){const z=G.wireframe===!0;let W=n[y.id];W===void 0&&(W={},n[y.id]=W);let K=W[b.id];K===void 0&&(K={},W[b.id]=K);let k=K[z];return k===void 0&&(k=f(l()),K[z]=k),k}function f(y){const b=[],G=[],z=[];for(let W=0;W<e;W++)b[W]=0,G[W]=0,z[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:b,enabledAttributes:G,attributeDivisors:z,object:y,attributes:{},index:null}}function p(y,b,G,z){const W=s.attributes,K=b.attributes;let k=0;const j=G.getAttributes();for(const X in j)if(j[X].location>=0){const ct=W[X];let pt=K[X];if(pt===void 0&&(X==="instanceMatrix"&&y.instanceMatrix&&(pt=y.instanceMatrix),X==="instanceColor"&&y.instanceColor&&(pt=y.instanceColor)),ct===void 0||ct.attribute!==pt||pt&&ct.data!==pt.data)return!0;k++}return s.attributesNum!==k||s.index!==z}function x(y,b,G,z){const W={},K=b.attributes;let k=0;const j=G.getAttributes();for(const X in j)if(j[X].location>=0){let ct=K[X];ct===void 0&&(X==="instanceMatrix"&&y.instanceMatrix&&(ct=y.instanceMatrix),X==="instanceColor"&&y.instanceColor&&(ct=y.instanceColor));const pt={};pt.attribute=ct,ct&&ct.data&&(pt.data=ct.data),W[X]=pt,k++}s.attributes=W,s.attributesNum=k,s.index=z}function v(){const y=s.newAttributes;for(let b=0,G=y.length;b<G;b++)y[b]=0}function m(y){g(y,0)}function g(y,b){const G=s.newAttributes,z=s.enabledAttributes,W=s.attributeDivisors;G[y]=1,z[y]===0&&(i.enableVertexAttribArray(y),z[y]=1),W[y]!==b&&(i.vertexAttribDivisor(y,b),W[y]=b)}function E(){const y=s.newAttributes,b=s.enabledAttributes;for(let G=0,z=b.length;G<z;G++)b[G]!==y[G]&&(i.disableVertexAttribArray(G),b[G]=0)}function S(y,b,G,z,W,K,k){k===!0?i.vertexAttribIPointer(y,b,G,W,K):i.vertexAttribPointer(y,b,G,z,W,K)}function w(y,b,G,z){v();const W=z.attributes,K=G.getAttributes(),k=b.defaultAttributeValues;for(const j in K){const X=K[j];if(X.location>=0){let lt=W[j];if(lt===void 0&&(j==="instanceMatrix"&&y.instanceMatrix&&(lt=y.instanceMatrix),j==="instanceColor"&&y.instanceColor&&(lt=y.instanceColor)),lt!==void 0){const ct=lt.normalized,pt=lt.itemSize,kt=t.get(lt);if(kt===void 0)continue;const Yt=kt.buffer,Y=kt.type,Q=kt.bytesPerElement,Mt=Y===i.INT||Y===i.UNSIGNED_INT||lt.gpuType===ic;if(lt.isInterleavedBufferAttribute){const mt=lt.data,Nt=mt.stride,Rt=lt.offset;if(mt.isInstancedInterleavedBuffer){for(let Wt=0;Wt<X.locationSize;Wt++)g(X.location+Wt,mt.meshPerAttribute);y.isInstancedMesh!==!0&&z._maxInstanceCount===void 0&&(z._maxInstanceCount=mt.meshPerAttribute*mt.count)}else for(let Wt=0;Wt<X.locationSize;Wt++)m(X.location+Wt);i.bindBuffer(i.ARRAY_BUFFER,Yt);for(let Wt=0;Wt<X.locationSize;Wt++)S(X.location+Wt,pt/X.locationSize,Y,ct,Nt*Q,(Rt+pt/X.locationSize*Wt)*Q,Mt)}else{if(lt.isInstancedBufferAttribute){for(let mt=0;mt<X.locationSize;mt++)g(X.location+mt,lt.meshPerAttribute);y.isInstancedMesh!==!0&&z._maxInstanceCount===void 0&&(z._maxInstanceCount=lt.meshPerAttribute*lt.count)}else for(let mt=0;mt<X.locationSize;mt++)m(X.location+mt);i.bindBuffer(i.ARRAY_BUFFER,Yt);for(let mt=0;mt<X.locationSize;mt++)S(X.location+mt,pt/X.locationSize,Y,ct,pt*Q,pt/X.locationSize*mt*Q,Mt)}}else if(k!==void 0){const ct=k[j];if(ct!==void 0)switch(ct.length){case 2:i.vertexAttrib2fv(X.location,ct);break;case 3:i.vertexAttrib3fv(X.location,ct);break;case 4:i.vertexAttrib4fv(X.location,ct);break;default:i.vertexAttrib1fv(X.location,ct)}}}}E()}function P(){L();for(const y in n){const b=n[y];for(const G in b){const z=b[G];for(const W in z)h(z[W].object),delete z[W];delete b[G]}delete n[y]}}function R(y){if(n[y.id]===void 0)return;const b=n[y.id];for(const G in b){const z=b[G];for(const W in z)h(z[W].object),delete z[W];delete b[G]}delete n[y.id]}function A(y){for(const b in n){const G=n[b];if(G[y.id]===void 0)continue;const z=G[y.id];for(const W in z)h(z[W].object),delete z[W];delete G[y.id]}}function L(){F(),o=!0,s!==r&&(s=r,c(s.object))}function F(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:a,reset:L,resetDefaultState:F,dispose:P,releaseStatesOfGeometry:R,releaseStatesOfProgram:A,initAttributes:v,enableAttribute:m,disableUnusedAttributes:E}}function Yv(i,t,e){let n;function r(c){n=c}function s(c,h){i.drawArrays(n,c,h),e.update(h,n,1)}function o(c,h,u){u!==0&&(i.drawArraysInstanced(n,c,h,u),e.update(h,n,u))}function a(c,h,u){if(u===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,u);let p=0;for(let x=0;x<u;x++)p+=h[x];e.update(p,n,1)}function l(c,h,u,f){if(u===0)return;const p=t.get("WEBGL_multi_draw");if(p===null)for(let x=0;x<c.length;x++)o(c[x],h[x],f[x]);
vendor: 4,110 bytes, line 3587
3587else{p.multiDrawArraysInstancedWEBGL(n,c,0,h,0,f,0,u);let x=0;for(let v=0;v<u;v++)x+=h[v];for(let v=0;v<f.length;v++)e.update(x,n,f[v])}}this.setMode=r,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function $v(i,t,e,n){let r;function s(){if(r!==void 0)return r;if(t.has("EXT_texture_filter_anisotropic")===!0){const A=t.get("EXT_texture_filter_anisotropic");r=i.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(A){return!(A!==In&&n.convert(A)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(A){const L=A===Ds&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(A!==ii&&n.convert(A)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==ti&&!L)}function l(A){if(A==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const u=e.logarithmicDepthBuffer===!0,f=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control");if(f===!0){const A=t.get("EXT_clip_control");A.clipControlEXT(A.LOWER_LEFT_EXT,A.ZERO_TO_ONE_EXT)}const p=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),x=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=i.getParameter(i.MAX_TEXTURE_SIZE),m=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),g=i.getParameter(i.MAX_VERTEX_ATTRIBS),E=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),S=i.getParameter(i.MAX_VARYING_VECTORS),w=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),P=x>0,R=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:f,maxTextures:p,maxVertexTextures:x,maxTextureSize:v,maxCubemapSize:m,maxAttributes:g,maxVertexUniforms:E,maxVaryings:S,maxFragmentUniforms:w,vertexTextures:P,maxSamples:R}}function Zv(i){const t=this;let e=null,n=0,r=!1,s=!1;const o=new Zi,a=new Bt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,f){const p=u.length!==0||f||n!==0||r;return r=f,n=u.length,p},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,f){e=h(u,f,0)},this.setState=function(u,f,p){const x=u.clippingPlanes,v=u.clipIntersection,m=u.clipShadows,g=i.get(u);if(!r||x===null||x.length===0||s&&!m)s?h(null):c();else{const E=s?0:n,S=E*4;let w=g.clippingState||null;l.value=w,w=h(x,f,S,p);for(let P=0;P!==S;++P)w[P]=e[P];g.clippingState=w,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=E}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(u,f,p,x){const v=u!==null?u.length:0;let m=null;if(v!==0){if(m=l.value,x!==!0||m===null){const g=p+v*4,E=f.matrixWorldInverse;a.getNormalMatrix(E),(m===null||m.length<g)&&(m=new Float32Array(g));for(let S=0,w=p;S!==v;++S,w+=4)o.copy(u[S]).applyMatrix4(E,a),o.normal.toArray(m,w),m[w+3]=o.constant}l.value=m,l.needsUpdate=!0}return t.numPlanes=v,t.numIntersection=0,m}}function Kv(i){let t=new WeakMap;function e(o,a){return a===cl?o.mapping=Hr:a===hl&&(o.mapping=Vr),o}function n(o){if(o&&o.isTexture){const a=o.mapping;if(a===cl||a===hl)if(t.has(o)){const l=t.get(o).texture;return e(l,o.mapping)}else{const l=o.image;if(l&&l.height>0){const c=new a_(l.height);return c.fromEquirectangularTexture(i,o),t.set(o,c),o.addEventListener("dispose",r),e(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}class jv extends Ku{constructor(t=-1,e=1,n=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
3587phicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,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,r,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=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-t,o=n+t,a=r+e,l=r-e;if(this.view!==null&&this.view.enabled){const 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){const 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}}const Rr=4,wh=[.125,.215,.35,.446,.526,.582],Qi=20,La=new jv,Ah=new Kt;let Ia=null,Da=0,Ua=0,Na=!1;const Ki=(1+Math.sqrt(5))/2,br=1/Ki,Ch=[new U(-Ki,br,0),new U(Ki,br,0),new U(-br,0,Ki),new U(br,0,Ki),new U(0,Ki,-br),new U(0,Ki,br),new U(-1,1,-1),new U(1,1,-1),new U(-1,1,1),new U(1,1,1)];class Rh{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,r=100){Ia=this._renderer.getRenderTarget(),Da=this._renderer.getActiveCubeFace(),Ua=this._renderer.getActiveMipmapLevel(),Na=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,r,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=Ih(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Lh(),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(Ia,Da,Ua),this._renderer.xr.enabled=Na,t.scissorTest=!1,co(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===Hr||t.mapping===Vr?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Ia=this._renderer.getRenderTarget(),Da=this._renderer.getActiveCubeFace(),Ua=this._renderer.getActiveMipmapLevel(),Na=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:qe,minFilter:qe,generateMipmaps:!1,type:Ds,format:In,colorSpace:Ni,depthBuffer:!1},r=Ph(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Ph(t,e,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Jv(s)),this._blurMaterial=Qv(s,t,e)}return r}_compileMaterial(t){const e=new zn(this._lodPlanes[0],t);this._renderer.compile(e,La)}_sceneToCubeUV(t,e,n,r){const a=new vn(90,1,e,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,u=h.autoClear,f=h.toneMapping;h.getClearColor(Ah),h.toneMapping=bi,h.autoClear=!1;
vendor: 5,418 bytes, lines 3587-3662
3587const p=new dc({name:"PMREM.Background",side:$e,depthWrite:!1,depthTest:!1}),x=new zn(new Os,p);let v=!1;const m=t.background;m?m.isColor&&(p.color.copy(m),t.background=null,v=!0):(p.color.copy(Ah),v=!0);for(let g=0;g<6;g++){const E=g%3;E===0?(a.up.set(0,l[g],0),a.lookAt(c[g],0,0)):E===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]));const S=this._cubeSize;co(r,E*S,g>2?S:0,S,S),h.setRenderTarget(r),v&&h.render(x,a),h.render(t,a)}x.geometry.dispose(),x.material.dispose(),h.toneMapping=f,h.autoClear=u,t.background=m}_textureToCubeUV(t,e){const n=this._renderer,r=t.mapping===Hr||t.mapping===Vr;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Ih()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Lh());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new zn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=t;const l=this._cubeSize;co(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(o,La)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;s<r;s++){const o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),a=Ch[(r-s-1)%Ch.length];this._blur(t,s-1,s,o,a)}e.autoClear=n}_blur(t,e,n,r,s){const o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,r,"latitudinal",s),this._halfBlur(o,t,n,n,r,"longitudinal",s)}_halfBlur(t,e,n,r,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,u=new zn(this._lodPlanes[r],c),f=c.uniforms,p=this._sizeLods[n]-1,x=isFinite(s)?Math.PI/(2*p):2*Math.PI/(2*Qi-1),v=s/x,m=isFinite(s)?1+Math.floor(h*v):Qi;m>Qi&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Qi}`);const g=[];let E=0;for(let A=0;A<Qi;++A){const L=A/v,F=Math.exp(-L*L/2);g.push(F),A===0?E+=F:A<m&&(E+=2*F)}for(let A=0;A<g.length;A++)g[A]=g[A]/E;f.envMap.value=t.texture,f.samples.value=m,f.weights.value=g,f.latitudinal.value=o==="latitudinal",a&&(f.poleAxis.value=a);const{_lodMax:S}=this;f.dTheta.value=x,f.mipInt.value=S-n;const w=this._sizeLods[r],P=3*w*(r>S-Rr?r-S+Rr:0),R=4*(this._cubeSize-w);co(e,P,R,3*w,2*w),l.setRenderTarget(e),l.render(u,La)}}function Jv(i){const t=[],e=[],n=[];let r=i;const s=i-Rr+1+wh.length;for(let o=0;o<s;o++){const a=Math.pow(2,r);e.push(a);let l=1/a;o>i-Rr?l=wh[o-i+Rr-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),h=-c,u=1+c,f=[h,h,u,h,u,u,h,h,u,u,h,u],p=6,x=6,v=3,m=2,g=1,E=new Float32Array(v*x*p),S=new Float32Array(m*x*p),w=new Float32Array(g*x*p);for(let R=0;R<p;R++){const A=R%3*2/3-1,L=R>2?0:-1,F=[A,L,0,A+2/3,L,0,A+2/3,L+1,0,A,L,0,A+2/3,L+1,0,A,L+1,0];E.set(F,v*x*R),S.set(f,m*x*R);const y=[R,R,R,R,R,R];w.set(y,g*x*R)}const P=new En;P.setAttribute("position",new we(E,v)),P.setAttribute("uv",new we(S,m)),P.setAttribute("faceIndex",new we(w,g)),t.push(P),r>Rr&&r--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function Ph(i,t,e){const n=new Ri(i,t,e);return n.texture.mapping=Yo,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function co(i,t,e,n,r){i.viewport.set(t,e,n,r),i.scissor.set(t,e,n,r)}function Qv(i,t,e){const n=new Float32Array(Qi),r=new U(0,1,0);return new si({name:"SphericalGaussianBlur",defines:{n:Qi,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:pc(),fragmentShader:` 3588 3589 precision mediump float; 3590 precision mediump int; 3591 3592 varying vec3 vOutputDirection; 3593 3594 uniform sampler2D envMap; 3595 uniform int samples; 3596 uniform float weights[ n ]; 3597 uniform bool latitudinal; 3598 uniform float dTheta; 3599 uniform float mipInt; 3600 uniform vec3 poleAxis; 3601 3602 #define ENVMAP_TYPE_CUBE_UV 3603 #include <cube_uv_reflection_fragment> 3604 3605 vec3 getSample( float theta, vec3 axis ) { 3606 3607 float cosTheta = cos( theta ); 3608 // Rodrigues' axis-angle rotation 3609 vec3 sampleDirection = vOutputDirection * cosTheta 3610 + cross( axis, vOutputDirection ) * sin( theta ) 3611 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3612 3613 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3614 3615 } 3616 3617 void main() { 3618 3619 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3620 3621 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3622 3623 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3624 3625 } 3626 3627 axis = normalize( axis ); 3628 3629 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3630 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3631 3632 for ( int i = 1; i < n; i++ ) { 3633 3634 if ( i >= samples ) { 3635 3636 break; 3637 3638 } 3639 3640 float theta = dTheta * float( i ); 3641 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3642 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3643 3644 } 3645 3646 } 3647 `,blending:Ti,depthTest:!1,depthWrite:!1})}function Lh(){return new si({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:pc(),fragmentShader:` 3648 3649 precision mediump float; 3650 precision mediump int; 3651 3652 varying vec3 vOutputDirection; 3653 3654 uniform sampler2D envMap; 3655 3656 #include <common> 3657 3658 void main() { 3659 3660 vec3 outputDirection = normalize( vOutputDirection ); 3661 vec2 uv = equirectUv( outputDirection ); 3662
3663 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 3664 3665 } 3666 `,blending:Ti,depthTest:!1,depthWrite:!1})}function Ih(){return new si({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:pc(),fragmentShader:` 3667 3668 precision mediump float; 3669 precision mediump int; 3670 3671 uniform float flipEnvMap; 3672 3673 varying vec3 vOutputDirection; 3674 3675 uniform samplerCube envMap; 3676 3677 void main() { 3678 3679 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 3680 3681 } 3682 `,blending:Ti,depthTest:!1,depthWrite:!1})}function pc(){return` 3683 3684 precision mediump float; 3685 precision mediump int; 3686 3687 attribute float faceIndex; 3688 3689 varying vec3 vOutputDirection; 3690 3691 // RH coordinate system; PMREM face-indexing convention 3692 vec3 getDirection( vec2 uv, float face ) { 3693 3694 uv = 2.0 * uv - 1.0; 3695 3696 vec3 direction = vec3( uv, 1.0 ); 3697 3698 if ( face == 0.0 ) { 3699 3700 direction = direction.zyx; // ( 1, v, u ) pos x 3701 3702 } else if ( face == 1.0 ) { 3703 3704 direction = direction.xzy; 3705 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 3706 3707 } else if ( face == 2.0 ) { 3708 3709 direction.x *= -1.0; // ( -u, v, 1 ) pos z 3710 3711 } else if ( face == 3.0 ) { 3712 3713 direction = direction.zyx; 3714 direction.xz *= -1.0; // ( -1, v, -u ) neg x 3715 3716 } else if ( face == 4.0 ) { 3717 3718 direction = direction.xzy; 3719 direction.xy *= -1.0; // ( -u, -1, v ) neg y 3720 3721 } else if ( face == 5.0 ) { 3722 3723 direction.z *= -1.0; // ( u, v, -1 ) neg z 3724 3725 } 3726 3727 return direction; 3728 3729 } 3730 3731 void main() { 3732 3733 vOutputDirection = getDirection( uv, faceIndex ); 3734 gl_Position = vec4( position, 1.0 ); 3735 3736 } 3737 `}function t0(i){let t=new WeakMap,e=null;function n(a){if(a&&a.isTexture){const l=a.mapping,c=l===cl||l===hl,h=l===Hr||l===Vr;if(c||h){let u=t.get(a);const f=u!==void 0?u.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==f)return e===null&&(e=new Rh(i)),u=c?e.fromEquirectangular(a,u):e.fromCubemap(a,u),u.texture.pmremVersion=a.pmremVersion,t.set(a,u),u.texture;if(u!==void 0)return u.texture;{const p=a.image;return c&&p&&p.height>0||h&&p&&r(p)?(e===null&&(e=new Rh(i)),u=c?e.fromEquirectangular(a):e.fromCubemap(a),u.texture.pmremVersion=a.pmremVersion,t.set(a,u),a.addEventListener("dispose",s),u.texture):null}}}return a}function r(a){let l=0;const c=6;for(let h=0;h<c;h++)a[h]!==void 0&&l++;return l===c}function s(a){const l=a.target;l.removeEventListener("dispose",s);const 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 e0(i){const t={};function e(n){if(t[n]!==void 0)return t[n];let r;switch(n){case"WEBGL_depth_texture":r=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=i.getExtension(n)}return t[n]=r,r}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){const r=e(n);return r===null&&Ao("THREE.WebGLRenderer: "+n+" extension not supported."),r}}}function n0(i,t,e,n){const r={},s=new WeakMap;function o(u){const f=u.target;f.index!==null&&t.remove(f.index);for(const x in f.attributes)t.remove(f.attributes[x]);for(const x in f.morphAttributes){const v=f.morphAttributes[x];for(let m=0,g=v.length;m<g;m++)t.remove(v[m])}f.removeEventListener("dispose",o),delete r[f.id];const p=s.get(f);p&&(t.remove(p),s.delete(f)),n.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,e.memory.geometries--}function a(u,f){return r[f.id]===!0||(f.addEventListener("dispose",o),r[f.id]=!0,e.memory.geometries++),f}function l(u){const f=u.attributes;for(const x in f)t.update(f[x],i.ARRAY_BUFFER);const p=u.morphAttributes;for(const x in p){const v=p[x];for(let m=0,g=v.length;m<g;m++)t.update(v[m],i.ARRAY_BUFFER)}}function c(u){const f=[],p=u.index,x=u.attributes.position;let v=0;if(p!==null){const E=p.array;v=p.version;for(let S=0,w=E.length;S<w;S+=3){const P=E[S+0],R=E[S+1],A=E[S+2];f.push(P,R,R,A,A,P)}}else if(x!==void 0){const E=x.array;v=x.version;for(let S=0,w=E.length/3-1;S<w;S+=3){const P=S+0,R=S+1,A=S+2;f.push(P,R,R,A,A,P)}}else return;const m=new(Gu(f)?$u:fc)(f,1);m.version=v;const g=s.get(u);g&&t.remove(g),s.set(u,m)}function h(u){const f=s.get(u);if(f){const p=u.index;p!==null&&f.version<p.version&&c(u)}else c(u);return s.get(u)}return{get:a,update:l,getWireframeAttribute:h}}function i0(i,t,e){let n;function r(f){n=f}let s,o;function a(f){s=f.type,o=f.bytesPerElement}function l(f,p){i.drawElements(n,p,s,f*o),e.update(p,n,1)}function c(f,p,x){x!==0&&(i.drawElementsInstanced(n,p,s,f*o,x),e.update(p,n,x))}function h(f,p,x){if(x===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,p,0,s,f,0,x);let m=0;for(let g=0;g<x;g++)m+=p[g];e.update(m,n,1)}function u(f,p,x,v){if(x===0)return;const m=t.get("WEBGL_multi_draw");if(m===null)for(let g=0;g<f.length;g++)c(f[g]/o,p[g],v[g]);
vendor: 18,093 bytes, lines 3737-3771
3737else{m.multiDrawElementsInstancedWEBGL(n,p,0,s,f,0,v,0,x);let g=0;for(let E=0;E<x;E++)g+=p[E];for(let E=0;E<v.length;E++)e.update(g,n,v[E])}}this.setMode=r,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function r0(i){const 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 i.TRIANGLES:e.triangles+=a*(s/3);break;case i.LINES:e.lines+=a*(s/2);break;case i.LINE_STRIP:e.lines+=a*(s-1);break;case i.LINE_LOOP:e.lines+=a*s;break;case i.POINTS:e.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:r,update:n}}function s0(i,t,e){const n=new WeakMap,r=new Me;function s(o,a,l){const c=o.morphTargetInfluences,h=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,u=h!==void 0?h.length:0;let f=n.get(a);if(f===void 0||f.count!==u){let F=function(){A.dispose(),n.delete(a),a.removeEventListener("dispose",F)};f!==void 0&&f.texture.dispose();const p=a.morphAttributes.position!==void 0,x=a.morphAttributes.normal!==void 0,v=a.morphAttributes.color!==void 0,m=a.morphAttributes.position||[],g=a.morphAttributes.normal||[],E=a.morphAttributes.color||[];let S=0;p===!0&&(S=1),x===!0&&(S=2),v===!0&&(S=3);let w=a.attributes.position.count*S,P=1;w>t.maxTextureSize&&(P=Math.ceil(w/t.maxTextureSize),w=t.maxTextureSize);const R=new Float32Array(w*P*4*u),A=new Xu(R,w,P,u);A.type=ti,A.needsUpdate=!0;const L=S*4;for(let y=0;y<u;y++){const b=m[y],G=g[y],z=E[y],W=w*P*4*y;for(let K=0;K<b.count;K++){const k=K*L;p===!0&&(r.fromBufferAttribute(b,K),R[W+k+0]=r.x,R[W+k+1]=r.y,R[W+k+2]=r.z,R[W+k+3]=0),x===!0&&(r.fromBufferAttribute(G,K),R[W+k+4]=r.x,R[W+k+5]=r.y,R[W+k+6]=r.z,R[W+k+7]=0),v===!0&&(r.fromBufferAttribute(z,K),R[W+k+8]=r.x,R[W+k+9]=r.y,R[W+k+10]=r.z,R[W+k+11]=z.itemSize===4?r.w:1)}}f={count:u,texture:A,size:new St(w,P)},n.set(a,f),a.addEventListener("dispose",F)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(i,"morphTexture",o.morphTexture,e);else{let p=0;for(let v=0;v<c.length;v++)p+=c[v];const x=a.morphTargetsRelative?1:1-p;l.getUniforms().setValue(i,"morphTargetBaseInfluence",x),l.getUniforms().setValue(i,"morphTargetInfluences",c)}l.getUniforms().setValue(i,"morphTargetsTexture",f.texture,e),l.getUniforms().setValue(i,"morphTargetsTextureSize",f.size)}return{update:s}}function o0(i,t,e,n){let r=new WeakMap;function s(l){const c=n.render.frame,h=l.geometry,u=t.get(l,h);if(r.get(u)!==c&&(t.update(u),r.set(u,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),r.get(l)!==c&&(e.update(l.instanceMatrix,i.ARRAY_BUFFER),l.instanceColor!==null&&e.update(l.instanceColor,i.ARRAY_BUFFER),r.set(l,c))),l.isSkinnedMesh){const f=l.skeleton;r.get(f)!==c&&(f.update(),r.set(f,c))}return u}function o(){r=new WeakMap}function a(l){const c=l.target;c.removeEventListener("dispose",a),e.remove(c.instanceMatrix),c.instanceColor!==null&&e.remove(c.instanceColor)}return{update:s,dispose:o}}class td extends Mn{constructor(t,e,n,r,s,o,a,l,c,h=Nr){if(h!==Nr&&h!==Wr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Nr&&(n=ar),n===void 0&&h===Wr&&(n=Gr),super(null,r,s,o,a,l,h,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=a!==void 0?a:xn,this.minFilter=l!==void 0?l:xn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}const ed=new Mn,Dh=new td(1,1),nd=new Xu,id=new Wm,rd=new ju,Uh=[],Nh=[],Oh=new Float32Array(16),Fh=new Float32Array(9),zh=new Float32Array(4);function ts(i,t,e){const n=i[0];if(n<=0||n>0)return i;const r=t*e;let s=Uh[r];if(s===void 0&&(s=new Float32Array(r),Uh[r]=s),t!==0){n.toArray(s,0);for(let o=1,a=0;o!==t;++o)a+=e,i[o].toArray(s,a)}return s}function Ae(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(i[e]!==t[e])return!1;return!0}function Ce(i,t){for(let e=0,n=t.length;e<n;e++)i[e]=t[e]}function Ko(i,t){let e=Nh[t];e===void 0&&(e=new Int32Array(t),Nh[t]=e);for(let n=0;n!==t;++n)e[n]=i.allocateTextureUnit();return e}function a0(i,t){const e=this.cache;e[0]!==t&&(i.uniform1f(this.addr,t),e[0]=t)}function l0(i,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(i.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ae(e,t))return;i.uniform2fv(this.addr,t),Ce(e,t)}}function c0(i,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(i.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)&&(i.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(Ae(e,t))return;i.uniform3fv(this.addr,t),Ce(e,t)}}function h0(i,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(i.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(Ae(e,t))return;i.uniform4fv(this.addr,t),Ce(e,t)}}function u0(i,t){const e=this.cache,n=t.elements;if(n===void 0){if(Ae(e,t))return;i.uniformMatrix2fv(this.addr,!1,t),Ce(e,t)}else{if(Ae(e,n))return;zh.set(n),i.uniformMatrix2fv(this.addr,!1,zh),Ce(e,n)}}function d0(i,t){const e=this.cache,n=t.elements;if(n===void 0){if(Ae(e,t))return;i.uniformMatrix3fv(this.addr,!1,t),Ce(e,t)}else{if(Ae(e,n))return;Fh.set(n),i.uniformMatrix3fv(this.addr,!1,Fh),Ce(e,n)}}function f0(i,t){const e=this.cache,n=t.elements;if(n===void 0){if(Ae(e,t))return;i.uniformMatrix4fv(this.addr,!1,t),Ce(e,t)}else{if(Ae(e,n))return;Oh.set(n),i.uniformMatrix4fv(this.addr,!1,Oh),Ce(e,n)}}function p0(i,t){const e=this.cache;e[0]!==t&&(i.uniform1i(this.addr,t),e[0]=t)}function m0(i,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(i.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ae(e,t))return;i.uniform2iv(this.addr,t),Ce(e,t)}}function _0(i,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(i.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Ae(e,t))return;i.uniform3iv(this.addr,t),Ce(e,t)}}function g0(i,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(i.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(Ae(e,t))return;i.uniform4iv(this.addr,t),Ce(e,t)}}function v0(i,t){const e=this.cache;e[0]!==t&&(i.uniform1ui(this.addr,t),e[0]=t)}function x0(i,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(i.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ae(e,t))return;i.uniform2uiv(this.addr,t),Ce(e,t)}}function y0(i,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(i.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Ae(e,t))return;i.uniform3uiv(this.addr,t),Ce(e,t)}}function S0(i,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(i.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(Ae(e,t))return;i.uniform4uiv(this.addr,t),Ce(e,t)}}function M0(i,t,e){const n=this.cache,r=e.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r);let s;this.type===i.SAMPLER_2D_SHADOW?(Dh.compareFunction=Vu,s=Dh):s=ed,e.setTexture2D(t||s,r)}function E0(i,t,e){const n=this.cache,r=e.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),e.setTexture3D(t||id,r)}function T0(i,t,e){const n=this.cache,r=e.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),e.setTextureCube(t||rd,r)}function b0(i,t,e){const n=this.cache,r=e.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),e.setTexture2DArray(t||nd,r)}function w0(i){switch(i){case 5126:return a0;case 35664:return l0;case 35665:return c0;case 35666:return h0;case 35674:return u0;case 35675:return d0;case 35676:return f0;case 5124:case 35670:return p0;case 35667:case 35671:return m0;case 35668:case 35672:return _0;case 35669:case 35673:return g0;case 5125:return v0;case 36294:return x0;case 36295:return y0;case 36296:return S0;case 35678:case 36198:case 36298:case 36306:case 35682:return M0;case 35679:case 36299:case 36307:return E0;case 35680:case 36300:case 36308:case 36293:return T0;case 36289:case 36303:case 36311:case 36292:return b0}}function A0(i,t){i.uniform1fv(this.addr,t)}function C0(i,t){const e=ts(t,this.size,2);i.uniform2fv(this.addr,e)}function R0(i,t){const e=ts(t,this.size,3);i.uniform3fv(this.addr,e)}function P0(i,t){const e=ts(t,this.size,4);i.uniform4fv(this.addr,e)}function L0(i,t){const e=ts(t,this.size,4);i.uniformMatrix2fv(this.addr,!1,e)}function I0(i,t){const e=ts(t,this.size,9);i.uniformMatrix3fv(this.addr,!1,e)}function D0(i,t){const e=ts(t,this.size,16);i.uniformMatrix4fv(this.addr,!1,e)}function U0(i,t){i.uniform1iv(this.addr,t)}function N0(i,t){i.uniform2iv(this.addr,t)}function O0(i,t){i.uniform3iv(this.addr,t)}function F0(i,t){i.uniform4iv(this.addr,t)}function z0(i,t){i.uniform1uiv(this.addr,t)}function B0(i,t){i.uniform2uiv(this.addr,t)}function k0(i,t){i.uniform3uiv(this.addr,t)}function H0(i,t){i.uniform4uiv(this.addr,t)}function V0(i,t,e){const n=this.cache,r=t.length,s=Ko(e,r);Ae(n,s)||(i.uniform1iv(this.addr,s),Ce(n,s));for(let o=0;o!==r;++o)e.setTexture2D(t[o]||ed,s[o])}function G0(i,t,e){const n=this.cache,r=t.length,s=Ko(e,r);Ae(n,s)||(i.uniform1iv(this.addr,s),Ce(n,s));for(let o=0;o!==r;++o)e.setTexture3D(t[o]||id,s[o])}function W0(i,t,e){const n=this.cache,r=t.length,s=Ko(e,r);Ae(n,s)||(i.uniform1iv(this.addr,s),Ce(n,s));for(let o=0;o!==r;++o)e.setTextureCube(t[o]||rd,s[o])}function X0(i,t,e){const n=this.cache,r=t.length,s=Ko(e,r);Ae(n,s)||(i.uniform1iv(this.addr,s),Ce(n,s));for(let o=0;o!==r;++o)e.setTexture2DArray(t[o]||nd,s[o])}function q0(i){switch(i){case 5126:return A0;case 35664:return C0;case 35665:return R0;case 35666:return P0;case 35674:return L0;case 35675:return I0;case 35676:return D0;case 5124:case 35670:return U0;case 35667:case 35671:return N0;case 35668:case 35672:return O0;case 35669:case 35673:return F0;case 5125:return z0;case 36294:return B0;case 36295:return k0;case 36296:return H0;case 35678:case 36198:case 36298:case 36306:case 35682:return V0;case 35679:case 36299:case 36307:return G0;case 35680:case 36300:case 36308:case 36293:return W0;case 36289:case 36303:case 36311:case 36292:return X0}}class Y0{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=w0(e.type)}}class $0{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=q0(e.type)}}class Z0{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const r=this.seq;for(let s=0,o=r.length;s!==o;++s){const a=r[s];a.setValue(t,e[a.id],n)}}}const Oa=/(\w+)(\])?(\[|\.)?/g;function Bh(i,t){i.seq.push(t),i.map[t.id]=t}function K0(i,t,e){const n=i.name,r=n.length;for(Oa.lastIndex=0;;){const s=Oa.exec(n),o=Oa.lastIndex;let a=s[1];const l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===r){Bh(e,c===void 0?new Y0(a,i,t):new $0(a,i,t));break}else{let u=e.map[a];u===void 0&&(u=new Z0(a),Bh(e,u)),e=u}}}class Ro{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const s=t.getActiveUniform(e,r),o=t.getUniformLocation(e,s.name);K0(s,o,this)}}setValue(t,e,n,r){const s=this.map[e];s!==void 0&&s.setValue(t,n,r)}setOptional(t,e,n){const r=e[n];r!==void 0&&this.setValue(t,n,r)}static upload(t,e,n,r){for(let s=0,o=e.length;s!==o;++s){const a=e[s],l=n[a.id];l.needsUpdate!==!1&&a.setValue(t,l.value,r)}}static seqWithValue(t,e){const n=[];for(let r=0,s=t.length;r!==s;++r){const o=t[r];o.id in e&&n.push(o)}return n}}function kh(i,t,e){const n=i.createShader(t);return i.shaderSource(n,e),i.compileShader(n),n}const j0=37297;let J0=0;function Q0(i,t){const e=i.split(` 3738`),n=[],r=Math.max(t-6,0),s=Math.min(t+6,e.length);for(let o=r;o<s;o++){const a=o+1;n.push(`${a===t?">":" "} ${a}: ${e[o]}`)}return n.join(` 3739`)}function tx(i){const t=ee.getPrimaries(ee.workingColorSpace),e=ee.getPrimaries(i);let n;switch(t===e?n="":t===No&&e===Uo?n="LinearDisplayP3ToLinearSRGB":t===Uo&&e===No&&(n="LinearSRGBToLinearDisplayP3"),i){case Ni:case $o:return[n,"LinearTransferOETF"];case Un:case cc:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",i),[n,"LinearTransferOETF"]}}function Hh(i,t,e){const n=i.getShaderParameter(t,i.COMPILE_STATUS),r=i.getShaderInfoLog(t).trim();if(n&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return e.toUpperCase()+` 3740 3741`+r+` 3742 3743`+Q0(i.getShaderSource(t),o)}else return r}function ex(i,t){const e=tx(t);return`vec4 ${i}( vec4 value ) { return ${e[0]}( ${e[1]}( value ) ); }`}function nx(i,t){let e;switch(t){case tm:e="Linear";break;case em:e="Reinhard";break;case nm:e="Cineon";break;case im:e="ACESFilmic";break;case sm:e="AgX";break;case om:e="Neutral";break;case rm:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+i+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const ho=new U;function ix(){ee.getLuminanceCoefficients(ho);const i=ho.x.toFixed(4),t=ho.y.toFixed(4),e=ho.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(` 3744`)}function rx(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(hs).join(` 3745`)}function sx(i){const t=[];for(const e in i){const n=i[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(` 3746`)}function ox(i,t){const e={},n=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES);for(let r=0;r<n;r++){const s=i.getActiveAttrib(t,r),o=s.name;let a=1;s.type===i.FLOAT_MAT2&&(a=2),s.type===i.FLOAT_MAT3&&(a=3),s.type===i.FLOAT_MAT4&&(a=4),e[o]={type:s.type,location:i.getAttribLocation(t,o),locationSize:a}}return e}function hs(i){return i!==""}function Vh(i,t){const e=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return i.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 Gh(i,t){return i.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const ax=/^[ \t]*#include +<([\w\d./]+)>/gm;function Bl(i){return i.replace(ax,cx)}const lx=new Map;function cx(i,t){let e=Ft[t];if(e===void 0){const n=lx.get(t);if(n!==void 0)e=Ft[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 Bl(e)}const hx=/#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 Wh(i){return i.replace(hx,ux)}function ux(i,t,e,n){let r="";for(let s=parseInt(t);s<parseInt(e);s++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function Xh(i){let t=`precision ${i.precision} float; 3747 precision ${i.precision} int; 3748 precision ${i.precision} sampler2D; 3749 precision ${i.precision} samplerCube; 3750 precision ${i.precision} sampler3D; 3751 precision ${i.precision} sampler2DArray; 3752 precision ${i.precision} sampler2DShadow; 3753 precision ${i.precision} samplerCubeShadow; 3754 precision ${i.precision} sampler2DArrayShadow; 3755 precision ${i.precision} isampler2D; 3756 precision ${i.precision} isampler3D; 3757 precision ${i.precision} isamplerCube; 3758 precision ${i.precision} isampler2DArray; 3759 precision ${i.precision} usampler2D; 3760 precision ${i.precision} usampler3D; 3761 precision ${i.precision} usamplerCube; 3762 precision ${i.precision} usampler2DArray; 3763 `;return i.precision==="highp"?t+=` 3764#define HIGH_PRECISION`:i.precision==="mediump"?t+=` 3765#define MEDIUM_PRECISION`:i.precision==="lowp"&&(t+=` 3766#define LOW_PRECISION`),t}function dx(i){let t="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===Ru?t="SHADOWMAP_TYPE_PCF":i.shadowMapType===Dp?t="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===Kn&&(t="SHADOWMAP_TYPE_VSM"),t}function fx(i){let t="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case Hr:case Vr:t="ENVMAP_TYPE_CUBE";break;case Yo:t="ENVMAP_TYPE_CUBE_UV";break}return t}function px(i){let t="ENVMAP_MODE_REFLECTION";if(i.envMap)switch(i.envMapMode){case Vr:t="ENVMAP_MODE_REFRACTION";break}return t}function mx(i){let t="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case Pu:t="ENVMAP_BLENDING_MULTIPLY";break;case Jp:t="ENVMAP_BLENDING_MIX";break;case Qp:t="ENVMAP_BLENDING_ADD";break}return t}function _x(i){const t=i.envMapCubeUVHeight;if(t===null)return null;const e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),112)),texelHeight:n,maxMip:e}}function gx(i,t,e,n){const r=i.getContext(),s=e.defines;let o=e.vertexShader,a=e.fragmentShader;const l=dx(e),c=fx(e),h=px(e),u=mx(e),f=_x(e),p=rx(e),x=sx(s),v=r.createProgram();let m,g,E=e.glslVersion?"#version "+e.glslVersion+` 3767`:"";e.isRawShaderMaterial?(m=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,x].filter(hs).join(` 3768`),m.length>0&&(m+=` 3769`),g=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,x].filter(hs).join(` 3770`),g.length>0&&(g+=` 3771`)):(m=[Xh(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,x,e.extensionCl
vendor: 5,767 bytes, lines 3771-3773
3771ipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",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_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.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` 3772`].filter(hs).join(` 3773`),g=[Xh(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,x,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 "+u:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.max
vendor: 12,252 bytes, lines 3773-3787
3773Mip+".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||e.batchingColor?"#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.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==bi?"#define TONE_MAPPING":"",e.toneMapping!==bi?Ft.tonemapping_pars_fragment:"",e.toneMapping!==bi?nx("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Ft.colorspace_pars_fragment,ex("linearToOutputTexel",e.outputColorSpace),ix(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` 3774`].filter(hs).join(` 3775`)),o=Bl(o),o=Vh(o,e),o=Gh(o,e),a=Bl(a),a=Vh(a,e),a=Gh(a,e),o=Wh(o),a=Wh(a),e.isRawShaderMaterial!==!0&&(E=`#version 300 es 3776`,m=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` 3777`)+` 3778`+m,g=["#define varying in",e.glslVersion===oh?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===oh?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` 3779`)+` 3780`+g);const S=E+m+o,w=E+g+a,P=kh(r,r.VERTEX_SHADER,S),R=kh(r,r.FRAGMENT_SHADER,w);r.attachShader(v,P),r.attachShader(v,R),e.index0AttributeName!==void 0?r.bindAttribLocation(v,0,e.index0AttributeName):e.morphTargets===!0&&r.bindAttribLocation(v,0,"position"),r.linkProgram(v);function A(b){if(i.debug.checkShaderErrors){const G=r.getProgramInfoLog(v).trim(),z=r.getShaderInfoLog(P).trim(),W=r.getShaderInfoLog(R).trim();let K=!0,k=!0;if(r.getProgramParameter(v,r.LINK_STATUS)===!1)if(K=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(r,v,P,R);else{const j=Hh(r,P,"vertex"),X=Hh(r,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(v,r.VALIDATE_STATUS)+` 3781 3782Material Name: `+b.name+` 3783Material Type: `+b.type+` 3784 3785Program Info Log: `+G+` 3786`+j+` 3787`+X)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(z===""||W==="")&&(k=!1);k&&(b.diagnostics={runnable:K,programLog:G,vertexShader:{log:z,prefix:m},fragmentShader:{log:W,prefix:g}})}r.deleteShader(P),r.deleteShader(R),L=new Ro(r,v),F=ox(r,v)}let L;this.getUniforms=function(){return L===void 0&&A(this),L};let F;this.getAttributes=function(){return F===void 0&&A(this),F};let y=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return y===!1&&(y=r.getProgramParameter(v,j0)),y},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(v),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=J0++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=P,this.fragmentShader=R,this}let vx=0;class xx{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,r=this._getShaderStage(e),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const 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){const e=this.materialCache;let n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return n===void 0&&(n=new yx(t),e.set(t,n)),n}}class yx{constructor(t){this.id=vx++,this.code=t,this.usedTimes=0}}function Sx(i,t,e,n,r,s,o){const a=new qu,l=new xx,c=new Set,h=[],u=r.logarithmicDepthBuffer,f=r.reverseDepthBuffer,p=r.vertexTextures;let x=r.precision;const v={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 m(y){return c.add(y),y===0?"uv":`uv${y}`}function g(y,b,G,z,W){const K=z.fog,k=W.geometry,j=y.isMeshStandardMaterial?z.environment:null,X=(y.isMeshStandardMaterial?e:t).get(y.envMap||j),lt=X&&X.mapping===Yo?X.image.height:null,ct=v[y.type];y.precision!==null&&(x=r.getMaxPrecision(y.precision),x!==y.precision&&console.warn("THREE.WebGLProgram.getParameters:",y.precision,"not supported, using",x,"instead."));const pt=k.morphAttributes.position||k.morphAttributes.normal||k.morphAttributes.color,kt=pt!==void 0?pt.length:0;let Yt=0;k.morphAttributes.position!==void 0&&(Yt=1),k.morphAttributes.normal!==void 0&&(Yt=2),k.morphAttributes.color!==void 0&&(Yt=3);let Y,Q,Mt,mt;if(ct){const We=On[ct];Y=We.vertexShader,Q=We.fragmentShader}else Y=y.vertexShader,Q=y.fragmentShader,l.update(y),Mt=l.getVertexShaderID(y),mt=l.getFragmentShaderID(y);const Nt=i.getRenderTarget(),Rt=W.isInstancedMesh===!0,Wt=W.isBatchedMesh===!0,ie=!!y.map,Xt=!!y.matcap,I=!!X,tn=!!y.aoMap,Vt=!!y.lightMap,$t=!!y.bumpMap,Lt=!!y.normalMap,ae=!!y.displacementMap,Ut=!!y.emissiveMap,C=!!y.metalnessMap,M=!!y.roughnessMap,B=y.anisotropy>0,Z=y.clearcoat>0,tt=y.dispersion>0,$=y.iridescence>0,Tt=y.sheen>0,at=y.transmission>0,_t=B&&!!y.anisotropyMap,Zt=Z&&!!y.clearcoatMap,et=Z&&!!y.clearcoatNormalMap,gt=Z&&!!y.clearcoatRoughnessMap,It=$&&!!y.iridescenceMap,Dt=$&&!!y.iridescenceThicknessMap,vt=Tt&&!!y.sheenColorMap,Gt=Tt&&!!y.sheenRoughnessMap,Ot=!!y.specularMap,oe=!!y.specularColorMap,D=!!y.specularIntensityMap,dt=at&&!!y.transmissionMap,q=at&&!!y.thicknessMap,J=!!y.gradientMap,ht=!!y.alphaMap,ft=y.alphaTest>0,qt=!!y.alphaHash,Ee=!!y.extensions;let Ge=bi;y.toneMapped&&(Nt===null||Nt.isXRRenderTarget===!0)&&(Ge=i.toneMapping);const jt={shaderID:ct,shaderType:y.type,shaderName:y.name,vertexShader:Y,fragmentShader:Q,defines:y.defines,customVertexShaderID:Mt,customFragmentShaderID:mt,isRawShaderMaterial:y.isRawShaderMaterial===!0,glslVersion:y.glslVersion,precision:x,batching:Wt,batchingColor:Wt&&W._colorsTexture!==null,instancing:Rt,instancingColor:Rt&&W.instanceColor!==null,instancingMorph:Rt&&W.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:Nt===null?i.outputColorSpace:Nt.isXRRenderTarget===!0?Nt.texture.colorSpace:Ni,alphaToCoverage:!!y.alphaToCoverage,map:ie,matcap:Xt,envMap:I,envMapMode:I&&X.mapping,envMapCubeUVHeight:lt,aoMap:tn,lightMap:Vt,bumpMap:$t,normalMap:Lt,displacementMap:p&&ae,emissiveMap:Ut,normalMapObjectSpace:Lt&&y.normalMapType===um,normalMapTangentSpace:Lt&&y.normalMapType===hm,metalnessMap:C,roughnessMap:M,anisotropy:B,anisotropyMap:_t,clearcoat:Z,clearcoatMap:Zt,clearcoatNormalMap:et,clearcoatRoughnessMap:gt,dispersion:tt,iridescence:$,iridescenceMap:It,iridescenceThicknessMap:Dt,sheen:Tt,sheenColorMap:vt,sheenRoughnessMap:Gt,specularMap:Ot,specularColorMap:oe,specularIntensityMap:D,transmission:at,transmissionMap:dt,thicknessMap:q,gradientMap:J,opaque:y.transparent===!1&&y.blending===Ur&&y.alphaToCoverage===!1,alphaMap:ht,alphaTest:ft,alphaHash:qt,combine:y.combine,mapUv:ie&&m(y.map.channel),aoMapUv:tn&&m(y.aoMap.channel),lightMapUv:Vt&&m(y.lightMap.channel),bumpMapUv:$t&&m(y.bumpMap.channel),normalMapUv:Lt&&m(y.normalMap.channel),displacementMapUv:ae&&m(y.displacementMap.channel),emissiveMapUv:Ut&&m(y.emissiveMap.channel),metalnessMapUv:C&&m(y.metalnessMap.channel),roughnessMapUv:M&&m(y.roughnessMap.channel),anisotropyMapUv:_t&&m(y.anisotropyMap.channel),clearcoatMapUv:Zt&&m(y.clearcoatMap.channel),clearcoatNormalMapUv:et&&m(y.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:gt&&m(y.clearcoatRoughnessMap.channel),iridescenceMapUv:It&&m(y.iridescenceMap.channel),iridescenceThicknessMapUv:Dt&&m(y.iridescenceThicknessMap.channel),sheenColorMapUv:vt&&m(y.sheenColorMap.channel),sheenRoughnessMapUv:Gt&&m(y.sheenRoughnessMap.channel),specularMapUv:Ot&&m(y.specularMap.channel),specularColorMapUv:oe&&m(y.specularColorMap.channel),specularIntensityMapUv:D&&m(y.specularIntensityMap.channel),transmissionMapUv:dt&&m(y.transmissionMap.channel),thicknessMapUv:q&&m(y.thicknessMap.channel),alphaMapUv:ht&&m(y.alphaMap.channel),vertexTangents:!!k.attributes.tangent&&(Lt||B),vertexColors:y.vertexColors,vertexAlphas:y.vertexColors===!0&&!!k.attributes.color&&k.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!k.attributes.uv&&(ie||ht),fog:!!K,useFog:y.fog===!0,fogExp2:!!K&&K.isFogExp2,flatShading:y.flatShading===!0,sizeAttenuation:y.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:f,skinning:W.isSkinnedMesh===!0,morphTargets:k.morphAttributes.position!==void 0,morphNormals:k.morphAttributes.normal!==void 0,morphColors:k.morphAttributes.color!==void 0,morphTargetsCount:kt,morphTextureStride:Yt,numDirLights:b.directional.length,numPointLights:b.point.length,numSpotLights:b.spot.length,numSpotLightMaps:b.spotLightMap.length,numRectAreaLights:b.rectArea.length,numHemiLights:b.hemi.length,numDirLightShadows:b.directionalShadowMap.length,numPointLightShadows:b.pointShadowMap.length,numSpotLightShadows:b.spotShadowMap.length,numSpotLightShadowsWithMaps:b.numSpotLightShadowsWithMaps,numLightProbes:b.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:y.dithering,shadowMapEnabled:i.shadowMap.enabled&&G.length>0,shadowMapType:i.shadowMap.type,toneMapping:Ge,decodeVideoTexture:ie&&y.map.isVideoTexture===!0&&ee.getTransfer(y.map.colorSpace)===ce,premultipliedAlpha:y.premultipliedAlpha,doubleSided:y.side===Qn,flipSided:y.side===$e,useDepthPacking:y.depthPacking>=0,depthPacking:y.depthPacking||0,index0AttributeName:y.index0AttributeName,extensionCl
vendor: 13,642 bytes, lines 3787-3793
3787ipCullDistance:Ee&&y.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ee&&y.extensions.multiDraw===!0||Wt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:y.customProgramCacheKey()};return jt.vertexUv1s=c.has(1),jt.vertexUv2s=c.has(2),jt.vertexUv3s=c.has(3),c.clear(),jt}function E(y){const b=[];if(y.shaderID?b.push(y.shaderID):(b.push(y.customVertexShaderID),b.push(y.customFragmentShaderID)),y.defines!==void 0)for(const G in y.defines)b.push(G),b.push(y.defines[G]);return y.isRawShaderMaterial===!1&&(S(b,y),w(b,y),b.push(i.outputColorSpace)),b.push(y.customProgramCacheKey),b.join()}function S(y,b){y.push(b.precision),y.push(b.outputColorSpace),y.push(b.envMapMode),y.push(b.envMapCubeUVHeight),y.push(b.mapUv),y.push(b.alphaMapUv),y.push(b.lightMapUv),y.push(b.aoMapUv),y.push(b.bumpMapUv),y.push(b.normalMapUv),y.push(b.displacementMapUv),y.push(b.emissiveMapUv),y.push(b.metalnessMapUv),y.push(b.roughnessMapUv),y.push(b.anisotropyMapUv),y.push(b.clearcoatMapUv),y.push(b.clearcoatNormalMapUv),y.push(b.clearcoatRoughnessMapUv),y.push(b.iridescenceMapUv),y.push(b.iridescenceThicknessMapUv),y.push(b.sheenColorMapUv),y.push(b.sheenRoughnessMapUv),y.push(b.specularMapUv),y.push(b.specularColorMapUv),y.push(b.specularIntensityMapUv),y.push(b.transmissionMapUv),y.push(b.thicknessMapUv),y.push(b.combine),y.push(b.fogExp2),y.push(b.sizeAttenuation),y.push(b.morphTargetsCount),y.push(b.morphAttributeCount),y.push(b.numDirLights),y.push(b.numPointLights),y.push(b.numSpotLights),y.push(b.numSpotLightMaps),y.push(b.numHemiLights),y.push(b.numRectAreaLights),y.push(b.numDirLightShadows),y.push(b.numPointLightShadows),y.push(b.numSpotLightShadows),y.push(b.numSpotLightShadowsWithMaps),y.push(b.numLightProbes),y.push(b.shadowMapType),y.push(b.toneMapping),y.push(b.numClippingPlanes),y.push(b.numClipIntersection),y.push(b.depthPacking)}function w(y,b){a.disableAll(),b.supportsVertexTextures&&a.enable(0),b.instancing&&a.enable(1),b.instancingColor&&a.enable(2),b.instancingMorph&&a.enable(3),b.matcap&&a.enable(4),b.envMap&&a.enable(5),b.normalMapObjectSpace&&a.enable(6),b.normalMapTangentSpace&&a.enable(7),b.clearcoat&&a.enable(8),b.iridescence&&a.enable(9),b.alphaTest&&a.enable(10),b.vertexColors&&a.enable(11),b.vertexAlphas&&a.enable(12),b.vertexUv1s&&a.enable(13),b.vertexUv2s&&a.enable(14),b.vertexUv3s&&a.enable(15),b.vertexTangents&&a.enable(16),b.anisotropy&&a.enable(17),b.alphaHash&&a.enable(18),b.batching&&a.enable(19),b.dispersion&&a.enable(20),b.batchingColor&&a.enable(21),y.push(a.mask),a.disableAll(),b.fog&&a.enable(0),b.useFog&&a.enable(1),b.flatShading&&a.enable(2),b.logarithmicDepthBuffer&&a.enable(3),b.reverseDepthBuffer&&a.enable(4),b.skinning&&a.enable(5),b.morphTargets&&a.enable(6),b.morphNormals&&a.enable(7),b.morphColors&&a.enable(8),b.premultipliedAlpha&&a.enable(9),b.shadowMapEnabled&&a.enable(10),b.doubleSided&&a.enable(11),b.flipSided&&a.enable(12),b.useDepthPacking&&a.enable(13),b.dithering&&a.enable(14),b.transmission&&a.enable(15),b.sheen&&a.enable(16),b.opaque&&a.enable(17),b.pointsUvs&&a.enable(18),b.decodeVideoTexture&&a.enable(19),b.alphaToCoverage&&a.enable(20),y.push(a.mask)}function P(y){const b=v[y.type];let G;if(b){const z=On[b];G=i_.clone(z.uniforms)}else G=y.uniforms;return G}function R(y,b){let G;for(let z=0,W=h.length;z<W;z++){const K=h[z];if(K.cacheKey===b){G=K,++G.usedTimes;break}}return G===void 0&&(G=new gx(i,b,y,s),h.push(G)),G}function A(y){if(--y.usedTimes===0){const b=h.indexOf(y);h[b]=h[h.length-1],h.pop(),y.destroy()}}function L(y){l.remove(y)}function F(){l.dispose()}return{getParameters:g,getProgramCacheKey:E,getUniforms:P,acquireProgram:R,releaseProgram:A,releaseShaderCache:L,programs:h,dispose:F}}function Mx(){let i=new WeakMap;function t(o){return i.has(o)}function e(o){let a=i.get(o);return a===void 0&&(a={},i.set(o,a)),a}function n(o){i.delete(o)}function r(o,a,l){i.get(o)[a]=l}function s(){i=new WeakMap}return{has:t,get:e,remove:n,update:r,dispose:s}}function Ex(i,t){return i.groupOrder!==t.groupOrder?i.groupOrder-t.groupOrder:i.renderOrder!==t.renderOrder?i.renderOrder-t.renderOrder:i.material.id!==t.material.id?i.material.id-t.material.id:i.z!==t.z?i.z-t.z:i.id-t.id}function qh(i,t){return i.groupOrder!==t.groupOrder?i.groupOrder-t.groupOrder:i.renderOrder!==t.renderOrder?i.renderOrder-t.renderOrder:i.z!==t.z?t.z-i.z:i.id-t.id}function Yh(){const i=[];let t=0;const e=[],n=[],r=[];function s(){t=0,e.length=0,n.length=0,r.length=0}function o(u,f,p,x,v,m){let g=i[t];return g===void 0?(g={id:u.id,object:u,geometry:f,material:p,groupOrder:x,renderOrder:u.renderOrder,z:v,group:m},i[t]=g):(g.id=u.id,g.object=u,g.geometry=f,g.material=p,g.groupOrder=x,g.renderOrder=u.renderOrder,g.z=v,g.group=m),t++,g}function a(u,f,p,x,v,m){const g=o(u,f,p,x,v,m);p.transmission>0?n.push(g):p.transparent===!0?r.push(g):e.push(g)}function l(u,f,p,x,v,m){const g=o(u,f,p,x,v,m);p.transmission>0?n.unshift(g):p.transparent===!0?r.unshift(g):e.unshift(g)}function c(u,f){e.length>1&&e.sort(u||Ex),n.length>1&&n.sort(f||qh),r.length>1&&r.sort(f||qh)}function h(){for(let u=t,f=i.length;u<f;u++){const p=i[u];if(p.id===null)break;p.id=null,p.object=null,p.geometry=null,p.material=null,p.group=null}}return{opaque:e,transmissive:n,transparent:r,init:s,push:a,unshift:l,finish:h,sort:c}}function Tx(){let i=new WeakMap;function t(n,r){const s=i.get(n);let o;return s===void 0?(o=new Yh,i.set(n,[o])):r>=s.length?(o=new Yh,s.push(o)):o=s[r],o}function e(){i=new WeakMap}return{get:t,dispose:e}}function bx(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new U,color:new Kt};break;case"SpotLight":e={position:new U,direction:new U,color:new Kt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new U,color:new Kt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new U,skyColor:new Kt,groundColor:new Kt};break;case"RectAreaLight":e={color:new Kt,position:new U,halfWidth:new U,halfHeight:new U};break}return i[t.id]=e,e}}}function wx(){const i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new St};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new St};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new St,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[t.id]=e,e}}}let Ax=0;function Cx(i,t){return(t.castShadow?2:0)-(i.castShadow?2:0)+(t.map?1:0)-(i.map?1:0)}function Rx(i){const t=new bx,e=wx(),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 U);const r=new U,s=new me,o=new me;function a(c){let h=0,u=0,f=0;for(let F=0;F<9;F++)n.probe[F].set(0,0,0);let p=0,x=0,v=0,m=0,g=0,E=0,S=0,w=0,P=0,R=0,A=0;c.sort(Cx);for(let F=0,y=c.length;F<y;F++){const b=c[F],G=b.color,z=b.intensity,W=b.distance,K=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)h+=G.r*z,u+=G.g*z,f+=G.b*z;else if(b.isLightProbe){for(let k=0;k<9;k++)n.probe[k].addScaledVector(b.sh.coefficients[k],z);A++}else if(b.isDirectionalLight){const k=t.get(b);if(k.color.copy(b.color).multiplyScalar(b.intensity),b.castShadow){const j=b.shadow,X=e.get(b);X.shadowIntensity=j.intensity,X.shadowBias=j.bias,X.shadowNormalBias=j.normalBias,X.shadowRadius=j.radius,X.shadowMapSize=j.mapSize,n.directionalShadow[p]=X,n.directionalShadowMap[p]=K,n.directionalShadowMatrix[p]=b.shadow.matrix,E++}n.directional[p]=k,p++}else if(b.isSpotLight){const k=t.get(b);k.position.setFromMatrixPosition(b.matrixWorld),k.color.copy(G).multiplyScalar(z),k.distance=W,k.coneCos=Math.cos(b.angle),k.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),k.decay=b.decay,n.spot[v]=k;const j=b.shadow;if(b.map&&(n.spotLightMap[P]=b.map,P++,j.updateMatrices(b),b.castShadow&&R++),n.spotLightMatrix[v]=j.matrix,b.castShadow){const X=e.get(b);X.shadowIntensity=j.intensity,X.shadowBias=j.bias,X.shadowNormalBias=j.normalBias,X.shadowRadius=j.radius,X.shadowMapSize=j.mapSize,n.spotShadow[v]=X,n.spotShadowMap[v]=K,w++}v++}else if(b.isRectAreaLight){const k=t.get(b);k.color.copy(G).multiplyScalar(z),k.halfWidth.set(b.width*.5,0,0),k.halfHeight.set(0,b.height*.5,0),n.rectArea[m]=k,m++}else if(b.isPointLight){const k=t.get(b);if(k.color.copy(b.color).multiplyScalar(b.intensity),k.distance=b.distance,k.decay=b.decay,b.castShadow){const j=b.shadow,X=e.get(b);X.shadowIntensity=j.intensity,X.shadowBias=j.bias,X.shadowNormalBias=j.normalBias,X.shadowRadius=j.radius,X.shadowMapSize=j.mapSize,X.shadowCameraNear=j.camera.near,X.shadowCameraFar=j.camera.far,n.pointShadow[x]=X,n.pointShadowMap[x]=K,n.pointShadowMatrix[x]=b.shadow.matrix,S++}n.point[x]=k,x++}else if(b.isHemisphereLight){const k=t.get(b);k.skyColor.copy(b.color).multiplyScalar(z),k.groundColor.copy(b.groundColor).multiplyScalar(z),n.hemi[g]=k,g++}}m>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=st.LTC_FLOAT_1,n.rectAreaLTC2=st.LTC_FLOAT_2):(n.rectAreaLTC1=st.LTC_HALF_1,n.rectAreaLTC2=st.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=f;const L=n.hash;(L.directionalLength!==p||L.pointLength!==x||L.spotLength!==v||L.rectAreaLength!==m||L.hemiLength!==g||L.numDirectionalShadows!==E||L.numPointShadows!==S||L.numSpotShadows!==w||L.numSpotMaps!==P||L.numLightProbes!==A)&&(n.directional.length=p,n.spot.length=v,n.rectArea.length=m,n.point.length=x,n.hemi.length=g,n.directionalShadow.length=E,n.directionalShadowMap.length=E,n.pointShadow.length=S,n.pointShadowMap.length=S,n.spotShadow.length=w,n.spotShadowMap.length=w,n.directionalShadowMatrix.length=E,n.pointShadowMatrix.length=S,n.spotLightMatrix.length=w+P-R,n.spotLightMap.length=P,n.numSpotLightShadowsWithMaps=R,n.numLightProbes=A,L.directionalLength=p,L.pointLength=x,L.spotLength=v,L.rectAreaLength=m,L.hemiLength=g,L.numDirectionalShadows=E,L.numPointShadows=S,L.numSpotShadows=w,L.numSpotMaps=P,L.numLightProbes=A,n.version=Ax++)}function l(c,h){let u=0,f=0,p=0,x=0,v=0;const m=h.matrixWorldInverse;for(let g=0,E=c.length;g<E;g++){const S=c[g];if(S.isDirectionalLight){const w=n.directional[u];w.direction.setFromMatrixPosition(S.matrixWorld),r.setFromMatrixPosition(S.target.matrixWorld),w.direction.sub(r),w.direction.transformDirection(m),u++}else if(S.isSpotLight){const w=n.spot[p];w.position.setFromMatrixPosition(S.matrixWorld),w.position.applyMatrix4(m),w.direction.setFromMatrixPosition(S.matrixWorld),r.setFromMatrixPosition(S.target.matrixWorld),w.direction.sub(r),w.direction.transformDirection(m),p++}else if(S.isRectAreaLight){const w=n.rectArea[x];w.position.setFromMatrixPosition(S.matrixWorld),w.position.applyMatrix4(m),o.identity(),s.copy(S.matrixWorld),s.premultiply(m),o.extractRotation(s),w.halfWidth.set(S.width*.5,0,0),w.halfHeight.set(0,S.height*.5,0),w.halfWidth.applyMatrix4(o),w.halfHeight.applyMatrix4(o),x++}else if(S.isPointLight){const w=n.point[f];w.position.setFromMatrixPosition(S.matrixWorld),w.position.applyMatrix4(m),f++}else if(S.isHemisphereLight){const w=n.hemi[v];w.direction.setFromMatrixPosition(S.matrixWorld),w.direction.transformDirection(m),v++}}}return{setup:a,setupView:l,state:n}}function $h(i){const t=new Rx(i),e=[],n=[];function r(h){c.camera=h,e.length=0,n.length=0}function s(h){e.push(h)}function o(h){n.push(h)}function a(){t.setup(e)}function l(h){t.setupView(e,h)}const c={lightsArray:e,shadowsArray:n,camera:null,lights:t,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function Px(i){let t=new WeakMap;function e(r,s=0){const o=t.get(r);let a;return o===void 0?(a=new $h(i),t.set(r,[a])):s>=o.length?(a=new $h(i),o.push(a)):a=o[s],a}function n(){t=new WeakMap}return{get:e,dispose:n}}class Lx extends Qr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=lm,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Ix extends Qr{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}}const Dx=`void main() { 3788 gl_Position = vec4( position, 1.0 ); 3789}`,Ux=`uniform sampler2D shadow_pass; 3790uniform vec2 resolution; 3791uniform float radius; 3792#include <packing> 3793void main() {
3794 const float samples = float( VSM_SAMPLES ); 3795 float mean = 0.0; 3796 float squared_mean = 0.0; 3797 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 3798 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 3799 for ( float i = 0.0; i < samples; i ++ ) { 3800 float uvOffset = uvStart + i * uvStride; 3801 #ifdef HORIZONTAL_PASS 3802 vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); 3803 mean += distribution.x; 3804 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 3805 #else 3806 float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); 3807 mean += depth; 3808 squared_mean += depth * depth; 3809 #endif 3810 } 3811 mean = mean / samples; 3812 squared_mean = squared_mean / samples; 3813 float std_dev = sqrt( squared_mean - mean * mean ); 3814 gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); 3815}`;function Nx(i,t,e){let n=new Ju;const r=new St,s=new St,o=new Me,a=new Lx({depthPacking:cm}),l=new Ix,c={},h=e.maxTextureSize,u={[Ci]:$e,[$e]:Ci,[Qn]:Qn},f=new si({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new St},radius:{value:4}},vertexShader:Dx,fragmentShader:Ux}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const x=new En;x.setAttribute("position",new we(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new zn(x,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ru;let g=this.type;this.render=function(R,A,L){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||R.length===0)return;const F=i.getRenderTarget(),y=i.getActiveCubeFace(),b=i.getActiveMipmapLevel(),G=i.state;G.setBlending(Ti),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const z=g!==Kn&&this.type===Kn,W=g===Kn&&this.type!==Kn;for(let K=0,k=R.length;K<k;K++){const j=R[K],X=j.shadow;if(X===void 0){console.warn("THREE.WebGLShadowMap:",j,"has no shadow.");continue}if(X.autoUpdate===!1&&X.needsUpdate===!1)continue;r.copy(X.mapSize);const lt=X.getFrameExtents();if(r.multiply(lt),s.copy(X.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/lt.x),r.x=s.x*lt.x,X.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/lt.y),r.y=s.y*lt.y,X.mapSize.y=s.y)),X.map===null||z===!0||W===!0){const pt=this.type!==Kn?{minFilter:xn,magFilter:xn}:{};X.map!==null&&X.map.dispose(),X.map=new Ri(r.x,r.y,pt),X.map.texture.name=j.name+".shadowMap",X.camera.updateProjectionMatrix()}i.setRenderTarget(X.map),i.clear();const ct=X.getViewportCount();for(let pt=0;pt<ct;pt++){const kt=X.getViewport(pt);o.set(s.x*kt.x,s.y*kt.y,s.x*kt.z,s.y*kt.w),G.viewport(o),X.updateMatrices(j,pt),n=X.getFrustum(),w(A,L,X.camera,j,this.type)}X.isPointLightShadow!==!0&&this.type===Kn&&E(X,L),X.needsUpdate=!1}g=this.type,m.needsUpdate=!1,i.setRenderTarget(F,y,b)};function E(R,A){const L=t.update(v);f.defines.VSM_SAMPLES!==R.blurSamples&&(f.defines.VSM_SAMPLES=R.blurSamples,p.defines.VSM_SAMPLES=R.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),R.mapPass===null&&(R.mapPass=new Ri(r.x,r.y)),f.uniforms.shadow_pass.value=R.map.texture,f.uniforms.resolution.value=R.mapSize,f.uniforms.radius.value=R.radius,i.setRenderTarget(R.mapPass),i.clear(),i.renderBufferDirect(A,null,L,f,v,null),p.uniforms.shadow_pass.value=R.mapPass.texture,p.uniforms.resolution.value=R.mapSize,p.uniforms.radius.value=R.radius,i.setRenderTarget(R.map),i.clear(),i.renderBufferDirect(A,null,L,p,v,null)}function S(R,A,L,F){let y=null;const b=L.isPointLight===!0?R.customDistanceMaterial:R.customDepthMaterial;if(b!==void 0)y=b;else if(y=L.isPointLight===!0?l:a,i.localClippingEnabled&&A.clipShadows===!0&&Array.isArray(A.clippingPlanes)&&A.clippingPlanes.length!==0||A.displacementMap&&A.displacementScale!==0||A.alphaMap&&A.alphaTest>0||A.map&&A.alphaTest>0){const G=y.uuid,z=A.uuid;let W=c[G];W===void 0&&(W={},c[G]=W);let K=W[z];K===void 0&&(K=y.clone(),W[z]=K,A.addEventListener("dispose",P)),y=K}if(y.visible=A.visible,y.wireframe=A.wireframe,F===Kn?y.side=A.shadowSide!==null?A.shadowSide:A.side:y.side=A.shadowSide!==null?A.shadowSide:u[A.side],y.alphaMap=A.alphaMap,y.alphaTest=A.alphaTest,y.map=A.map,y.clipShadows=A.clipSh
vendor: 5,614 bytes, line 3815
3815adows,y.clippingPlanes=A.clippingPlanes,y.clipIntersection=A.clipIntersection,y.displacementMap=A.displacementMap,y.displacementScale=A.displacementScale,y.displacementBias=A.displacementBias,y.wireframeLinewidth=A.wireframeLinewidth,y.linewidth=A.linewidth,L.isPointLight===!0&&y.isMeshDistanceMaterial===!0){const G=i.properties.get(y);G.light=L}return y}function w(R,A,L,F,y){if(R.visible===!1)return;if(R.layers.test(A.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&y===Kn)&&(!R.frustumCulled||n.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,R.matrixWorld);const z=t.update(R),W=R.material;if(Array.isArray(W)){const K=z.groups;for(let k=0,j=K.length;k<j;k++){const X=K[k],lt=W[X.materialIndex];if(lt&<.visible){const ct=S(R,lt,F,y);R.onBeforeShadow(i,R,A,L,z,ct,X),i.renderBufferDirect(L,null,z,ct,R,X),R.onAfterShadow(i,R,A,L,z,ct,X)}}}else if(W.visible){const K=S(R,W,F,y);R.onBeforeShadow(i,R,A,L,z,K,null),i.renderBufferDirect(L,null,z,K,R,null),R.onAfterShadow(i,R,A,L,z,K,null)}}const G=R.children;for(let z=0,W=G.length;z<W;z++)w(G[z],A,L,F,y)}function P(R){R.target.removeEventListener("dispose",P);for(const L in c){const F=c[L],y=R.target.uuid;y in F&&(F[y].dispose(),delete F[y])}}}const Ox={[nl]:il,[rl]:al,[sl]:ll,[kr]:ol,[il]:nl,[al]:rl,[ll]:sl,[ol]:kr};function Fx(i){function t(){let D=!1;const dt=new Me;let q=null;const J=new Me(0,0,0,0);return{setMask:function(ht){q!==ht&&!D&&(i.colorMask(ht,ht,ht,ht),q=ht)},setLocked:function(ht){D=ht},setClear:function(ht,ft,qt,Ee,Ge){Ge===!0&&(ht*=Ee,ft*=Ee,qt*=Ee),dt.set(ht,ft,qt,Ee),J.equals(dt)===!1&&(i.clearColor(ht,ft,qt,Ee),J.copy(dt))},reset:function(){D=!1,q=null,J.set(-1,0,0,0)}}}function e(){let D=!1,dt=!1,q=null,J=null,ht=null;return{setReversed:function(ft){dt=ft},setTest:function(ft){ft?Mt(i.DEPTH_TEST):mt(i.DEPTH_TEST)},setMask:function(ft){q!==ft&&!D&&(i.depthMask(ft),q=ft)},setFunc:function(ft){if(dt&&(ft=Ox[ft]),J!==ft){switch(ft){case nl:i.depthFunc(i.NEVER);break;case il:i.depthFunc(i.ALWAYS);break;case rl:i.depthFunc(i.LESS);break;case kr:i.depthFunc(i.LEQUAL);break;case sl:i.depthFunc(i.EQUAL);break;case ol:i.depthFunc(i.GEQUAL);break;case al:i.depthFunc(i.GREATER);break;case ll:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}J=ft}},setLocked:function(ft){D=ft},setClear:function(ft){ht!==ft&&(i.clearDepth(ft),ht=ft)},reset:function(){D=!1,q=null,J=null,ht=null}}}function n(){let D=!1,dt=null,q=null,J=null,ht=null,ft=null,qt=null,Ee=null,Ge=null;return{setTest:function(jt){D||(jt?Mt(i.STENCIL_TEST):mt(i.STENCIL_TEST))},setMask:function(jt){dt!==jt&&!D&&(i.stencilMask(jt),dt=jt)},setFunc:function(jt,We,Wn){(q!==jt||J!==We||ht!==Wn)&&(i.stencilFunc(jt,We,Wn),q=jt,J=We,ht=Wn)},setOp:function(jt,We,Wn){(ft!==jt||qt!==We||Ee!==Wn)&&(i.stencilOp(jt,We,Wn),ft=jt,qt=We,Ee=Wn)},setLocked:function(jt){D=jt},setClear:function(jt){Ge!==jt&&(i.clearStencil(jt),Ge=jt)},reset:function(){D=!1,dt=null,q=null,J=null,ht=null,ft=null,qt=null,Ee=null,Ge=null}}}const r=new t,s=new e,o=new n,a=new WeakMap,l=new WeakMap;let c={},h={},u=new WeakMap,f=[],p=null,x=!1,v=null,m=null,g=null,E=null,S=null,w=null,P=null,R=new Kt(0,0,0),A=0,L=!1,F=null,y=null,b=null,G=null,z=null;const W=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let K=!1,k=0;const j=i.getParameter(i.VERSION);j.indexOf("WebGL")!==-1?(k=parseFloat(/^WebGL (\d)/.exec(j)[1]),K=k>=1):j.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),K=k>=2);let X=null,lt={};const ct=i.getParameter(i.SCISSOR_BOX),pt=i.getParameter(i.VIEWPORT),kt=new Me().fromArray(ct),Yt=new Me().fromArray(pt);function Y(D,dt,q,J){const ht=new Uint8Array(4),ft=i.createTexture();i.bindTexture(D,ft),i.texParameteri(D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(D,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let qt=0;qt<q;qt++)D===i.TEXTURE_3D||D===i.TEXTURE_2D_ARRAY?i.texImage3D(dt,0,i.RGBA,1,1,J,0,i.RGBA,i.UNSIGNED_BYTE,ht):i.texImage2D(dt+qt,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,ht);return ft}const Q={};Q[i.TEXTURE_2D]=Y(i.TEXTURE_2D,i.TEXTURE_2D,1),Q[i.TEXTURE_CUBE_MAP]=Y(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),Q[i.TEXTURE_2D_ARRAY]=Y(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),Q[i.TEXTURE_3D]=Y(i.TEXTURE_3D,i.TEXTURE_3D,1,1),r.setClear(0,0,0,1),s.setClear(1),o.setClear(0),Mt(i.DEPTH_TEST),s.setFunc(kr),Vt(!1),$t(th),Mt(i.CULL_FACE),I(Ti);function Mt(D){c[D]!==!0&&(i.enable(D),c[D]=!0)}function mt(D){c[D]!==!1&&(i.disable(D),c[D]=!1)}function Nt(D,dt){return h[D]!==dt?(i.bindFramebuffer(D,dt),h[D]=dt,D===i.DRAW_FRAMEBUFFER&&(h[i.FRAMEBUFFER]=dt),D===i.FRAMEBUFFER&&(h[i.DRAW_FRAMEBUFFER]=dt),!0):!1}function Rt(D,dt){let q=f,J=!1;if(D){q=u.get(dt),q===void 0&&(q=[],u.set(dt,q));const ht=D.textures;if(q.length!==ht.length||q[0]!==i.COLOR_ATTACHMENT0){for(let ft=0,qt=ht.length;ft<qt;ft++)q[ft]=i.COLOR_ATTACHMENT0+ft;q.length=ht.length,J=!0}}else q[0]!==i.BACK&&(q[0]=i.BACK,J=!0);J&&i.drawBuffers(q)}function Wt(D){return p!==D?(i.useProgram(D),p=D,!0):!1}const ie={[Ji]:i.FUNC_ADD,[Np]:i.FUNC_SUBTRACT,[Op]:i.FUNC_REVERSE_SUBTRACT};ie[Fp]=i.MIN,ie[zp]=i.MAX;const Xt={[Bp]:i.ZERO,[kp]:i.ONE,[Hp]:i.SRC_COLOR,[tl]:i.SRC_ALPHA,[Yp]:i.SRC_ALPHA_SATURATE,[Xp]:i.DST_COLOR,[Gp]:i.DST_ALPHA,[Vp]:i.ONE_MINUS_SRC_COLOR,[el]:i.ONE_MINUS_SRC_ALPHA,[qp]:i.ONE_MINUS_DST_COLOR,[Wp]:i.ONE_MINUS_DST_ALPHA,[$p]:i.CONSTANT_COLOR,[Zp]:i.ONE_MINUS_CONSTANT_COLOR,[Kp]:i.CONSTANT_ALPHA,[jp]:i.ONE_MINUS_CONSTANT_ALPHA};function I(D,dt,q,J,ht,ft,qt,Ee,Ge,jt){if(D===Ti){x===!0&&(mt(i.BLEND),x=!1);return}if(x===!1&&(Mt(i.BLEND),x=!0),D!==Up){if(D!==v||jt!==L){if((m!==Ji||S!==Ji)&&
vendor: 4,450 bytes, line 3815
3815(i.blendEquation(i.FUNC_ADD),m=Ji,S=Ji),jt)switch(D){case Ur:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case eh:i.blendFunc(i.ONE,i.ONE);break;case nh:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case ih:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",D);break}else switch(D){case Ur:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case eh:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case nh:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case ih:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",D);break}g=null,E=null,w=null,P=null,R.set(0,0,0),A=0,v=D,L=jt}return}ht=ht||dt,ft=ft||q,qt=qt||J,(dt!==m||ht!==S)&&(i.blendEquationSeparate(ie[dt],ie[ht]),m=dt,S=ht),(q!==g||J!==E||ft!==w||qt!==P)&&(i.blendFuncSeparate(Xt[q],Xt[J],Xt[ft],Xt[qt]),g=q,E=J,w=ft,P=qt),(Ee.equals(R)===!1||Ge!==A)&&(i.blendColor(Ee.r,Ee.g,Ee.b,Ge),R.copy(Ee),A=Ge),v=D,L=!1}function tn(D,dt){D.side===Qn?mt(i.CULL_FACE):Mt(i.CULL_FACE);let q=D.side===$e;dt&&(q=!q),Vt(q),D.blending===Ur&&D.transparent===!1?I(Ti):I(D.blending,D.blendEquation,D.blendSrc,D.blendDst,D.blendEquationAlpha,D.blendSrcAlpha,D.blendDstAlpha,D.blendColor,D.blendAlpha,D.premultipliedAlpha),s.setFunc(D.depthFunc),s.setTest(D.depthTest),s.setMask(D.depthWrite),r.setMask(D.colorWrite);const J=D.stencilWrite;o.setTest(J),J&&(o.setMask(D.stencilWriteMask),o.setFunc(D.stencilFunc,D.stencilRef,D.stencilFuncMask),o.setOp(D.stencilFail,D.stencilZFail,D.stencilZPass)),ae(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),D.alphaToCoverage===!0?Mt(i.SAMPLE_ALPHA_TO_COVERAGE):mt(i.SAMPLE_ALPHA_TO_COVERAGE)}function Vt(D){F!==D&&(D?i.frontFace(i.CW):i.frontFace(i.CCW),F=D)}function $t(D){D!==Lp?(Mt(i.CULL_FACE),D!==y&&(D===th?i.cullFace(i.BACK):D===Ip?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):mt(i.CULL_FACE),y=D}function Lt(D){D!==b&&(K&&i.lineWidth(D),b=D)}function ae(D,dt,q){D?(Mt(i.POLYGON_OFFSET_FILL),(G!==dt||z!==q)&&(i.polygonOffset(dt,q),G=dt,z=q)):mt(i.POLYGON_OFFSET_FILL)}function Ut(D){D?Mt(i.SCISSOR_TEST):mt(i.SCISSOR_TEST)}function C(D){D===void 0&&(D=i.TEXTURE0+W-1),X!==D&&(i.activeTexture(D),X=D)}function M(D,dt,q){q===void 0&&(X===null?q=i.TEXTURE0+W-1:q=X);let J=lt[q];J===void 0&&(J={type:void 0,texture:void 0},lt[q]=J),(J.type!==D||J.texture!==dt)&&(X!==q&&(i.activeTexture(q),X=q),i.bindTexture(D,dt||Q[D]),J.type=D,J.texture=dt)}function B(){const D=lt[X];D!==void 0&&D.type!==void 0&&(i.bindTexture(D.type,null),D.type=void 0,D.texture=void 0)}function Z(){try{i.compressedTexImage2D.apply(i,arguments)}catch(D){console.error("THREE.WebGLState:",D)}}function tt(){try{i.compressedTexImage3D.apply(i,arguments)}catch(D){console.error("THREE.WebGLState:",D)}}function $(){try{i.texSubImage2D.apply(i,arguments)}catch(D){console.error("THREE.WebGLState:",D)}}function Tt(){try{i.texSubImage3D.apply(i,arguments)}catch(D){console.error("THREE.WebGLState:",D)}}function at(){try{i.compressedTexSubImage2D.apply(i,arguments)}catch(D){console.error("THREE.WebGLState:",D)}}function _t(){try{i.compressedTexSubImage3D.apply(i,arguments)}catch(D){console.error("THREE.WebGLState:",D)}}function Zt(){try{i.texStorage2D.apply(i,arguments)}catch(D){console.error("THREE.WebGLState:",D)}}function et(){try{i.texStorage3D.apply(i,arguments)}catch(D){console.error("THREE.WebGLState:",D)}}function gt(){try{i.texImage2D.apply(i,arguments)}catch(D){console.error("THREE.WebGLState:",D)}}function It(){try{i.texImage3D.apply(i,arguments)}catch(D){console.error("THREE.WebGLState:",D)}}function Dt(D){kt.equals(D)===!1&&(i.scissor(D.x,D.y,D.z,D.w),kt.copy(D))}function vt(D){Yt.equals(D)===!1&&(i.viewport(D.x,D.y,D.z,D.w),Yt.copy(D))}function Gt(D,dt){let q=l.get(dt);q===void 0&&(q=new WeakMap,l.set(dt,q));let J=q.get(D);J===void 0&&(J=i.getUniformBlockIndex(dt,D.name),q.set(D,J))}function Ot(D,dt){const J=l.get(dt).get(D);a.get(dt)!==J&&(i.uniformBlockBinding(dt,J,D.__bindingPointIndex),a.set(dt,J))}function oe(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor
vendor: 7,598 bytes, line 3815
3815(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),c={},X=null,lt={},h={},u=new WeakMap,f=[],p=null,x=!1,v=null,m=null,g=null,E=null,S=null,w=null,P=null,R=new Kt(0,0,0),A=0,L=!1,F=null,y=null,b=null,G=null,z=null,kt.set(0,0,i.canvas.width,i.canvas.height),Yt.set(0,0,i.canvas.width,i.canvas.height),r.reset(),s.reset(),o.reset()}return{buffers:{color:r,depth:s,stencil:o},enable:Mt,disable:mt,bindFramebuffer:Nt,drawBuffers:Rt,useProgram:Wt,setBlending:I,setMaterial:tn,setFlipSided:Vt,setCullFace:$t,setLineWidth:Lt,setPolygonOffset:ae,setScissorTest:Ut,activeTexture:C,bindTexture:M,unbindTexture:B,compressedTexImage2D:Z,compressedTexImage3D:tt,texImage2D:gt,texImage3D:It,updateUBOMapping:Gt,uniformBlockBinding:Ot,texStorage2D:Zt,texStorage3D:et,texSubImage2D:$,texSubImage3D:Tt,compressedTexSubImage2D:at,compressedTexSubImage3D:_t,scissor:Dt,viewport:vt,reset:oe}}function Zh(i,t,e,n){const r=zx(n);switch(e){case Nu:return i*t;case Fu:return i*t;case zu:return i*t*2;case Bu:return i*t/r.components*r.byteLength;case oc:return i*t/r.components*r.byteLength;case ku:return i*t*2/r.components*r.byteLength;case ac:return i*t*2/r.components*r.byteLength;case Ou:return i*t*3/r.components*r.byteLength;case In:return i*t*4/r.components*r.byteLength;case lc:return i*t*4/r.components*r.byteLength;case Mo:case Eo:return Math.floor((i+3)/4)*Math.floor((t+3)/4)*8;case To:case bo:return Math.floor((i+3)/4)*Math.floor((t+3)/4)*16;case pl:case _l:return Math.max(i,16)*Math.max(t,8)/4;case fl:case ml:return Math.max(i,8)*Math.max(t,8)/2;case gl:case vl:return Math.floor((i+3)/4)*Math.floor((t+3)/4)*8;case xl:return Math.floor((i+3)/4)*Math.floor((t+3)/4)*16;case yl:return Math.floor((i+3)/4)*Math.floor((t+3)/4)*16;case Sl:return Math.floor((i+4)/5)*Math.floor((t+3)/4)*16;case Ml:return Math.floor((i+4)/5)*Math.floor((t+4)/5)*16;case El:return Math.floor((i+5)/6)*Math.floor((t+4)/5)*16;case Tl:return Math.floor((i+5)/6)*Math.floor((t+5)/6)*16;case bl:return Math.floor((i+7)/8)*Math.floor((t+4)/5)*16;case wl:return Math.floor((i+7)/8)*Math.floor((t+5)/6)*16;case Al:return Math.floor((i+7)/8)*Math.floor((t+7)/8)*16;case Cl:return Math.floor((i+9)/10)*Math.floor((t+4)/5)*16;case Rl:return Math.floor((i+9)/10)*Math.floor((t+5)/6)*16;case Pl:return Math.floor((i+9)/10)*Math.floor((t+7)/8)*16;case Ll:return Math.floor((i+9)/10)*Math.floor((t+9)/10)*16;case Il:return Math.floor((i+11)/12)*Math.floor((t+9)/10)*16;case Dl:return Math.floor((i+11)/12)*Math.floor((t+11)/12)*16;case wo:case Ul:case Nl:return Math.ceil(i/4)*Math.ceil(t/4)*16;case Hu:case Ol:return Math.ceil(i/4)*Math.ceil(t/4)*8;case Fl:case zl:return Math.ceil(i/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function zx(i){switch(i){case ii:case Iu:return{byteLength:1,components:1};case Ms:case Du:case Ds:return{byteLength:2,components:1};case rc:case sc:return{byteLength:2,components:4};case ar:case ic:case ti:return{byteLength:4,components:1};case Uu:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}function Bx(i,t,e,n,r,s,o){const 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 St,h=new WeakMap;let u;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(C,M){return p?new OffscreenCanvas(C,M):Fo("canvas")}function v(C,M,B){let Z=1;const tt=Ut(C);if((tt.width>B||tt.height>B)&&(Z=B/Math.max(tt.width,tt.height)),Z<1)if(typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&C instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&C instanceof ImageBitmap||typeof VideoFrame<"u"&&C instanceof VideoFrame){const $=Math.floor(Z*tt.width),Tt=Math.floor(Z*tt.height);u===void 0&&(u=x($,Tt));const at=M?x($,Tt):u;return at.width=$,at.height=Tt,at.getContext("2d").drawImage(C,0,0,$,Tt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+tt.width+"x"+tt.height+") to ("+$+"x"+Tt+")."),at}else return"data"in C&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+tt.width+"x"+tt.height+")."),C;return C}function m(C){return C.generateMipmaps&&C.minFilter!==xn&&C.minFilter!==qe}function g(C){i.generateMipmap(C)}function E(C,M,B,Z,tt=!1){if(C!==null){if(i[C]!==void 0)return i[C];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+C+"'")}let $=M;if(M===i.RED&&(B===i.FLOAT&&($=i.R32F),B===i.HALF_FLOAT&&($=i.R16F),B===i.UNSIGNED_BYTE&&($=i.R8)),M===i.RED_INTEGER&&(B===i.UNSIGNED_BYTE&&($=i.R8UI),B===i.UNSIGNED_SHORT&&($=i.R16UI),B===i.UNSIGNED_INT&&($=i.R32UI),B===i.BYTE&&($=i.R8I),B===i.SHORT&&($=i.R16I),B===i.INT&&($=i.R32I)),M===i.RG&&(B===i.FLOAT&&($=i.RG32F),B===i.HALF_FLOAT&&($=i.RG16F),B===i.UNSIGNED_BYTE&&($=i.RG8)),M===i.RG_INTEGER&&(B===i.UNSIGNED_BYTE&&($=i.RG8UI),B===i.UNSIGNED_SHORT&&($=i.RG16UI),B===i.UNSIGNED_INT&&($=i.RG32UI),B===i.BYTE&&($=i.RG8I),B===i.SHORT&&($=i.RG16I),B===i.INT&&($=i.RG32I)),M===i.RGB_INTEGER&&(B===i.UNSIGNED_BYTE&&($=i.RGB8UI),B===i.UNSIGNED_SHORT&&($=i.RGB16UI),B===i.UNSIGNED_INT&&($=i.RGB32UI),B===i.BYTE&&($=i.RGB8I),B===i.SHORT&&($=i.RGB16I),B===i.INT&&($=i.RGB32I)),M===i.RGBA_INTEGER&&(B===i.UNSIGNED_BYTE&&($=i.RGBA8UI),B===i.UNSIGNED_SHORT&&($=i.RGBA16UI),B===i.UNSIGNED_INT&&($=i.RGBA32UI),B===i.BYTE&&($=i.RGBA8I),B===i.SHORT&&($=i.RGBA16I),B===i.INT&&($=i.RGBA32I)),M===i.RGB&&B===i.UNSIGNED_INT_5_9_9_9_REV&&($=i.RGB9_E5),M===i.RGBA){const Tt=tt?Do:ee.getTransfer(Z);B===i.FLOAT&&($=i.RGBA32F),B===i.HALF_FLOAT&&($=i.RGBA16F),B===i.UNSIGNED_BYTE&&($=Tt===ce?i.SRGB8_ALPHA8:i.RGBA8),B===i.UNSIGNED_SHORT_4_4_4_4&&($=i.RGBA4),B===i.UNSIGNED_SHORT_5_5_5_1&&($=i.RGB5_A1)}return($===i.R16F||$===i.R32F||$===i.RG16F||$===i.RG32F||$===i.RGBA16F||$===i.RGBA32F)&&t.get("EXT_color_buffer_float"),$}function S(C,M){let B;return C?M===null||M===ar||M===Gr?B=i.DEPTH24_STENCIL8:M===ti?B=i.DEPTH32F_STENCIL8:M===Ms&&(B=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):M===null||M===ar||M===Gr?B=i.DEPTH_COMPONENT24:M===ti?B=i.DEPTH_COMPONENT32F:M===Ms&&(B=i.DEPTH_COMPONENT16),B}function w(C,M){return m(C)===!0||C.isFramebufferTexture&&C.minFilter!==xn&&C.minFilter!==qe?Math.log2(Math.max(M.width,M.height))+1:C.mipmaps!==void 0&&C.mipmaps.length>0?C.mipmaps.length:C.isCompressedTexture&&Array.isArray(C.image)?M.mipmaps.length:1}function P(C){const M=C.target;M.removeEventListener("dispose",P),A(M),M.isVideoTexture&&h.delete(M)}function R(C){const M=C.target;M.removeEventListener("dispose",R),F(M)}function A(C){const M=n.get(C);if(M.__webglInit===void 0)return;const B=C.source,Z=f.get(B);if(Z){const tt=Z[M.__cacheKey];tt.usedTimes--,tt.usedTimes===0&&L(C),Object.keys(Z).length===0&&f.delete(B)}n.remove(C)}function L(C){const M=n.get(C);i.deleteTexture(M.__webglTexture);const B=C.source,Z=f.get(B);delete Z[M.__cacheKey],o.memory.textures--}function F(C){const M=n.get(C);
vendor: 5,511 bytes, line 3815
3815if(C.depthTexture&&C.depthTexture.dispose(),C.isWebGLCubeRenderTarget)for(let Z=0;Z<6;Z++){if(Array.isArray(M.__webglFramebuffer[Z]))for(let tt=0;tt<M.__webglFramebuffer[Z].length;tt++)i.deleteFramebuffer(M.__webglFramebuffer[Z][tt]);else i.deleteFramebuffer(M.__webglFramebuffer[Z]);M.__webglDepthbuffer&&i.deleteRenderbuffer(M.__webglDepthbuffer[Z])}else{if(Array.isArray(M.__webglFramebuffer))for(let Z=0;Z<M.__webglFramebuffer.length;Z++)i.deleteFramebuffer(M.__webglFramebuffer[Z]);else i.deleteFramebuffer(M.__webglFramebuffer);if(M.__webglDepthbuffer&&i.deleteRenderbuffer(M.__webglDepthbuffer),M.__webglMultisampledFramebuffer&&i.deleteFramebuffer(M.__webglMultisampledFramebuffer),M.__webglColorRenderbuffer)for(let Z=0;Z<M.__webglColorRenderbuffer.length;Z++)M.__webglColorRenderbuffer[Z]&&i.deleteRenderbuffer(M.__webglColorRenderbuffer[Z]);M.__webglDepthRenderbuffer&&i.deleteRenderbuffer(M.__webglDepthRenderbuffer)}const B=C.textures;for(let Z=0,tt=B.length;Z<tt;Z++){const $=n.get(B[Z]);$.__webglTexture&&(i.deleteTexture($.__webglTexture),o.memory.textures--),n.remove(B[Z])}n.remove(C)}let y=0;function b(){y=0}function G(){const C=y;return C>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+C+" texture units while this GPU supports only "+r.maxTextures),y+=1,C}function z(C){const M=[];return M.push(C.wrapS),M.push(C.wrapT),M.push(C.wrapR||0),M.push(C.magFilter),M.push(C.minFilter),M.push(C.anisotropy),M.push(C.internalFormat),M.push(C.format),M.push(C.type),M.push(C.generateMipmaps),M.push(C.premultiplyAlpha),M.push(C.flipY),M.push(C.unpackAlignment),M.push(C.colorSpace),M.join()}function W(C,M){const B=n.get(C);if(C.isVideoTexture&&Lt(C),C.isRenderTargetTexture===!1&&C.version>0&&B.__version!==C.version){const Z=C.image;if(Z===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Z.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Yt(B,C,M);return}}e.bindTexture(i.TEXTURE_2D,B.__webglTexture,i.TEXTURE0+M)}function K(C,M){const B=n.get(C);if(C.version>0&&B.__version!==C.version){Yt(B,C,M);return}e.bindTexture(i.TEXTURE_2D_ARRAY,B.__webglTexture,i.TEXTURE0+M)}function k(C,M){const B=n.get(C);if(C.version>0&&B.__version!==C.version){Yt(B,C,M);return}e.bindTexture(i.TEXTURE_3D,B.__webglTexture,i.TEXTURE0+M)}function j(C,M){const B=n.get(C);if(C.version>0&&B.__version!==C.version){Y(B,C,M);return}e.bindTexture(i.TEXTURE_CUBE_MAP,B.__webglTexture,i.TEXTURE0+M)}const X={[ul]:i.REPEAT,[tr]:i.CLAMP_TO_EDGE,[dl]:i.MIRRORED_REPEAT},lt={[xn]:i.NEAREST,[am]:i.NEAREST_MIPMAP_NEAREST,[Gs]:i.NEAREST_MIPMAP_LINEAR,[qe]:i.LINEAR,[ca]:i.LINEAR_MIPMAP_NEAREST,[er]:i.LINEAR_MIPMAP_LINEAR},ct={[dm]:i.NEVER,[vm]:i.ALWAYS,[fm]:i.LESS,[Vu]:i.LEQUAL,[pm]:i.EQUAL,[gm]:i.GEQUAL,[mm]:i.GREATER,[_m]:i.NOTEQUAL};function pt(C,M){if(M.type===ti&&t.has("OES_texture_float_linear")===!1&&(M.magFilter===qe||M.magFilter===ca||M.magFilter===Gs||M.magFilter===er||M.minFilter===qe||M.minFilter===ca||M.minFilter===Gs||M.minFilter===er)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(C,i.TEXTURE_WRAP_S,X[M.wrapS]),i.texParameteri(C,i.TEXTURE_WRAP_T,X[M.wrapT]),(C===i.TEXTURE_3D||C===i.TEXTURE_2D_ARRAY)&&i.texParameteri(C,i.TEXTURE_WRAP_R,X[M.wrapR]),i.texParameteri(C,i.TEXTURE_MAG_FILTER,lt[M.magFilter]),i.texParameteri(C,i.TEXTURE_MIN_FILTER,lt[M.minFilter]),M.compareFunction&&(i.texParameteri(C,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(C,i.TEXTURE_COMPARE_FUNC,ct[M.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(M.magFilter===xn||M.minFilter!==Gs&&M.minFilter!==er||M.type===ti&&t.has("OES_texture_float_linear")===!1)return;if(M.anisotropy>1||n.get(M).__currentAnisotropy){const B=t.get("EXT_texture_filter_anisotropic");i.texParameterf(C,B.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(M.anisotropy,r.getMaxAnisotropy())),n.get(M).__currentAnisotropy=M.anisotropy}}}function kt(C,M){let B=!1;C.__webglInit===void 0&&(C.__webglInit=!0,M.addEventListener("dispose",P));const Z=M.source;let tt=f.get(Z);tt===void 0&&(tt={},f.set(Z,tt));const $=z(M);if($!==C.__cacheKey){tt[$]===void 0&&(tt[$]={texture:i.createTexture(),usedTimes:0},o.memory.textures++,B=!0),tt[$].usedTimes++;const Tt=tt[C.__cacheKey];Tt!==void 0&&(tt[C.__cacheKey].usedTimes--,Tt.usedTimes===0&&L(M)),C.__cacheKey=$,C.__webglTexture=tt[$].texture}return B}function Yt(C,M,B){let Z=i.TEXTURE_2D;(M.isDataArrayTexture||M.isCompressedArrayTexture)&&(Z=i.TEXTURE_2D_ARRAY),M.isData3DTexture&&(Z=i.TEXTURE_3D);const tt=kt(C,M),$=M.source;e.bindTexture(Z,C.__webglTexture,i.TEXTURE0+B);const Tt=n.get($);if($.version!==Tt.__version||tt===!0){e.activeTexture(i.TEXTURE0+B);const at=ee.getPrimaries(ee.workingColorSpace),_t=M.colorSpace===vi?null:ee.getPrimaries(M.colorSpace),Zt=M.colorSpace===vi||at===_t?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,M.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,M.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Zt);let et=v(M.image,!1,r.maxTextureSize);et=ae(M,et);const gt=s.convert(M.format,M.colorSpace),It=s.convert(M.type);let Dt=E(M.internalFormat,gt,It,M.colorSpace,M.isVideoTexture);pt(Z,M);let vt;const Gt=M.mipmaps,Ot=M.isVideoTexture!==!0,oe=Tt.__version===void 0||tt===!0,D=$.dataReady,dt=w(M,et);
vendor: 4,063 bytes, line 3815
3815if(M.isDepthTexture)Dt=S(M.format===Wr,M.type),oe&&(Ot?e.texStorage2D(i.TEXTURE_2D,1,Dt,et.width,et.height):e.texImage2D(i.TEXTURE_2D,0,Dt,et.width,et.height,0,gt,It,null));else if(M.isDataTexture)if(Gt.length>0){Ot&&oe&&e.texStorage2D(i.TEXTURE_2D,dt,Dt,Gt[0].width,Gt[0].height);for(let q=0,J=Gt.length;q<J;q++)vt=Gt[q],Ot?D&&e.texSubImage2D(i.TEXTURE_2D,q,0,0,vt.width,vt.height,gt,It,vt.data):e.texImage2D(i.TEXTURE_2D,q,Dt,vt.width,vt.height,0,gt,It,vt.data);M.generateMipmaps=!1}else Ot?(oe&&e.texStorage2D(i.TEXTURE_2D,dt,Dt,et.width,et.height),D&&e.texSubImage2D(i.TEXTURE_2D,0,0,0,et.width,et.height,gt,It,et.data)):e.texImage2D(i.TEXTURE_2D,0,Dt,et.width,et.height,0,gt,It,et.data);else if(M.isCompressedTexture)if(M.isCompressedArrayTexture){Ot&&oe&&e.texStorage3D(i.TEXTURE_2D_ARRAY,dt,Dt,Gt[0].width,Gt[0].height,et.depth);for(let q=0,J=Gt.length;q<J;q++)if(vt=Gt[q],M.format!==In)if(gt!==null)if(Ot){if(D)if(M.layerUpdates.size>0){const ht=Zh(vt.width,vt.height,M.format,M.type);for(const ft of M.layerUpdates){const qt=vt.data.subarray(ft*ht/vt.data.BYTES_PER_ELEMENT,(ft+1)*ht/vt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,q,0,0,ft,vt.width,vt.height,1,gt,qt,0,0)}M.clearLayerUpdates()}else e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,q,0,0,0,vt.width,vt.height,et.depth,gt,vt.data,0,0)}else e.compressedTexImage3D(i.TEXTURE_2D_ARRAY,q,Dt,vt.width,vt.height,et.depth,0,vt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Ot?D&&e.texSubImage3D(i.TEXTURE_2D_ARRAY,q,0,0,0,vt.width,vt.height,et.depth,gt,It,vt.data):e.texImage3D(i.TEXTURE_2D_ARRAY,q,Dt,vt.width,vt.height,et.depth,0,gt,It,vt.data)}else{Ot&&oe&&e.texStorage2D(i.TEXTURE_2D,dt,Dt,Gt[0].width,Gt[0].height);for(let q=0,J=Gt.length;q<J;q++)vt=Gt[q],M.format!==In?gt!==null?Ot?D&&e.compressedTexSubImage2D(i.TEXTURE_2D,q,0,0,vt.width,vt.height,gt,vt.data):e.compressedTexImage2D(i.TEXTURE_2D,q,Dt,vt.width,vt.height,0,vt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ot?D&&e.texSubImage2D(i.TEXTURE_2D,q,0,0,vt.width,vt.height,gt,It,vt.data):e.texImage2D(i.TEXTURE_2D,q,Dt,vt.width,vt.height,0,gt,It,vt.data)}else if(M.isDataArrayTexture)if(Ot){if(oe&&e.texStorage3D(i.TEXTURE_2D_ARRAY,dt,Dt,et.width,et.height,et.depth),D)if(M.layerUpdates.size>0){const q=Zh(et.width,et.height,M.format,M.type);for(const J of M.layerUpdates){const ht=et.data.subarray(J*q/et.data.BYTES_PER_ELEMENT,(J+1)*q/et.data.BYTES_PER_ELEMENT);e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,J,et.width,et.height,1,gt,It,ht)}M.clearLayerUpdates()}else e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,et.width,et.height,et.depth,gt,It,et.data)}else e.texImage3D(i.TEXTURE_2D_ARRAY,0,Dt,et.width,et.height,et.depth,0,gt,It,et.data);else if(M.isData3DTexture)Ot?(oe&&e.texStorage3D(i.TEXTURE_3D,dt,Dt,et.width,et.height,et.depth),D&&e.texSubImage3D(i.TEXTURE_3D,0,0,0,0,et.width,et.height,et.depth,gt,It,et.data)):e.texImage3D(i.TEXTURE_3D,0,Dt,et.width,et.height,et.depth,0,gt,It,et.data);else if(M.isFramebufferTexture){if(oe)if(Ot)e.texStorage2D(i.TEXTURE_2D,dt,Dt,et.width,et.height);else{let q=et.width,J=et.height;for(let ht=0;ht<dt;ht++)e.texImage2D(i.TEXTURE_2D,ht,Dt,q,J,0,gt,It,null),q>>=1,J>>=1}}else if(Gt.length>0){if(Ot&&oe){const q=Ut(Gt[0]);e.texStorage2D(i.TEXTURE_2D,dt,Dt,q.width,q.height)}for(let q=0,J=Gt.length;q<J;q++)vt=Gt[q],Ot?D&&e.texSubImage2D(i.TEXTURE_2D,q,0,0,gt,It,vt):e.texImage2D(i.TEXTURE_2D,q,Dt,gt,It,vt);M.generateMipmaps=!1}else if(Ot){if(oe){const q=Ut(et);e.texStorage2D(i.TEXTURE_2D,dt,Dt,q.width,q.height)}D&&e.texSubImage2D(i.TEXTURE_2D,0,0,0,gt,It,et)}else e.texImage2D(i.TEXTURE_2D,0,Dt,gt,It,et);m(M)&&g(Z),Tt.__version=$.version,M.onUpdate&&M.onUpdate(M)}C.__version=M.version}function Y(C,M,B){if(M.image.length!==6)return;const Z=kt(C,M),tt=M.source;e.bindTexture(i.TEXTURE_CUBE_MAP,C.__webglTexture,i.TEXTURE0+B);const $=n.get(tt);if(tt.version!==$.__version||Z===!0){e.activeTexture(i.TEXTURE0+B);
vendor: 4,185 bytes, line 3815
3815const Tt=ee.getPrimaries(ee.workingColorSpace),at=M.colorSpace===vi?null:ee.getPrimaries(M.colorSpace),_t=M.colorSpace===vi||Tt===at?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,M.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,M.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,_t);const Zt=M.isCompressedTexture||M.image[0].isCompressedTexture,et=M.image[0]&&M.image[0].isDataTexture,gt=[];for(let J=0;J<6;J++)!Zt&&!et?gt[J]=v(M.image[J],!0,r.maxCubemapSize):gt[J]=et?M.image[J].image:M.image[J],gt[J]=ae(M,gt[J]);const It=gt[0],Dt=s.convert(M.format,M.colorSpace),vt=s.convert(M.type),Gt=E(M.internalFormat,Dt,vt,M.colorSpace),Ot=M.isVideoTexture!==!0,oe=$.__version===void 0||Z===!0,D=tt.dataReady;let dt=w(M,It);pt(i.TEXTURE_CUBE_MAP,M);let q;if(Zt){Ot&&oe&&e.texStorage2D(i.TEXTURE_CUBE_MAP,dt,Gt,It.width,It.height);for(let J=0;J<6;J++){q=gt[J].mipmaps;for(let ht=0;ht<q.length;ht++){const ft=q[ht];M.format!==In?Dt!==null?Ot?D&&e.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,ht,0,0,ft.width,ft.height,Dt,ft.data):e.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,ht,Gt,ft.width,ft.height,0,ft.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Ot?D&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,ht,0,0,ft.width,ft.height,Dt,vt,ft.data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,ht,Gt,ft.width,ft.height,0,Dt,vt,ft.data)}}}else{if(q=M.mipmaps,Ot&&oe){q.length>0&&dt++;const J=Ut(gt[0]);e.texStorage2D(i.TEXTURE_CUBE_MAP,dt,Gt,J.width,J.height)}for(let J=0;J<6;J++)if(et){Ot?D&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,0,0,0,gt[J].width,gt[J].height,Dt,vt,gt[J].data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,0,Gt,gt[J].width,gt[J].height,0,Dt,vt,gt[J].data);for(let ht=0;ht<q.length;ht++){const qt=q[ht].image[J].image;Ot?D&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,ht+1,0,0,qt.width,qt.height,Dt,vt,qt.data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,ht+1,Gt,qt.width,qt.height,0,Dt,vt,qt.data)}}else{Ot?D&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,0,0,0,Dt,vt,gt[J]):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,0,Gt,Dt,vt,gt[J]);for(let ht=0;ht<q.length;ht++){const ft=q[ht];Ot?D&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,ht+1,0,0,Dt,vt,ft.image[J]):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+J,ht+1,Gt,Dt,vt,ft.image[J])}}}m(M)&&g(i.TEXTURE_CUBE_MAP),$.__version=tt.version,M.onUpdate&&M.onUpdate(M)}C.__version=M.version}function Q(C,M,B,Z,tt,$){const Tt=s.convert(B.format,B.colorSpace),at=s.convert(B.type),_t=E(B.internalFormat,Tt,at,B.colorSpace);if(!n.get(M).__hasExternalTextures){const et=Math.max(1,M.width>>$),gt=Math.max(1,M.height>>$);tt===i.TEXTURE_3D||tt===i.TEXTURE_2D_ARRAY?e.texImage3D(tt,$,_t,et,gt,M.depth,0,Tt,at,null):e.texImage2D(tt,$,_t,et,gt,0,Tt,at,null)}e.bindFramebuffer(i.FRAMEBUFFER,C),$t(M)?a.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,Z,tt,n.get(B).__webglTexture,0,Vt(M)):(tt===i.TEXTURE_2D||tt>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&tt<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,Z,tt,n.get(B).__webglTexture,$),e.bindFramebuffer(i.FRAMEBUFFER,null)}function Mt(C,M,B){if(i.bindRenderbuffer(i.RENDERBUFFER,C),M.depthBuffer){const Z=M.depthTexture,tt=Z&&Z.isDepthTexture?Z.type:null,$=S(M.stencilBuffer,tt),Tt=M.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,at=Vt(M);$t(M)?a.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,at,$,M.width,M.height):B?i.renderbufferStorageMultisample(i.RENDERBUFFER,at,$,M.width,M.height):i.renderbufferStorage(i.RENDERBUFFER,$,M.width,M.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,Tt,i.RENDERBUFFER,C)}else{const Z=M.textures;for(let tt=0;tt<Z.length;tt++){const $=Z[tt],Tt=s.convert($.format,$.colorSpace),at=s.convert($.type),_t=E($.internalFormat,Tt,at,$.colorSpace),Zt=Vt(M);B&&$t(M)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,Zt,_t,M.width,M.height):$t(M)?a.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,Zt,_t,M.width,M.height):i.renderbufferStorage(i.RENDERBUFFER,_t,M.width,M.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}
3815function mt(C,M){if(M&&M.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(i.FRAMEBUFFER,C),!(M.depthTexture&&M.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(M.depthTexture).__webglTexture||M.depthTexture.image.width!==M.width||M.depthTexture.image.height!==M.height)&&(M.depthTexture.image.width=M.width,M.depthTexture.image.height=M.height,M.depthTexture.needsUpdate=!0),W(M.depthTexture,0);const Z=n.get(M.depthTexture).__webglTexture,tt=Vt(M);if(M.depthTexture.format===Nr)$t(M)?a.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Z,0,tt):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Z,0);else if(M.depthTexture.format===Wr)$t(M)?a.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Z,0,tt):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Z,0);else throw new Error("Unknown depthTexture format")}function Nt(C){const M=n.get(C),B=C.isWebGLCubeRenderTarget===!0;if(M.__boundDepthTexture!==C.depthTexture){const Z=C.depthTexture;if(M.__depthDisposeCallback&&M.__depthDisposeCallback(),Z){const tt=()=>{delete M.__boundDepthTexture,delete M.__depthDisposeCallback,Z.removeEventListener("dispose",tt)};Z.addEventListener("dispose",tt),M.__depthDisposeCallback=tt}M.__boundDepthTexture=Z}if(C.depthTexture&&!M.__autoAllocateDepthBuffer){if(B)throw new Error("target.depthTexture not supported in Cube render targets");mt(M.__webglFramebuffer,C)}else if(B){M.__webglDepthbuffer=[];for(let Z=0;Z<6;Z++)if(e.bindFramebuffer(i.FRAMEBUFFER,M.__webglFramebuffer[Z]),M.__webglDepthbuffer[Z]===void 0)M.__webglDepthbuffer[Z]=i.createRenderbuffer(),Mt(M.__webglDepthbuffer[Z],C,!1);else{const tt=C.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,$=M.__webglDepthbuffer[Z];i.bindRenderbuffer(i.RENDERBUFFER,$),i.framebufferRenderbuffer(i.FRAMEBUFFER,tt,i.RENDERBUFFER,$)}}else if(e.bindFramebuffer(i.FRAMEBUFFER,M.__webglFramebuffer),M.__webglDepthbuffer===void 0)M.__webglDepthbuffer=i.createRenderbuffer(),Mt(M.__webglDepthbuffer,C,!1);else{const Z=C.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,tt=M.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,tt),i.framebufferRenderbuffer(i.FRAMEBUFFER,Z,i.RENDERBUFFER,tt)}e.bindFramebuffer(i.FRAMEBUFFER,null)}function Rt(C,M,B){const Z=n.get(C);M!==void 0&&Q(Z.__webglFramebuffer,C,C.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),B!==void 0&&Nt(C)}function Wt(C){const M=C.texture,B=n.get(C),Z=n.get(M);C.addEventListener("dispose",R);const tt=C.textures,$=C.isWebGLCubeRenderTarget===!0,Tt=tt.length>1;if(Tt||(Z.__webglTexture===void 0&&(Z.__webglTexture=i.createTexture()),Z.__version=M.version,o.memory.textures++),$){B.__webglFramebuffer=[];for(let at=0;at<6;at++)if(M.mipmaps&&M.mipmaps.length>0){B.__webglFramebuffer[at]=[];for(let _t=0;_t<M.mipmaps.length;_t++)B.__webglFramebuffer[at][_t]=i.createFramebuffer()}else B.__webglFramebuffer[at]=i.createFramebuffer()}else{if(M.mipmaps&&M.mipmaps.length>0){B.__webglFramebuffer=[];for(let at=0;at<M.mipmaps.length;at++)B.__webglFramebuffer[at]=i.createFramebuffer()}else B.__webglFramebuffer=i.createFramebuffer();if(Tt)for(let at=0,_t=tt.length;at<_t;at++){const Zt=n.get(tt[at]);Zt.__webglTexture===void 0&&(Zt.__webglTexture=i.createTexture(),o.memory.textures++)}if(C.samples>0&&$t(C)===!1){B.__webglMultisampledFramebuffer=i.createFramebuffer(),B.__webglColorRenderbuffer=[],e.bindFramebuffer(i.FRAMEBUFFER,B.__webglMultisampledFramebuffer);for(let at=0;at<tt.length;at++){const _t=tt[at];B.__webglColorRenderbuffer[at]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,B.__webglColorRenderbuffer[at]);const Zt=s.convert(_t.format,_t.colorSpace),et=s.convert(_t.type),gt=E(_t.internalFormat,Zt,et,_t.colorSpace,C.isXRRenderTarget===!0),It=Vt(C);i.renderbufferStorageMultisample(i.RENDERBUFFER,It,gt,C.width,C.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+at,i.RENDERBUFFER,B.__webglColorRen
vendor: 8,731 bytes, line 3815
3815derbuffer[at])}i.bindRenderbuffer(i.RENDERBUFFER,null),C.depthBuffer&&(B.__webglDepthRenderbuffer=i.createRenderbuffer(),Mt(B.__webglDepthRenderbuffer,C,!0)),e.bindFramebuffer(i.FRAMEBUFFER,null)}}if($){e.bindTexture(i.TEXTURE_CUBE_MAP,Z.__webglTexture),pt(i.TEXTURE_CUBE_MAP,M);for(let at=0;at<6;at++)if(M.mipmaps&&M.mipmaps.length>0)for(let _t=0;_t<M.mipmaps.length;_t++)Q(B.__webglFramebuffer[at][_t],C,M,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+at,_t);else Q(B.__webglFramebuffer[at],C,M,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+at,0);m(M)&&g(i.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(Tt){for(let at=0,_t=tt.length;at<_t;at++){const Zt=tt[at],et=n.get(Zt);e.bindTexture(i.TEXTURE_2D,et.__webglTexture),pt(i.TEXTURE_2D,Zt),Q(B.__webglFramebuffer,C,Zt,i.COLOR_ATTACHMENT0+at,i.TEXTURE_2D,0),m(Zt)&&g(i.TEXTURE_2D)}e.unbindTexture()}else{let at=i.TEXTURE_2D;if((C.isWebGL3DRenderTarget||C.isWebGLArrayRenderTarget)&&(at=C.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),e.bindTexture(at,Z.__webglTexture),pt(at,M),M.mipmaps&&M.mipmaps.length>0)for(let _t=0;_t<M.mipmaps.length;_t++)Q(B.__webglFramebuffer[_t],C,M,i.COLOR_ATTACHMENT0,at,_t);else Q(B.__webglFramebuffer,C,M,i.COLOR_ATTACHMENT0,at,0);m(M)&&g(at),e.unbindTexture()}C.depthBuffer&&Nt(C)}function ie(C){const M=C.textures;for(let B=0,Z=M.length;B<Z;B++){const tt=M[B];if(m(tt)){const $=C.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:i.TEXTURE_2D,Tt=n.get(tt).__webglTexture;e.bindTexture($,Tt),g($),e.unbindTexture()}}}const Xt=[],I=[];function tn(C){if(C.samples>0){if($t(C)===!1){const M=C.textures,B=C.width,Z=C.height;let tt=i.COLOR_BUFFER_BIT;const $=C.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Tt=n.get(C),at=M.length>1;if(at)for(let _t=0;_t<M.length;_t++)e.bindFramebuffer(i.FRAMEBUFFER,Tt.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+_t,i.RENDERBUFFER,null),e.bindFramebuffer(i.FRAMEBUFFER,Tt.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+_t,i.TEXTURE_2D,null,0);e.bindFramebuffer(i.READ_FRAMEBUFFER,Tt.__webglMultisampledFramebuffer),e.bindFramebuffer(i.DRAW_FRAMEBUFFER,Tt.__webglFramebuffer);for(let _t=0;_t<M.length;_t++){if(C.resolveDepthBuffer&&(C.depthBuffer&&(tt|=i.DEPTH_BUFFER_BIT),C.stencilBuffer&&C.resolveStencilBuffer&&(tt|=i.STENCIL_BUFFER_BIT)),at){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,Tt.__webglColorRenderbuffer[_t]);const Zt=n.get(M[_t]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,Zt,0)}i.blitFramebuffer(0,0,B,Z,0,0,B,Z,tt,i.NEAREST),l===!0&&(Xt.length=0,I.length=0,Xt.push(i.COLOR_ATTACHMENT0+_t),C.depthBuffer&&C.resolveDepthBuffer===!1&&(Xt.push($),I.push($),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,I)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,Xt))}if(e.bindFramebuffer(i.READ_FRAMEBUFFER,null),e.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),at)for(let _t=0;_t<M.length;_t++){e.bindFramebuffer(i.FRAMEBUFFER,Tt.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+_t,i.RENDERBUFFER,Tt.__webglColorRenderbuffer[_t]);const Zt=n.get(M[_t]).__webglTexture;e.bindFramebuffer(i.FRAMEBUFFER,Tt.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+_t,i.TEXTURE_2D,Zt,0)}e.bindFramebuffer(i.DRAW_FRAMEBUFFER,Tt.__webglMultisampledFramebuffer)}else if(C.depthBuffer&&C.resolveDepthBuffer===!1&&l){const M=C.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[M])}}}function Vt(C){return Math.min(r.maxSamples,C.samples)}function $t(C){const M=n.get(C);return C.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&M.__useRenderToTexture!==!1}function Lt(C){const M=o.render.frame;h.get(C)!==M&&(h.set(C,M),C.update())}function ae(C,M){const B=C.colorSpace,Z=C.format,tt=C.type;return C.isCompressedTexture===!0||C.isVideoTexture===!0||B!==Ni&&B!==vi&&(ee.getTransfer(B)===ce?(Z!==In||tt!==ii)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",B)),M}function Ut(C){return typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement?(c.width=C.naturalWidth||C.width,c.height=C.naturalHeight||C.height):typeof VideoFrame<"u"&&C instanceof VideoFrame?(c.width=C.displayWidth,c.height=C.displayHeight):(c.width=C.width,c.height=C.height),c}this.allocateTextureUnit=G,this.resetTextureUnits=b,this.setTexture2D=W,this.setTexture2DArray=K,this.setTexture3D=k,this.setTextureCube=j,this.rebindTextures=Rt,this.setupRenderTarget=Wt,this.updateRenderTargetMipmap=ie,this.updateMultisampleRenderTarget=tn,this.setupDepthRenderbuffer=Nt,this.setupFrameBufferTexture=Q,this.useMultisampledRTT=$t}function kx(i,t){function e(n,r=vi){let s;const o=ee.getTransfer(r);if(n===ii)return i.UNSIGNED_BYTE;if(n===rc)return i.UNSIGNED_SHORT_4_4_4_4;if(n===sc)return i.UNSIGNED_SHORT_5_5_5_1;if(n===Uu)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===Iu)return i.BYTE;if(n===Du)return i.SHORT;if(n===Ms)return i.UNSIGNED_SHORT;if(n===ic)return i.INT;if(n===ar)return i.UNSIGNED_INT;if(n===ti)return i.FLOAT;if(n===Ds)return i.HALF_FLOAT;if(n===Nu)return i.ALPHA;if(n===Ou)return i.RGB;if(n===In)return i.RGBA;if(n===Fu)return i.LUMINANCE;if(n===zu)return i.LUMINANCE_ALPHA;if(n===Nr)return i.DEPTH_COMPONENT;if(n===Wr)return i.DEPTH_STENCIL;if(n===Bu)return i.RED;if(n===oc)return i.RED_INTEGER;if(n===ku)return i.RG;if(n===ac)return i.RG_INTEGER;if(n===lc)return i.RGBA_INTEGER;if(n===Mo||n===Eo||n===To||n===bo)if(o===ce)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Mo)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Eo)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===To)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===bo)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Mo)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Eo)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===To)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===bo)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===fl||n===pl||n===ml||n===_l)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===fl)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===pl)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===ml)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===_l)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===gl||n===vl||n===xl)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===gl||n===vl)return o===ce?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===xl)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===yl||n===Sl||n===Ml||n===El||n===Tl||n===bl||n===wl||n===Al||n===Cl||n===Rl||n===Pl||n===Ll||n===Il||n===Dl)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===yl)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Sl)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Ml)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===El)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Tl)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===bl)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===wl)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Al)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Cl)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Rl)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Pl)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Ll)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Il)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Dl)return o===ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===wo||n===Ul||n===Nl)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===wo)return o===ce?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Ul)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Nl)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Hu||n===Ol||n===Fl||n===zl)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===wo)return s.COMPRESSED_RED_RGT
vendor: 6,146 bytes, lines 3815-3839
3815C1_EXT;if(n===Ol)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Fl)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===zl)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Gr?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:e}}class Hx extends vn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class Pr extends Ve{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Vx={type:"move"};class Fa{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Pr,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 Pr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Pr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U),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){const e=this._hand;if(e)for(const 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 r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){o=!0;for(const v of t.hand.values()){const m=e.getJointPose(v,n),g=this._getHandJoint(c,v);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}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],f=h.position.distanceTo(u.position),p=.02,x=.005;c.inputState.pinching&&f>p+x?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=p-x&&(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&&(r=e.getPose(t.targetRaySpace,n),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Vx)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const n=new Pr;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}const Gx=` 3816void main() { 3817 3818 gl_Position = vec4( position, 1.0 ); 3819 3820}`,Wx=` 3821uniform sampler2DArray depthColor; 3822uniform float depthWidth; 3823uniform float depthHeight; 3824 3825void main() { 3826 3827 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 3828 3829 if ( coord.x >= 1.0 ) { 3830 3831 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 3832 3833 } else { 3834 3835 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 3836 3837 } 3838 3839}`;class Xx{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){const r=new Mn,s=t.properties.get(r);s.__webglTexture=e.texture,(e.depthNear!=n.depthNear||e.depthFar!=n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,n=new si({vertexShader:Gx,fragmentShader:Wx,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new zn(new Zo(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class qx extends lr{constructor(t,e){super();const n=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,h=null,u=null,f=null,p=null,x=null;const v=new Xx,m=e.getContextAttributes();let g=null,E=null;const S=[],w=[],P=new St;let R=null;const A=new vn;A.layers.enable(1),A.viewport=new Me;const L=new vn;L.layers.enable(2),L.viewport=new Me;const F=[A,L],y=new Hx;y.layers.enable(1),y.layers.enable(2);let b=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let Q=S[Y];return Q===void 0&&(Q=new Fa,S[Y]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(Y){let Q=S[Y];return Q===void 0&&(Q=new Fa,S[Y]=Q),Q.getGripSpace()},this.getHand=function(Y){let Q=S[Y];return Q===void 0&&(Q=new Fa,S[Y]=Q),Q.getHandSpace()};function z(Y){const Q=w.indexOf(Y.inputSource);if(Q===-1)return;const Mt=S[Q];Mt!==void 0&&(Mt.update(Y.inputSource,Y.frame,c||o),Mt.dispatchEvent({type:Y.type,data:Y.inputSource}))}function W(){r.removeEventListener("select",z),r.removeEventListener("selectstart",z),r.removeEventListener("selectend",z),r.removeEventListener("squeeze",z),r.removeEventListener("squeezestart",z),r.removeEventListener("squeezeend",z),r.removeEventListener("end",W),r.removeEventListener("inputsourceschange",K);for(let Y=0;Y<S.length;Y++){const Q=w[Y];
vendor: 5,824 bytes, line 3839
3839Q!==null&&(w[Y]=null,S[Y].disconnect(Q))}b=null,G=null,v.reset(),t.setRenderTarget(g),p=null,f=null,u=null,r=null,E=null,Yt.stop(),n.isPresenting=!1,t.setPixelRatio(R),t.setSize(P.width,P.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){a=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return f!==null?f:p},this.getBinding=function(){return u},this.getFrame=function(){return x},this.getSession=function(){return r},this.setSession=async function(Y){if(r=Y,r!==null){if(g=t.getRenderTarget(),r.addEventListener("select",z),r.addEventListener("selectstart",z),r.addEventListener("selectend",z),r.addEventListener("squeeze",z),r.addEventListener("squeezestart",z),r.addEventListener("squeezeend",z),r.addEventListener("end",W),r.addEventListener("inputsourceschange",K),m.xrCompatible!==!0&&await e.makeXRCompatible(),R=t.getPixelRatio(),t.getSize(P),r.renderState.layers===void 0){const Q={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};p=new XRWebGLLayer(r,e,Q),r.updateRenderState({baseLayer:p}),t.setPixelRatio(1),t.setSize(p.framebufferWidth,p.framebufferHeight,!1),E=new Ri(p.framebufferWidth,p.framebufferHeight,{format:In,type:ii,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let Q=null,Mt=null,mt=null;m.depth&&(mt=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Q=m.stencil?Wr:Nr,Mt=m.stencil?Gr:ar);const Nt={colorFormat:e.RGBA8,depthFormat:mt,scaleFactor:s};u=new XRWebGLBinding(r,e),f=u.createProjectionLayer(Nt),r.updateRenderState({layers:[f]}),t.setPixelRatio(1),t.setSize(f.textureWidth,f.textureHeight,!1),E=new Ri(f.textureWidth,f.textureHeight,{format:In,type:ii,depthTexture:new td(f.textureWidth,f.textureHeight,Mt,void 0,void 0,void 0,void 0,void 0,void 0,Q),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1})}E.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await r.requestReferenceSpace(a),Yt.setContext(r),Yt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return v.getDepthTexture()};function K(Y){for(let Q=0;Q<Y.removed.length;Q++){const Mt=Y.removed[Q],mt=w.indexOf(Mt);mt>=0&&(w[mt]=null,S[mt].disconnect(Mt))}for(let Q=0;Q<Y.added.length;Q++){const Mt=Y.added[Q];let mt=w.indexOf(Mt);if(mt===-1){for(let Rt=0;Rt<S.length;Rt++)if(Rt>=w.length){w.push(Mt),mt=Rt;break}else if(w[Rt]===null){w[Rt]=Mt,mt=Rt;break}if(mt===-1)break}const Nt=S[mt];Nt&&Nt.connect(Mt)}}const k=new U,j=new U;function X(Y,Q,Mt){k.setFromMatrixPosition(Q.matrixWorld),j.setFromMatrixPosition(Mt.matrixWorld);const mt=k.distanceTo(j),Nt=Q.projectionMatrix.elements,Rt=Mt.projectionMatrix.elements,Wt=Nt[14]/(Nt[10]-1),ie=Nt[14]/(Nt[10]+1),Xt=(Nt[9]+1)/Nt[5],I=(Nt[9]-1)/Nt[5],tn=(Nt[8]-1)/Nt[0],Vt=(Rt[8]+1)/Rt[0],$t=Wt*tn,Lt=Wt*Vt,ae=mt/(-tn+Vt),Ut=ae*-tn;if(Q.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(Ut),Y.translateZ(ae),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Nt[10]===-1)Y.projectionMatrix.copy(Q.projectionMatrix),Y.projectionMatrixInverse.copy(Q.projectionMatrixInverse);else{const C=Wt+ae,M=ie+ae,B=$t-Ut,Z=Lt+(mt-Ut),tt=Xt*ie/M*C,$=I*ie/M*C;Y.projectionMatrix.makePerspective(B,Z,tt,$,C,M),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function lt(Y,Q){Q===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(Q.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(r===null)return;let Q=Y.near,Mt=Y.far;v.texture!==null&&(v.depthNear>0&&(Q=v.depthNear),v.depthFar>0&&(Mt=v.depthFar)),y.near=L.near=A.near=Q,y.far=L.far=A.far=Mt,(b!==y.near||G!==y.far)&&(r.updateRenderState({depthNear:y.near,depthFar:y.far}),b=y.near,G=y.far);const mt=Y.parent,Nt=y.cameras;lt(y,mt);for(let Rt=0;Rt<Nt.length;Rt++)lt(Nt[Rt],mt);Nt.length===2?X(y,A,L):y.projectionMatrix.copy(A.projectionMatrix),ct(Y,y,mt)};function ct(Y,Q,Mt){Mt===null?Y.matrix.copy(Q.matrixWorld):(Y.matrix.copy(Mt.matrixWorld),Y.matrix.invert(),Y.matrix.multiply(Q.matrixWorld)),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.updateMatrixWorld(!0),Y.projectionMatrix.copy(Q.projectionMatrix),Y.projectionMatrixInverse.copy(Q.projectionMatrixInverse),Y.isPerspectiveCamera&&(Y.fov=Es*2*Math.atan(1/Y.projectionMatrix.elements[5]),Y.zoom=1)}this.getCamera=function(){return y},this.getFoveation=function(){if(!(f===null&&p===null))return l},this.setFoveation=function(Y){l=Y,f!==null&&(f.fixedFoveation=Y),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=Y)},this.hasDepthSensing=function(){return v.texture!==null},this.getDepthSensingMesh=function(){return v.getMesh(y)};let pt=null;function kt(Y,Q){if(h=Q.getViewerPose(c||o),x=Q,h!==null){const Mt=h.views;p!==null&&(t.setRenderTargetFramebuffer(E,p.framebuffer),t.setRenderTarget(E));let mt=!1;Mt.length!==y.cameras.length&&(y.cameras.length=0,mt=!0);for(let Rt=0;Rt<Mt.length;Rt++){const Wt=Mt[Rt];let ie=null;if(p!==null)ie=p.getViewport(Wt);else{const I=u.getViewSubImage(f,Wt);ie=I.viewport,Rt===0&&(t.setRenderTargetTextures(E,I.colorTexture,f.ignoreDepthValues?void 0:I.depthStencilTexture),t.setRenderTarget(E))}let Xt=F[Rt];Xt===void 0&&(Xt=new vn,Xt.layers.enable(Rt),Xt.viewport=new Me,F[Rt]=Xt),Xt.matrix.fromArray(Wt.transform.matrix),Xt.matrix.decompose(Xt.position,
vendor: 20,690 bytes, line 3839
3839Xt.quaternion,Xt.scale),Xt.projectionMatrix.fromArray(Wt.projectionMatrix),Xt.projectionMatrixInverse.copy(Xt.projectionMatrix).invert(),Xt.viewport.set(ie.x,ie.y,ie.width,ie.height),Rt===0&&(y.matrix.copy(Xt.matrix),y.matrix.decompose(y.position,y.quaternion,y.scale)),mt===!0&&y.cameras.push(Xt)}const Nt=r.enabledFeatures;if(Nt&&Nt.includes("depth-sensing")){const Rt=u.getDepthInformation(Mt[0]);Rt&&Rt.isValid&&Rt.texture&&v.init(t,Rt,r.renderState)}}for(let Mt=0;Mt<S.length;Mt++){const mt=w[Mt],Nt=S[Mt];mt!==null&&Nt!==void 0&&Nt.update(mt,Q,c||o)}pt&&pt(Y,Q),Q.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Q}),x=null}const Yt=new Qu;Yt.setAnimationLoop(kt),this.setAnimationLoop=function(Y){pt=Y},this.dispose=function(){}}}const qi=new ri,Yx=new me;function $x(i,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,Zu(i)),g.isFog?(m.fogNear.value=g.near,m.fogFar.value=g.far):g.isFogExp2&&(m.fogDensity.value=g.density)}function r(m,g,E,S,w){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(m,g):g.isMeshToonMaterial?(s(m,g),u(m,g)):g.isMeshPhongMaterial?(s(m,g),h(m,g)):g.isMeshStandardMaterial?(s(m,g),f(m,g),g.isMeshPhysicalMaterial&&p(m,g,w)):g.isMeshMatcapMaterial?(s(m,g),x(m,g)):g.isMeshDepthMaterial?s(m,g):g.isMeshDistanceMaterial?(s(m,g),v(m,g)):g.isMeshNormalMaterial?s(m,g):g.isLineBasicMaterial?(o(m,g),g.isLineDashedMaterial&&a(m,g)):g.isPointsMaterial?l(m,g,E,S):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===$e&&(m.bumpScale.value*=-1)),g.normalMap&&(m.normalMap.value=g.normalMap,e(g.normalMap,m.normalMapTransform),m.normalScale.value.copy(g.normalScale),g.side===$e&&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);const E=t.get(g),S=E.envMap,w=E.envMapRotation;S&&(m.envMap.value=S,qi.copy(w),qi.x*=-1,qi.y*=-1,qi.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(qi.y*=-1,qi.z*=-1),m.envMapRotation.value.setFromMatrix4(Yx.makeRotationFromEuler(qi)),m.flipEnvMap.value=S.isCubeTexture&&S.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,m.lightMapIntensity.value=g.lightMapIntensity,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,E,S){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*E,m.scale.value=S*.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 u(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function f(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 p(m,g,E){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===$e&&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=E.texture,m.transmissionSamplerSize.value.set(E.width,E.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 x(m,g){g.matcap&&(m.matcap.value=g.matcap)}function v(m,g){const E=t.get(g).light;m.referencePosition.value.setFromMatrixPosition(E.matrixWorld),m.nearDistance.value=E.shadow.camera.near,m.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function Zx(i,t,e,n){let r={},s={},o=[];const a=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(E,S){const w=S.program;n.uniformBlockBinding(E,w)}function c(E,S){let w=r[E.id];w===void 0&&(x(E),w=h(E),r[E.id]=w,E.addEventListener("dispose",m));const P=S.program;n.updateUBOMapping(E,P);const R=t.render.frame;s[E.id]!==R&&(f(E),s[E.id]=R)}function h(E){const S=u();E.__bindingPointIndex=S;const w=i.createBuffer(),P=E.__size,R=E.usage;return i.bindBuffer(i.UNIFORM_BUFFER,w),i.bufferData(i.UNIFORM_BUFFER,P,R),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,S,w),w}function u(){for(let E=0;E<a;E++)if(o.indexOf(E)===-1)return o.push(E),E;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(E){const S=r[E.id],w=E.uniforms,P=E.__cache;i.bindBuffer(i.UNIFORM_BUFFER,S);for(let R=0,A=w.length;R<A;R++){const L=Array.isArray(w[R])?w[R]:[w[R]];for(let F=0,y=L.length;F<y;F++){const b=L[F];if(p(b,R,F,P)===!0){const G=b.__offset,z=Array.isArray(b.value)?b.value:[b.value];let W=0;for(let K=0;K<z.length;K++){const k=z[K],j=v(k);typeof k=="number"||typeof k=="boolean"?(b.__data[0]=k,i.bufferSubData(i.UNIFORM_BUFFER,G+W,b.__data)):k.isMatrix3?(b.__data[0]=k.elements[0],b.__data[1]=k.elements[1],b.__data[2]=k.elements[2],b.__data[3]=0,b.__data[4]=k.elements[3],b.__data[5]=k.elements[4],b.__data[6]=k.elements[5],b.__data[7]=0,b.__data[8]=k.elements[6],b.__data[9]=k.elements[7],b.__data[10]=k.elements[8],b.__data[11]=0):(k.toArray(b.__data,W),W+=j.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,G,b.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function p(E,S,w,P){const R=E.value,A=S+"_"+w;if(P[A]===void 0)return typeof R=="number"||typeof R=="boolean"?P[A]=R:P[A]=R.clone(),!0;{const L=P[A];if(typeof R=="number"||typeof R=="boolean"){if(L!==R)return P[A]=R,!0}else if(L.equals(R)===!1)return L.copy(R),!0}return!1}function x(E){const S=E.uniforms;let w=0;const P=16;for(let A=0,L=S.length;A<L;A++){const F=Array.isArray(S[A])?S[A]:[S[A]];for(let y=0,b=F.length;y<b;y++){const G=F[y],z=Array.isArray(G.value)?G.value:[G.value];for(let W=0,K=z.length;W<K;W++){const k=z[W],j=v(k),X=w%P,lt=X%j.boundary,ct=X+lt;w+=lt,ct!==0&&P-ct<j.storage&&(w+=P-ct),G.__data=new Float32Array(j.storage/Float32Array.BYTES_PER_ELEMENT),G.__offset=w,w+=j.storage}}}const R=w%P;return R>0&&(w+=P-R),E.__size=w,E.__cache={},this}function v(E){const S={boundary:0,storage:0};return typeof E=="number"||typeof E=="boolean"?(S.boundary=4,S.storage=4):E.isVector2?(S.boundary=8,S.storage=8):E.isVector3||E.isColor?(S.boundary=16,S.storage=12):E.isVector4?(S.boundary=16,S.storage=16):E.isMatrix3?(S.boundary=48,S.storage=48):E.isMatrix4?(S.boundary=64,S.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),S}function m(E){const S=E.target;S.removeEventListener("dispose",m);const w=o.indexOf(S.__bindingPointIndex);o.splice(w,1),i.deleteBuffer(r[S.id]),delete r[S.id],delete s[S.id]}function g(){for(const E in r)i.deleteBuffer(r[E]);o=[],r={},s={}}return{bind:l,update:c,dispose:g}}class Kx{constructor(t={}){const{canvas:e=Nm(),context:n=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1}=t;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=o;const p=new Uint32Array(4),x=new Int32Array(4);let v=null,m=null;const g=[],E=[];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=Un,this.toneMapping=bi,this.toneMappingExposure=1;const S=this;let w=!1,P=0,R=0,A=null,L=-1,F=null;const y=new Me,b=new Me;let G=null;const z=new Kt(0);let W=0,K=e.width,k=e.height,j=1,X=null,lt=null;const ct=new Me(0,0,K,k),pt=new Me(0,0,K,k);let kt=!1;const Yt=new Ju;let Y=!1,Q=!1;const Mt=new me,mt=new me,Nt=new U,Rt=new Me,Wt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ie=!1;function Xt(){return A===null?j:1}let I=n;function tn(T,N){return e.getContext(T,N)}try{const T={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${nc}`),e.addEventListener("webglcontextlost",J,!1),e.addEventListener("webglcontextrestored",ht,!1),e.addEventListener("webglcontextcreationerror",ft,!1),I===null){const N="webgl2";if(I=tn(N,T),I===null)throw tn(N)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(T){throw console.error("THREE.WebGLRenderer: "+T.message),T}let Vt,$t,Lt,ae,Ut,C,M,B,Z,tt,$,Tt,at,_t,Zt,et,gt,It,Dt,vt,Gt,Ot,oe,D;function dt(){Vt=new e0(I),Vt.init(),Ot=new kx(I,Vt),$t=new $v(I,Vt,t,Ot),Lt=new Fx(I),$t.reverseDepthBuffer&&Lt.buffers.depth.setReversed(!0),ae=new r0(I),Ut=new Mx,C=new Bx(I,Vt,Lt,Ut,$t,Ot,ae),M=new Kv(S),B=new t0(S),Z=new h_(I),oe=new qv(I,Z),tt=new n0(I,Z,ae,oe),$=new o0(I,tt,Z,ae),Dt=new s0(I,$t,C),et=new Zv(Ut),Tt=new Sx(S,M,B,Vt,$t,oe,et),at=new $x(S,Ut),_t=new Tx,Zt=new Px(Vt),It=new Xv(S,M,B,Lt,$,f,l),gt=new Nx(S,$,$t),D=new Zx(I,ae,$t,Lt),vt=new Yv(I,Vt,ae),Gt=new i0(I,Vt,ae),ae.programs=Tt.programs,S.capabilities=$t,S.extensions=Vt,S.properties=Ut,S.renderLists=_t,S.shadowMap=gt,S.state=Lt,S.info=ae}dt();const q=new qx(S,I);this.xr=q,this.getContext=function(){return I},this.getContextAttributes=function(){return I.getContextAttributes()},this.forceContextLoss=function(){const T=Vt.get("WEBGL_lose_context");T&&T.loseContext()},this.forceContextRestore=function(){const T=Vt.get("WEBGL_lose_context");T&&T.restoreContext()},this.getPixelRatio=function(){return j},this.setPixelRatio=function(T){T!==void 0&&(j=T,this.setSize(K,k,!1))},this.getSize=function(T){return T.set(K,k)},this.setSize=function(T,N,H=!0){if(q.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}K=T,k=N,e.width=Math.floor(T*j),e.height=Math.floor(N*j),H===!0&&(e.style.width=T+"px",e.style.height=N+"px"),this.setViewport(0,0,T,N)},this.getDrawingBufferSize=function(T){return T.set(K*j,k*j).floor()},this.setDrawingBufferSize=function(T,N,H){K=T,k=N,j=H,e.width=Math.floor(T*H),e.height=Math.floor(N*H),this.setViewport(0,0,T,N)},this.getCurrentViewport=function(T){return T.copy(y)},this.getViewport=function(T){return T.copy(ct)},this.setViewport=function(T,N,H,V){T.isVector4?ct.set(T.x,T.y,T.z,T.w):ct.set(T,N,H,V),Lt.viewport(y.copy(ct).multiplyScalar(j).round())},this.getScissor=function(T){return T.copy(pt)},this.setScissor=function(T,N,H,V){T.isVector4?pt.set(T.x,T.y,T.z,T.w):pt.set(T,N,H,V),Lt.scissor(b.copy(pt).multiplyScalar(j).round())},this.getScissorTest=function(){return kt},this.setScissorTest=function(T){Lt.setScissorTest(kt=T)},this.setOpaqueSort=function(T){X=T},this.setTransparentSort=function(T){lt=T},this.getClearColor=function(T){return T.copy(It.getClearColor())},this.setClearColor=function(){It.setClearColor.apply(It,arguments)},this.getClearAlpha=function(){return It.getClearAlpha()},this.setClearAlpha=function(){It.setClearAlpha.apply(It,arguments)},this.clear=function(T=!0,N=!0,H=!0){let V=0;if(T){let O=!1;if(A!==null){const it=A.texture.format;O=it===lc||it===ac||it===oc}if(O){const it=A.texture.type,ut=it===ii||it===ar||it===Ms||it===Gr||it===rc||it===sc,yt=It.getClearColor(),Et=It.getClearAlpha(),Ct=yt.r,Pt=yt.g,bt=yt.b;ut?(p[0]=Ct,p[1]=Pt,p[2]=bt,p[3]=Et,I.clearBufferuiv(I.COLOR,0,p)):(x[0]=Ct,x[1]=Pt,x[2]=bt,x[3]=Et,I.clearBufferiv(I.COLOR,0,x))}else V|=I.COLOR_BUFFER_BIT}N&&(V|=I.DEPTH_BUFFER_BIT,I.clearDepth(this.capabilities.reverseDepthBuffer?0:1)),H&&(V|=I.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),I.clear(V)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",J,!1),e.removeEventListener("webglcontextrestored",ht,!1),e.removeEventListener("webglcontextcreationerror",ft,!1),_t.dispose(),Zt.dispose(),Ut.dispose(),M.dispose(),B.dispose(),$.dispose(),oe.dispose(),D.dispose(),Tt.dispose(),q.dispose(),q.removeEventListener("sessionstart",qc),q.removeEventListener("sessionend",Yc),Bi.stop()};function J(T){T.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function ht(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const T=ae.autoReset,N=gt.enabled,H=gt.autoUpdate,V=gt.needsUpdate,O=gt.type;dt(),ae.autoReset=T,gt.enabled=N,gt.autoUpdate=H,gt.needsUpdate=V,gt.type=O}function ft(T){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",T.statusMessage)}function qt(T){const N=T.target;N.removeEventListener("dispose",qt),Ee(N)}function Ee(T){Ge(T),Ut.remove(T)}function Ge(T){const N=Ut.get(T).programs;N!==void 0&&(N.forEach(function(H){Tt.releaseProgram(H)}),T.isShaderMaterial&&Tt.releaseShaderCache(T))}this.renderBufferDirect=function(T,N,H,V,O,it){N===null&&(N=Wt);const ut=O.isMesh&&O.matrixWorld.determinant()<0,yt=pf(T,N,H,V,O);Lt.setMaterial(V,ut);let Et=H.index,Ct=1;if(V.wireframe===!0){if(Et=tt.getWireframeAttribute(H),Et===void 0)return;Ct=2}const Pt=H.drawRange,bt=H.attributes.position;let ne=Pt.start*Ct,le=(Pt.start+Pt.count)*Ct;it!==null&&(ne=Math.max(ne,it.start*Ct),le=Math.min(le,(it.start+it.count)*Ct)),Et!==null?(ne=Math.max(ne,0),le=Math.min(le,Et.count)):bt!=null&&(ne=Math.max(ne,0),le=Math.min(le,bt.count));const _e=le-ne;if(_e<0||_e===1/0)return;oe.setup(O,V,yt,H,Et);let en,Qt=vt;if(Et!==null&&(en=Z.get(Et),Qt=Gt,Qt.setIndex(en)),O.isMesh)V.wireframe===!0?(Lt.setLineWidth(V.wireframeLinewidth*Xt()),Qt.setMode(I.LINES)):Qt.setMode(I.TRIANGLES);else if(O.isLine){let wt=V.linewidth;wt===void 0&&(wt=1),Lt.setLineWidth(wt*Xt()),O.isLineSegments?Qt.setMode(I.LINES):O.isLineLoop?Qt.setMode(I.LINE_LOOP):Qt.setMode(I.LINE_STRIP)}else O.isPoints?Qt.setMode(I.POINTS):O.isSprite&&Qt.setMode(I.TRIANGLES);if(O.isBatchedMesh)if(O._multiDrawInstances!==null)Qt.renderMultiDrawInstances(O._multiDrawStarts,O._multiDrawCounts,O._multiDrawCount,O._multiDrawInstances);else if(Vt.get("WEBGL_multi_draw"))Qt.renderMultiDraw(O._multiDrawStarts,O._multiDrawCounts,O._multiDrawCount);else{const wt=O._multiDrawStarts,Ie=O._multiDrawCounts,te=O._multiDrawCount,wn=Et?Z.get(Et).bytesPerElement:1,ur=Ut.get(V).currentProgram.getUniforms();for(let nn=0;nn<te;nn++)ur.setValue(I,"_gl_DrawID",nn),Qt.render(wt[nn]/wn,Ie[nn])}else if(O.isInstancedMesh)Qt.renderInstances(ne,_e,O.count);else if(H.isInstancedBufferGeometry){const wt=H._maxInstanceCount!==void 0?H._maxInstanceCount:1/0,Ie=Math.min(H.instanceCount,wt);Qt.renderInstances(ne,_e,Ie)}else Qt.render(ne,_e)};function jt(T,N,H){T.transparent===!0&&T.side===Qn&&T.forceSinglePass===!1?(T.side=$e,T.needsUpdate=!0,Vs(T,N,H),T.side=Ci,T.needsUpdate=!0,Vs(T,N,H),T.side=Qn):Vs(T,N,H)}this.compile=function(T,N,H=null){H===null&&(H=T),m=Zt.get(H),m.init(N),E.push(m),H.traverseVisible(function(O){O.isLight&&O.layers.test(N.layers)&&(m.pushLight(O),O.castShadow&&m.pushShadow(O))}),T!==H&&T.traverseVisible(function(O){O.isLight&&O.layers.test(N.layers)&&(m.pushLight(O),O.castShadow&&m.pushShadow(O))}),m.setupLights();const V=new Set;return T.traverse(function(O){if(!(O.isMesh||O.isPoints||O.isLine||O.isSprite))return;const it=O.material;if(it)if(Array.isArray(it))for(let ut=0;ut<it.length;ut++){const yt=it[ut];jt(yt,H,O),V.add(yt)}else jt(it,H,O),V.add(it)}),E.pop(),m=null,V},this.compileAsync=function(T,N,H=null){const V=this.compile(T,N,H);return new Promise(O=>{function it(){if(V.forEach(function(ut){Ut.get(ut).currentProgram.isReady()&&V.delete(ut)}),V.size===0){O(T);return}setTimeout(it,10)}Vt.get("KHR_parallel_shader_compile")!==null?it():setTimeout(it,10)})};let We=null;function Wn(T){We&&We(T)}function qc(){Bi.stop()}function Yc(){Bi.start()}const Bi=new Qu;Bi.setAnimationLoop(Wn),typeof self<"u"&&Bi.setContext(self),this.setAnimationLoop=function(T){We=T,q.setAnimationLoop(T),T===null?Bi.stop():Bi.start()},q.addEventListener("sessionstart",qc),q.addEventListener("sessionend",Yc),this.render=function(T,N){if(N!==void 0&&N.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld(),N.parent===null&&N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),q.enabled===!0&&q.isPresenting===!0&&(q.cameraAutoUpdate===!0&&q.updateCamera(N),N=q.getCamera()),T.isScene===!0&&T.onBeforeRender(S,T,N,A),m=Zt.get(T,E.length),m.init(N),E.push(m),mt.multiplyMatrices(N.projectionMatrix,N.matrixWorldInverse),Yt.setFromProjectionMatrix(mt),Q=this.localClippingEnabled,Y=et.init(this.clippingPlanes,Q),v=_t.get(T,g.length),v.init(
vendor: 4,664 bytes, line 3839
3839),g.push(v),q.enabled===!0&&q.isPresenting===!0){const it=S.xr.getDepthSensingMesh();it!==null&&sa(it,N,-1/0,S.sortObjects)}sa(T,N,0,S.sortObjects),v.finish(),S.sortObjects===!0&&v.sort(X,lt),ie=q.enabled===!1||q.isPresenting===!1||q.hasDepthSensing()===!1,ie&&It.addToRenderList(v,T),this.info.render.frame++,Y===!0&&et.beginShadows();const H=m.state.shadowsArray;gt.render(H,T,N),Y===!0&&et.endShadows(),this.info.autoReset===!0&&this.info.reset();const V=v.opaque,O=v.transmissive;if(m.setupLights(),N.isArrayCamera){const it=N.cameras;if(O.length>0)for(let ut=0,yt=it.length;ut<yt;ut++){const Et=it[ut];Zc(V,O,T,Et)}ie&&It.render(T);for(let ut=0,yt=it.length;ut<yt;ut++){const Et=it[ut];$c(v,T,Et,Et.viewport)}}else O.length>0&&Zc(V,O,T,N),ie&&It.render(T),$c(v,T,N);A!==null&&(C.updateMultisampleRenderTarget(A),C.updateRenderTargetMipmap(A)),T.isScene===!0&&T.onAfterRender(S,T,N),oe.resetDefaultState(),L=-1,F=null,E.pop(),E.length>0?(m=E[E.length-1],Y===!0&&et.setGlobalState(S.clippingPlanes,m.state.camera)):m=null,g.pop(),g.length>0?v=g[g.length-1]:v=null};function sa(T,N,H,V){if(T.visible===!1)return;if(T.layers.test(N.layers)){if(T.isGroup)H=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(N);else if(T.isLight)m.pushLight(T),T.castShadow&&m.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||Yt.intersectsSprite(T)){V&&Rt.setFromMatrixPosition(T.matrixWorld).applyMatrix4(mt);const ut=$.update(T),yt=T.material;yt.visible&&v.push(T,ut,yt,H,Rt.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(!T.frustumCulled||Yt.intersectsObject(T))){const ut=$.update(T),yt=T.material;if(V&&(T.boundingSphere!==void 0?(T.boundingSphere===null&&T.computeBoundingSphere(),Rt.copy(T.boundingSphere.center)):(ut.boundingSphere===null&&ut.computeBoundingSphere(),Rt.copy(ut.boundingSphere.center)),Rt.applyMatrix4(T.matrixWorld).applyMatrix4(mt)),Array.isArray(yt)){const Et=ut.groups;for(let Ct=0,Pt=Et.length;Ct<Pt;Ct++){const bt=Et[Ct],ne=yt[bt.materialIndex];ne&&ne.visible&&v.push(T,ut,ne,H,Rt.z,bt)}}else yt.visible&&v.push(T,ut,yt,H,Rt.z,null)}}const it=T.children;for(let ut=0,yt=it.length;ut<yt;ut++)sa(it[ut],N,H,V)}function $c(T,N,H,V){const O=T.opaque,it=T.transmissive,ut=T.transparent;m.setupLightsView(H),Y===!0&&et.setGlobalState(S.clippingPlanes,H),V&&Lt.viewport(y.copy(V)),O.length>0&&Hs(O,N,H),it.length>0&&Hs(it,N,H),ut.length>0&&Hs(ut,N,H),Lt.buffers.depth.setTest(!0),Lt.buffers.depth.setMask(!0),Lt.buffers.color.setMask(!0),Lt.setPolygonOffset(!1)}function Zc(T,N,H,V){if((H.isScene===!0?H.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[V.id]===void 0&&(m.state.transmissionRenderTarget[V.id]=new Ri(1,1,{generateMipmaps:!0,type:Vt.has("EXT_color_buffer_half_float")||Vt.has("EXT_color_buffer_float")?Ds:ii,minFilter:er,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ee.workingColorSpace}));const it=m.state.transmissionRenderTarget[V.id],ut=V.viewport||y;it.setSize(ut.z,ut.w);const yt=S.getRenderTarget();S.setRenderTarget(it),S.getClearColor(z),W=S.getClearAlpha(),W<1&&S.setClearColor(16777215,.5),S.clear(),ie&&It.render(H);const Et=S.toneMapping;S.toneMapping=bi;const Ct=V.viewport;if(V.viewport!==void 0&&(V.viewport=void 0),m.setupLightsView(V),Y===!0&&et.setGlobalState(S.clippingPlanes,V),Hs(T,H,V),C.updateMultisampleRenderTarget(it),C.updateRenderTargetMipmap(it),Vt.has("WEBGL_multisampled_render_to_texture")===!1){let Pt=!1;for(let bt=0,ne=N.length;bt<ne;bt++){const le=N[bt],_e=le.object,en=le.geometry,Qt=le.material,wt=le.group;if(Qt.side===Qn&&_e.layers.test(V.layers)){const Ie=Qt.side;Qt.side=$e,Qt.needsUpdate=!0,Kc(_e,H,V,en,Qt,wt),Qt.side=Ie,Qt.needsUpdate=!0,Pt=!0}}Pt===!0&&(C.updateMultisampleRenderTarget(it),C.updateRenderTargetMipmap(it))}S.setRenderTarget(yt),S.setClearColor(z,W),Ct!==void 0&&(V.viewport=Ct),S.toneMapping=Et}function Hs(T,N,H){const V=N.isScene===!0?N.overrideMaterial:null;for(let O=0,it=T.length;O<it;O++){const ut=T[O],yt=ut.object,Et=ut.geometry,Ct=V===null?ut.material:V,Pt=ut.group;yt.layers.test(H.layers)&&Kc(yt,N,H,Et,Ct,Pt)}}function Kc(T,N,H,V,O,it){T.onBeforeRender(S,N,H,V,O,it),T.modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,T.matrixWorld),T.normalMatrix.getNormalMatrix(T.modelViewMatrix),O.onBeforeRender(S,N,H,V,T,it),O.transparent===!0&&O.side===Qn&&O.forceSinglePass===!1?(O.side=$e,O.needsUpdate=!0,S.renderBufferDirect(H,N,V,O,T,it),O.side=Ci,O.needsUpdate=!0,S.renderBufferDirect(H,N,V,O,T,it),O.side=Qn):S.renderBufferDirect(H,N,V,O,T,it),T.onAfterRender(S,N,H,V,O,it)}function Vs(T,N,H){N.isScene!==!0&&(N=Wt);const V=Ut.get(T),O=m.state.lights,it=m.state.shadowsArray,ut=O.state.ver
vendor: 4,540 bytes, line 3839
3839sion,yt=Tt.getParameters(T,O.state,it,N,H),Et=Tt.getProgramCacheKey(yt);let Ct=V.programs;V.environment=T.isMeshStandardMaterial?N.environment:null,V.fog=N.fog,V.envMap=(T.isMeshStandardMaterial?B:M).get(T.envMap||V.environment),V.envMapRotation=V.environment!==null&&T.envMap===null?N.environmentRotation:T.envMapRotation,Ct===void 0&&(T.addEventListener("dispose",qt),Ct=new Map,V.programs=Ct);let Pt=Ct.get(Et);if(Pt!==void 0){if(V.currentProgram===Pt&&V.lightsStateVersion===ut)return Jc(T,yt),Pt}else yt.uniforms=Tt.getUniforms(T),T.onBeforeCompile(yt,S),Pt=Tt.acquireProgram(yt,Et),Ct.set(Et,Pt),V.uniforms=yt.uniforms;const bt=V.uniforms;return(!T.isShaderMaterial&&!T.isRawShaderMaterial||T.clipping===!0)&&(bt.clippingPlanes=et.uniform),Jc(T,yt),V.needsLights=_f(T),V.lightsStateVersion=ut,V.needsLights&&(bt.ambientLightColor.value=O.state.ambient,bt.lightProbe.value=O.state.probe,bt.directionalLights.value=O.state.directional,bt.directionalLightShadows.value=O.state.directionalShadow,bt.spotLights.value=O.state.spot,bt.spotLightShadows.value=O.state.spotShadow,bt.rectAreaLights.value=O.state.rectArea,bt.ltc_1.value=O.state.rectAreaLTC1,bt.ltc_2.value=O.state.rectAreaLTC2,bt.pointLights.value=O.state.point,bt.pointLightShadows.value=O.state.pointShadow,bt.hemisphereLights.value=O.state.hemi,bt.directionalShadowMap.value=O.state.directionalShadowMap,bt.directionalShadowMatrix.value=O.state.directionalShadowMatrix,bt.spotShadowMap.value=O.state.spotShadowMap,bt.spotLightMatrix.value=O.state.spotLightMatrix,bt.spotLightMap.value=O.state.spotLightMap,bt.pointShadowMap.value=O.state.pointShadowMap,bt.pointShadowMatrix.value=O.state.pointShadowMatrix),V.currentProgram=Pt,V.uniformsList=null,Pt}function jc(T){if(T.uniformsList===null){const N=T.currentProgram.getUniforms();T.uniformsList=Ro.seqWithValue(N.seq,T.uniforms)}return T.uniformsList}function Jc(T,N){const H=Ut.get(T);H.outputColorSpace=N.outputColorSpace,H.batching=N.batching,H.batchingColor=N.batchingColor,H.instancing=N.instancing,H.instancingColor=N.instancingColor,H.instancingMorph=N.instancingMorph,H.skinning=N.skinning,H.morphTargets=N.morphTargets,H.morphNormals=N.morphNormals,H.morphColors=N.morphColors,H.morphTargetsCount=N.morphTargetsCount,H.numClippingPlanes=N.numClippingPlanes,H.numIntersection=N.numClipIntersection,H.vertexAlphas=N.vertexAlphas,H.vertexTangents=N.vertexTangents,H.toneMapping=N.toneMapping}function pf(T,N,H,V,O){N.isScene!==!0&&(N=Wt),C.resetTextureUnits();const it=N.fog,ut=V.isMeshStandardMaterial?N.environment:null,yt=A===null?S.outputColorSpace:A.isXRRenderTarget===!0?A.texture.colorSpace:Ni,Et=(V.isMeshStandardMaterial?B:M).get(V.envMap||ut),Ct=V.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,Pt=!!H.attributes.tangent&&(!!V.normalMap||V.anisotropy>0),bt=!!H.morphAttributes.position,ne=!!H.morphAttributes.normal,le=!!H.morphAttributes.color;let _e=bi;V.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(_e=S.toneMapping);const en=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,Qt=en!==void 0?en.length:0,wt=Ut.get(V),Ie=m.state.lights;if(Y===!0&&(Q===!0||T!==F)){const mn=T===F&&V.id===L;et.setState(V,T,mn)}let te=!1;V.version===wt.__version?(wt.needsLights&&wt.lightsStateVersion!==Ie.state.version||wt.outputColorSpace!==yt||O.isBatchedMesh&&wt.batching===!1||!O.isBatchedMesh&&wt.batching===!0||O.isBatchedMesh&&wt.batchingColor===!0&&O.colorTexture===null||O.isBatchedMesh&&wt.batchingColor===!1&&O.colorTexture!==null||O.isInstancedMesh&&wt.instancing===!1||!O.isInstancedMesh&&wt.instancing===!0||O.isSkinnedMesh&&wt.skinning===!1||!O.isSkinnedMesh&&wt.skinning===!0||O.isInstancedMesh&&wt.instancingColor===!0&&O.instanceColor===null||O.isInstancedMesh&&wt.instancingColor===!1&&O.instanceColor!==null||O.isInstancedMesh&&wt.instancingMorph===!0&&O.morphTexture===null||O.isInstancedMesh&&wt.instancingMorph===!1&&O.morphTexture!==null||wt.envMap!==Et||V.fog===!0&&wt.fog!==it||wt.numClippingPlanes!==void 0&&(wt.numClippingPlanes!==et.numPlanes||wt.numIntersection!==et.numIntersection)||wt.vertexAlphas!==Ct||wt.vertexTangents!==Pt||wt.morphTargets!==bt||wt.morphNormals!==ne||wt.morphColors!==le||wt.toneMapping!==_e||wt.morphTargetsCount!==Qt)&&(te=!0):(te=!0,wt.__version=V.version);let wn=wt.currentProgram;te===!0&&(wn=Vs(V,N,O));let ur=!1,nn=!1,oa=!1;const xe=wn.getUniforms(),li=wt.uniforms;if(Lt.useProgram(wn.program)&&(ur=!0,nn=!0,oa=!0),V.id!==L&&(L=V.id,nn=!0),ur||F!==T){$t.reverseDepthBuffer?(Mt.copy(T.projectionMatrix),Fm(
3839Mt),zm(Mt),xe.setValue(I,"projectionMatrix",Mt)):xe.setValue(I,"projectionMatrix",T.projectionMatrix),xe.setValue(I,"viewMatrix",T.matrixWorldInverse);const mn=xe.map.cameraPosition;mn!==void 0&&mn.setValue(I,Nt.setFromMatrixPosition(T.matrixWorld)),$t.logarithmicDepthBuffer&&xe.setValue(I,"logDepthBufFC",2/(Math.log(T.far+1)/Math.LN2)),(V.isMeshPhongMaterial||V.isMeshToonMaterial||V.isMeshLambertMaterial||V.isMeshBasicMaterial||V.isMeshStandardMaterial||V.isShaderMaterial)&&xe.setValue(I,"isOrthographic",T.isOrthographicCamera===!0),F!==T&&(F=T,nn=!0,oa=!0)}if(O.isSkinnedMesh){xe.setOptional(I,O,"bindMatrix"),xe.setOptional(I,O,"bindMatrixInverse");const mn=O.skeleton;mn&&(mn.boneTexture===null&&mn.computeBoneTexture(),xe.setValue(I,"boneTexture",mn.boneTexture,C))}O.isBatchedMesh&&(xe.setOptional(I,O,"batchingTexture"),xe.setValue(I,"batchingTexture",O._matricesTexture,C),xe.setOptional(I,O,"batchingIdTexture"),xe.setValue(I,"batchingIdTexture",O._indirectTexture,C),xe.setOptional(I,O,"batchingColorTexture"),O._colorsTexture!==null&&xe.setValue(I,"batchingColorTexture",O._colorsTexture,C));const aa=H.morphAttributes;if((aa.position!==void 0||aa.normal!==void 0||aa.color!==void 0)&&Dt.update(O,H,wn),(nn||wt.receiveShadow!==O.receiveShadow)&&(wt.receiveShadow=O.receiveShadow,xe.setValue(I,"receiveShadow",O.receiveShadow)),V.isMeshGouraudMaterial&&V.envMap!==null&&(li.envMap.value=Et,li.flipEnvMap.value=Et.isCubeTexture&&Et.isRenderTargetTexture===!1?-1:1),V.isMeshStandardMaterial&&V.envMap===null&&N.environment!==null&&(li.envMapIntensity.value=N.environmentIntensity),nn&&(xe.setValue(I,"toneMappingExposure",S.toneMappingExposure),wt.needsLights&&mf(li,oa),it&&V.fog===!0&&at.refreshFogUniforms(li,it),at.refreshMaterialUniforms(li,V,j,k,m.state.transmissionRenderTarget[T.id]),Ro.upload(I,jc(wt),li,C)),V.isShaderMaterial&&V.uniformsNeedUpdate===!0&&(Ro.upload(I,jc(wt),li,C),V.uniformsNeedUpdate=!1),V.isSpriteMaterial&&xe.setValue(I,"center",O.center),xe.setValue(I,"modelViewMatrix",O.modelViewMatrix),xe.setValue(I,"normalMatrix",O.normalMatrix),xe.setValue(I,"modelMatrix",O.matrixWorld),V.isShaderMaterial||V.isRawShaderMaterial){const mn=V.uniformsGroups;for(let la=0,gf=mn.length;la<gf;la++){const Qc=mn[la];D.update(Qc,wn),D.bind(Qc,wn)}}return wn}function mf(T,N){T.ambientLightColor.needsUpdate=N,T.lightProbe.needsUpdate=N,T.directionalLights.needsUpdate=N,T.directionalLightShadows.needsUpdate=N,T.pointLights.needsUpdate=N,T.pointLightShadows.needsUpdate=N,T.spotLights.needsUpdate=N,T.spotLightShadows.needsUpdate=N,T.rectAreaLights.needsUpdate=N,T.hemisphereLights.needsUpdate=N}function _f(T){return T.isMeshLambertMaterial||T.isMeshToonMaterial||T.isMeshPhongMaterial||T.isMeshStandardMaterial||T.isShadowMaterial||T.isShaderMaterial&&T.lights===!0}this.getActiveCubeFace=function(){return P},this.getActiveMipmapLevel=function(){return R},this.getRenderTarget=function(){return A},this.setRenderTargetTextures=function(T,N,H){Ut.get(T.texture).__webglTexture=N,Ut.get(T.depthTexture).__webglTexture=H;const V=Ut.get(T);V.__hasExternalTextures=!0,V.__autoAllocateDepthBuffer=H===void 0,V.__autoAllocateDepthBuffer||Vt.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),V.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(T,N){const H=Ut.get(T);H.__webglFramebuffer=N,H.__useDefaultFramebuffer=N===void 0},this.setRenderTarget=function(T,N=0,H=0){A=T,P=N,R=H;let V=!0,O=null,it=!1,ut=!1;if(T){const Et=Ut.get(T);if(Et.__useDefaultFramebuffer!==void 0)Lt.bindFramebuffer(I.FRAMEBUFFER,null),V=!1;else if(Et.__webglFramebuffer===void 0)C.setupRenderTarget(T);else if(Et.__hasExternalTextures)C.rebindTextures(T,Ut.get(T.texture).__webglTexture,Ut.get(T.depthTexture).__webglTexture);else if(T.depthBuffer){const bt=T.depthTexture;if(Et.__boundDepthTexture!==bt){if(bt!==null&&Ut.has(bt)&&(T.width!==bt.image.width||T.height!==bt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");C.setupDepthRenderbuffer(T)}}const Ct=T.texture;(Ct.isData3DTexture||Ct.isDataArrayTexture||Ct.isCompressedArrayTexture)&&(ut=!0);const Pt=Ut.get(T).__webglFramebuffer;
3839T.isWebGLCubeRenderTarget?(Array.isArray(Pt[N])?O=Pt[N][H]:O=Pt[N],it=!0):T.samples>0&&C.useMultisampledRTT(T)===!1?O=Ut.get(T).__webglMultisampledFramebuffer:Array.isArray(Pt)?O=Pt[H]:O=Pt,y.copy(T.viewport),b.copy(T.scissor),G=T.scissorTest}else y.copy(ct).multiplyScalar(j).floor(),b.copy(pt).multiplyScalar(j).floor(),G=kt;if(Lt.bindFramebuffer(I.FRAMEBUFFER,O)&&V&&Lt.drawBuffers(T,O),Lt.viewport(y),Lt.scissor(b),Lt.setScissorTest(G),it){const Et=Ut.get(T.texture);I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_CUBE_MAP_POSITIVE_X+N,Et.__webglTexture,H)}else if(ut){const Et=Ut.get(T.texture),Ct=N||0;I.framebufferTextureLayer(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,Et.__webglTexture,H||0,Ct)}L=-1},this.readRenderTargetPixels=function(T,N,H,V,O,it,ut){if(!(T&&T.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let yt=Ut.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&ut!==void 0&&(yt=yt[ut]),yt){Lt.bindFramebuffer(I.FRAMEBUFFER,yt);try{const Et=T.texture,Ct=Et.format,Pt=Et.type;if(!$t.textureFormatReadable(Ct)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!$t.textureTypeReadable(Pt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}N>=0&&N<=T.width-V&&H>=0&&H<=T.height-O&&I.readPixels(N,H,V,O,Ot.convert(Ct),Ot.convert(Pt),it)}finally{const Et=A!==null?Ut.get(A).__webglFramebuffer:null;Lt.bindFramebuffer(I.FRAMEBUFFER,Et)}}},this.readRenderTargetPixelsAsync=async function(T,N,H,V,O,it,ut){if(!(T&&T.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let yt=Ut.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&ut!==void 0&&(yt=yt[ut]),yt){const Et=T.texture,Ct=Et.format,Pt=Et.type;if(!$t.textureFormatReadable(Ct))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!$t.textureTypeReadable(Pt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(N>=0&&N<=T.width-V&&H>=0&&H<=T.height-O){Lt.bindFramebuffer(I.FRAMEBUFFER,yt);const bt=I.createBuffer();I.bindBuffer(I.PIXEL_PACK_BUFFER,bt),I.bufferData(I.PIXEL_PACK_BUFFER,it.byteLength,I.STREAM_READ),I.readPixels(N,H,V,O,Ot.convert(Ct),Ot.convert(Pt),0);const ne=A!==null?Ut.get(A).__webglFramebuffer:null;Lt.bindFramebuffer(I.FRAMEBUFFER,ne);const le=I.fenceSync(I.SYNC_GPU_COMMANDS_COMPLETE,0);return I.flush(),await Om(I,le,4),I.bindBuffer(I.PIXEL_PACK_BUFFER,bt),I.getBufferSubData(I.PIXEL_PACK_BUFFER,0,it),I.deleteBuffer(bt),I.deleteSync(le),it}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(T,N=null,H=0){T.isTexture!==!0&&(Ao("WebGLRenderer: copyFramebufferToTexture function signature has changed."),N=arguments[0]||null,T=arguments[1]);const V=Math.pow(2,-H),O=Math.floor(T.image.width*V),it=Math.floor(T.image.height*V),ut=N!==null?N.x:0,yt=N!==null?N.y:0;C.setTexture2D(T,0),I.copyTexSubImage2D(I.TEXTURE_2D,H,0,0,ut,yt,O,it),Lt.unbindTexture()},this.copyTextureToTexture=function(T,N,H=null,V=null,O=0){T.isTexture!==!0&&(Ao("WebGLRenderer: copyTextureToTexture function signature has changed."),V=arguments[0]||null,T=arguments[1],N=arguments[2],O=arguments[3]||0,H=null);let it,ut,yt,Et,Ct,Pt;H!==null?(it=H.max.x-H.min.x,ut=H.max.y-H.min.y,yt=H.min.x,Et=H.min.y):(it=T.image.width,ut=T.image.height,yt=0,Et=0),V!==null?(Ct=V.x,Pt=V.y):(Ct=0,Pt=0);const bt=Ot.convert(N.format),ne=Ot.convert(N.type);C.setTexture2D(N,0),I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL,N.flipY),I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),I.pixelStorei(I.UNPACK_ALIGNMENT,N.unpackAlignment);const le=I.getParameter(I.UNPACK_ROW_LENGTH),_e=I.getParameter(I.UNPACK_IMAGE_HEIGHT),en=I.getParameter(I.UNPACK_SKIP_PIXELS),Qt=
3839I.getParameter(I.UNPACK_SKIP_ROWS),wt=I.getParameter(I.UNPACK_SKIP_IMAGES),Ie=T.isCompressedTexture?T.mipmaps[O]:T.image;I.pixelStorei(I.UNPACK_ROW_LENGTH,Ie.width),I.pixelStorei(I.UNPACK_IMAGE_HEIGHT,Ie.height),I.pixelStorei(I.UNPACK_SKIP_PIXELS,yt),I.pixelStorei(I.UNPACK_SKIP_ROWS,Et),T.isDataTexture?I.texSubImage2D(I.TEXTURE_2D,O,Ct,Pt,it,ut,bt,ne,Ie.data):T.isCompressedTexture?I.compressedTexSubImage2D(I.TEXTURE_2D,O,Ct,Pt,Ie.width,Ie.height,bt,Ie.data):I.texSubImage2D(I.TEXTURE_2D,O,Ct,Pt,it,ut,bt,ne,Ie),I.pixelStorei(I.UNPACK_ROW_LENGTH,le),I.pixelStorei(I.UNPACK_IMAGE_HEIGHT,_e),I.pixelStorei(I.UNPACK_SKIP_PIXELS,en),I.pixelStorei(I.UNPACK_SKIP_ROWS,Qt),I.pixelStorei(I.UNPACK_SKIP_IMAGES,wt),O===0&&N.generateMipmaps&&I.generateMipmap(I.TEXTURE_2D),Lt.unbindTexture()},this.copyTextureToTexture3D=function(T,N,H=null,V=null,O=0){T.isTexture!==!0&&(Ao("WebGLRenderer: copyTextureToTexture3D function signature has changed."),H=arguments[0]||null,V=arguments[1]||null,T=arguments[2],N=arguments[3],O=arguments[4]||0);let it,ut,yt,Et,Ct,Pt,bt,ne,le;const _e=T.isCompressedTexture?T.mipmaps[O]:T.image;H!==null?(it=H.max.x-H.min.x,ut=H.max.y-H.min.y,yt=H.max.z-H.min.z,Et=H.min.x,Ct=H.min.y,Pt=H.min.z):(it=_e.width,ut=_e.height,yt=_e.depth,Et=0,Ct=0,Pt=0),V!==null?(bt=V.x,ne=V.y,le=V.z):(bt=0,ne=0,le=0);const en=Ot.convert(N.format),Qt=Ot.convert(N.type);let wt;if(N.isData3DTexture)C.setTexture3D(N,0),wt=I.TEXTURE_3D;else if(N.isDataArrayTexture||N.isCompressedArrayTexture)C.setTexture2DArray(N,0),wt=I.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL,N.flipY),I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),I.pixelStorei(I.UNPACK_ALIGNMENT,N.unpackAlignment);const Ie=I.getParameter(I.UNPACK_ROW_LENGTH),te=I.getParameter(I.UNPACK_IMAGE_HEIGHT),wn=I.getParameter(I.UNPACK_SKIP_PIXELS),ur=I.getParameter(I.UNPACK_SKIP_ROWS),nn=I.getParameter(I.UNPACK_SKIP_IMAGES);I.pixelStorei(I.UNPACK_ROW_LENGTH,_e.width),I.pixelStorei(I.UNPACK_IMAGE_HEIGHT,_e.height),I.pixelStorei(I.UNPACK_SKIP_PIXELS,Et),I.pixelStorei(I.UNPACK_SKIP_ROWS,Ct),I.pixelStorei(I.UNPACK_SKIP_IMAGES,Pt),T.isDataTexture||T.isData3DTexture?I.texSubImage3D(wt,O,bt,ne,le,it,ut,yt,en,Qt,_e.data):N.isCompressedArrayTexture?I.compressedTexSubImage3D(wt,O,bt,ne,le,it,ut,yt,en,_e.data):I.texSubImage3D(wt,O,bt,ne,le,it,ut,yt,en,Qt,_e),I.pixelStorei(I.UNPACK_ROW_LENGTH,Ie),I.pixelStorei(I.UNPACK_IMAGE_HEIGHT,te),I.pixelStorei(I.UNPACK_SKIP_PIXELS,wn),I.pixelStorei(I.UNPACK_SKIP_ROWS,ur),I.pixelStorei(I.UNPACK_SKIP_IMAGES,nn),O===0&&N.generateMipmaps&&I.generateMipmap(wt),Lt.unbindTexture()},this.initRenderTarget=function(T){Ut.get(T).__webglFramebuffer===void 0&&C.setupRenderTarget(T)},this.initTexture=function(T){T.isCubeTexture?C.setTextureCube(T,0):T.isData3DTexture?C.setTexture3D(T,0):T.isDataArrayTexture||T.isCompressedArrayTexture?C.setTexture2DArray(T,0):C.setTexture2D(T,0),Lt.unbindTexture()},this.resetState=function(){P=0,R=0,A=null,Lt.reset(),oe.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ei}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===cc?"display-p3":"srgb",e.unpackColorSpace=ee.workingColorSpace===$o?"display-p3":"srgb"}}class sd extends Ve{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 ri,this.environmentIntensity=1,this.environmentRotation=new ri,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){const 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}}class jx extends Qr{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Kt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const zo=new U,Bo=new U,Kh=new me,ls=new uc,uo=new Ns,za=new U,jh=new U;class Jx extends Ve{constructor(t=new En,e=new jx){super(),this.isLine=!0,this.type="Line",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}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[0];for(let r=1,s=e.count;r<s;r++)zo.fromBufferAttribute(e,r-1),Bo.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=zo.distanceTo(Bo
vendor: 2,678 bytes, line 3839
3839);t.setAttribute("lineDistance",new ni(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,s=t.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),uo.copy(n.boundingSphere),uo.applyMatrix4(r),uo.radius+=s,t.ray.intersectsSphere(uo)===!1)return;Kh.copy(r).invert(),ls.copy(t.ray).applyMatrix4(Kh);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=this.isLineSegments?2:1,h=n.index,f=n.attributes.position;if(h!==null){const p=Math.max(0,o.start),x=Math.min(h.count,o.start+o.count);for(let v=p,m=x-1;v<m;v+=c){const g=h.getX(v),E=h.getX(v+1),S=fo(this,t,ls,l,g,E);S&&e.push(S)}if(this.isLineLoop){const v=h.getX(x-1),m=h.getX(p),g=fo(this,t,ls,l,v,m);g&&e.push(g)}}else{const p=Math.max(0,o.start),x=Math.min(f.count,o.start+o.count);for(let v=p,m=x-1;v<m;v+=c){const g=fo(this,t,ls,l,v,v+1);g&&e.push(g)}if(this.isLineLoop){const v=fo(this,t,ls,l,x-1,p);v&&e.push(v)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function fo(i,t,e,n,r,s){const o=i.geometry.attributes.position;if(zo.fromBufferAttribute(o,r),Bo.fromBufferAttribute(o,s),e.distanceSqToSegment(zo,Bo,za,jh)>n)return;za.applyMatrix4(i.matrixWorld);const l=t.ray.origin.distanceTo(za);if(!(l<t.near||l>t.far))return{distance:l,point:jh.clone().applyMatrix4(i.matrixWorld),index:r,face:null,faceIndex:null,barycoord:null,object:i}}const Jh=new U,Qh=new U;class Qx extends Jx{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[];for(let r=0,s=e.count;r<s;r+=2)Jh.fromBufferAttribute(e,r),Qh.fromBufferAttribute(e,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Jh.distanceTo(Qh);t.setAttribute("lineDistance",new ni(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class ty extends Qr{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Kt(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}}
vendor: 9,212 bytes, line 3839
3839const tu=new me,kl=new uc,po=new Ns,mo=new U;class od extends Ve{constructor(t=new En,e=new ty){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){const n=this.geometry,r=this.matrixWorld,s=t.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),po.copy(n.boundingSphere),po.applyMatrix4(r),po.radius+=s,t.ray.intersectsSphere(po)===!1)return;tu.copy(r).invert(),kl.copy(t.ray).applyMatrix4(tu);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=n.index,u=n.attributes.position;if(c!==null){const f=Math.max(0,o.start),p=Math.min(c.count,o.start+o.count);for(let x=f,v=p;x<v;x++){const m=c.getX(x);mo.fromBufferAttribute(u,m),eu(mo,m,l,r,t,e,this)}}else{const f=Math.max(0,o.start),p=Math.min(u.count,o.start+o.count);for(let x=f,v=p;x<v;x++)mo.fromBufferAttribute(u,x),eu(mo,x,l,r,t,e,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){const r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function eu(i,t,e,n,r,s,o){const a=kl.distanceSqToPoint(i);if(a<e){const l=new U;kl.closestPointToPoint(i,l),l.applyMatrix4(n);const c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}class Gn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),s=0;e.push(0);for(let o=1;o<=t;o++)n=this.getPoint(o/t),s+=n.distanceTo(r),e.push(s),r=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let r=0;const s=n.length;let o;e?o=e:o=t*n[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=n[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,n[r]===o)return r/(s-1);const h=n[r],f=n[r+1]-h,p=(o-h)/f;return(r+p)/(s-1)}getTangent(t,e){let r=t-1e-4,s=t+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=e||(o.isVector2?new St:new U);return l.copy(a).sub(o).normalize(),l}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new U,r=[],s=[],o=[],a=new U,l=new me;for(let p=0;p<=t;p++){const x=p/t;r[p]=this.getTangentAt(x,new U)}s[0]=new U,o[0]=new U;let c=Number.MAX_VALUE;const h=Math.abs(r[0].x),u=Math.abs(r[0].y),f=Math.abs(r[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),f<=c&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let p=1;p<=t;p++){if(s[p]=s[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(r[p-1],r[p]),a.length()>Number.EPSILON){a.normalize();const x=Math.acos(De(r[p-1].dot(r[p]),-1,1));s[p].applyMatrix4(l.makeRotationAxis(a,x))}o[p].crossVectors(r[p],s[p])}if(e===!0){let p=Math.acos(De(s[0].dot(s[t]),-1,1));p/=t,r[0].dot(a.crossVectors(s[0],s[t]))>0&&(p=-p);for(let x=1;x<=t;x++)s[x].applyMatrix4(l.makeRotationAxis(r[x],p*x)),o[x].crossVectors(r[x],s[x])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class mc extends Gn{constructor(t=0,e=0,n=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(t,e=new St){const n=e,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const a=this.aStartAngle+t*s;let l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const h=Math.cos(this.aRotation),u=Math.sin(this.aRotation),f=l-this.aX,p=c-this.aY;l=f*h-p*u+this.aX,c=f*u+p*h+this.aY}return n.set(l,c)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class ey extends mc{constructor(t,e,n,r,s,o){super(t,e,n,n,r,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function _c(){let i=0,t=0,e=0,n=0;function r(s,o,a,l){i=s,t=a,e=-3*s+3*o-2*a-l,n=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,c){r(o,a,c*(a-s),c*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,c,h,u){let f=(o-s)/c-(a-s)/(c+h)+(a-o)/h,p=(a-o)/h-(l-o)/(h+u)+(l-a)/u;f*=h,p*=h,r(o,a,f,p)},calc:function(s){const o=s*s,a=o*s;return i+t*s+e*o+n*a}}}const _o=new U,Ba=new _c,ka=new _c,Ha=new _c;class ny extends Gn{constructor(t=[],e=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r}getPoint(t,e=new U){const n=e,r=this.points,s=r.length,o=(s-(this.closed?0:1))*t;let a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,h;this.closed||a>0?c=r[(a-1)%s]:(_o.subVectors(r[0],r[1]).add(r[0]),c=_o);const u=r[a%s],f=r[(a+1)%s];if(this.closed||a+2<s?h=r[(a+2)%s]:(_o.subVectors(r[s-1],r[s-2]).add(r[s-1]),h=_o),this.curveType==="centripetal"||this.curveType==="chordal"){const p=this.curveType==="chordal"?.5:.25;let x=Math.pow(c.distanceToSquared(u),p),v=Math.pow(u.distanceToSquared(f),p),m=Math.pow(f.distanceToSquared(h),p);v<1e-4&&(v=1),x<1e-4&&(x=v),m<1e-4&&(m=v),Ba.initNonuniformCatmullRom(c.x,u.x,f.x,h.x,x,v,m),ka.initNonuniformCatmullRom(c.y,u.y,f.y,h.y,x,v,m),Ha.initNonuniformCatmullRom(c.z,u.z,f.z,h.z,x,v,m)}else this.curveType==="catmullrom"&&(Ba.initCatmullRom(c.x,u.x,f.x,h.x,this.tension),ka.initCatmullRom(c.y,u.y,f.y,h.y,this.tension),Ha.initCatmullRom(c.z,u.z,f.z,h.z,this.tension));return n.set(Ba.calc(l),ka.calc(l),Ha.calc(l)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(new U().fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function nu(i,t,e,n,r){const s=(n-t)*.5,o=(r-e)*.5,a=i*i,l=i*a;return(2*e-2*n+s+o)*l+(-3*e+3*n-2*s-o)*a+s*i+e}function iy(i,t){const e=1-i;return e*e*t}function ry(i,t){return 2*(1-i)*i*t}function sy(i,t){return i*i*t}function _s(i,t,e,n){return iy(i,t)+ry(i,e)+sy(i,n)}function oy(i,t){const e=1-i;return e*e*e*t}function ay(i,t){const e=1-i;return 3*e*e*i*t}function ly(i,t){return 3*(1-i)*i*i*t}function cy(i,t){return i*i*i*t}function gs(i,t,e,n,r){return oy(i,t)+ay(i,e)+ly(i,n)+cy(i,r)}class ad extends Gn{constructor(t=new St,e=new St,n=new St,r=new St){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new St){const n=e,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(gs(t,r.x,s.x,o.x,a.x),gs(t,r.y,s.y,o.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}
vendor: 5,408 bytes, line 3839
3839class hy extends Gn{constructor(t=new U,e=new U,n=new U,r=new U){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new U){const n=e,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(gs(t,r.x,s.x,o.x,a.x),gs(t,r.y,s.y,o.y,a.y),gs(t,r.z,s.z,o.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class ld extends Gn{constructor(t=new St,e=new St){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new St){const n=e;return t===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new St){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class uy extends Gn{constructor(t=new U,e=new U){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new U){const n=e;return t===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new U){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class cd extends Gn{constructor(t=new St,e=new St,n=new St){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new St){const n=e,r=this.v0,s=this.v1,o=this.v2;return n.set(_s(t,r.x,s.x,o.x),_s(t,r.y,s.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class dy extends Gn{constructor(t=new U,e=new U,n=new U){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new U){const n=e,r=this.v0,s=this.v1,o=this.v2;return n.set(_s(t,r.x,s.x,o.x),_s(t,r.y,s.y,o.y),_s(t,r.z,s.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class hd extends Gn{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new St){const n=e,r=this.points,s=(r.length-1)*t,o=Math.floor(s),a=s-o,l=r[o===0?o:o-1],c=r[o],h=r[o>r.length-2?r.length-1:o+1],u=r[o>r.length-3?r.length-1:o+2];return n.set(nu(a,l.x,c.x,h.x,u.x),nu(a,l.y,c.y,h.y,u.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const r=this.points[e];t.points.push(r.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const r=t.points[e];this.points.push(new St().fromArray(r))}return this}}var iu=Object.freeze({__proto__:null,ArcCurve:ey,CatmullRomCurve3:ny,CubicBezierCurve:ad,CubicBezierCurve3:hy,EllipseCurve:mc,LineCurve:ld,LineCurve3:uy,QuadraticBezierCurve:cd,QuadraticBezierCurve3:dy,SplineCurve:hd});class fy extends Gn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const n=t.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new iu[n](e,t))}return this}getPoint(t,e){const n=t*this.getLength(),r=this.getCurveLengths();let s=0;for(;s<r.length;){if(r[s]>=n){const o=r[s]-n,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,e)}s++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],a=o.isEllipseCurve?t*2:o.isLineCurve||o.isLineCurve3?1:o.isS
3839plineCurve?t*o.points.length:t,l=o.getPoints(a);for(let c=0;c<l.length;c++){const h=l[c];n&&n.equals(h)||(e.push(h),n=h)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const r=this.curves[e];t.curves.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const r=t.curves[e];this.curves.push(new iu[r.type]().fromJSON(r))}return this}}class ru extends fy{constructor(t){super(),this.type="Path",this.currentPoint=new St,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new ld(this.currentPoint.clone(),new St(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,r){const s=new cd(this.currentPoint.clone(),new St(t,e),new St(n,r));return this.curves.push(s),this.currentPoint.set(n,r),this}bezierCurveTo(t,e,n,r,s,o){const a=new ad(this.currentPoint.clone(),new St(t,e),new St(n,r),new St(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new hd(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,r,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(t+a,e+l,n,r,s,o),this}absarc(t,e,n,r,s,o){return this.absellipse(t,e,n,n,r,s,o),this}ellipse(t,e,n,r,s,o,a,l){const c=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(t+c,e+h,n,r,s,o,a,l),this}absellipse(t,e,n,r,s,o,a,l){const c=new mc(t,e,n,r,s,o,a,l);if(this.curves.length>0){const u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class py extends ru{constructor(t){super(t),this.uuid=cr(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const r=t.holes[e];this.holes.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const r=this.holes[e];t.holes.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const r=t.holes[e];this.holes.push(new ru().fromJSON(r))}return this}}class gc extends si{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class my{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=su(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=su();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function su(){return performance.now()}class _y extends lr{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(){}disconnect(){}dispose(){}update(){}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:nc}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=nc);function jn(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function ud(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,i.__proto__=t}/*! 3840 * GSAP 3.15.0 3841 * https://gsap.com 3842 * 3843 * @license Copyright 2008-2026, GreenSock. All rights reserved. 3844 * Subject to the terms at https://gsap.com/standard-license 3845 * @author: Jack Doyle, [email protected] 3846*/var hn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Ts={duration:.5,overwrite:!1,delay:0},vc,Ue,ue,yn=1e8,se=1/yn,Hl=Math.PI*2,gy=Hl/4,vy=0,dd=Math.sqrt,xy=Math.cos,yy=Math.sin,Le=function(t){return typeof t=="string"},ve=function(t){return typeof t=="function"},oi=function(t){return typeof t=="number"},xc=function(t){return typeof t>"u"},kn=function(t){return typeof t=="object"},Ze=function(t){return t!==!1},yc=function(){return typeof window<"u"},go=function(t){return ve(t)||Le(t)},fd=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ze=Array.isArray,Sy=/random\([^)]+\)/g,My=/,\s*/g,ou=/(?:-?\.?\d|\.)+/gi,pd=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Lr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Va=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,md=/[+-]=-?[.\d]+/,Ey=/[^,'"\[\]\s]+/gi,Ty=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,fe,Nn,Vl,Sc,un={},ko={},_d,gd=function(t){return(ko=qr(t,un))&&Qe},Mc=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},bs=function(t,e){return!e&&console.warn(t)},vd=function(t,e){return t&&(un[t]=e)&&ko&&(ko[t]=e)||un},ws=function(){return 0},by={suppressEvents:!0,isStart:!0,kill:!1},Po={suppressEvents:!0,kill:!1},wy={suppressEvents:!0},Ec={},wi=[],Gl={},xd,on={},Ga={},au=30,Lo=[],Tc="",bc=function(t){var e=t[0],n,r;if(kn(e)||ve(e)||(t=[t]),!(n=(e._gsap||{}).harness)){for(r=Lo.length;r--&&!Lo[r].targetTest(e););n=Lo[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Hd(t[r],n)))||t.splice(r,1);return t},ir=function(t){return t._gsap||bc(Sn(t))[0]._gsap},yd=function(t,e,n){return(n=t[e])&&ve(n)?t[e]():xc(n)&&t.getAttribute&&t.getAttribute(e)||n}
vendor: 6,228 bytes, line 3846
3846,Ke=function(t,e){return(t=t.split(",")).forEach(e)||t},ye=function(t){return Math.round(t*1e5)/1e5||0},de=function(t){return Math.round(t*1e7)/1e7||0},Fr=function(t,e){var n=e.charAt(0),r=parseFloat(e.substr(2));return t=parseFloat(t),n==="+"?t+r:n==="-"?t-r:n==="*"?t*r:t/r},Ay=function(t,e){for(var n=e.length,r=0;t.indexOf(e[r])<0&&++r<n;);return r<n},Ho=function(){var t=wi.length,e=wi.slice(0),n,r;for(Gl={},wi.length=0,n=0;n<t;n++)r=e[n],r&&r._lazy&&(r.render(r._lazy[0],r._lazy[1],!0)._lazy=0)},wc=function(t){return!!(t._initted||t._startAt||t.add)},Sd=function(t,e,n,r){wi.length&&!Ue&&Ho(),t.render(e,n,!!(Ue&&e<0&&wc(t))),wi.length&&!Ue&&Ho()},Md=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Ey).length<2?e:Le(t)?t.trim():t},Ed=function(t){return t},dn=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Cy=function(t){return function(e,n){for(var r in n)r in e||r==="duration"&&t||r==="ease"||(e[r]=n[r])}},qr=function(t,e){for(var n in e)t[n]=e[n];return t},lu=function i(t,e){for(var n in e)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=kn(e[n])?i(t[n]||(t[n]={}),e[n]):e[n]);return t},Vo=function(t,e){var n={},r;for(r in t)r in e||(n[r]=t[r]);return n},vs=function(t){var e=t.parent||fe,n=t.keyframes?Cy(ze(t.keyframes)):dn;if(Ze(t.inherit))for(;e;)n(t,e.vars.defaults),e=e.parent||e._dp;return t},Ry=function(t,e){for(var n=t.length,r=n===e.length;r&&n--&&t[n]===e[n];);return n<0},Td=function(t,e,n,r,s){var o=t[r],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[r]=e,e._prev=o,e.parent=e._dp=t,e},jo=function(t,e,n,r){n===void 0&&(n="_first"),r===void 0&&(r="_last");var s=e._prev,o=e._next;s?s._next=o:t[n]===e&&(t[n]=o),o?o._prev=s:t[r]===e&&(t[r]=s),e._next=e._prev=e.parent=null},Pi=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},rr=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},Py=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Wl=function(t,e,n,r){return t._startAt&&(Ue?t._startAt.revert(Po):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,r))},Ly=function i(t){return!t||t._ts&&i(t.parent)},cu=function(t){return t._repeat?Yr(t._tTime,t=t.duration()+t._rDelay)*t:0},Yr=function(t,e){var n=Math.floor(t=de(t/e));return t&&n===t?n-1:n},Go=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Jo=function(t){return t._end=de(t._start+(t._tDur/Math.abs(t._ts||t._rts||se)||0))},Qo=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=de(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Jo(t),n._dirty||rr(n,t)),t},bd=function(t,e){var n;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(n=Go(t.rawTime(),e),(!e._dur||Fs(0,e.totalDuration(),n)-e._tTime>se)&&e.render(n,!0)),rr(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=-se}},Fn=function(t,e,n,r){return e.parent&&Pi(e),e._start=de((oi(n)?n:n||t!==fe?gn(t,n,e):t._time)+e._delay),e._end=de(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Td(t,e,"_first","_last",t._sort?"_start":0),Xl(e)||(t._recent=e),r||bd(t,e),t._ts<0&&Qo(t,t._tTime),t},wd=function(t,e){return(un.ScrollTrigger||Mc("scrollTrigger",e))&&un.ScrollTrigger.create(e,t)},Ad=function(t,e,n,r,s){if(Cc(t,e,s),!t._initted)return 1;if(!n&&t._pt&&!Ue&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&xd!==an.frame)return wi.push(t),t._lazy=[s,r],1},Iy=function i(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||i(e))},Xl=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},Dy=function(t,e,n,r){var s=t.ratio,o=e<0||!e&&(!t._start&&Iy(t)&&!(!t._initted&&Xl(t))||(t._ts<0||t._dp._ts<0)&&!Xl(t))?0:1,a=t._rDelay,l=0,c,h,u;if(a&&t._repeat&&(l=Fs(0,t._tDur,e),h=Yr(l,a),t._yoyo&&h&1&&(o=1-o),h!==Yr(t._tTime,a)&&(s=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==s||Ue||r||t._zTime===se||!e&&t._zTime){if(!t._initted&&Ad(t,e,r,n,l))return;for(u=t._zTime,t._zTime=e||(n?se:0),n||(n=e&&!u),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&&Wl(t,e,n,!0),t._onUpdate&&!n&&ln(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&ln(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&Pi(t,1),!n&&!Ue&&(ln(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},Uy=function(t,e,n){var r;if(n>e)for(r=t._first;r&&r._start<=n;){if(r.data==="isPause"&&r._start>e)return r;r=r._next}else for(r=t._last;r&&r._start>=n;){if(r.data==="isPause"&&r._start<e)return r;r=r._prev}},$r=function(t,e,n,r){var s=t._repeat,o=de(e)||0,a=t._tTime/t._tDur;return a&&!r&&(t._time*=o/t._dur),t._dur=o,t._tDur=s?s<0?1e10:de(o*(s+1)+t._rDelay*s):o,a>0&&!r&&Qo(t,t._tTime=t._tDur*a),t.parent&&Jo(t),n||rr(t.parent,t),t},hu=function(t){return t instanceof Ye?rr(t):$r(t,t._dur)},Ny={_start:0,endTime:ws,totalDuration:ws},gn=function i(t,e,n){var r=t.labels,s=t._recent||Ny,o=t.duration()>=yn?s.endTime(!1):t._dur,a,l,c;return Le(e)&&(isNaN(e)||e in r)?(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 r||(r[e]=o),r[e]):(l=parseFloat(e.charAt(a-1)+e.substr(a+1)),c&&n&&(l=l/100*(ze(n)?n[0]:n).totalDuration()),a>1?i(t,e.substr(0,a-1),n)+l:o+l)):e==null?o:+e},xs=function(t,e,n){var r=oi(e[1]),s=(r?2:1)+(t<2?0:1),o=e[s],a,l;if(r&&(o.duration=e[1]),o.parent=n,t){for(a=o,l=n;l&&!("immediateRender"in a);)a=l.vars.defaults||{},l=Ze(l.vars.inherit)&&l.parent;o.immediateRender=Ze(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[s-1]}return new Se(e[0],o,e[s+1])},Oi=function(t,e){return t||t===0?e(t):e},Fs=function(t,e,n){return n<t?t:n>e?e:n},Fe=function(t,e){return!Le(t)||!(e=Ty.exec(t))?"":e[1]},Oy=function(t,e,n){return Oi(n,function(r){return Fs(t,e,r)})},ql=[].slice,Cd=function(t,e){return t&&kn(t)&&"length"in t&&(!e&&!t.length||t.length-1
vendor: 15,938 bytes, line 3846
3846in t&&kn(t[0]))&&!t.nodeType&&t!==Nn},Fy=function(t,e,n){return n===void 0&&(n=[]),t.forEach(function(r){var s;return Le(r)&&!e||Cd(r,1)?(s=n).push.apply(s,Sn(r)):n.push(r)})||n},Sn=function(t,e,n){return ue&&!e&&ue.selector?ue.selector(t):Le(t)&&!n&&(Vl||!Zr())?ql.call((e||Sc).querySelectorAll(t),0):ze(t)?Fy(t,n):Cd(t)?ql.call(t,0):t?[t]:[]},Yl=function(t){return t=Sn(t)[0]||bs("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return Sn(e,n.querySelectorAll?n:n===t?bs("Invalid scope")||Sc.createElement("div"):t)}},Rd=function(t){return t.sort(function(){return .5-Math.random()})},Pd=function(t){if(ve(t))return t;var e=kn(t)?t:{each:t},n=sr(e.ease),r=e.from||0,s=parseFloat(e.base)||0,o={},a=r>0&&r<1,l=isNaN(r)||a,c=e.axis,h=r,u=r;return Le(r)?h=u={center:.5,edges:.5,end:1}[r]||0:!a&&l&&(h=r[0],u=r[1]),function(f,p,x){var v=(x||e).length,m=o[v],g,E,S,w,P,R,A,L,F;if(!m){if(F=e.grid==="auto"?0:(e.grid||[1,yn])[1],!F){for(A=-yn;A<(A=x[F++].getBoundingClientRect().left)&&F<v;);F<v&&F--}for(m=o[v]=[],g=l?Math.min(F,v)*h-.5:r%F,E=F===yn?0:l?v*u/F-.5:r/F|0,A=0,L=yn,R=0;R<v;R++)S=R%F-g,w=E-(R/F|0),m[R]=P=c?Math.abs(c==="y"?w:S):dd(S*S+w*w),P>A&&(A=P),P<L&&(L=P);r==="random"&&Rd(m),m.max=A-L,m.min=L,m.v=v=(parseFloat(e.amount)||parseFloat(e.each)*(F>v?v-1:c?c==="y"?v/F:F:Math.max(F,v/F))||0)*(r==="edges"?-1:1),m.b=v<0?s-v:s,m.u=Fe(e.amount||e.each)||0,n=n&&v<0?Ky(n):n}return v=(m[f]-m.min)/m.max||0,de(m.b+(n?n(v):v)*m.v)+m.u}},$l=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var r=de(Math.round(parseFloat(n)/t)*t*e);return(r-r%1)/e+(oi(n)?0:Fe(n))}},Ld=function(t,e){var n=ze(t),r,s;return!n&&kn(t)&&(r=n=t.radius||yn,t.values?(t=Sn(t.values),(s=!oi(t[0]))&&(r*=r)):t=$l(t.increment)),Oi(e,n?ve(t)?function(o){return s=t(o),Math.abs(s-o)<=r?s:o}:function(o){for(var a=parseFloat(s?o.x:o),l=parseFloat(s?o.y:0),c=yn,h=0,u=t.length,f,p;u--;)s?(f=t[u].x-a,p=t[u].y-l,f=f*f+p*p):f=Math.abs(t[u]-a),f<c&&(c=f,h=u);return h=!r||c<=r?t[h]:o,s||h===o||oi(o)?h:h+Fe(o)}:$l(t))},Id=function(t,e,n,r){return Oi(ze(t)?!e:n===!0?!!(n=0):!r,function(){return ze(t)?t[~~(Math.random()*t.length)]:(n=n||1e-5)&&(r=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((t-n/2+Math.random()*(e-t+n*.99))/n)*n*r)/r})},zy=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){return e.reduce(function(s,o){return o(s)},r)}},By=function(t,e){return function(n){return t(parseFloat(n))+(e||Fe(n))}},ky=function(t,e,n){return Ud(t,e,0,1,n)},Dd=function(t,e,n){return Oi(n,function(r){return t[~~e(r)]})},Hy=function i(t,e,n){var r=e-t;return ze(t)?Dd(t,i(0,t.length),e):Oi(n,function(s){return(r+(s-t)%r)%r+t})},Vy=function i(t,e,n){var r=e-t,s=r*2;return ze(t)?Dd(t,i(0,t.length-1),e):Oi(n,function(o){return o=(s+(o-t)%s)%s||0,t+(o>r?s-o:o)})},As=function(t){return t.replace(Sy,function(e){var n=e.indexOf("[")+1,r=e.substring(n||7,n?e.indexOf("]"):e.length-1).split(My);return Id(n?r:+r[0],n?0:+r[1],+r[2]||1e-5)})},Ud=function(t,e,n,r,s){var o=e-t,a=r-n;return Oi(s,function(l){return n+((l-t)/o*a||0)})},Gy=function i(t,e,n,r){var s=isNaN(t+e)?0:function(p){return(1-p)*t+p*e};if(!s){var o=Le(t),a={},l,c,h,u,f;if(n===!0&&(r=1)&&(n=null),o)t={p:t},e={p:e};else if(ze(t)&&!ze(e)){for(h=[],u=t.length,f=u-2,c=1;c<u;c++)h.push(i(t[c-1],t[c]));u--,s=function(x){x*=u;var v=Math.min(f,~~x);return h[v](x-v)},n=e}else r||(t=qr(ze(t)?[]:{},t));if(!h){for(l in e)Ac.call(a,t,l,"get",e[l]);s=function(x){return Lc(x,a)||(o?t.p:t)}}}return Oi(n,s)},uu=function(t,e,n){var r=t.labels,s=yn,o,a,l;for(o in r)a=r[o]-e,a<0==!!n&&a&&s>(a=Math.abs(a))&&(l=o,s=a);return l},ln=function(t,e,n){var r=t.vars,s=r[e],o=ue,a=t._ctx,l,c,h;if(s)return l=r[e+"Params"],c=r.callbackScope||t,n&&wi.length&&Ho(),a&&(ue=a),h=l?s.apply(c,l):s.call(c),ue=o,h},us=function(t){return Pi(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Ue),t.progress()<1&&ln(t,"onInterrupt"),t},Ir,Nd=[],Od=function(t){if(t)if(t=!t.name&&t.default||t,yc()||t.headless){var e=t.name,n=ve(t),r=e&&!n&&t.init?function(){this._props=[]}:t,s={init:ws,render:Lc,add:Ac,kill:oS,modifier:sS,rawVars:0},o={targetTest:0,get:0,getSetter:Pc,aliases:{},register:0};if(Zr(),t!==r){if(on[e])return;dn(r,dn(Vo(t,s),o)),qr(r.prototype,qr(s,Vo(t,o))),on[r.prop=e]=r,t.targetTest&&(Lo.push(r),Ec[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}vd(e,r),t.register&&t.register(Qe,r,je)}else Nd.push(t)},re=255,ds={aqua:[0,re,re],lime:[0,re,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,re],navy:[0,0,128],white:[re,re,re],olive:[128,128,0],yellow:[re,re,0],orange:[re,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[re,0,0],pink:[re,192,203],cyan:[0,re,re],transparent:[re,re,re,0]},Wa=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)*re+.5|0},Fd=function(t,e,n){var r=t?oi(t)?[t>>16,t>>8&re,t&re]:0:ds.black,s,o,a,l,c,h,u,f,p,x;if(!r){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ds[t])r=ds[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 r=parseInt(t.substr(1,6),16),[r>>16,r>>8&re,r&re,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),r=[t>>16,t>>8&re,t&re]}else if(t.substr(0,3)==="hsl"){if(r=x=t.match(ou),!e)l=+r[0]%360/360,c=+r[1]/100,h=+r[2]/100,o=h<=.5?h*(c+1):h+c-h*c,s=h*2-o,r.length>3&&(r[3]*=1),r[0]=Wa(l+1/3,s,o),r[1]=Wa(l,s,o),r[2]=Wa(l-1/3,s,o);else if(~t.indexOf("="))return r=t.match(pd),n&&r.length<4&&(r[3]=1),r}else r=t.match(ou)||ds.transparent;r=r.map(Number)}return e&&!x&&(s=r[0]/re,o=r[1]/re,a=r[2]/re,u=Math.max(s,o,a),f=Math.min(s,o,a),h=(u+f)/2,u===f?l=c=0:(p=u-f,c=h>.5?p/(2-u-f):p/(u+f),l=u===s?(o-a)/p+(o<a?6:0):u===o?(a-s)/p+2:(s-o)/p+4,l*=60),r[0]=~~(l+.5),r[1]=~~(c*100+.5),r[2]=~~(h*100+.5)),n&&r.length<4&&(r[3]=1),r},zd=function(t){var e=[],n=[],r=-1;return t.split(Ai).forEach(function(s){var o=s.match(Lr)||[];e.push.apply(e,o),n.push(r+=o.length+1)}),e.c=n,e},du=function(t,e,n){var r="",s=(t+r).match(Ai),o=e?"hsla(":"rgba(",a=0,l,c,h,u;if(!s)return t;if(s=s.map(function(f){return(f=Fd(f,e,1))&&o+(e?f[0]+","+f[1]+"%,"+f[2]+"%,"+f[3]:f.join(","))+")"}),n&&(h=zd(t),l=n.c,l.join(r)!==h.c.join(r)))for(c=t.replace(Ai,"1").split(Lr),u=c.length-1;a<u;a++)r+=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(Ai),u=c.length-1;a<u;a++)r+=c[a]+s[a];return r+c[u]},Ai=(function(){var i="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in ds)i+="|"+t+"\\b";return new RegExp(i+")","gi")})(),Wy=/hsl[a]?\(/,Bd=function(t){var e=t.join(" "),n;if(Ai.lastIndex=0,Ai.test(e))return n=Wy.test(e),t[1]=du(t[1],n),t[0]=du(t[0],n,zd(t[1])),!0},Cs,an=(function(){var i=Date.now,t=500,e=33,n=i(),r=n,s=1e3/240,o=s,a=[],l,c,h,u,f,p,x=function v(m){var g=i()-r,E=m===!0,S,w,P,R;if((g>t||g<0)&&(n+=g-e),r+=g,P=r-n,S=P-o,(S>0||E)&&(R=++u.frame,f=P-u.time*1e3,u.time=P=P/1e3,o+=S+(S>=s?4:s-S),w=1),E||(l=c(v)),w)for(p=0;p<a.length;p++)a[p](P,f,R,m)};return u={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(m){return f/(1e3/(m||60))},wake:function(){_d&&(!Vl&&yc()&&(Nn=Vl=window,Sc=Nn.document||{},un.gsap=Qe,(Nn.gsapVersions||(Nn.gsapVersions=[])).push(Qe.version),gd(ko||Nn.GreenSockGlobals||!Nn.gsap&&Nn||{}),Nd.forEach(Od)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&u.sleep(),c=h||function(m){return setTimeout(m,o-u.time*1e3+1|0)},Cs=1,x(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(l),Cs=0,c=ws},lagSmoothing:function(m,g){t=m||1/0,e=Math.min(g||33,t)},fps:function(m){s=1e3/(m||240),o=u.time*1e3+s},add:function(m,g,E){var S=g?function(w,P,R,A){m(w,P,R,A),u.remove(S)}:m;return u.remove(m),a[E?"unshift":"push"](S),Zr(),S},remove:function(m,g){~(g=a.indexOf(m))&&a.splice(g,1)&&p>=g&&p--},_listeners:a},u})(),Zr=function(){return!Cs&&an.wake()},Ht={},Xy=/^[\d.\-M][\d.\-,\s]/,qy=/["']/g,Yy=function(t){for(var e={},n=t.substr(1,t.length-3).split(":"),r=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[r]=isNaN(c)?c.replace(qy,"").trim():+c,r=l.substr(a+1).trim();return e},$y=function(t){var e=t.indexOf("(")+1,n=t.indexOf(")"),r=t.indexOf("(",e);return t.substring(e,~r&&r<n?t.indexOf(")",n+1):n)},Zy=function(t){var e=(t+"").split("("),n=Ht[e[0]];return n&&e.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[Yy(e[1])]:$y(t).split(",").map(Md)):Ht._CE&&Xy.test(t)?Ht._CE("",t):n},Ky=function(t){return function(e){return 1-t(1-e)}},sr=function(t,e){return t&&(ve(t)?t:Ht[t]||Zy(t))||e},hr=function(t,e,n,r){n===void 0&&(n=function(l){return 1-e(1-l)}),r===void 0&&(r=function(l){return l<.5?e(l*2)/2:1-e((1-l)*2)/2});var s={easeIn:e,easeOut:n,easeInOut:r},o;return Ke(t,function(a){Ht[a]=un[a]=s,Ht[o=a.toLowerCase()]=n;for(var l in s)Ht[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=Ht[a+"."+l]=s[l]}),s},kd=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},Xa=function i(t,e,n){var r=e>=1?e:1,s=(n||(t?.3:.45))/(e<1?e:1),o=s/Hl*(Math.asin(1/r)||0),a=function(h){return h===1?1:r*Math.pow(2,-10*h)*yy((h-o)*s)+1},l=t==="out"?a:t==="in"?function(c){return 1-a(1-c)}:kd(a);return s=Hl/s,l.config=function(c,h){return i(t,c,h)},l},qa=function i(t,e){e===void 0&&(e=1.70158);var n=function(o){return o?--o*o*((e+1)*o+e)+1:0},r=t==="out"?n:t==="in"?function(s){return 1-n(1-s)}:kd(n);return r.config=function(s){return i(t,s)},r};Ke("Linear,Quad,Cubic,Quart,Quint,Strong",function(i,t){var e=t<5?t+1:t;hr(i+",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})});Ht.Linear.easeNone=Ht.none=Ht.Linear.easeIn;hr("Elastic",Xa("in"),Xa("out"),Xa());(function(i,t){var e=1/t,n=2*e,r=2.5*e,s=function(a){return a<e?i*a*a:a<n?i*Math.pow(a-1.5/t,2)+.75:a<r?i*(a-=2.25/t)*a+.9375:i*Math.pow(a-2.625/t,2)+.984375};hr("Bounce",function(o){return 1-s(1-o)},s)})(7.5625,2.75);hr("Expo",function(i){return Math.pow(2,10*(i-1))*i+i*i*i*i*i*i*(1-i)});hr("Circ",function(i){return-(dd(1-i*i)-1)});hr("Sine",function(i){return i===1?1:-xy(i*gy)+1});hr("Back",qa("in"),qa("out"),qa());Ht.SteppedEase=Ht.steps=un.SteppedEase={config:function(t,e){t===void 0&&(t=1);var n=1/t,r=t+(e?0:1),s=e?1:0,o=1-se;return function(a){return((r*Fs(0,o,a)|0)+s)*n}}};Ts.ease=Ht["quad.out"];Ke("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(i){return Tc+=i+","+i+"Params,"});var Hd=function(t,e){this.id=vy++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:yd,this.set=e?e.getSetter:Pc},Rs=(function(){function i(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,$r(this,+e.duration,1,1),this.data=e.data,ue&&(this._ctx=ue,ue.data.push(this)),Cs||an.wake()}var t=i.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,$r(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,r){if(Zr(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(Qo(this,n),!s._dp||s.parent||bd(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)&&Fn(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!r||this._initted&&Math.abs(this._zTime)===se||!this._initted&&this._dur&&n||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Sd(this,n,r)),this},t.time=function(n,r){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+cu(this))%(this._dur+this._rDelay)||(n?this._dur:0),r):this._time},t.totalProgress=function(n,r){return arguments.length?this.totalTime(this.totalDuration()*n,r):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(n,r){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+cu(this),r):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(n,r){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*s,r):this._repeat?Yr(this._tTime,s)+1:1},t.timeScale=function(n,r){if(!arguments.length)return this._rts===-se?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?Go(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-se?0:this._rts,this.totalTime(Fs(-Math.abs(this._delay),this.totalDuration(),s),r!==!1),Jo(this),Py(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):(Zr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==se&&(this._tTime-=se)))),this):this._ps},t.startTime=function(n){if(arguments.length){this._start=de(n);var r=this.parent||this._dp;return r&&(r._sort||!this.parent)&&Fn(r,this,this._start-this._delay),this}return this._start},t.endTime=function(n){return this._start+(Ze(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(n){var r=this.parent||this._dp;return r?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Go(r.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=wy);var r=Ue;return Ue=n,wc(this)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),Ue=r,this},t.globalTime=function(n){for(var r=this,s=arguments.length?n:r.rawTime();r;)s=r._start+s/(Math.abs(r._ts)||1),r=r._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,hu(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var r=this._time;return this._rDelay=n,hu(this),r?this.time(r):this}return this._rDelay},t.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},t.seek=function(n,r){return this.totalTime(gn(this,n),Ze(r))},t.restart=function(n,r){return this.play().totalTime(n?-this._delay:0,Ze(r)),this._dur||(this._zTime=-se),this},t.play=function(n,r){return n!=null&&this.seek(n,r),this.reversed(!1).paused(!1)},t.reverse=function(n,r){return n!=null&&this.seek(n||this.totalDuration(),r),this.reversed(!0).paused(!1)},t.pause=function(n,r){return n!=null&&this.seek(n,r),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?-se:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-se,this},t.isActive=function(){var n=this.parent||this._dp,r=this._start,s;return!!(!n||this._ts&&this._initted&&n.isActive()&&(s=n.rawTime(!0))>=r&&s<this.endTime(!0)-se)},t.eventCallback=function(n,r,s){var o=this.vars;return arguments.length>1?(r?(o[n]=r,s&&(o[n+"Params"]=s),n==="onUpdate"&&(this._onUpdate=r)):delete o[n],this):o[n]},t.then=function(n){var r=this,s=r._prom;return new Promise(function(o){var a=ve(n)?n:Ed,l=function(){var h=r.then;
vendor: 7,034 bytes, line 3846
3846r.then=null,s&&s(),ve(a)&&(a=a(r))&&(a.then||a===r)&&(r.then=h),o(a),r.then=h};r._initted&&r.totalProgress()===1&&r._ts>=0||!r._tTime&&r._ts<0?l():r._prom=l})},t.kill=function(){us(this)},i})();dn(Rs.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:-se,_prom:0,_ps:!1,_rts:1});var Ye=(function(i){ud(t,i);function t(n,r){var s;return n===void 0&&(n={}),s=i.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=Ze(n.sortChildren),fe&&Fn(n.parent||fe,jn(s),r),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&wd(jn(s),n.scrollTrigger),s}var e=t.prototype;return e.to=function(r,s,o){return xs(0,arguments,this),this},e.from=function(r,s,o){return xs(1,arguments,this),this},e.fromTo=function(r,s,o,a){return xs(2,arguments,this),this},e.set=function(r,s,o){return s.duration=0,s.parent=this,vs(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Se(r,s,gn(this,o),1),this},e.call=function(r,s,o){return Fn(this,Se.delayedCall(0,r,s),o)},e.staggerTo=function(r,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 Se(r,o,gn(this,l)),this},e.staggerFrom=function(r,s,o,a,l,c,h){return o.runBackwards=1,vs(o).immediateRender=Ze(o.immediateRender),this.staggerTo(r,s,o,a,l,c,h)},e.staggerFromTo=function(r,s,o,a,l,c,h,u){return a.startAt=o,vs(a).immediateRender=Ze(a.immediateRender),this.staggerTo(r,s,a,l,c,h,u)},e.render=function(r,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,h=r<=0?0:de(r),u=this._zTime<0!=r<0&&(this._initted||!c),f,p,x,v,m,g,E,S,w,P,R,A;if(this!==fe&&h>l&&r>=0&&(h=l),h!==this._tTime||o||u){if(a!==this._time&&c&&(h+=this._time-a,r+=this._time-a),f=h,w=this._start,S=this._ts,g=!S,u&&(c||(a=this._zTime),(r||!s)&&(this._zTime=r)),this._repeat){if(R=this._yoyo,m=c+this._rDelay,this._repeat<-1&&r<0)return this.totalTime(m*100+r,s,o);if(f=de(h%m),h===l?(v=this._repeat,f=c):(P=de(h/m),v=~~P,v&&v===P&&(f=c,v--),f>c&&(f=c)),P=Yr(this._tTime,m),!a&&this._tTime&&P!==v&&this._tTime-P*m-this._dur<=0&&(P=v),R&&v&1&&(f=c-f,A=1),v!==P&&!this._lock){var L=R&&P&1,F=L===(R&&v&1);if(v<P&&(L=!L),a=L?0:h%c?c:h,this._lock=1,this.render(a||(A?0:de(v*m)),s,!c)._lock=0,this._tTime=h,!s&&this.parent&&ln(this,"onRepeat"),this.vars.repeatRefresh&&!A&&(this.invalidate()._lock=1,P=v),a&&a!==this._time||g!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,F&&(this._lock=2,a=L?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!A&&this.invalidate()),this._lock=0,!this._ts&&!g)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(E=Uy(this,de(a),de(f)),E&&(h-=f-(f=E._start))),this._tTime=h,this._time=f,this._act=!!S,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=r,a=0),!a&&h&&c&&!s&&!P&&(ln(this,"onStart"),this._tTime!==h))return this;if(f>=a&&r>=0)for(p=this._first;p;){if(x=p._next,(p._act||f>=p._start)&&p._ts&&E!==p){if(p.parent!==this)return this.render(r,s,o);if(p.render(p._ts>0?(f-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(f-p._start)*p._ts,s,o),f!==this._time||!this._ts&&!g){E=0,x&&(h+=this._zTime=-se);break}}p=x}else{p=this._last;for(var y=r<0?r:f;p;){if(x=p._prev,(p._act||y<=p._end)&&p._ts&&E!==p){if(p.parent!==this)return this.render(r,s,o);if(p.render(p._ts>0?(y-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(y-p._start)*p._ts,s,o||Ue&&wc(p)),f!==this._time||!this._ts&&!g){E=0,x&&(h+=this._zTime=y?-se:se);break}}p=x}}if(E&&!s&&(this.pause(),E.render(f>=a?0:-se)._zTime=f>=a?1:-1,this._ts))return this._start=w,Jo(this),this.render(r,s,o);this._onUpdate&&!s&&ln(this,"onUpdate",!0),(h===l&&this._tTime>=this.totalDuration()||!h&&a)&&(w===this._start||Math.abs(S)!==Math.abs(this._ts))&&(this._lock||((r||!c)&&(h===l&&this._ts>0||!h&&this._ts<0)&&Pi(this,1),!s&&!(r<0&&!a)&&(h||a||!l)&&(ln(this,h===l&&r>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(r,s){var o=this;if(oi(s)||(s=gn(this,s,r)),!(r instanceof Rs)){if(ze(r))return r.forEach(function(a){return o.add(a,s)}),this;if(Le(r))return this.addLabel(r,s);if(ve(r))r=Se.delayedCall(0,r);else return this}return this!==r?Fn(this,r,s):this},e.getChildren=function(r,s,o,a){r===void 0&&(r=!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 Se?s&&l.push(c):(o&&l.push(c),r&&l.push.apply(l,c.getChildren(!0,s,o)))),c=c._next;return l},e.getById=function(r){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===r)return s[o]},e.remove=function(r){return Le(r)?this.removeLabel(r):ve(r)?this.killTweensOf(r):(r.parent===this&&jo(this,r),r===this._recent&&(this._recent=this._last),rr(this))},e.totalTime=function(r,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=de(an.time-(this._ts>0?r/this._ts:(this.totalDuration()-r)/-this._ts))),i.prototype.totalTime.call(this,r,s),this._forcing=0,this):this._tTime},e.addLabel=function(r,s){return this.labels[r]=gn(this,s),this},e.removeLabel=function(r){return delete this.labels[r],this},e.addPause=function(r,s,o){var a=Se.delayedCall(0,s||ws,o);return a.data="isPause",this._hasPause=1,Fn(this,a,gn(this,r))},e.removePause=function(r){var s=this._first;for(r=gn(this,r);s;)s._start===r&&s.data==="isPause"&&Pi(s),s=s._next},e.killTweensOf=function(r,s,o){for(var a=this.getTweensOf(r,o),l=a.length;l--;)yi!==a[l]&&a[l].kill(r,s);return this},e.getTweensOf=function(r,s){for(var o=[],a=Sn(r),l=this._first,c=oi(s),h;l;)l instanceof Se?Ay(l._targets,a)&&(c?(!yi||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(r,s){s=s||{};var o=this,a=gn(o,r),l=s,c=l.startAt,h=l.onStart,u=l.onStartParams,f=l.immediateRender,p,x=Se.to(o,dn({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())||se,onStart:function(){if(o.pause(),!p){var m=s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());x._dur!==m&&$r(x,m,0,1).render(x._time,!0,!0),p=1}h&&h.apply(x,u||[])}},s));return f?x.render(0):x},e.tweenFromTo=function(r,s,o){return this.tweenTo(s,dn({startAt:{time:gn(this,r)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(r){return r===void 0&&(r=this._time),uu(this,gn(this,r))},e.previousLabel=function(r){return r===void 0&&(r=this._time),uu(this,gn(this,r),1)},e.currentLabel=function(r){return arguments.length?this.seek(r,!0):this.previousLabel(this._time+se)},e.shiftChildren=function(r,s,o){o===void 0&&(o=0);var a=this._first,l=this.labels,c;for(r=de(r);a;)a._start>=o&&(a._start+=r,a._end+=r),a=a._next;if(s)for(c in l)l[c]>=o&&(l[c]+=r);return rr(this)}
vendor: 3,006 bytes, line 3846
3846,e.invalidate=function(r){var s=this._first;for(this._lock=0;s;)s.invalidate(r),s=s._next;return i.prototype.invalidate.call(this,r)},e.clear=function(r){r===void 0&&(r=!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),r&&(this.labels={}),rr(this)},e.totalDuration=function(r){var s=0,o=this,a=o._last,l=yn,c,h,u;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-r:r));if(o._dirty){for(u=o.parent;a;)c=a._prev,a._dirty&&a.totalDuration(),h=a._start,h>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,Fn(o,a,h-a._delay,1)._lock=0):l=h,h<0&&a._ts&&(s-=h,(!u&&!o._dp||u&&u.smoothChildTiming)&&(o._start+=de(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;$r(o,o===fe&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(r){if(fe._ts&&(Sd(fe,Go(r,fe)),xd=an.frame),an.frame>=au){au+=hn.autoSleep||120;var s=fe._first;if((!s||!s._ts)&&hn.autoSleep&&an._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||an.sleep()}}},t})(Rs);dn(Ye.prototype,{_lock:0,_hasPause:0,_forcing:0});var jy=function(t,e,n,r,s,o,a){var l=new je(this._pt,t,e,0,1,Yd,null,s),c=0,h=0,u,f,p,x,v,m,g,E;for(l.b=n,l.e=r,n+="",r+="",(g=~r.indexOf("random("))&&(r=As(r)),o&&(E=[n,r],o(E,t,e),n=E[0],r=E[1]),f=n.match(Va)||[];u=Va.exec(r);)x=u[0],v=r.substring(c,u.index),p?p=(p+1)%5:v.substr(-5)==="rgba("&&(p=1),x!==f[h++]&&(m=parseFloat(f[h-1])||0,l._pt={_next:l._pt,p:v||h===1?v:",",s:m,c:x.charAt(1)==="="?Fr(m,x)-m:parseFloat(x)-m,m:p&&p<4?Math.round:0},c=Va.lastIndex);return l.c=c<r.length?r.substring(c,r.length):"",l.fp=a,(md.test(r)||g)&&(l.e=0),this._pt=l,l},Ac=function(t,e,n,r,s,o,a,l,c,h){ve(r)&&(r=r(s||0,t,o));var u=t[e],f=n!=="get"?n:ve(u)?c?t[e.indexOf("set")||!ve(t["get"+e.substr(3)])?e:"get"+e.substr(3)](c):t[e]():u,p=ve(u)?c?nS:Xd:Rc,x;if(Le(r)&&(~r.indexOf("random(")&&(r=As(r)),r.charAt(1)==="="&&(x=Fr(f,r)+(Fe(f)||0),(x||x===0)&&(r=x))),!h||f!==r||Zl)return!isNaN(f*r)&&r!==""?(x=new je(this._pt,t,e,+f||0,r-(f||0),typeof u=="boolean"?rS:qd,0,p),c&&(x.fp=c),a&&x.modifier(a,this,t),this._pt=x):(!u&&!(e in t)&&Mc(e,r),jy.call(this,t,e,f,r,p,l||hn.stringFilter,c))},Jy=function(t,e,n,r,s){if(ve(t)&&(t=ys(t,s,e,n,r)),!kn(t)||t.style&&t.nodeType||ze(t)||fd(t))return Le(t)?ys(t,s,e,n,r):t;var o={},a;for(a in t)o[a]=ys(t[a],s,e,n,r);return o},Vd=function(t,e,n,r,s,o){var a,l,c,h;if(on[t]&&(a=new on[t]).init(s,a.rawVars?e[t]:Jy(e[t],r,s,o,n),n,r,o)!==!1&&(n._pt=l=new je(n._pt,s,t,0,1,a.render,a,0,a.priority),n!==Ir))for(c=n._ptLookup[n._targets.indexOf(s)],h=a._props.length;h--;)c[a._props[h]]=l;return a},yi,Zl,Cc=function i(t,e,n){var r=t.vars,s=r.ease,o=r.startAt,a=r.immediateRender,l=r.lazy,c=r.onUpdate,h=r.runBackwards,u=r.yoyoEase,f=r.keyframes,p=r.autoRevert,x=t._dur,v=t._startAt,m=t._targets,g=t.parent,E=g&&g.data==="nested"?g.vars.targets:m,S=t._overwrite==="auto"&&!vc,w=t.timeline,P=r.easeReverse||u,R,A,L,F,y,b,G,z,W,K,k,j,X;
vendor: 4,850 bytes, line 3846
3846if(w&&(!f||!s)&&(s="none"),t._ease=sr(s,Ts.ease),t._rEase=P&&(sr(P)||t._ease),t._from=!w&&!!r.runBackwards,t._from&&(t.ratio=1),!w||f&&!r.stagger){if(z=m[0]?ir(m[0]).harness:0,j=z&&r[z.prop],R=Vo(r,Ec),v&&(v._zTime<0&&v.progress(1),e<0&&h&&a&&!p?v.render(-1,!0):v.revert(h&&x?Po:by),v._lazy=0),o){if(Pi(t._startAt=Se.set(m,dn({data:"isStart",overwrite:!1,parent:g,immediateRender:!0,lazy:!v&&Ze(l),startAt:null,delay:0,onUpdate:c&&function(){return ln(t,"onUpdate")},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(Ue||!a&&!p)&&t._startAt.revert(Po),a&&x&&e<=0&&n<=0){e&&(t._zTime=e);return}}else if(h&&x&&!v){if(e&&(a=!1),L=dn({overwrite:!1,data:"isFromStart",lazy:a&&!v&&Ze(l),immediateRender:a,stagger:0,parent:g},R),j&&(L[z.prop]=j),Pi(t._startAt=Se.set(m,L)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(Ue?t._startAt.revert(Po):t._startAt.render(-1,!0)),t._zTime=e,!a)i(t._startAt,se,se);else if(!e)return}for(t._pt=t._ptCache=0,l=x&&Ze(l)||l&&!x,A=0;A<m.length;A++){if(y=m[A],G=y._gsap||bc(m)[A]._gsap,t._ptLookup[A]=K={},Gl[G.id]&&wi.length&&Ho(),k=E===m?A:E.indexOf(y),z&&(W=new z).init(y,j||R,t,k,E)!==!1&&(t._pt=F=new je(t._pt,y,W.name,0,1,W.render,W,0,W.priority),W._props.forEach(function(lt){K[lt]=F}),W.priority&&(b=1)),!z||j)for(L in R)on[L]&&(W=Vd(L,R,t,k,y,E))?W.priority&&(b=1):K[L]=F=Ac.call(t,y,L,"get",R[L],k,E,0,r.stringFilter);t._op&&t._op[A]&&t.kill(y,t._op[A]),S&&t._pt&&(yi=t,fe.killTweensOf(y,K,t.globalTime(e)),X=!t.parent,yi=0),t._pt&&l&&(Gl[G.id]=1)}b&&$d(t),t._onInit&&t._onInit(t)}t._onUpdate=c,t._initted=(!t._op||t._pt)&&!X,f&&e<=0&&w.render(yn,!0,!0)},Qy=function(t,e,n,r,s,o,a,l){var c=(t._pt&&t._ptCache||(t._ptCache={}))[e],h,u,f,p;if(!c)for(c=t._ptCache[e]=[],f=t._ptLookup,p=t._targets.length;p--;){if(h=f[p][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 Zl=1,t.vars[e]="+=0",Cc(t,a),Zl=0,l?bs(e+" not eligible for reset. Try splitting into individual properties"):1;c.push(h)}for(p=c.length;p--;)u=c[p],h=u._pt||u,h.s=(r||r===0)&&!s?r:h.s+(r||0)+o*h.c,h.c=n-h.s,u.e&&(u.e=ye(n)+Fe(u.e)),u.b&&(u.b=h.s+Fe(u.b))},tS=function(t,e){var n=t[0]?ir(t[0]).harness:0,r=n&&n.aliases,s,o,a,l;if(!r)return e;s=qr({},e);for(o in r)if(o in s)for(l=r[o].split(","),a=l.length;a--;)s[l[a]]=s[o];return s},eS=function(t,e,n,r){var s=e.ease||r||"power1.inOut",o,a;if(ze(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})},ys=function(t,e,n,r,s){return ve(t)?t.call(e,n,r,s):Le(t)&&~t.indexOf("random(")?As(t):t},Gd=Tc+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",Wd={};Ke(Gd+",id,stagger,delay,duration,paused,scrollTrigger",function(i){return Wd[i]=1});var Se=(function(i){ud(t,i);function t(n,r,s,o){var a;typeof r=="number"&&(s.duration=r,r=s,s=null),a=i.call(this,o?r:vs(r))||this;var l=a.vars,c=l.duration,h=l.delay,u=l.immediateRender,f=l.stagger,p=l.overwrite,x=l.keyframes,v=l.defaults,m=l.scrollTrigger,g=r.parent||fe,E=(ze(n)||fd(n)?oi(n[0]):"length"in r)?[n]:Sn(n),S,w,P,R,A,L,F,y;if(a._targets=E.length?bc(E):bs("GSAP target "+n+" not found. https://gsap.com",!hn.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=p,x||f||go(c)||go(h)){r=a.vars;var b=r.easeReverse||r.yoyoEase;if(S=a.timeline=new Ye({data:"nested",defaults:v||{},targets:g&&g.data==="nested"?g.vars.targets:E}),S.kill(),S.parent=S._dp=jn(a),S._start=0,f||go(c)||go(h)){if(R=E.length,F=f&&Pd(f),kn(f))for(A in f)~Gd.indexOf(A)&&(y||(y={}),y[A]=f[A]);for(w=0;w<R;w++)P=Vo(r,Wd),P.stagger=0,b&&(P.easeReverse=b),y&&qr(P,y),L=E[w],P.duration=+ys(c,jn(a),w,L,E),P.delay=(+ys(h,jn(a),w,L,E)||0)-a._delay,!f&&R===1&&P.delay&&(a._delay=h=P.delay,a._start+=h,P.delay=0),S.to(L,P,F?F(w,L,E):0),S._ease=Ht.none;S.duration()?c=h=0:a.timeline=0}else if(x){vs(dn(S.vars.defaults,{ease:"none"})),S._ease=sr(x.ease||r.ease||"none");var G=0,z,W,K;if(ze(x))x.forEach(function(k){return S.to(E,k,">")}),S.duration();else{P={};for(A in x)A==="ease"||A==="easeEach"||eS(A,x[A],P,x.easeEach);for(A in P)for(z=P[A].sort(function(k,j){return k.t-j.t}),G=0,w=0;w<z.length;w++)W=z[w],K={ease:W.e,duration:(W.t-(w?z[w-1].t:0))/100*c},K[A]=W.v,S.to(E,K,G),G+=K.duration;S.duration()<c&&S.to({},{duration:c-S.duration()})}}c||a.duration(c=S.duration())}else a.timeline=0;return p===!0&&!vc&&(yi=jn(a),fe.killTweensOf(E),yi=0),Fn(g,jn(a),s),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(u||!c&&!x&&a._start===de(g._time)&&Ze(u)&&Ly(jn(a))&&g.data!=="nested")&&(a._tTime=-se,a.render(Math.max(0,-h)||0)),m&&wd(jn(a),m),a}var e=t.prototype;return e.render=function(r,s,o){var a=this._time,l=this._tDur,c=this._dur,h=r<0,u=r>l-se&&!h?l:r<se?0:r,f,p,x,v,m,g,E,S;if(!c)Dy(this,r,s,o);else if(u!==this._tTime||!r||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if
3846(f=u,S=this.timeline,this._repeat){if(v=c+this._rDelay,this._repeat<-1&&h)return this.totalTime(v*100+r,s,o);if(f=de(u%v),u===l?(x=this._repeat,f=c):(m=de(u/v),x=~~m,x&&x===m?(f=c,x--):f>c&&(f=c)),g=this._yoyo&&x&1,g&&(f=c-f),m=Yr(this._tTime,v),f===a&&!o&&this._initted&&x===m)return this._tTime=u,this;x!==m&&this.vars.repeatRefresh&&!g&&!this._lock&&f!==v&&this._initted&&(this._lock=o=1,this.render(de(v*x),!0).invalidate()._lock=0)}if(!this._initted){if(Ad(this,h?r:f,o,s,u))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&x!==m))return this;if(c!==this._dur)return this.render(r,s,o)}if(this._rEase){var w=f<a;if(w!==this._inv){var P=w?a:c-a;this._inv=w,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=a,this._invRecip=P?(w?-1:1)/P:0,this._invScale=w?-this.ratio:1-this.ratio,this._invEase=w?this._rEase:this._ease}this.ratio=E=this._invRatio+this._invScale*this._invEase((f-this._invTime)*this._invRecip)}else this.ratio=E=this._ease(f/c);if(this._from&&(this.ratio=E=1-E),this._tTime=u,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),!a&&u&&!s&&!m&&(ln(this,"onStart"),this._tTime!==u))return this;for(p=this._pt;p;)p.r(E,p.d),p=p._next;S&&S.render(r<0?r:S._dur*S._ease(f/this._dur),s,o)||this._startAt&&(this._zTime=r),this._onUpdate&&!s&&(h&&Wl(this,r,s,o),ln(this,"onUpdate")),this._repeat&&x!==m&&this.vars.onRepeat&&!s&&this.parent&&ln(this,"onRepeat"),(u===this._tDur||!u)&&this._tTime===u&&(h&&!this._onUpdate&&Wl(this,r,!0,!0),(r||!c)&&(u===this._tDur&&this._ts>0||!u&&this._ts<0)&&Pi(this,1),!s&&!(h&&!a)&&(u||a||g)&&(ln(this,u===l?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(r){return(!r||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(r),i.prototype.invalidate.call(this,r)},e.resetTo=function(r,s,o,a,l){Cs||an.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||Cc(this,c),h=this._ease(c/this._dur),Qy(this,r,s,o,a,h,c,l)?this.resetTo(r,s,o,a,1):(Qo(this,0),this.parent||Td(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(r,s){if(s===void 0&&(s="all"),!r&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?us(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Ue),this;if(this.timeline){var o=this.timeline.totalDuration();
vendor: 11,465 bytes, lines 3846-3853
3846return this.timeline.killTweensOf(r,s,yi&&yi.vars.overwrite!==!0)._first||us(this),this.parent&&o!==this.timeline.totalDuration()&&$r(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=r?Sn(r):a,c=this._ptLookup,h=this._pt,u,f,p,x,v,m,g;if((!s||s==="all")&&Ry(a,l))return s==="all"&&(this._pt=0),us(this);for(u=this._op=this._op||[],s!=="all"&&(Le(s)&&(v={},Ke(s,function(E){return v[E]=1}),s=v),s=tS(a,s)),g=a.length;g--;)if(~l.indexOf(a[g])){f=c[g],s==="all"?(u[g]=s,x=f,p={}):(p=u[g]=u[g]||{},x=s);for(v in x)m=f&&f[v],m&&((!("kill"in m.d)||m.d.kill(v)===!0)&&jo(this,m,"_pt"),delete f[v]),p!=="all"&&(p[v]=1)}return this._initted&&!this._pt&&h&&us(this),this},t.to=function(r,s){return new t(r,s,arguments[2])},t.from=function(r,s){return xs(1,arguments)},t.delayedCall=function(r,s,o,a){return new t(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:r,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(r,s,o){return xs(2,arguments)},t.set=function(r,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new t(r,s)},t.killTweensOf=function(r,s,o){return fe.killTweensOf(r,s,o)},t})(Rs);dn(Se.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Ke("staggerTo,staggerFrom,staggerFromTo",function(i){Se[i]=function(){var t=new Ye,e=ql.call(arguments,0);return e.splice(i==="staggerFromTo"?5:4,0,0),t[i].apply(t,e)}});var Rc=function(t,e,n){return t[e]=n},Xd=function(t,e,n){return t[e](n)},nS=function(t,e,n,r){return t[e](r.fp,n)},iS=function(t,e,n){return t.setAttribute(e,n)},Pc=function(t,e){return ve(t[e])?Xd:xc(t[e])&&t.setAttribute?iS:Rc},qd=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},rS=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},Yd=function(t,e){var n=e._pt,r="";if(!t&&e.b)r=e.b;else if(t===1&&e.e)r=e.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*t):Math.round((n.s+n.c*t)*1e4)/1e4)+r,n=n._next;r+=e.c}e.set(e.t,e.p,r,e)},Lc=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},sS=function(t,e,n,r){for(var s=this._pt,o;s;)o=s._next,s.p===r&&s.modifier(t,e,n),s=o},oS=function(t){for(var e=this._pt,n,r;e;)r=e._next,e.p===t&&!e.op||e.op===t?jo(this,e,"_pt"):e.dep||(n=1),e=r;return!n},aS=function(t,e,n,r){r.mSet(t,e,r.m.call(r.tween,n,r.mt),r)},$d=function(t){for(var e=t._pt,n,r,s,o;e;){for(n=e._next,r=s;r&&r.pr>e.pr;)r=r._next;(e._prev=r?r._prev:o)?e._prev._next=e:s=e,(e._next=r)?r._prev=e:o=e,e=n}t._pt=s},je=(function(){function i(e,n,r,s,o,a,l,c,h){this.t=n,this.s=s,this.c=o,this.p=r,this.r=a||qd,this.d=l||this,this.set=c||Rc,this.pr=h||0,this._next=e,e&&(e._prev=this)}var t=i.prototype;return t.modifier=function(n,r,s){this.mSet=this.mSet||this.set,this.set=aS,this.m=n,this.mt=s,this.tween=r},i})();Ke(Tc+"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,easeReverse",function(i){return Ec[i]=1});un.TweenMax=un.TweenLite=Se;un.TimelineLite=un.TimelineMax=Ye;fe=new Ye({sortChildren:!1,defaults:Ts,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});hn.stringFilter=Bd;var or=[],Io={},lS=[],fu=0,cS=0,Ya=function(t){return(Io[t]||lS).map(function(e){return e()})},Kl=function(){var t=Date.now(),e=[];t-fu>2&&(Ya("matchMediaInit"),or.forEach(function(n){var r=n.queries,s=n.conditions,o,a,l,c;for(a in r)o=Nn.matchMedia(r[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,c=1);c&&(n.revert(),l&&e.push(n))}),Ya("matchMediaRevert"),e.forEach(function(n){return n.onMatch(n,function(r){return n.add(null,r)})}),fu=t,Ya("matchMedia"))},Zd=(function(){function i(e,n){this.selector=n&&Yl(n),this.data=[],this._r=[],this.isReverted=!1,this.id=cS++,e&&this.add(e)}var t=i.prototype;return t.add=function(n,r,s){ve(n)&&(s=r,r=n,n=ve);var o=this,a=function(){var c=ue,h=o.selector,u;return c&&c!==o&&c.data.push(o),s&&(o.selector=Yl(s)),ue=o,u=r.apply(o,arguments),ve(u)&&o._r.push(u),ue=c,o.selector=h,o.isReverted=!1,u};return o.last=a,n===ve?a(o,function(l){return o.add(null,l)}):n?o[n]=a:a},t.ignore=function(n){var r=ue;ue=null,n(this),ue=r},t.getTweens=function(){var n=[];return this.data.forEach(function(r){return r instanceof i?n.push.apply(n,r.getTweens()):r instanceof Se&&!(r.parent&&r.parent.data==="nested")&&n.push(r)}),n},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(n,r){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,u){return u.g-h.g||-1/0}).forEach(function(h){return h.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof Ye?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof Se)&&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(),r)for(var o=or.length;o--;)or[o].id===this.id&&or.splice(o,1)},t.revert=function(n){this.kill(n||{})},i})(),hS=(function(){function i(e){this.contexts=[],this.scope=e,ue&&ue.data.push(this)}var t=i.prototype;return t.add=function(n,r,s){kn(n)||(n={matches:n});var o=new Zd(0,s||this.scope),a=o.conditions={},l,c,h;ue&&!o.selector&&(o.selector=ue.selector),this.contexts.push(o),r=o.add("onMatch",r),o.queries=n;for(c in n)c==="all"?h=1:(l=Nn.matchMedia(n[c]),l&&(or.indexOf(o)<0&&or.push(o),(a[c]=l.matches)&&(h=1),l.addListener?l.addListener(Kl):l.addEventListener("change",Kl)));return h&&r(o,function(u){return o.add(null,u)}),this},t.revert=function(n){this.kill(n||{})},t.kill=function(n){this.contexts.forEach(function(r){return r.kill(n,!0)})},i})(),Wo={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(r){return Od(r)})},timeline:function(t){return new Ye(t)},getTweensOf:function(t,e){return fe.getTweensOf(t,e)},getProperty:function(t,e,n,r){Le(t)&&(t=Sn(t)[0]);var s=ir(t||{}).get,o=n?Ed:Md;return n==="native"&&(n=""),t&&(e?o((on[e]&&on[e].get||s)(t,e,n,r)):function(a,l,c){return o((on[a]&&on[a].get||s)(t,a,l,c))})},quickSetter:function(t,e,n){if(t=Sn(t),t.length>1){var r=t.map(function(h){return Qe.quickSetter(h,e,n)}),s=r.length;return function(h){for(var u=s;u--;)r[u](h)}}t=t[0]||{};var o=on[e],a=ir(t),l=a.harness&&(a.harness.aliases||{})[e]||e,c=o?function(h){var u=new o;Ir._pt=0,u.init(t,n?h+n:h,Ir,0,[t]),u.render(1,u),Ir._pt&&Lc(1,Ir)}: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 r,s=Qe.to(t,dn((r={},r[e]="+=0.1",r.paused=!0,r.stagger=0,r),n||{})),o=function(l,c,h){return s.resetTo(e,l,c,h)};return o.tween=s,o},isTweening:function(t){return fe.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=sr(t.ease,Ts.ease)),lu(Ts,t||{})},config:function(t){return lu(hn,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,r=t.plugins,s=t.defaults,o=t.extendTimeline;(r||"").split(",").forEach(function(a){return a&&!on[a]&&!un[a]&&bs(e+" effect requires "+a+" plugin.")}),Ga[e]=function(a,l,c){return n(Sn(a),dn(l||{},s),c)},o&&(Ye.prototype[e]=function(a,l,c){return this.add(Ga[e](a,kn(l)?l:(c=l)&&{},this),c)})},registerEase:function(t,e){Ht[t]=sr(e)},parseEase:function(t,e){return arguments.length?sr(t,e):Ht},getById:function(t){return fe.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var n=new Ye(t),r,s;for(n.smoothChildTiming=Ze(t.smoothChildTiming),fe.remove(n),n._dp=0,n._time=n._tTime=fe._time,r=fe._first;r;)s=r._next,(e||!(!r._dur&&r instanceof Se&&r.vars.onComplete===r._targets[0]))&&Fn(n,r,r._start-r._delay),r=s;return Fn(fe,n,0),n},context:function(t,e){return t?new Zd(t,e):ue},matchMedia:function(t){return new hS(t)},matchMediaRefresh:function(){return or.forEach(function(t){var e=t.conditions,n,r;for(r in e)e[r]&&(e[r]=!1,n=1);n&&t.revert()})||Kl()},addEventListener:function(t,e){var n=Io[t]||(Io[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=Io[t],r=n&&n.indexOf(e);r>=0&&n.splice(r,1)},utils:{wrap:Hy,wrapYoyo:Vy,distribute:Pd,random:Id,snap:Ld,normalize:ky,getUnit:Fe,clamp:Oy,splitColor:Fd,toArray:Sn,selector:Yl,mapRange:Ud,pipe:zy,unitize:By,interpolate:Gy,shuffle:Rd},install:gd,effects:Ga,ticker:an,updateRoot:Ye.updateRoot,plugins:on,globalTimeline:fe,core:{PropTween:je,globals:vd,Tween:Se,Timeline:Ye,Animation:Rs,getCache:ir,_removeLinkedListItem:jo,reverting:function(){return Ue},context:function(t){return t&&ue&&(ue.data.push(t),t._ctx=ue),ue},suppressOverwrites:function(t){return vc=t}}};Ke("to,from,fromTo,delayedCall,set,killTweensOf",function(i){return Wo[i]=Se[i]});an.add(Ye.updateRoot);Ir=Wo.to({},{duration:0});var uS=function(t,e){for(var n=t._pt;n&&n.p!==e&&n.op!==e&&n.fp!==e;)n=n._next;return n},dS=function(t,e){var n=t._targets,r,s,o;for(r in e)for(s=n.length;s--;)o=t._ptLookup[s][r],o&&(o=o.d)&&(o._pt&&(o=uS(o,r)),o&&o.modifier&&o.modifier(e[r],t,n[s],r))},$a=function(t,e){return{name:t,headless:1,rawVars:1,init:function(r,s,o){o._onInit=function(a){var l,c;if(Le(s)&&(l={},Ke(s,function(h){return l[h]=1}),s=l),e){l={};for(c in s)l[c]=e(s[c]);s=l}dS(a,s)}}}},Qe=Wo.registerPlugin({name:"attr",init:function(t,e,n,r,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],r,s,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(t,e){for(var n=e._pt;n;)Ue?n.set(n.t,n.p,n.b,n):n.r(t,n.d),n=n._next}},{name:"endArray",headless:1,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)}},$a("roundProps",$l),$a("modifiers"),$a("snap",Ld))||Wo;Se.version=Ye.version=Qe.version="3.15.0";_d=1;yc()&&Zr();Ht.Power0;Ht.Power1;Ht.Power2;Ht.Power3;Ht.Power4;Ht.Linear;Ht.Quad;Ht.Cubic;Ht.Quart;Ht.Quint;Ht.Strong;Ht.Elastic;Ht.Back;Ht.SteppedEase;Ht.Bounce;Ht.Sine;Ht.Expo;Ht.Circ;/*! 3847 * CSSPlugin 3.15.0 3848 * https://gsap.com 3849 * 3850 * Copyright 2008-2026, GreenSock. All rights reserved. 3851 * Subject to the terms at https://gsap.com/standard-license 3852 * @author: Jack Doyle, [email protected] 3853*/var pu,Si,zr,Ic,nr,mu,Dc,fS=function(){return typeof window<"u"},ai={},ji=180/Math.PI,Br=Math.PI/180,wr=Math.atan2,_u=1e8,Uc=/([A-Z])/g,pS=/(left|right|width|margin|padding|x)/i,mS=/[\s,\(]\S/,Bn={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},jl=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},_S=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)},gS=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)},vS=function(t,e){return e.set(e.t,e.p,t===1?e.e:t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},xS=function(t,e){var n=e.s+e.c*t;e.set(e.t,e.p,~~(n+(n<0?-.5:.5))+e.u,e)},Kd=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},jd=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},yS=function(t,e,n){return t.style[e]=n},SS=function(t,e,n){return t.style.setProperty(e,n)},MS=function(t,e,n){return t._gsap[e]=n},ES=function(t,e,n){return t._gsap.scaleX=t._gsap.scaleY=n},TS=function(t,e,n,r,s){var o=t._gsap;o.scaleX=o.scaleY=n,o.renderTransform(s,o)},bS=function(t,e,n,r,s){var o=t._gsap;o[e]=n,o.renderTransform(s,o)},pe="transform",Je=pe+"Origin",wS=function i(t,e){var n=this,r=this.target,s=r.style,o=r._gsap;
vendor: 16,353 bytes, line 3853
3853if(t in ai&&s){if(this.tfm=this.tfm||{},t!=="transform")t=Bn[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return n.tfm[a]=Jn(r,a)}):this.tfm[t]=o.x?o[t]:Jn(r,t),t===Je&&(this.tfm.zOrigin=o.zOrigin);else return Bn.transform.split(",").forEach(function(a){return i.call(n,a,e)});if(this.props.indexOf(pe)>=0)return;o.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(Je,e,"")),t=pe}(s||e)&&this.props.push(t,e,s[t])},Jd=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},AS=function(){var t=this.props,e=this.target,n=e.style,r=e._gsap,s,o;for(s=0;s<t.length;s+=3)t[s+1]?t[s+1]===2?e[t[s]](t[s+2]):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(Uc,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)r[o]=this.tfm[o];r.svg&&(r.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),s=Dc(),(!s||!s.isStart)&&!n[pe]&&(Jd(n),r.zOrigin&&n[Je]&&(n[Je]+=" "+r.zOrigin+"px",r.zOrigin=0,r.renderTransform()),r.uncache=1)}},Qd=function(t,e){var n={target:t,props:[],revert:AS,save:wS};return t._gsap||Qe.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach(function(r){return n.save(r)}),n},tf,Jl=function(t,e){var n=Si.createElementNS?Si.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Si.createElement(t);return n&&n.style?n:Si.createElement(t)},cn=function i(t,e,n){var r=getComputedStyle(t);return r[e]||r.getPropertyValue(e.replace(Uc,"-$1").toLowerCase())||r.getPropertyValue(e)||!n&&i(t,Kr(e)||e,1)||""},gu="O,Moz,ms,Ms,Webkit".split(","),Kr=function(t,e,n){var r=e||nr,s=r.style,o=5;if(t in s&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(gu[o]+t in s););return o<0?null:(o===3?"ms":o>=0?gu[o]:"")+t},Ql=function(){fS()&&window.document&&(pu=window,Si=pu.document,zr=Si.documentElement,nr=Jl("div")||{style:{}},Jl("div"),pe=Kr(pe),Je=pe+"Origin",nr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",tf=!!Kr("perspective"),Dc=Qe.core.reverting,Ic=1)},vu=function(t){var e=t.ownerSVGElement,n=Jl("svg",e&&e.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=t.cloneNode(!0),s;r.style.display="block",n.appendChild(r),zr.appendChild(n);try{s=r.getBBox()}catch{}return n.removeChild(r),zr.removeChild(n),s},xu=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},ef=function(t){var e,n;try{e=t.getBBox()}catch{e=vu(t),n=1}return e&&(e.width||e.height)||n||(e=vu(t)),e&&!e.width&&!e.x&&!e.y?{x:+xu(t,["x","cx","x1"])||0,y:+xu(t,["y","cy","y1"])||0,width:0,height:0}:e},nf=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ef(t))},Li=function(t,e){if(e){var n=t.style,r;e in ai&&e!==Je&&(e=pe),n.removeProperty?(r=e.substr(0,2),(r==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),n.removeProperty(r==="--"?e:e.replace(Uc,"-$1").toLowerCase())):n.removeAttribute(e)}},Mi=function(t,e,n,r,s,o){var a=new je(t._pt,e,n,0,1,o?jd:Kd);return t._pt=a,a.b=r,a.e=s,t._props.push(n),a},yu={deg:1,rad:1,turn:1},CS={grid:1,flex:1},Ii=function i(t,e,n,r){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",a=nr.style,l=pS.test(e),c=t.tagName.toLowerCase()==="svg",h=(c?"client":"offset")+(l?"Width":"Height"),u=100,f=r==="px",p=r==="%",x,v,m,g;if(r===o||!s||yu[r]||yu[o])return s;if(o!=="px"&&!f&&(s=i(t,e,n,"px")),g=t.getCTM&&nf(t),(p||o==="%")&&(ai[e]||~e.indexOf("adius")))return x=g?t.getBBox()[l?"width":"height"]:t[h],ye(p?s/x*u:s/100*x);if(a[l?"width":"height"]=u+(f?o:r),v=r!=="rem"&&~e.indexOf("adius")||r==="em"&&t.appendChild&&!c?t:t.parentNode,g&&(v=(t.ownerSVGElement||{}).parentNode),(!v||v===Si||!v.appendChild)&&(v=Si.body),m=v._gsap,m&&p&&m.width&&l&&m.time===an.time&&!m.uncache)return ye(s/m.width*u);if(p&&(e==="height"||e==="width")){var E=t.style[e];t.style[e]=u+r,x=t[h],E?t.style[e]=E:Li(t,e)}else(p||o==="%")&&!CS[cn(v,"display")]&&(a.position=cn(t,"position")),v===t&&(a.position="static"),v.appendChild(nr),x=nr[h],v.removeChild(nr),a.position="absolute";return l&&p&&(m=ir(v),m.time=an.time,m.width=v[h]),ye(f?x*s/u:x&&s?u/x*s:0)},Jn=function(t,e,n,r){var s;return Ic||Ql(),e in Bn&&e!=="transform"&&(e=Bn[e],~e.indexOf(",")&&(e=e.split(",")[0])),ai[e]&&e!=="transform"?(s=Ls(t,r),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:qo(cn(t,Je))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||r||~(s+"").indexOf("calc("))&&(s=Xo[e]&&Xo[e](t,e,n)||cn(t,e)||yd(t,e)||(e==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?Ii(t,e,s,n)+n:s},RS=function(t,e,n,r){if(!n||n==="none"){var s=Kr(e,t,1),o=s&&cn(t,s,1);o&&o!==n?(e=s,n=o):e==="borderColor"&&(n=cn(t,"borderTopColor"))}var a=new je(this._pt,t.style,e,0,1,Yd),l=0,c=0,h,u,f,p,x,v,m,g,E,S,w,P;if(a.b=n,a.e=r,n+="",r+="",r.substring(0,6)==="var(--"&&(r=cn(t,r.substring(4,r.indexOf(")")))),r==="auto"&&(v=t.style[e],t.style[e]=r,r=cn(t,e)||r,v?t.style[e]=v:Li(t,e)),h=[n,r],Bd(h),n=h[0],r=h[1],f=n.match(Lr)||[],P=r.match(Lr)||[],P.length){for(;u=Lr.exec(r);)m=u[0],E=r.substring(l,u.index),x?x=(x+1)%5:(E.substr(-5)==="rgba("||E.substr(-5)==="hsla(")&&(x=1),m!==(v=f[c++]||"")&&(p=parseFloat(v)||0,w=v.substr((p+"").length),m.charAt(1)==="="&&(m=Fr(p,m)+w),g=parseFloat(m),S=m.substr((g+"").length),l=Lr.lastIndex-S.length,S||(S=S||hn.units[e]||w,l===r.length&&(r+=S,a.e+=S)),w!==S&&(p=Ii(t,e,v,S)||0),a._pt={_next:a._pt,p:E||c===1?E:",",s:p,c:g-p,m:x&&x<4||e==="zIndex"?Math.round:0});a.c=l<r.length?r.substring(l,r.length):""}else a.r=e==="display"&&r==="none"?jd:Kd;return md.test(r)&&(a.e=0),this._pt=a,a},Su={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},PS=function(t){var e=t.split(" "),n=e[0],r=e[1]||"50%";return(n==="top"||n==="bottom"||r==="left"||r==="right")&&(t=n,n=r,r=t),e[0]=Su[n]||n,e[1]=Su[r]||r,e.join(" ")},LS=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var n=e.t,r=n.style,s=e.u,o=n._gsap,a,l,c;if(s==="all"||s===!0)r.cssText="",l=1;else for(s=s.split(","),c=s.length;--c>-1;)a=s[c],ai[a]&&(l=1,a=a==="transformOrigin"?Je:pe),Li(n,a);l&&(Li(n,pe),o&&(o.svg&&n.removeAttribute("transform"),r.scale=r.rotate=r.translate="none",Ls(n,1),o.uncache=1,Jd(r)))}},Xo={clearProps:function(t,e,n,r,s){if(s.data!=="isFromStart"){var o=t._pt=new je(t._pt,e,n,0,0,LS);return o.u=r,o.pr=-10,o.tween=s,t._props.push(n),1}}},Ps=[1,0,0,1,0,0],rf={},sf=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Mu=function(t){var e=cn(t,pe);return sf(e)?Ps:e.substr(7).match(pd).map(ye)},Nc=function(t,e){var n=t._gsap||ir(t),r=t.style,s=Mu(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"?Ps:s):(s===Ps&&!t.offsetParent&&t!==zr&&!n.svg&&(l=r.display,r.display="block",o=t.parentNode,(!o||!t.offsetParent&&!t.getBoundingClientRect().width)&&(c=1,a=t.nextElementSibling,zr.appendChild(t)),s=Mu(t),l?r.display=l:Li(t,"display"),c&&(a?o.insertBefore(t,a):o?o.appendChild(t):zr.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},tc=function(t,e,n,r,s,o){var a=t._gsap,l=s||Nc(t,!0),c=a.xOrigin||0,h=a.yOrigin||0,u=a.xOffset||0,f=a.yOffset||0,p=l[0],x=l[1],v=l[2],m=l[3],g=l[4],E=l[5],S=e.split(" "),w=parseFloat(S[0])||0,P=parseFloat(S[1])||0,R,A,L,F;n?l!==Ps&&(A=p*m-x*v)&&(L=w*(m/A)+P*(-v/A)+(v*E-m*g)/A,F=w*(-x/A)+P*(p/A)-(p*E-x*g)/A,w=L,P=F):(R=ef(t),w=R.x+(~S[0].indexOf("%")?w/100*R.width:w),P=R.y+(~(S[1]||S[0]).indexOf("%")?P/100*R.height:P)),r||r!==!1&&a.smooth?(g=w-c,E=P-h,a.xOffset=u+(g*p+E*v)-g,a.yOffset=f+(g*x+E*m)-E):a.xOffset=a.yOffset=0,a.xOrigin=w,a.yOrigin=P,a.smooth=!!r,a.origin=e,a.originIsAbsolute=!!n,t.style[Je]="0px 0px",o&&(Mi(o,a,"xOrigin",c,w),Mi(o,a,"yOrigin",h,P),Mi(o,a,"xOffset",u,a.xOffset),Mi(o,a,"yOffset",f,a.yOffset)),t.setAttribute("data-svg-origin",w+" "+P)},Ls=function(t,e){var n=t._gsap||new Hd(t);if("x"in n&&!e&&!n.uncache)return n;var r=t.style,s=n.scaleX<0,o="px",a="deg",l=getComputedStyle(t),c=cn(t,Je)||"0",h,u,f,p,x,v,m,g,E,S,w,P,R,A,L,F,y,b,G,z,W,K,k,j,X,lt,ct,pt,kt,Yt,Y,Q;return h=u=f=v=m=g=E=S=w=0,p=x=1,n.svg=!!(t.getCTM&&nf(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(r[pe]=(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[pe]!=="none"?l[pe]:"")),r.scale=r.rotate=r.translate="none"),A=Nc(t,n.svg),n.svg&&(n.uncache?(X=t.getBBox(),c=n.xOrigin-X.x+"px "+(n.yOrigin-X.y)+"px",j=""):j=!e&&t.getAttribute("data-svg-origin"),tc(t,j||c,!!j||n.originIsAbsolute,n.smooth!==!1,A)),P=n.xOrigin||0,R=n.yOrigin||0,A!==Ps&&(b=A[0],G=A[1],z=A[2],W=A[3],h=K=A[4],u=k=A[5],A.length===6?(p=Math.sqrt(b*b+G*G),x=Math.sqrt(W*W+z*z),v=b||G?wr(G,b)*ji:0,E=z||W?wr(z,W)*ji+v:0,E&&(x*=Math.abs(Math.cos(E*Br))),n.svg&&(h-=P-(P*b+R*z),u-=R-(P*G+R*W))):(Q=A[6],Yt=A[7],ct=A[8],pt=A[9],kt=A[10],Y=A[11],h=A[12],u=A[13],f=A[14],L=wr(Q,kt),m=L*ji,L&&(F=Math.cos(-L),y=Math.sin(-L),j=K*F+ct*y,X=k*F+pt*y,lt=Q*F+kt*y,ct=K*-y+ct*F,pt=k*-y+pt*F,kt=Q*-y+kt*F,Y=Yt*-y+Y*F,K=j,k=X,Q=lt),L=wr(-z,kt),g=L*ji,L&&(F=Math.cos(-L),y=Math.sin(-L),j=b*F-ct*y,X=G*F-pt*y,lt=z*F-kt*y,Y=W*y+Y*F,b=j,G=X,z=lt),L=wr(G,b),v=L*ji,L&&(F=Math.cos(L),y=Math.sin(L),j=b*F+G*y,X=K*F+k*y,G=G*F-b*y,k=k*F-K*y,b=j,K=X),m&&Math.abs(m)+Math.abs(v)>359.9&&(m=v=0,g=180-g),p=ye(Math.sqrt(b*b+G*G+z*z)),x=ye(Math.sqrt(k*k+Q*Q)),L=wr(K,k),E=Math.abs(L)>2e-4?L*ji:0,w=Y?1/(Y<0?-Y:Y):0),n.svg&&(j=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!sf(cn(t,pe)),j&&t.setAttribute("transform",j))),Math.abs(E)>90&&Math.abs(E)<270&&(s?(p*=-1,E+=v<=0?180:-180,v+=v<=0?180:-180):(x*=-1,E+=E<=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=u-((n.yPercent=u&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-u)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+o,n.z=f+o,n.scaleX=ye(p),n.scaleY=ye(x),n.rotation=ye(v)+a,n.rotationX=ye(m)+a,n.rotationY=ye(g)+a,n.skewX=E+a,n.skewY=S+a,n.transformPerspective=w+o,(n.zOrigin=parseFloat(c.split(" ")[2])||!e&&n.zOrigin||0)&&(r[Je]=qo(c)),n.xOffset=n.yOffset=0,n.force3D=hn.force3D,n.renderTransform=n.svg?DS:tf?of:IS,n.uncache=0,n},qo=function(t){return(t=t.split(" "))[0]+" "+t[1]},Za=function(t,e,n){var r=Fe(e);return ye(parseFloat(e)+parseFloat(Ii(t,"x",n+"px",r)))+r},IS=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,of(t,e)},Yi="0deg",cs="0px",$i=") ",of=function(t,e){var n=e||this,r=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.z,c=n.rotation,h=n.rotationY,u=n.rotationX,f=n.skewX,p=n.skewY,x=n.scaleX,v=n.scaleY,m=n.transformPerspective,g=n.force3D,E=n.target,S=n.zOrigin,w="",P=g==="auto"&&t&&t!==1||g===!0;if(S&&(u!==Yi||h!==Yi)){var R=parseFloat(h)*Br,A=Math.sin(R),L=Math.cos(R),F;R=parseFloat(u)*Br,F=Math.cos(R),o=Za(E,o,A*F*-S),a=Za(E,a,-Math.sin(R)*-S),l=Za(E,l,L*F*-S+S)}m!==cs&&(w+="perspective("+m+$i),(r||s)&&(w+="translate("+r+"%, "+s+"%) "),(P||o!==cs||a!==cs||l!==cs)&&(w+=l!==cs||P?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+$i),c!==Yi&&(w+="rotate("+c+$i),h!==Yi&&(w+="rotateY("+h+$i),u!==Yi&&(w+="rotateX("+u+$i),(f!==Yi||p!==Yi)&&(w+="skew("+f+", "+p+$i),(x!==1||v!==1)&&(w+="scale("+x+", "+v+$i),E.style[pe]=w||"translate(0, 0)"},DS=function(t,e){var n=e||this,r=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.rotation,c=n.skewX,h=n.skewY,u=n.scaleX,f=n.scaleY,p=n.target,x=n.xOrigin,v=n.yOrigin,m=n.xOffset,g=n.yOffset,E=n.forceCSS,S=parseFloat(o),w=parseFloat(a),P,R,A,L,F;l=parseFloat(l),c=parseFloat(c),h=parseFloat(h),h&&(h=parseFloat(h),c+=h,l+=h),l||c?(l*=Br,c*=Br,P=Math.cos(l)*u,R=Math.sin(l)*u,A=Math.sin(l-c)*-f,L=Math.cos(l-c)*f,c&&(h*=Br,F=Math.tan(c-h),F=Math.sqrt(1+F*F),A*=F,L*=F,h&&(F=Math.tan(h),F=Math.sqrt(1+F*F),P*=F,R*=F)),P=ye(P),R=ye(R),A=ye(A),L=ye(L)):(P=u,L=f,R=A=0),(S&&!~(o+"").indexOf("px")||w&&!~(a+"").indexOf("px"))&&(S=Ii(p,"x",o,"px"),w=Ii(p,"y",a,"px")),(x||v||m||g)&&(S=ye(S+x-(x*P+v*A)+m),w=ye(w+v-(x*R+v*L)+g)),(r||s)&&(F=p.getBBox(),S=ye(S+r/100*F.width),w=ye(w+s/100*F.height)),F="matrix("+P+","+R+","+A+","+L+","+S+","+w+")",p.setAttribute("transform",F),E&&(p.style[pe]=F)},US=function(t,e,n,r,s){var o=360,a=Le(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?ji:1),c=l-r,h=r+c+"deg",u,f;return a&&(u=s.split("_")[1],u==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-o)),u==="cw"&&c<0?c=(c+o*_u)%o-~~(c/o)*o:u==="ccw"&&c>0&&(c=(c-o*_u)%o-~~(c/o)*o)),t._pt=f=new je(t._pt,e,n,r,c,_S),f.e=h,f.u="deg",t._props.push(n),f},Eu=function(t,e){for(var n in e)t[n]=e[n];return t},NS=function(t,e,n){var r=Eu({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=n.style,a,l,c,h,u,f,p,x;r.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),o[pe]=e,a=Ls(n,1),Li(n,pe),n.setAttribute("transform",c)):(c=getComputedStyle(n)[pe],o[pe]=e,a=Ls(n,1),o[pe]=c);for(l in ai)c=r[l],h=a[l],c!==h&&s.indexOf(l)<0&&(p=Fe(c),x=Fe(h),u=p!==x?Ii(n,l,c,x):parseFloat(c),f=parseFloat(h),t._pt=new je(t._pt,a,l,u,f-u,jl),t._pt.u=x||0,t._props.push(l));Eu(a,r)};Ke("padding,margin,Width,Radius",function(i,t){var e="Top",n="Right",r="Bottom",s="Left",o=(t<3?[e,n,r,s]:[e+s,e+n,r+n,r+s]).map(function(a){return t<2?i+a:"border"+a+i});Xo[t>1?"border"+i:i]=function(a,l,c,h,u){var f,p;if(arguments.length<4)return f=o.map(function(x){return Jn(a,x,c)}),p=f.join(" "),p.split(f[0]).length===5?f[0]:p;f=(h+"").split(" "),p={},o.forEach(function(x,v){return p[x]=f[v]=f[v]||f[(v-1)/2|0]}),a.init(l,p,u)}});var af={name:"css",register:Ql,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,r,s){var o=this._props,a=t.style,l=n.vars.startAt,c,h,u,f,p,x,v,m,g,E,S,w,P,R,A,L,F;Ic||Ql(),this.styles=this.styles||Qd(t),L=this.styles.props,this.tween=n;for(v in e)if(v!=="autoRound"&&(h=e[v],!(on[v]&&Vd(v,e,n,r,t,s)))){if(p=typeof h,x=Xo[v],p==="function"&&(h=h.call(n,r,t,s),p=typeof h),p==="string"&&~h.indexOf("random(")&&(h=As(h)),x)x(this,t,v,h,n)&&(A=1);else if(v.substr(0,2)==="--")c=(getComputedStyle(t).getPropertyValue(v)+"").trim(),h+="",Ai.lastIndex=0,Ai.test(c)||(m=Fe(c),g=Fe(h),g?m!==g&&(c=Ii(t,v,c,g)+g):m&&(h+=m)),this.add(a,"setProperty",c,h,r,s,0,0,v),o.push(v),L.push(v,0,a[v]);else if(p!=="undefined"){if(l&&v in l?(c=typeof l[v]=="function"?l[v].call(n,r,t,s):l[v],Le(c)&&~c.indexOf("random(")&&(c=As(c)),Fe(c+"")||c==="auto"||(c+=hn.units[v]||Fe(Jn(t,v))||""),(c+"").charAt(1)==="="&&(c=Jn(t,v))):c=Jn(t,v),f=parseFloat(c),E=p==="string"&&h.charAt(1)==="="&&h.substr(0,2),E&&(h=h.substr(2)),u=parseFloat(h),v in Bn&&(v==="autoAlpha"&&(f===1&&Jn(t,"visibility")==="hidden"&&u&&(f=0),L.push("visibility",0,a.visibility),Mi(this,a,"visibility",f?"inherit":"hidden",u?"inherit":"hidden",!u)),v!=="scale"&&v!=="transform"&&(v=Bn[v],~v.indexOf(",")&&(v=v.split(",")[0]))),S=v in ai,S){if(this.styles.save(v),F=h,p==="string"&&h.substring(0,6)==="var(--"){if(h=cn(t,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var y=t.style.perspective;t.style.perspective=h,h=cn(t,"perspective"),y?t.style.perspective=y:Li(t,"perspective")}u=parseFloat(h)}if(w||(P=t._gsap,P.renderTransform&&!e.parseTransform||Ls(t,e.parseTransform),R=e.smoothOrigin!==!1&&P.smooth,w=this._pt=new je(this._pt,a,pe,0,1,P.renderTransform,P,0,-1),w.dep=1),v==="scale")this._pt=new je(this._pt,P,"scaleY",P.scaleY,(E?Fr(P.scaleY,E+u):u)-P.scaleY||0,jl),this._pt.u=0,o.push("scaleY",v),v+="X";else if(v==="transformOrigin"){L.push(Je,0,a[Je]),h=PS(h),P.svg?tc(t,h,0,R,0,this):(g=parseFloat(h.split(" ")[2])||0,g!==P.zOrigin&&Mi(this,P,"zOrigin",P.zOrigin,g),Mi(this,a,v,qo(c),qo(h)));continue}else if(v==="svgOrigin"){tc(t,h,1,R,0,this);continue}else if(v in rf){US(this,P,v,f,E?Fr(f,E+h):h);continue}else if(v==="smoothOrigin"){Mi(this,P,"smooth",P.smooth,h);continue}else if(v==="force3D"){P[v]=h;continue}else if(v==="transform"){NS(this,h,t);continue}}else v in a||(v=Kr(v)||v);if(S||(u||u===0)&&(f||f===0)&&!mS.test(h)&&v in a)m=(c+"").substr((f+"").length),u||(u=0),g=Fe(h)||(v in hn.units?hn.units[v]:m),m!==g&&(f=Ii(t,v,c,g)),this._pt=new je(this._pt,S?P:a,v,f,(E?Fr(f,E+u):u)-f,!S&&(g==="px"||v==="zIndex")&&e.autoRound!==!1?xS:jl),this._pt.u=g||0,S&&F!==h?(this._pt.b=c,this._pt.e=F,this._pt.r=vS):m!==g&&g!=="%"&&(this._pt.b=c,this._pt.r=gS);else if(v in a)RS.call(this,t,v,c,E?E+h:h);
3853else if(v in t)this.add(t,v,c||t[v],E?E+h:h,r,s);else if(v!=="parseTransform"){Mc(v,h);continue}S||(v in a?L.push(v,0,a[v]):typeof t[v]=="function"?L.push(v,2,t[v]()):L.push(v,1,c||t[v])),o.push(v)}}A&&$d(this)},render:function(t,e){if(e.tween._time||!Dc())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:Jn,aliases:Bn,getSetter:function(t,e,n){var r=Bn[e];return r&&r.indexOf(",")<0&&(e=r),e in ai&&e!==Je&&(t._gsap.x||Jn(t,"x"))?n&&mu===n?e==="scale"?ES:MS:(mu=n||{})&&(e==="scale"?TS:bS):t.style&&!xc(t.style[e])?yS:~e.indexOf("-")?SS:Pc(t,e)},core:{_removeProperty:Li,_getMatrix:Nc}};Qe.utils.checkPrefix=Kr;Qe.core.getStyleSaver=Qd;(function(i,t,e,n){var r=Ke(i+","+t+","+e,function(s){ai[s]=1});Ke(t,function(s){hn.units[s]="deg",rf[s]=1}),Bn[r[13]]=i+","+t,Ke(n,function(s){var o=s.split(":");Bn[o[1]]=r[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");Ke("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(i){hn.units[i]="px"});Qe.registerPlugin(af);var OS=Qe.registerPlugin(af)||Qe,FS=OS.core.Tween;const Ka={type:"change"},Oc={type:"start"},Fc={type:"end"},Tu=1e-6,Jt={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4},vo=new St,mi=new St,zS=new U,xo=new U,ja=new U,Ar=new Jr,bu=new U,yo=new U,Ja=new U,So=new U;class lf extends _y{constructor(t,e=null){super(t,e),this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:Ei.ROTATE,MIDDLE:Ei.DOLLY,RIGHT:Ei.PAN},this.state=Jt.NONE,this.keyState=Jt.NONE,this.target=new U,this._lastPosition=new U,this._lastZoom=1,this._touchZoomDistanceStart=0,this._touchZoomDistanceEnd=0,this._lastAngle=0,this._eye=new U,this._movePrev=new St,this._moveCurr=new St,this._lastAxis=new U,this._zoomStart=new St,this._zoomEnd=new St,this._panStart=new St,this._panEnd=new St,this._pointers=[],this._pointerPositions={},this._onPointerMove=kS.bind(this),this._onPointerDown=BS.bind(this),this._onPointerUp=HS.bind(this),this._onPointerCancel=VS.bind(this),this._onContextMenu=ZS.bind(this),this._onMouseWheel=$S.bind(this),this._onKeyDown=WS.bind(this),this._onKeyUp=GS.bind(this),this._onTouchStart=KS.bind(this),this._onTouchMove=jS.bind(this),this._onTouchEnd=JS.bind(this),this._onMouseDown=XS.bind(this),this._onMouseMove=qS.bind(this),this._onMouseUp=YS.bind(this),this._target0=this.target.clone(),this._position0=this.object.position.clone(),this._up0=this.object.up.clone(),this._zoom0=this.object.zoom,e!==null&&(this.connect(),this.handleResize()),this.update()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}handleResize(){const t=this.domElement.getBoundingClientRect(),e=this.domElement.ownerDocument.documentElement;this.screen.left=t.left+window.pageXOffset-e.clientLeft,this.screen.top=t.top+window.pageYOffset-e.clientTop,this.screen.width=t.width,this.screen.height=t.height}update(){this._eye.subVectors(this.object.position,this.target),this.noRotate||this._rotateCamera(),this.noZoom||this._zoomCamera(),this.noPan||this._panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this._checkDistances(),this.object.lookAt(this.target),this._lastPosition.distanceToSquared(this.object.position)>Tu&&(this.dispatchEvent(Ka),this._lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this._lastPosition.distanceToSquared(this.object.position)>Tu||this._lastZoom!==this.object.zoom)&&(this.dispatchEvent(Ka),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type.")}reset(){this.state=Jt.NONE,this.keyState=Jt.NONE,this.target.copy(this._target0),this.object.position.copy(this._position0),this.object.up.copy(this._up0),this.object.zoom=this._zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(Ka),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom}_panCamera(){if(mi.copy(this._panEnd).sub(this._panStart),mi.lengthSq()){if(this.object.isOrthographicCamera){const t=(this.object.right-this.object.left)/this.object.zoom/this.domElement.clientWidth,e=(this.object.top-this.object.bottom)/this.object.zoom/this.domElement.clientWidth;mi.x*=t,mi.y*=e}mi.multiplyScalar(this._eye.length()*this.panSpeed),xo.copy(this._eye).cross(this.object.up).setLength(mi.x),xo.add(zS.copy(this.object.up).setLength(mi.y)),this.object.position.add(xo),this.target.add(xo),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(mi.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}_rotateCamera(){So.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0);let t=So.length();t?(this._eye.copy(this.object.position).sub(this.target),bu.copy(this._eye).normalize(),yo.copy(this.object.up).normalize(),Ja.crossVectors(yo,bu).normalize(),yo.set
3853Length(this._moveCurr.y-this._movePrev.y),Ja.setLength(this._moveCurr.x-this._movePrev.x),So.copy(yo.add(Ja)),ja.crossVectors(So,this._eye).normalize(),t*=this.rotateSpeed,Ar.setFromAxisAngle(ja,t),this._eye.applyQuaternion(Ar),this.object.up.applyQuaternion(Ar),this._lastAxis.copy(ja),this._lastAngle=t):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),Ar.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(Ar),this.object.up.applyQuaternion(Ar)),this._movePrev.copy(this._moveCurr)}_zoomCamera(){let t;this.state===Jt.TOUCH_ZOOM_PAN?(t=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(t):this.object.isOrthographicCamera?(this.object.zoom=lh.clamp(this.object.zoom/t,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(t=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,t!==1&&t>0&&(this.object.isPerspectiveCamera?this._eye.multiplyScalar(t):this.object.isOrthographicCamera?(this.object.zoom=lh.clamp(this.object.zoom/t,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor)}_getMouseOnScreen(t,e){return vo.set((t-this.screen.left)/this.screen.width,(e-this.screen.top)/this.screen.height),vo}_getMouseOnCircle(t,e){return vo.set((t-this.screen.width*.5-this.screen.left)/(this.screen.width*.5),(this.screen.height+2*(this.screen.top-e))/this.screen.width),vo}_addPointer(t){this._pointers.push(t)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e].pointerId==t.pointerId){this._pointers.splice(e,1);return}}_trackPointer(t){let e=this._pointerPositions[t.pointerId];e===void 0&&(e=new St,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0].pointerId?this._pointers[1]:this._pointers[0];return this._pointerPositions[e.pointerId]}_checkDistances(){(!this.noZoom||!this.noPan)&&(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))}}function BS(i){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._addPointer(i),i.pointerType==="touch"?this._onTouchStart(i):this._onMouseDown(i))}function kS(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function HS(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchEnd(i):this._onMouseUp(),this._removePointer(i),this._pointers.length===0&&(this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp)))}function VS(i){this._removePointer(i)}function GS(){this.enabled!==!1&&(this.keyState=Jt.NONE,window.addEventListener("keydown",this._onKeyDown))}function WS(i){this.enabled!==!1&&(window.removeEventListener("keydown",this._onKeyDown),this.keyState===Jt.NONE&&(i.code===this.keys[Jt.ROTATE]&&!this.noRotate?this.keyState=Jt.ROTATE:i.code===this.keys[Jt.ZOOM]&&!this.noZoom?this.keyState=Jt.ZOOM:i.code===this.keys[Jt.PAN]&&!this.noPan&&(this.keyState=Jt.PAN)))}function XS(i){let t;switch(i.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case Ei.DOLLY:this.state=Jt.ZOOM;break;case Ei.ROTATE:this.state=Jt.ROTATE;break;case Ei.PAN:this.state=Jt.PAN;break;default:this.state=Jt.NONE}const e=this.keyState!==Jt.NONE?this.keyState:this.state;e===Jt.ROTATE&&!this.noRotate?(this._moveCurr.copy(this._getMouseOnCircle(i.pageX,i.pageY)),this._movePrev.copy(this._moveCurr)):e===Jt.ZOOM&&!this.noZoom?(this._zoomStart.copy(this._getMouseOnScreen(i.pageX,i.pageY)),this._zoomEnd.copy(this._zoomStart)):e===Jt.PAN&&!this.noPan&&(this._panStart.copy(this._getMouseOnScreen(i.pageX,i.pageY)),this._panEnd.copy(this._panStart)),this.dispatchEvent(Oc)}function qS(i){const t=this.keyState!==Jt.NONE?this.keyState:this.state;t===Jt.ROTATE&&!this.noRotate?(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(i.pageX,i.pageY))):t===Jt.ZOOM&&!this.noZoom?this._zoomEnd.copy(this._getMouseOnScreen(i.pageX,i.pageY)):t===Jt.PAN&&!this.noPan&&this._panEnd.copy(this._getMouseOnScreen(i.pageX,i.pageY))}function YS(){this.state=Jt.NONE,this.dispatchEvent(Fc)}function $S(i){if(this.enabled!==!1&&this.noZoom!==!0){switch(i.preventDefault(),i.deltaMode){case 2:this._zoomStart.y-=i.deltaY*.025;break;case 1:this._zoomStart.y-=i.deltaY*.01;break;default:this._zoomStart.y-=i.deltaY*25e-5;break}this.dispatchEvent(Oc),this.dispatchEvent(Fc)}}function ZS(i){this.enabled!==!1&&i.preventDefault()}function KS(i){switch(this._trackPointer(i),this._pointers.length){case 1:this.state=Jt.TOUC
3853H_ROTATE,this._moveCurr.copy(this._getMouseOnCircle(this._pointers[0].pageX,this._pointers[0].pageY)),this._movePrev.copy(this._moveCurr);break;default:this.state=Jt.TOUCH_ZOOM_PAN;const t=this._pointers[0].pageX-this._pointers[1].pageX,e=this._pointers[0].pageY-this._pointers[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(t*t+e*e);const n=(this._pointers[0].pageX+this._pointers[1].pageX)/2,r=(this._pointers[0].pageY+this._pointers[1].pageY)/2;this._panStart.copy(this._getMouseOnScreen(n,r)),this._panEnd.copy(this._panStart);break}this.dispatchEvent(Oc)}function jS(i){switch(this._trackPointer(i),this._pointers.length){case 1:this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(i.pageX,i.pageY));break;default:const t=this._getSecondPointerPosition(i),e=i.pageX-t.x,n=i.pageY-t.y;this._touchZoomDistanceEnd=Math.sqrt(e*e+n*n);const r=(i.pageX+t.x)/2,s=(i.pageY+t.y)/2;this._panEnd.copy(this._getMouseOnScreen(r,s));break}}function JS(i){switch(this._pointers.length){case 0:this.state=Jt.NONE;break;case 1:this.state=Jt.TOUCH_ROTATE,this._moveCurr.copy(this._getMouseOnCircle(i.pageX,i.pageY)),this._movePrev.copy(this._moveCurr);break;case 2:this.state=Jt.TOUCH_ZOOM_PAN;for(let t=0;t<this._pointers.length;t++)if(this._pointers[t].pointerId!==i.pointerId){const e=this._pointerPositions[this._pointers[t].pointerId];this._moveCurr.copy(this._getMouseOnCircle(e.x,e.y)),this._movePrev.copy(this._moveCurr);break}break}this.dispatchEvent(Fc)}const QS=` 3854precision mediump float; 3855 3856uniform float useColor; 3857uniform float cellAtlasPxPerSide; 3858uniform float lodAtlasPxPerSide; 3859uniform float cellPxHeight; 3860uniform float lodPxHeight; 3861uniform float borderWidth; 3862uniform vec3 borderColor; 3863uniform float display; 3864uniform float time; 3865 3866varying vec3 vColor; // cell's color (for gpu picking) 3867varying vec2 vOffset; // cell's offset in px from left, top of tex 3868varying float vWidth; // cell's width in lod tex in px 3869varying float vHeight; // cell's height in lod tex in px 3870varying float vOpacity; // cell's opacity 3871varying float vSelected; // greater than 0.5 if selected 3872varying float vClusterSelected; // greater than 0.5 if cluster is selected 3873varying float vTextureIndex; // cell's texture index 3874 3875#ifndef SELECTING 3876 uniform sampler2D textures[N_TEXTURES]; // array of sampler2Ds 3877 uniform sampler2D lodTexture; // single sampler2D 3878#endif 3879 3880void main() { 3881 if (display < 0.5) { 3882 discard; 3883 } else { 3884 // is this cell a LOD cell? 3885 bool isLod = vTextureIndex < -0.5; 3886 3887 // get the width of the border on each side of the cell 3888 float borderW = borderWidth / 2.0; 3889 3890 // find the width and height of this cell in its texture (in px) 3891 float w = isLod ? vWidth : vWidth/vHeight*cellPxHeight; 3892 float h = isLod ? vHeight : cellPxHeight; 3893 3894 // find the length of the cell in its longest dimension (in px) 3895 float big = max(w, h); 3896 3897 // set boolean indicating whether to center cells 3898 bool center = true; 3899 3900 // find min, max vals of 0:1 scaled x axis to be textured 3901 float x0 = center ? (big-w)/2.0/big : 0.0; 3902 float x1 = center ? (w/big)+x0 : w / big; 3903 3904 // find min, max vals of 0:1 scaled y axis to be textured 3905 float y0 = center ? (big-h)/2.0/big : 0.0; 3906 float y1 = center ? (h/big)+y0 : h / big; 3907 3908 // clip the cell to center the texture on the x axis 3909 if (h > w && (gl_PointCoord.x < x0 || gl_PointCoord.x > x1)) discard; 3910 3911 // if this cell's image is landscape clip bottom margin 3912 else if (w > h && gl_PointCoord.y < y0 || gl_PointCoord.y > y1) discard; 3913 3914 // if this shader is using vColor attributes skip texture processing 3915 if (int(useColor) == 1) { 3916 gl_FragColor = vec4(vColor, 1.0); 3917 3918 // else this cell should be textured 3919 } else { 3920 3921 // identify whether this pixel is selected, cluster selected, and inside border area 3922 bool isSelected = vSelected > 0.5; 3923 bool isClusterSelected = vClusterSelected > 0.5; 3924 bool isInBorder = gl_PointCoord.x < x0 + borderW || 3925 gl_PointCoord.x > x1 - borderW || 3926 gl_PointCoord.y < y0 + borderW || 3927 gl_PointCoord.y > y1 - borderW; 3928 3929 // check if the current pointcoord position is within the border 3930 if ((isSelected || isClusterSelected) && isInBorder) { 3931 3932 // configure the cluster selected stripe 3933 float stripeRepeatWidth = 8.0 / big; 3934 float stripeWidth = 3.0 / big; 3935 float stripeSpeed = 1.5;
3936 vec4 stripeColor = vec4(1.0, 1.0, 1.0, 1.0); 3937 vec4 selectedColor = vec4(borderColor, 1.0); 3938 vec4 redColor = vec4(156.0 / 255.0, 23.0 / 255.0, 23.0 / 255.0, 1); 3939 vec4 noColor = vec4(0.0, 0.0, 0.0, 0.0); 3940 3941 // determine whether we're on or off band 3942 float pos = gl_PointCoord.x + gl_PointCoord.y; 3943 float m = mod(pos + mod(time * stripeSpeed, stripeRepeatWidth), stripeRepeatWidth); 3944 bool band = m < stripeWidth; 3945 3946 // determine border type to use 3947 if (isSelected && isClusterSelected) { 3948 gl_FragColor = band ? stripeColor : selectedColor; 3949 } else if (isSelected) { 3950 gl_FragColor = selectedColor; 3951 } else if (isClusterSelected) { 3952 gl_FragColor = band ? stripeColor : redColor; 3953 } 3954 3955 // pixel is outside the border; paint with the provided texture 3956 } else { 3957 3958 // get the x and y positions to sample for this cell's texture 3959 float x = center ? gl_PointCoord.x - x0 : gl_PointCoord.x; 3960 float y = center ? gl_PointCoord.y - y0 : gl_PointCoord.y; 3961 3962 // scale the x and y positions to the size of the texture 3963 vec2 uv = vOffset + vec2(x, y) * big; 3964 3965 // set variables consumed by fragment tree below 3966 vec2 scaledUv = isLod ? uv/lodAtlasPxPerSide : uv/cellAtlasPxPerSide; 3967 int textureIndex = isLod ? -1 : int(vTextureIndex); 3968 3969 // target to be replaced by texture tree 3970 TEXTURE_LOOKUP_TREE 3971 3972 gl_FragColor = mix(gl_FragColor, vec4(0.0), 1.0-vOpacity); 3973 gl_FragColor.a = 1.0; 3974 3975 if (vSelected > 0.5) gl_FragColor = mix(gl_FragColor, vec4(borderColor, 1.0), 0.15); 3976 } 3977 } 3978 } 3979} 3980`,tM=` 3981precision mediump float; 3982 3983uniform mat4 modelViewMatrix; 3984uniform mat4 projectionMatrix; 3985uniform vec3 cameraPosition; 3986uniform float scale; 3987uniform float targetScale; 3988uniform float transitionPercent; 3989uniform float scaleTransitionPercent; 3990uniform float borderWidth; 3991 3992attribute vec3 position; // x y z position offsets for an instance 3993attribute vec3 targetPosition; // x y z position to which we're transitioning 3994attribute vec3 color; // unique color for cell; used for raycasting 3995attribute float width; // px width of cell in lod texture 3996attribute float height; // px height of cell in lod texture 3997attribute vec2 offset; // px offset in tex from left, top 3998attribute float opacity; // opacity value for cell 3999attribute float selected; // 1 if the cell is selected else 0 4000attribute float clusterSelected; // 1 if the cell's cluster is selected else 0 4001attribute float textureIndex; // index of instance's texture among all textures 4002 4003varying vec3 vColor; // cell color 4004varying vec2 vOffset; // px of cell offset left, top in texture 4005varying float vWidth; // px width of cell in lod texture 4006varying float vHeight; // px height of cell in lod texture 4007varying float vOpacity; // cell opacity 4008varying float vSelected; // 1 if this cell is selected else 0 4009varying float vClusterSelected; // 1 if this cell's cluster is selected else 0 4010varying float vTextureIndex; // cell texture idx (varyings can't be int) 4011 4012void main() { 4013 // pass varyings to fragment shader 4014 vTextureIndex = textureIndex; 4015 vColor = color; 4016 vWidth = width; 4017 vHeight = height; 4018 vOffset = offset; 4019 vOpacity = opacity; 4020 vSelected = selected; 4021 vClusterSelected = clusterSelected; 4022 4023 float percent = clamp(transitionPercent, 0.0, 1.0); 4024 4025 // set point position as a mixture between the position + target 4026 vec3 pos = mix(position, targetPosition, percent); 4027 vec4 world = modelViewMatrix * vec4(pos, 1.0); 4028 gl_Position = projectionMatrix * world; 4029 4030 // use the unscaled point position and camera position to set point size 4031 float s = mix(scale, targetScale, percent); 4032 float pointSize = s / -world.z; 4033 4034 if (selected > 0.5) { 4035 gl_PointSize = pointSize + (pointSize * borderWidth); 4036 } else { 4037 gl_PointSize = pointSize; 4038 } 4039} 4040`,eM=` 4041precision mediump float; 4042 4043uniform mat4 modelViewMatrix; 4044uniform mat4 projectionMatrix; 4045uniform vec3 cameraPosition; 4046uniform float scale; 4047 4048attribute vec2 offset; 4049attribute vec3 position; 4050 4051varying vec2 vOffset; 4052 4053void main() {
4054 vec4 world = modelViewMatrix * vec4(position, 1.0); 4055 gl_Position = projectionMatrix * world; 4056 gl_PointSize = scale / -world.z; 4057 vOffset = offset; 4058} 4059`,nM=` 4060precision highp float; 4061uniform float display; 4062 4063void main() { 4064 if (display < 0.5) { 4065 discard; 4066 } else { 4067 gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); 4068 } 4069`,iM=` 4070precision highp float; 4071 4072 uniform mat4 modelViewMatrix; 4073 uniform mat4 projectionMatrix; 4074 uniform float transitionPercent; 4075 uniform vec3 cameraPosition; 4076 uniform float scale; 4077 uniform float targetScale; 4078 4079 attribute vec3 position; 4080 attribute vec3 targetPosition; 4081 attribute vec2 midpoint; 4082 attribute vec2 targetMidpoint; 4083 4084 void main() { 4085 float percent = clamp(transitionPercent, 0.0, 1.0); 4086 vec3 positionC = mix(position, targetPosition, percent); 4087 vec2 midpointC = mix(midpoint, targetMidpoint, percent); 4088 float scaleC = mix(scale, targetScale, percent); 4089 4090 // scale the pos 4091 positionC.x -= ((midpointC.x - positionC.x) * scaleC * 0.2); 4092 positionC.y -= ((midpointC.y - positionC.y) * scaleC * 0.2); 4093 4094 vec4 mvPos = modelViewMatrix * vec4(positionC, 1.0); 4095 gl_Position = projectionMatrix * mvPos; 4096 } 4097`;function zc(){this.data={baseUrl:"/",dir:this.isLocalhost?"/vizwow/data":"vizwow/data",file:"manifest.json",gzipped:!1},this.size={cell:32,lodCell:128,atlas:2048,texture:ia.limits.textureSize,lodTexture:2**13,points:{min:0,max:0,initial:10,grid:10,scatter:0,date:0}},this.transitions={duration:1,delay:0,ease:{value:1,ease:void 0}},this.pickerMaxZ=.4,this.atlasesPerTex=(this.size.texture/this.size.atlas)**2,this.flyToImage=null,this.zoomConfig=null,this.isLocalhost=window.location.hostname.includes("localhost")||window.location.hostname.includes("127.0.0.1")||window.location.hostname.includes("0.0.0.0")||window.location.hostname.includes("[::]")}zc.prototype.setFlyToImage=function(i){this.flyToImage=i};zc.prototype.setZoomConfig=function(i){this.zoomConfig=i};function es(){this.atlasCount=null,this.textureCount=null,this.layouts=[],this.cells=[],this.textures=[],this.textureProgress={},this.loadedTextures=0,this.boundingBox={x:{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},y:{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY}},ot.getHeightMap(this.load.bind(this))}es.prototype.load=function(){var i=Vn(nt.data.dir+"/"+nt.data.file),t=nt.isLocalhost?nt.data.baseUrl:"";Hn(i,(function(e){Hn(Vn(t+e.imagelist),(function(n){this.parseManifest(Object.assign({},e,n))}).bind(this))}).bind(this),(function(e){nt.data.gzipped?console.warn("ERROR: could not load manifest.json"):(nt.data.gzipped=!0,nt.data.file=nt.data.file+".gz",this.load())}).bind(this))};es.prototype.parseManifest=function(i){console.log("parseManifest",i),this.json=i,nt.size.cell=i.config.sizes.cell,nt.size.atlas=i.config.sizes.atlas,nt.size.lodCell=i.config.sizes.lod,nt.size.points=i.point_sizes,this.atlasCount=i.atlas.count,this.textureCount=Math.ceil(i.atlas.count/nt.atlasesPerTex),this.layouts=i.layouts,this.hotspots=new pn,He.init(Object.keys(this.layouts)),i.metadata&&jr.loadFilters();for(var t=0;t<this.textureCount;t++)this.textures.push(new ns({idx:t,onProgress:this.onTextureProgress.bind(this),onLoad:this.onTextureLoad.bind(this)}));Hn(Vn(this.layouts[He.selected].layout),(function(e){this.addCells(e),this.hotspots.initialize()}).bind(this))};es.prototype.onTextureProgress=function(i,t){this.textureProgress[i]=t/this.textures[i].getAtlasCount(i),Wc.updateProgress()};es.prototype.onTextureLoad=function(i){this.loadedTextures+=1,Wc.updateProgress()};es.prototype.addCells=function(i){for(var t=0,e=0;e<this.json.cell_sizes.length;e++)for(var n=0;n<this.json.cell_sizes[e].length;n++){Math.floor(e/nt.atlasesPerTex);var r=i[t],s=this.json.atlas.positions[e][n],o=Bc(e),a=this.json.cell_sizes[e][n];this.cells.push(new Tn({idx:t,w:a[0],h:a[1],x:r[0],y:r[1],z:r[2]||null,dx:s[0]+o.x,dy:s[1]+o.y})),t++}Di.indexCells()};function ns(i){this.idx=i.idx,this.atlases=[],this.atlasProgress={},this.loadedAtlases=0,this.onProgress=i.onProgress,this.onLoad=i.onLoad,this.canvas=null,this.ctx=null,this.load()}ns.prototype.setCanvas=function(){this.canvas=Gc("canvas",{width:nt.size.texture,height:nt.size.texture,id:"texture-"+this.idx}),this.ctx=this.canvas.getContext("2d")};ns.prototype.load=function(){this.setCanvas();for(var i=0;i<this.getAtlasCount();i++)this.atlases.push(new cf({idx:nt.atlasesPerTex*this.idx+i,onProgress:this.onAtlasProgress.bind(this),onLoad:this.onAtlasLoad.bind(this)}))};ns.prototype.getAtlasCount=function(){return rt.atlasCount/nt.atlasesPerTex>this.idx+1?nt.atlasesPerTex:rt.atlasCount%nt.atlasesPerTex};ns.prototype.onAtlasProgress=function(i,t){this.atlasProgress[i]=t;var e=hf(this.atlasProgress);this.onProgress(this.idx,e)};ns.prototype.onAtlasLoad=function(i){nt.size.atlas,nt.size.texture;var t=i.idx%nt.atlasesPerTex,e=Bc(t),n=nt.size.atlas,r=nt.size.atlas;this.ctx.drawImage(i.image,e.x,e.y,n,r),++this.loadedAtlases==this.getAtlasCount()&&this.onLoad(this.idx)};function Bc(i){var t=nt.size.atlas,e=nt.size.texture;return{x:i*t%e,y:Math.floor(i*t/e)*t%e}}function cf(i){this.idx=i.idx,this.progress=0,this.onProgress=i.onProgress,this.onLoad=i.onLoad,this.image=null,this.url=Vn(rt.json.atlas_dir+"/atlas-"+this.idx+".jpg"),this.load()}cf.prototype.load=function(){this.image=new Image,this.image.onload=(function(){this.onLoad(this)}).bind(this);var i=new XMLHttpRequest;i.onprogress=(function(t){var e=parseInt(t.loaded/t.total*100);this.onProgress(this.idx,e)}).bind(this),i.onload=(function(t){this.image.src=window.URL.createObjectURL(t.target.response)}).bind(this),i.open("GET",this.url,!0),i.responseType="blob",i.send()};function Tn(i){this.idx=i.idx,this.texIdx=this.getIndexOfTexture(),this.gridCoords={},this.x=i.x,this.y=i.y,this.z=i.z||this.getZ(i.x,i.y),this.tx=this.x,this.ty=this.y,this.tz=this.z,this.dx=i.dx,this.dy=i.dy,this.w=i.w,this.h=i.h,this.updateParentBoundingBox()}Tn.prototype.getZ=function(i,t){return ot.getHeightAt(i,t)||0};Tn.prototype.updateParentBoundingBox=function(){var i=rt.boundingBox;["x","y"].forEach((function(t){i[t].max=Math.max(i[t].max,this[t]),i[t].min=Math.min(i[t].min,this[t])}).bind(this))};Tn.prototype.getIndexOfAtlas=function(){for(var i=0,t=0;t<rt.json.atlas.positions.length;t++)if(i+=rt.json.atlas.positions[t].length,i>this.idx)return t;return t};Tn.prototype.getIndexInAtlas=function(){for(var i=this.getIndexOfAtlas(),t=0,e=0;e<i;e++)t+=rt.json.atlas.positions[e].length;return this.idx-t};Tn.prototype.getIndexOfTexture=function(){return Math.floor(this.getIndexOfAtlas()/nt.atlasesPerTex)};Tn.prototype.getIndexInTexture=function(){for(var i=0,t=0;t<this.getIndexOfAtlas();t++)t%nt.atlaesPerTex==0&&(i=0),i+=rt.json.atlas.positions[i].length;return i+this.getIndexInAtlas()};Tn.prototype.getIndexOfDrawCall=function(){return Math.floor(this.idx/ia.limits.indexedElements)};Tn.prototype.getIndexInDrawCall=function(){return this.idx%ia.limits.indexedElements};Tn.prototype.activate=function(){this.dx=Di.state.cellIdxToCoords[this.idx].x,this.dy=Di.state.cellIdxToCoords[this.idx].y,this.texIdx=-1,["textureIndex","offset"].forEach(this.setBuffer.bind(this))};Tn.prototype.deactivate=function(){var i=this.getIndexOfAtlas(),t=this.getIndexInAtlas(),e=Bc(i);d=rt.json.atlas.positions[i][t],this.dx=d[0]+e.x,this.dy=d[1]+e.y,this.texIdx=this.getIndexOfTexture(),["textureIndex","offset"].forEach(this.setBuffer.bind(this))};Tn.prototype.setBuffer=function(i){var t=ot.group,e=t.children[this.getIndexOfDrawCall()].geometry.attributes,n=this.getIndexInDrawCall();switch(i){case"textureIndex":e.textureIndex.array[n]=this.texIdx;return;case"offset":this.texIdx==-1?nt.size.lodTexture:nt.size.texture,e.offset.array[n*2]=this.dx,e.offset.array[n*2+1]=this.dy;return;case"position":e.position.array[n*3]=this.x,e.position.array[n*3+1]=this.y,e.position.array[n*3+2]=this.z;return;case"targetPosition":e.targetPosition.array[n*3]=this.tx,e.targetPosition.array[n*3+1]=this.ty,e.targetPosition.array[n*3+2]=this.tz;return}};function bn(){this.jitterElem=null,this.selected=null,this.options=[],this.currentTransition="01"}bn.prototype.init=function(i){this.options=i,this.selected=rt.json.initial_layout||Object.keys(i)[0],this.elems={input:document.querySelector("#jitter-input"),jitter:document.querySelector("#jitter-container"),icons:document.querySelector("#icons"),layoutCategorical:document.querySelector("#layout-categorical"),layoutDate:document.querySelector("#layout-date"),layoutPose:document.querySelector("#layout-pose"),layoutGeographic:document.querySelector("#layout-geographic"),zoomPlus:document.querySelector("#zoom-plus"),zoomMinus:document.querySelector("#zoom-minus"),zoomReset:document.querySelector("#zoom-reset")}};bn.prototype.showHideIcons=function(){rt.layouts.categorical&&(this.elems.layoutCategorical.style.display="inline-block"),rt.layouts.date&&(this.elems.layoutDate.style.display="inline-block"),rt.layouts.pose&&(this.elems.layoutPose.style.display="inline-block"),rt.layouts.geographic&&(this.elems.layoutGeographic.style.display="inline-block")};bn.prototype.selectActiveIcon=function(){for(var i=this.elems.icons.querySelectorAll(".layout-icon"),t=0;t<i.length;t++)i[t].classList.remove("active");try{document.querySelector("#layout-"+this.selected).classList.add("active")}catch{console.warn(" * the requested layout has no icon:",this.selected)}};bn.prototype.addEventListeners=function(){this.elems.icons.addEventListener("click",(function(i){!i.target||!i.target.id||i.target.id=="icons"||this.set(i.target.id.replace("layout-",""),!0)}).bind(this)),this.elems.jitter.addEventListener("click",(function(i){i.target.tagName!="INPUT"&&(this.elems.input.checked?(this.elems.input.checked=!1,this.elems.jitter.classList.remove("visible")):(this.elems.input.checked=!0,this.elems.jitter.classList.add("visible"))),this.set(this.selected,!1)}).bind(this)),this.elems.zoomPlus.addEventListener("click",(function(){ot.zoomInCamera()}).bind(this)),this.elems.zoomMinus.addEventListener("click",(function(){ot.zoomOutCamera()}).bind(this)),this.elems.zoomReset.addEventListener("click",(function(){ot.resetZoom(!0)}).bind(this))};bn.prototype.set=function(i,t){if(!ot.state.transitioning){ot.state.transitioning=!0,this.selected=i,ot.setMode("pan"),this.setPointScalar(),this.setText();
4097var e=ot.recenterCamera(t),n="layout";setTimeout((function(){Hn(Vn(rt.layouts[i][n]),(function(r){Di.clear();for(var s=0;s<rt.cells.length;s++)rt.cells[s].tx=r[s][0],rt.cells[s].ty=r[s][1],rt.cells[s].tz=r[s][2]||rt.cells[s].getZ(r[s][0],r[s][1]),rt.cells[s].setBuffer("targetPosition");if(he.mesh){var o=he.getAttributes("targetPosition");he.mesh.geometry.attributes.targetPosition.array=o.positions.array.slice(0),he.mesh.geometry.attributes.targetPosition.needsUpdate=!0,he.mesh.geometry.attributes.targetMidpoint.array=o.midpoints.array,he.mesh.geometry.attributes.targetMidpoint.needsUpdate=!0;var a=[he.mesh.material.uniforms.transitionPercent]}else var a=[];for(var s=0;s<ot.group.children.length;s++)ot.group.children[s].geometry.attributes.targetPosition.needsUpdate=!0,a.push(ot.group.children[s].material.uniforms.transitionPercent);FS.to(a,nt.transitions.duration,nt.transitions.ease),setTimeout(this.onTransitionComplete.bind(this),nt.transitions.duration*1e3)}).bind(this))}).bind(this),e)}};bn.prototype.setPointScalar=function(){var i=!1,t=this.selected;if((t=="tsne"||t=="umap"||t=="pose")&&(i=nt.size.points.scatter),(t=="alphabetic"||t=="grid")&&(i=nt.size.points.grid),t=="categorical"&&(i=nt.size.points.categorical),t=="geographic"&&(i=nt.size.points.geographic),t=="date"&&(i=nt.size.points.date),i){var e=ot.getPointScale();ot.setUniform("targetScale",e),he.mesh&&(he.mesh.material.uniforms.targetScale.value=e)}};bn.prototype.showHideJitter=function(){var i="jittered"in rt.layouts[this.selected];return i?ot.state.transitioning?this.elems.jitter.classList.add("visible","disabled"):this.elems.jitter.classList.add("visible"):this.elems.jitter.classList.remove("visible"),i&&this.elems.input.checked};bn.prototype.showHideContext=function(){this.selected=="geographic"?globe.show():globe.hide()};bn.prototype.setText=function(){if(_i.mesh){var i=rt.json.layouts[this.selected].labels;i&&_i.mesh?(Hn(Vn(i),_i.formatText.bind(_i)),_i.mesh.material.uniforms.render.value=1):_i.mesh.material.uniforms.render.value=0}};bn.prototype.setCurrentTransition=function(i){this.currentTransition=i};bn.prototype.onTransitionComplete=function(){rt.hotspots.showHide(),rt.cells.forEach(function(t){t.x=t.tx,t.y=t.ty,t.z=t.tz,t.setBuffer("position")}),he.mesh&&(he.mesh.geometry.attributes.position.array=he.mesh.geometry.attributes.targetPosition.array.slice(0),he.mesh.geometry.attributes.midpoint.array=he.mesh.geometry.attributes.targetMidpoint.array.slice(0),he.mesh.geometry.attributes.position.needsUpdate=!0,he.mesh.geometry.attributes.midpoint.needsUpdate=!0,he.mesh.material.uniforms.transitionPercent={type:"f",value:0});for(var i=0;i<ot.group.children.length;i++)ot.group.children[i].geometry.attributes.position.needsUpdate=!0,ot.group.children[i].material.uniforms.transitionPercent={type:"f",value:0};ot.state.transitioning=!1,ot.setScaleUniforms(),Di.indexCells(),this.currentTransition==="12"&&ot.setZoomLevel(nt.zoomConfig.grid_in),this.currentTransition==="23"&&(console.log("zoom level in tsne",nt.zoomConfig.date),ot.setZoomLevel(nt.zoomConfig.date)),this.currentTransition==="null3"&&ot.setZoomLevel(nt.zoomConfig.date),this.currentTransition==="32"&&ot.setZoomLevel(nt.zoomConfig.grid_in),(this.currentTransition==="10"||this.currentTransition==="01")&&ot.setZoomLevel(nt.zoomConfig.umap),this.currentTransition==="21"&&ot.flyToCellImage(nt.flyToImage)};function At(){this.canvas=document.querySelector("#pixplot-canvas"),this.scene=this.getScene(),this.camera=this.getCamera(),this.renderer=this.getRenderer(),this.controls=this.getControls(),this.stats=this.getStats(),this.color=new Kt,this.clock=new my,this.time=0,this.center={},this.group={},this.state={flying:!1,transitioning:!1,displayed:!1,mode:"pan"},this.elems={pointSize:document.querySelector("#pointsize-range-input")},this.addEventListeners(),this.ready=!1}At.prototype.getScene=function(){var i=new sd;return i};At.prototype.getCamera=function(){var i=na(),t=i.w/i.h;return new vn(75,t,.001,10)};At.prototype.getRenderer=function(){return new Kx({antialias:!0,canvas:this.canvas,alpha:!0})};At.prototype.getControls=function(){const i=new lf(this.camera,this.canvas);return i.zoomSpeed=.4,i.panSpeed=.4,i.noRotate=!0,i.noZoom=!0,i.mouseButtons.LEFT=Ei.PAN,i.mouseButtons.RIGHT=Ei.ROTATE,i};At.prototype.getHeightMap=function(i){var t=new Image;t.crossOrigin="Anonymous",t.onload=(function(){var n=document.createElement("canvas"),r=n.getContext("2d");n.width=t.width,n.height=t.height,r.drawImage(t,0,0),this.heightmap=r.getImageData(0,0,t.width,t.height),i()}).bind(this);var e="/";t.src=this.heightmap||e+"vizwow/images/heightmap.jpg"};At.prototype.getHeightAt=function(e,n){var e=(e+1)/2,n=(n+1)/2,r=Math.floor(n*(this.heightmap.height-1)),s=Math.floor(e*(this.heightmap.width-1)),o=r*this.heightmap.width*4+s*4,a=this.heightmap.data[o]*(this.heightmapScalar/1e3||0);return a};At.prototype.addEventListeners=function(){this.addResizeListener(),this.addLostContextListener(),this.addTabChangeListeners()};At.prototype.addScrollListener=function(){};At.prototype.handlewheel=function(i){};At.prototype.addResizeListener=function(){window.addEventListener("resize",this.handleResize.bind(this),!1)};At.prototype.handleResize=function(){var i=na(),t=i.w*window.devicePixelRatio,e=i.h*window.devicePixelRatio;this.camera.aspect=t/e,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,e,!1),this.controls.handleResize(),Xc.tex.setSize(t,e),this.setScaleUniforms()};At.prototype.setScaleUniforms=function(){if(this.state.displayed){var i=ot.getPointScale();ot.setUniform("scale",i),he.mesh&&(he.mesh.material.uniforms.scale.value=i)}};At.prototype.addScalarChangeListener=function(){this.elems.pointSize.addEventListener("change",this.setScaleUniforms.bind(this)),this.elems.pointSize.addEventListener("input",this.setScaleUniforms.bind(this))};At.prototype.addTabChangeListeners=function(){window.addEventListener("visibilitychange",(function(){this.canvas.width=this.canvas.width+1,setTimeout((function(){this.canvas.width=this.canvas.width-1}).bind(this),50)}).bind(this))};At.prototype.addLostContextListener=function(){this.canvas.addEventListener("webglcontextlost",function(i){i.preventDefault(),window.location.reload()})};At.prototype.addModeChangeListeners=function(){document.querySelector("#pan").addEventListener("click",this.handleModeIconClick.bind(this)),document.querySelector("#select").addEventListener("click",this.handleModeIconClick.bind(this)),document.querySelector("#select").addEventListener("mouseenter",this.showSelectTooltip.bind(this))};At.prototype.setCenter=function(){this.center={x:(rt.boundingBox.x.min+rt.boundingBox.x.max)/2,y:(rt.boundingBox.y.min+rt.boundingBox.y.max)/2}};At.prototype.recenterCamera=function(i){var t=this.getInitialLocation();return this.camera.position.z<t.z&&i?(this.flyTo(t),nt.transitions.duration/2*1e3):0};At.prototype.setZoomLevel=function(i=null){var t={x:this.camera.position.x===-0?0:this.camera.position.x,y:this.camera.position.y,z:i};this.flyTo(t)};At.prototype.zoomInCamera=function(i=null){var t={x:this.camera.position.x,y:this.camera.position.y,z:i||this.camera.position.z-.3};t.z>this.camera.near&&this.flyTo(t)};At.prototype.zoomOutCamera=function(i){var t={x:this.camera.position.x,y:this.camera.position.y,z:i||this.camera.position.z-.3};t.z>this.camera.near&&this.flyTo(t)};At.prototype.resetZoom=function(){var i=this.getInitialLocation();this.flyTo(i)};At.prototype.plotPoints=function(){var i=this.getDrawCallToCells();this.group=new Pr;
4097for(var t in i){var e=i[t],n=this.getGroupAttributes(e),r=new En;r.setAttribute("position",n.position),r.setAttribute("targetPosition",n.targetPosition),r.setAttribute("color",n.color),r.setAttribute("width",n.width),r.setAttribute("height",n.height),r.setAttribute("offset",n.offset),r.setAttribute("opacity",n.opacity),r.setAttribute("selected",n.selected),r.setAttribute("clusterSelected",n.clusterSelected),r.setAttribute("textureIndex",n.textureIndex),r.setDrawRange(0,e.length);var s=this.getShaderMaterial({firstTex:n.texStartIdx,textures:n.textures,useColor:!1});s.transparent=!0;var o=new od(r,s);o.frustumCulled=!1,this.group.add(o)}this.scene.add(this.group)};At.prototype.getDrawCallToCells=function(){for(var i={},t=0;t<rt.cells.length;t++){var e=rt.cells[t],n=e.getIndexOfDrawCall();n in i?i[n].push(e):i[n]=[e]}return i};At.prototype.getGroupAttributes=function(i){for(var t=this.getCellIterators(i.length),e=0;e<i.length;e++){var n=i[e],r=this.color.setHex(i[e].idx+1);t.texIndex[t.texIndexIterator++]=n.texIdx,t.position[t.positionIterator++]=n.x,t.position[t.positionIterator++]=n.y,t.position[t.positionIterator++]=n.z,t.targetPosition[t.targetPositionIterator++]=n.tx,t.targetPosition[t.targetPositionIterator++]=n.ty,t.targetPosition[t.targetPositionIterator++]=n.tz,t.color[t.colorIterator++]=r.r,t.color[t.colorIterator++]=r.g,t.color[t.colorIterator++]=r.b,t.opacity[t.opacityIterator++]=1,t.selected[t.selectedIterator++]=0,t.clusterSelected[t.clusterSelectedIterator++]=0,t.width[t.widthIterator++]=n.w,t.height[t.heightIterator++]=n.h,t.offset[t.offsetIterator++]=n.dx,t.offset[t.offsetIterator++]=n.dy}var s=new we(t.position,3,!0,1),o=new we(t.targetPosition,3,!0,1),a=new we(t.color,3,!0,1),l=new we(t.opacity,1,!0,1),c=new Qs(t.selected,1,!1,1),h=new Qs(t.clusterSelected,1,!1,1),u=new Qm(t.texIndex,1,!1,1),f=new Qs(t.width,1,!1,1),p=new Qs(t.height,1,!1,1),x=new fc(t.offset,2,!1,1);u.usage=ki,s.usage=ki,o.usage=ki,l.usage=ki,c.usage=ki,h.usage=ki,x.usage=ki;var v=this.getTexIndices(i);return{position:s,targetPosition:o,color:a,width:f,height:p,offset:x,opacity:l,selected:c,clusterSelected:h,textureIndex:u,textures:this.getTextures({startIdx:v.first,endIdx:v.last}),texStartIdx:v.first,texEndIdx:v.last}};At.prototype.getCellIterators=function(i){return{position:new Float32Array(i*3),targetPosition:new Float32Array(i*3),color:new Float32Array(i*3),width:new Uint8Array(i),height:new Uint8Array(i),offset:new
4097Uint16Array(i*2),opacity:new Float32Array(i),selected:new Uint8Array(i),clusterSelected:new Uint8Array(i),texIndex:new Int8Array(i),positionIterator:0,targetPositionIterator:0,colorIterator:0,widthIterator:0,heightIterator:0,offsetIterator:0,opacityIterator:0,selectedIterator:0,clusterSelectedIterator:0,texIndexIterator:0}};At.prototype.getTexIndices=function(i){for(var t=0;i[t].texIdx==-1;)t++;for(var e=i.length-1;i[e].texIdx==-1;)e--;return{first:i[t].texIdx,last:i[e].texIdx}};At.prototype.getTextures=function(i){for(var t=[],e=i.startIdx;e<=i.endIdx;e++){var n=this.getTexture(rt.textures[e].canvas);t.push(n)}return t};At.prototype.getTexture=function(i){var t=new Mn(i);return t.needsUpdate=!0,t.flipY=!1,t.generateMipmaps=!1,t.magFilter=qe,t.minFilter=qe,t};At.prototype.getPointScale=function(){var i=null;(He.selected=="tsne"||He.selected=="umap"||He.selected=="pose")&&(i=nt.size.points.scatter),(He.selected=="alphabetic"||He.selected=="grid")&&(i=nt.size.points.grid),He.selected=="categorical"&&(i=nt.size.points.categorical),He.selected=="geographic"&&(i=nt.size.points.geographic),He.selected=="date"&&(i=nt.size.points.date);var t=na();return i*window.devicePixelRatio*t.h};At.prototype.getShaderMaterial=function(i){var t=tM,e=this.getFragmentShader(i);return new gc({uniforms:{textures:{type:"tv",value:i.textures},lodTexture:{type:"t",value:Di.tex.texture},transitionPercent:{type:"f",value:0},scale:{type:"f",value:this.getPointScale()},targetScale:{type:"f",value:this.getPointScale()},useColor:{type:"f",value:i.useColor?1:0},cellAtlasPxPerSide:{type:"f",value:nt.size.texture},lodAtlasPxPerSide:{type:"f",value:nt.size.lodTexture},cellPxHeight:{type:"f",value:nt.size.cell},lodPxHeight:{type:"f",value:nt.size.lodCell},borderWidth:{type:"f",value:.15},borderColor:{type:"vec3",value:new Float32Array([234/255,183/255,85/255])},display:{type:"f",value:1},time:{type:"f",value:0}},vertexShader:t,fragmentShader:e})};At.prototype.setUniform=function(i,t){var e=this.group&&this.group.children;if(e)for(var n=0;n<e.length;n++)e[n].material.uniforms[i].value=t};At.prototype.setBuffer=function(i,t){var e=ot.getDrawCallToCells();for(var n in e){var r=ot.group.children[n].geometry.attributes[i],s=e[n];r.array=t.slice(s[0].idx,s[s.length-1].idx+1),r.needsUpdate=!0}};At.prototype.setBorderedImages=function(i){for(var t=new Uint8Array(rt.cells.length),e=0;e<i.length;e++)t[i[e]]=1;this.setBuffer("selected",t)};At.prototype.setOpaqueImages=function(i){for(var t=new Float32Array(rt.cells.length),e=0;e<t.length;e++)t[e]=.35;for(var e=0;e<i.length;e++)t[i[e]]=1;this.setBuffer("opacity",t)};At.prototype.getFragmentShader=function(i){var t=i.useColor,e=i.firstTex,n=i.textures,r=QS;if(t)return r=r.replace("uniform sampler2D textures[N_TEXTURES];",""),r=r.replace("TEXTURE_LOOKUP_TREE",""),r;for(var s=this.getFragLeaf(-1,"lodTexture"),o=e;o<e+n.length;o++)s+=" else "+this.getFragLeaf(o,"textures["+o+"]");return r=r.replace(`#define SELECTING 4098`,""),r=r.replace("N_TEXTURES",n.length),r=r.replace("TEXTURE_LOOKUP_TREE",s),r};At.prototype.getFragLeaf=function(i,t){return"if (textureIndex == "+i+`) { 4099 gl_FragColor = texture2D(`+t+`, scaledUv); 4100 }`};At.prototype.attrsNeedUpdate=function(i){this.group.children.forEach((function(t){i.forEach((function(e){t.geometry.attributes[e].needsUpdate=!0}).bind(this))}).bind(this))};At.prototype.getStats=function(){if(!window.location.href.includes("stats=true"))return null;var i=new Stats;return i.domElement.id="stats",i.domElement.style.position="absolute",i.domElement.style.top="65px",i.domElement.style.right="5px",i.domElement.style.left="initial",document.body.appendChild(i.domElement),i};At.prototype.flyTo=function(i){if(!this.state.flying){this.state.flying=!0;var t=this.getCamera(),e=new lf(t,this.canvas);t.position.set(i.x,i.y,i.z),e.target.set(i.x,i.y,i.z),e.update();var n=0,r=this.camera.quaternion.clone();Se.to(this.camera.position,nt.transitions.duration,{x:i.x,y:i.y,z:i.z,onUpdate:(function(){n++;var s=n/(nt.transitions.duration*60);this.camera.quaternion.slerpQuaternions(r,t.quaternion,s)}).bind(this),onComplete:(function(){var s=t.quaternion,o=t.position,a=t.up,l=e.target,c=oM();this.camera.position.set(o.x,o.y,o.z),this.camera.up.set(a.x,a.y,a.z),this.camera.quaternion.set(s.x,s.y,s.z,s.w),this.controls.target=new U(l.x,l.y,c),this.controls.update(),this.state.flying=!1}).bind(this),ease:i.ease||void 0})}};At.prototype.flyToCellIdx=function(i){var t=rt.cells[i],e={x:t.x,y:t.y,z:Math.min(nt.pickerMaxZ-1e-4,t.z+this.getPointScale()/100)};ot.flyTo(e)};At.prototype.flyToCellImage=function(i){for(var t=null,e=0;e<rt.json.images.length;e++)rt.json.images[e]==i&&(t=e);if(!t)return console.warn("The requested image could not be found");rt.cells[t],this.flyToCellIdx(t)};At.prototype.getInitialLocation=function(){var i=nt.zoomConfig.default,t=0,e=0;return(He.currentTransition==="01"||He.currentTransition==="10")&&(i=nt.zoomConfig.umap,t=.1,e=0),He.currentTransition==="null3"&&(i=nt.zoomConfig.date),{x:e,y:t,z:i}};At.prototype.render=function(){requestAnimationFrame(this.render.bind(this)),this.state.displayed&&(this.renderer.render(this.scene,this.camera),this.controls.update(),this.stats&&this.stats.update(),Di.update(),this.time+=this.clock.getDelta()/10,this.setUniform("time",this.time))};At.prototype.init=function(){this.setCenter();var i=this.getInitialLocation();this.camera.position.set(i.x,i.y,i.z),this.camera.lookAt(i.x,i.y,i.z),this.plotPoints(),he.plot(),this.handleResize(),this.render(),this.setMode("pan"),ot.state.displayed=!0};At.prototype.handleModeIconClick=function(i){this.setMode(i.target.id),rt.hotspots.setCreateHotspotVisibility(!1)};At.prototype.showSelectTooltip=function(){(!localStorage.getItem("select-tooltip-cleared")||localStorage.getItem("select-tooltip-cleared")=="false")&&(this.elems.selectTooltip.style.display="inline-block"),this.elems.selectTooltipButton.addEventListener("click",(function(){this.hideSelectTooltip()}).bind(this))};At.prototype.hideSelectTooltip=function(){localStorage.setItem("select-tooltip-cleared",!0),this.elems.selectTooltip.style.display="none"};At.prototype.setMode=function(i){this.mode=i;for(var t=document.querySelectorAll("#selection-icons img"),e=0;e<t.length;e++)t[e].className=t[e].id==i?"active":"";this.mode=="pan"?(this.controls.noPan=!1,this.canvas.classList.remove("select"),this.canvas.classList.add("pan")):this.mode=="select"&&(this.controls.noPan=!0,this.canvas.classList.remove("pan"),this.canvas.classList.add("select"))};function wu(){this.anchorPoint=void 0,this.reverse=!1,this.points=[]}wu.prototype={constructor:wu,Point:function(i,t){this.x=i,this.y=t},_findPolarAngle:function(i,t){var e=57.295779513082,n,r;if(!i||!t||(n=t.x-i.x,r=t.y-i.y,n==0&&r==0))return 0;var s=Math.atan2(r,n)*e;return this.reverse?s<=0&&(s+=360):s>=0&&(s+=360),s},addPoint:function(i,t){var e=this.anchorPoint===void 0||this.anchorPoint.y>t||this.anchorPoint.y===t&&this.anchorPoint.x>i;e?(this.anchorPoint!==void 0&&this.points.push(new this.Point(this.anchorPoint.x,this.anchorPoint.y)),this.anchorPoint=new this.Point(i,t)):this.points.push(new this.Point(i,t))},_sortPoints:function(){var i=this;return this.points.sort(function(t,e){var n=i._findPolarAngle(i.anchorPoint,t),r=i._findPolarAngle(i.anchorPoint,e);return n<r?-1:n>r?1:0})},_checkPoints:function(i,t,e){var n,r=this._findPolarAngle(i,t),s=this._findPolarAngle(i,e);return r>s?(n=r-s,!(n>180)):r<s?(n=s-r,n>180):!0},getHull:function(){var i=[],t,e;if(this.reverse=this.points.every(function(a){return a.x<0&&a.y<0}),t=this._sortPoints(),e=t.length,e<3)return t.unshift(this.anchorPoint),t;for(i.push(t.shift(),t.shift());;){var n,r,s;if(i.push(t.shift()),n=i[i.length-3],r=i[i.length-2],s=i[i.length-1],this._checkPoints(n,r,s)&&i.splice(i.length-2,1),t.length==0){if(e==i.length){var o=this.anchorPoint;return i=i.filter(function(a){return!!a}),i.some(function(a){return a.x==o.x&&a.y==o.y})||i.unshift(this.anchorPoint),i}t=i,e=t.length,i=[],i.push(t.shift(),t.shift())}}}};function Fi(){this.scene=new sd,this.scene.background=new Kt(0),this.mouseDown=new St,this.tex=this.getTexture()}Fi.prototype.getTexture=function(){var i=na(),t=new Ri(i.w,i.h);return t.texture.minFilter=qe,t};Fi.prototype.onMouseDown=function(i){var t=this.getClickOffsets(i);this.mouseDown.x=t.x,this.mouseDown.y=t.y};Fi.prototype.getClickOffsets=function(i){var t=i.target.getBoundingClientRect();return{x:i.clientX-t.left,y:i.clientY-t.top}};Fi.prototype.onMouseUp=function(i){if(i.target.className=="modal-top"||i.target.className=="modal-x")return Is.close();var t=this.getClickOffsets(i),e=this.select({x:t.x,y:t.y});if(!(t.x!==this.mouseDown.x||t.y!==this.mouseDown.y||e==-1||i.target.id!=="pixplot-canvas")&&ot.mode=="pan")return ot.camera.position.z>nt.pickerMaxZ?ot.flyToCellIdx(e):Is.showCells([e])};Fi.prototype.init=function(){ot.canvas.addEventListener("mousedown",this.onMouseDown.bind(this)),document.body.addEventListener("mouseup",this.onMouseUp.bind(this));for(var i=new Pr,t=0;t<ot.group.children.length;t++){var e=ot.group.children[t].clone();e.material=ot.getShaderMaterial({useColor:!0}),i.add(e)}this.scene.add(i)};Fi.prototype.render=function(){ot.renderer.setRenderTarget(this.tex),ot.renderer.render(this.scene,ot.camera),ot.renderer.setRenderTarget(null)};Fi.prototype.select=function(i){if(!(!ot||!i)){this.render();var t=new Uint8Array(4),e=i.x*window.devicePixelRatio,n=this.tex.height-i.y*window.devicePixelRatio;ot.renderer.readRenderTargetPixels(this.tex,e,n,1,1,t);var r=t[0]<<16|t[1]<<8|t[2],s=r-1;return s}};function ta(){}ta.prototype.init=function(){this.elems={container:document.querySelector("#date-container"),slider:document.querySelector("#date-sl
4100ider")},rt.json.layouts.date&&(this.state={data:{},min:null,max:null,selected:[null,null]},jr.filters.push(this),this.imageSelected=function(i){return!0},this.load())};ta.prototype.load=function(){Hn(Vn(nt.data.dir+"/metadata/dates.json"),(function(i){this.state.min=i.domain.min,this.state.max=i.domain.max;var t=Object.keys(i.dates);t.forEach((function(e){try{var n=parseInt(e)}catch{var n=e}i.dates[e].forEach((function(r){this.state.data[r]=n}).bind(this)),this.imageSelected=function(r){var s=this.state.data[r];return this.state.selected[0]==this.state.min&&this.state.selected[1]==this.state.max?!0:!s||!Number.isInteger(s)?!1:s>=this.state.selected[0]&&s<=this.state.selected[1]}}).bind(this))}).bind(this))};ta.prototype.addFilter=function(){this.slider=noUiSlider.create(this.elems.slider,{start:[this.state.min,this.state.max],tooltips:[!0,!0],step:1,behaviour:"drag",connect:!0,range:{min:this.state.min,max:this.state.max},format:{to:function(i){return parseInt(i)},from:function(i){return parseInt(i)}}}),this.slider.on("update",(function(i){this.state.selected=i,jr.filterImages()}).bind(this))};function zi(){}zi.prototype.init=function(){rt.json.layouts.date&&(this.count=1e3,this.point=500,this.scale=0,this.kerning=0,this.canvas=null,this.texture=this.getTexture(),this.json={},this.createMesh(),this.addEventListeners())};zi.prototype.addEventListeners=function(){window.addEventListener("resize",(function(){this.mesh&&(this.mesh.material.uniforms.scale.value=ot.getPointScale())}).bind(this))};zi.prototype.getTexture=function(){var i=document.createElement("canvas"),t=i.getContext("2d"),e={},n=.2,r=.2,s=32,o=122,a=":;<=>?@[\\]^_`",l=o-s-a.length+1;this.canvas=this.point*Math.ceil(l**(1/2)),i.width=this.canvas,i.height=this.canvas,i.id="character-canvas",t.font=this.point+"px Helvetica, Arial, sans-serif",t.fillStyle="rgba(255, 255, 255, 0)",t.fillRect(0,0,i.width,i.height),t.fillStyle="#ffffff";for(var c=0,h=0,u=s;u<o+1;u++){var f=String.fromCharCode(u);a.includes(f)||(e[f]={x:c,y:h},t.fillText(f,c+n*this.point,h+this.point-r*this.point),c+=this.point,c>i.width-this.point&&(c=0,h+=this.point))}var p=new Mn(i);return p.flipY=!1,p.needsUpdate=!0,{map:e,tex:p}};zi.prototype.createMesh=function(){this.scale=nt.size.points.date,this.kerning=this.scale*.9;var i=new En,t=new we(new Float32Array(this.count*3),3),e=new we(new Uint16Array(this.count*2),2);i.setAttribute("position",t),i.setAttribute("offset",e);var n=new gc({uniforms:{point:{type:"f",value:this.point},canvas:{type:"f",value:this.canvas},scale:{type:"f",value:this.getPointScale()},texture:{type:"t",value:this.texture.tex},render:{type:"f",value:0}},vertexShader:eM,fragmentShader:document.querySelector("#text-fragment-shader").textContent});this.mesh=new od(i,n),this.mesh.frustumCulled=!1,ot.scene.add(this.mesh)};zi.prototype.setWords=function(i){var t=new Uint16Array(this.count*2),e=new Float32Array(this.count*3),n=0,r=0;i.forEach((function(s,o){for(var a=0;a<s.word.length;a++){var l=s.word[a]in this.texture.map?this.texture.map[s.word[a]]:{x:this.canvas-this.point,y:this.canvas-this.point};t[n++]=l.x,t[n++]=l.y,e[r++]=s.x+this.kerning*a,e[r++]=s.y,e[r++]=s.z||0}this.mesh.geometry.attributes.position.array=e,this.mesh.geometry.attributes.offset.array=t,this.mesh.geometry.attributes.position.needsUpdate=!0,this.mesh.geometry.attributes.offset.needsUpdate=!0}).bind(this))};zi.prototype.getPointScale=function(){return window.devicePixelRatio*window.innerHeight*this.scale};zi.prototype.formatText=function(i){var t=[];i.labels.forEach(function(e,n){var r=0;t.push({word:e,x:i.positions[n][0]+r,y:i.positions[n][1]})}),this.setWords(t)};function zs(){this.elems={container:document.querySelector("#pose-display-container"),select:document.querySelector("#pose-display-select")}}zs.prototype.plot=function(){rt.layouts.pose&&Hn(Vn("data/image-vectors/openpose/vectors.json"),(function(i){this.json=i;var t=new gc({vertexShader:iM,fragmentShader:nM,uniforms:{transitionPercent:{type:"f",value:0},display:{type:"f",value:0},scale:{type:"f",value:0},targetScale:{type:"f",value:0}}}),e=new En,n=this.getAttributes("position");e.setAttribute("position",n.positions),e.setAttribute("targetPosition",n.positions.clone()),e.setAttribute("midpoint",n.midpoints),e.setAttribute("targetMidpoint",n.midpoints.clone()),this.mesh=new Qx(e,t),ot.scene.add(this.mesh),this.elems.container.style.display="inline-block",this.elems.select.addEventListener("change",this.toggleLineDisplay.bind(this))}).bind(this))};zs.prototype.getAttributes=function(i){var t=.1,e=[],n=[],r=0,s=0,o=[[10,9],[9,8],[11,12],[12,13],[2,3],[3,4],[5,6],[6,7],[11,5],[5,2],[2,8],[8,11]];return this.json.forEach(function(a,l){var c={x:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],y:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],score:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]};a.forEach(function(E){E[0]<c.x[0]&&(c.x[0]=E[0]),E[0]>c.x[1]&&(c.x[1]=E[0]),E[1]<c.y[0]&&(c.y[0]=E[1]),E[1]>c.y[1]&&(c.y[1]=E[1]),E[2]<c.score[0]&&(c.score[0]=E[2]),E[2]>c.score[1]&&(c.score[1]=E[2])});var h={x:(c.x[0]+c.x[1])/2,y:1-(c.y[0]+c.y[1])/2},u=.005/(c.y[1]-c.y[0]),f=[];a.forEach(function(E,S){var w=E[0],P=1-E[1],R=i=="position"?{x:"x",y:"y"}:{x:"tx",y:"ty"};f.push({x:rt.cells[l][R.x]+u*(w-h.x),y:rt.cells[l][R.y]+u*(P-h.y),score:E[2]})});var p={x:0,y:0};f.forEach(function(E){E.score>=t&&(p.x+=E.x,p.y+=E.y)});for(var x=f.filter(function(E){return E.score>=t}).length,v=0;v<o.length;v++){var m=f[o[v][0]],g=f[o[v][1]];m.score<t||g.score<t||(e[r++]=m.x,e[r++]=m.y,e[r++]=0,e[r++]=g.x,e[r++]=g.y,e[r++]=0,n[s++]=p.x/x,n[s++]=p.y/x,n[s++]=p.x/x,n[s++]=p.y/x)}}
4100),{positions:new we(new Float32Array(e),3),midpoints:new we(new Float32Array(n),2)}};zs.prototype.toggleLineDisplay=function(){this.setDisplay(this.elems.select.value)};zs.prototype.setDisplay=function(i){if(i=="poses"){for(var t=0;t<ot.group.children.length;t++)ot.group.children[t].material.uniforms.display.value=0;he.mesh.material.uniforms.display.value=1}else{for(var t=0;t<ot.group.children.length;t++)ot.group.children[t].material.uniforms.display.value=1;he.mesh.material.uniforms.display.value=0}};function Dn(){this.cellIdx=null,this.cellIndices=[],this.addEventListeners(),this.state={highlightPose:!1}}Dn.prototype.showCells=function(i,t){var e=this;e.displayed=!0,e.cellIndices=Object.assign([],i),e.cellIdx=isNaN(parseInt(t))?0:parseInt(t);var n=rt.json.images[e.cellIndices[e.cellIdx]],r=rt.json.images_cropped?nt.data.dir+"/uncropped/"+df(n):nt.data.dir+"/originals/"+n;function s(l){var l=l||{},c=document.querySelector("#selected-image-template").textContent,h=document.querySelector("#selected-image-target"),u="pose"in rt.json.layouts&&rt.json.layouts.pose,f={hasPose:u,multiImage:e.cellIndices.length>1,meta:Object.assign({},l||{},{src:r,filename:l.filename||n})};h.innerHTML=_.template(c)(f),h.style.display="block",document.querySelector("#svg-image-filtered").setAttribute("href",l.image.src),document.querySelector("#svg-image-unfiltered").setAttribute("href",l.image.src),u&&(document.querySelector("#pose-highlight-icon").addEventListener("click",e.togglePoseHighlight.bind(e)),window.addEventListener("resize",e.resizePoseHighlight.bind(e))),document.querySelector("#selected-image-parent").appendChild(l.image)}var o=new Image;o.id="selected-image",o.onload=function(){s({image:o}),Hn(nt.data.dir+"/metadata/file/"+n+".json",function(a){s(Object.assign({},a,{image:o}))})},o.src=r};Dn.prototype.close=function(){window.location.href="#",document.querySelector("#selected-image-target").style.display="none",window.removeEventListener("resize",self.resizePoseHighlight),this.cellIndices=[],this.cellIdx=null,this.displayed=!1};Dn.prototype.addEventListeners=function(){window.addEventListener("keydown",this.handleKeydown.bind(this))};Dn.prototype.handleKeydown=function(i){i.keyCode==37&&this.showPreviousCell(),i.keyCode==39&&this.showNextCell()};Dn.prototype.showPreviousCell=function(){if(this.displayed){var i=this.cellIdx>0?this.cellIdx-1:this.cellIndices.length-1;this.showCells(this.cellIndices,i)}};Dn.prototype.showNextCell=function(){if(this.displayed){var i=this.cellIdx<this.cellIndices.length-1?this.cellIdx+1:0;this.showCells(this.cellIndices,i)}};Dn.prototype.togglePoseHighlight=function(){var i=!this.state.highlightPose;i?(document.querySelector("#pose-highlight-icon").classList.add("active"),this.applyGaussianFilter()):(document.querySelector("#pose-highlight-icon").classList.remove("active"),this.removeGaussianFilter()),this.state.highlightPose=i};Dn.prototype.applyGaussianFilter=function(){var i=document.querySelector("#blur-ellipse");i&&i.parentNode.removeChild(i);var i=document.querySelector("#selected-image-svg"),t=i.getBoundingClientRect(),e={};["top","right","bottom","left"].forEach(function(x){var v=getComputedStyle(i,null).getPropertyValue("padding-"+x);e[x]=parseInt(v.replace("px",""))});for(var n=t.width-e.left-e.right,r=t.height-e.top-e.bottom,s=.1,o=he.json[Is.cellIndices[Is.cellIdx]],a=[],l=0;l<o.length;l++){var c=o[l][2];c>=s&&a.push({x:o[l][0]*n,y:o[l][1]*r,score:c})}var h={x:0,y:0},u={x:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],y:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]};a.forEach(function(x){h.x+=x.x,h.y+=x.y,x.x<u.x[0]&&(u.x[0]=x.x),x.x>u.x[1]&&(u.x[1]=x.x),x.y<u.y[0]&&(u.y[0]=x.y),x.y>u.y[1]&&(u.y[1]=x.y)});var f={cx:h.x/a.length,cy:h.y*1.1/a.length,rx:(u.x[1]-u.x[0])*.7,ry:(u.y[1]-u.y[0])*.7},p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");p.setAttribute("cx",f.cx),p.setAttribute("cy",f.cy),p.setAttribute("rx",f.rx),p.setAttribute("ry",f.ry),p.setAttribute("fill","#ffffff"),p.setAttribute("filter","url(#blur-filter)"),p.setAttribute("id","blur-ellipse"),document.querySelector("#blur-mask").appendChild(p),document.querySelector("#selected-image").style.opacity=0,document.querySelector("#svg-image-filtered").style.opacity=.25};Dn.prototype.removeGaussianFilter=function(){document.querySelector("#svg-image-filtered").style.opacity=1};Dn.prototype.resizePoseHighlight=function(){this.state.highlightPose&&this.applyGaussianFilter()};function fn(){var i=1;this.tex=this.getCanvas(nt.size.lodTexture),this.cell=this.getCanvas(nt.size.lodCell),this.cellIdxToImage={},this.grid={},this.minZ=.8,this.initialRadius=i,this.state={openCoords:this.getAllTexCoords(),camPos:{x:null,y:null},neighborsRequested:0,gridPosToCoords:{},cellIdxToCoords:{},cellsToActivate:[],fetchQueue:[],radius:i,run:!0}}fn.prototype.getCanvas=function(i){var t=Gc("canvas",{width:i,height:i,id:"lod-canvas"});return{canvas:t,ctx:t.getContext("2d"),texture:ot.getTexture(t)}};fn.prototype.getAllTexCoords=function(){for(var i=[],t=0;t<nt.size.lodTexture/nt.size.lodCell;t++)for(var e=0;e<nt.size.lodTexture/nt.size.lodCell;
4100e++)i.push({x:e*nt.size.lodCell,y:t*nt.size.lodCell});return i};fn.prototype.indexCells=function(){var i={};rt.cells.forEach((function(t){t.gridCoords=this.toGridCoords(t);var e=t.gridCoords.x,n=t.gridCoords.y;i[e]||(i[e]={}),i[e][n]||(i[e][n]=[]),i[e][n].push(t.idx)}).bind(this)),this.grid=i};fn.prototype.toGridCoords=function(i){var t=rt.boundingBox,e={x:(i.x-t.x.min)/(t.x.max-t.x.min),y:(i.y-t.y.min)/(t.y.max-t.y.min)};if(rt.json)var n={x:1/Math.max(100,Math.ceil(rt.json.images.length/100)),y:1/Math.max(100,Math.ceil(rt.json.images.length/100))};else var n={x:1/Math.max(100,Math.ceil(8)),y:1/Math.max(100,Math.ceil(8))};return{x:Math.floor(e.x/n.x),y:Math.floor(e.y/n.y)}};fn.prototype.update=function(){!this.state.run||ot.state.flying||ot.state.transitioning||(this.updateGridPosition(),this.fetchNextImage(),ot.camera.position.z<this.minZ?this.addCellsToLodTexture():this.clear())};fn.prototype.updateGridPosition=function(){var i=this.toGridCoords(ot.camera.position);(this.state.camPos.x!==i.x||this.state.camPos.y!==i.y)&&(this.state.radius>1&&(this.state.radius=Math.ceil(this.state.radius*.6)),this.state.camPos=i,this.state.neighborsRequested=0,this.unload(),ot.camera.position.z<this.minZ&&(this.state.fetchQueue=uf(this.grid,[i.x,i.y],[])))};fn.prototype.fetchNextImage=function(){var i=this.state.fetchQueue[0];if(this.state.fetchQueue=this.state.fetchQueue.slice(1),Number.isInteger(i))if(this.cellIdxToImage[i])this.state.cellIdxToCoords[i]||(this.state.cellsToActivate=this.state.cellsToActivate.concat(i));else{var t=new Image;t.onload=(function(o){this.cellIdxToImage[o]=t,this.state.cellIdxToCoords[o]||(this.state.cellsToActivate=this.state.cellsToActivate.concat(o))}).bind(this,i),t.src=nt.data.dir+"/thumbs/"+rt.json.images[i]}else if(this.state.neighborsRequested<this.state.radius){this.state.neighborsRequested=this.state.radius;for(var e=Math.floor(-this.state.radius*1.5);e<=Math.ceil(this.state.radius*1.5);e++)for(var n=-this.state.radius;n<=this.state.radius;n++){var r=[this.state.camPos.x+e,this.state.camPos.y+n],s=uf(this.grid,r,[]).filter((function(o){return!this.state.cellIdxToCoords[o]}).bind(this));this.state.fetchQueue=this.state.fetchQueue.concat(s)}this.state.openCoords&&this.state.radius<30&&this.state.radius++}};fn.prototype.addCellsToLodTexture=function(){for(var i=!1,t=0;t<this.state.cellsToActivate.length;t++){var e=this.state.cellsToActivate[0],n=rt.cells[e];if(this.state.cellsToActivate=this.state.cellsToActivate.slice(1),!(this.state.cellIdxToCoords[e]||!this.inRadius(n.gridCoords))){var r=this.state.openCoords[0];if(this.state.openCoords=this.state.openCoords.slice(1),r){i=!0;var s=n.gridCoords.x+"."+n.gridCoords.y;this.state.gridPosToCoords[s]||(this.state.gridPosToCoords[s]=[]),this.state.gridPosToCoords[s].push(Object.assign({},r,{cellIdx:n.idx})),this.state.cellIdxToCoords[n.idx]=r,this.cell.ctx.clearRect(0,0,nt.size.lodCell,nt.size.lodCell),this.cell.ctx.drawImage(this.cellIdxToImage[n.idx],0,0);var o=ot.getTexture(this.cell.canvas);ot.renderer.copyTextureToTexture(r,o,this.tex.texture),n.activate()}}}i&&ot.attrsNeedUpdate(["textureIndex","offset"])};fn.prototype.inRadius=function(i){var t=Math.floor(Math.abs(i.x-this.state.camPos.x)),e=Math.ceil(Math.abs(i.y-this.state.camPos.y));return t<=this.state.radius*1.5&&e<this.state.radius};fn.prototype.unload=function(){Object.keys(this.state.gridPosToCoords).forEac
4100h((function(i){var t=i.split(".");this.inRadius({x:parseInt(t[0]),y:parseInt(t[1])})||this.unloadGridPos(i)}).bind(this))};fn.prototype.unloadGridPos=function(i){var t=this.state.gridPosToCoords[i];t.forEach((function(e){try{rt.cells[e.cellIdx].deactivate(),delete this.state.cellIdxToCoords[e.cellIdx]}catch{}}).bind(this)),delete this.state.gridPosToCoords[i],this.state.openCoords=this.state.openCoords.concat(t)};fn.prototype.clear=function(){Object.keys(this.state.gridPosToCoords).forEach(this.unloadGridPos.bind(this)),this.state.camPos={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ot.attrsNeedUpdate(["offset","textureIndex"]),this.state.radius=this.initialRadius};function kc(){this.filters=[],self.values=[]}kc.prototype.loadFilters=function(){var i=nt.data.dir+"/metadata/filters/filters.json";Hn(Vn(i),(function(t){for(var e=0;e<t.length;e++)this.filters.push(new Bs(t[e]))}).bind(this))};kc.prototype.filterImages=function(){for(var i=[],t=0;t<rt.json.images.length;t++){for(var e=!0,n=0;n<this.filters.length;n++)if(this.filters[n].imageSelected&&!this.filters[n].imageSelected(rt.json.images[t])){e=!1;break}e&&i.push(t)}ot.setOpaqueImages(i)};function Bs(i){if(this.values=i.filter_values||[],!(this.values.length<=1)){this.selected=null,this.name=i.filter_name||"",this.elem=document.createElement("div"),this.elem.addEventListener("mouseenter",this.show.bind(this)),this.elem.addEventListener("mouseleave",this.hide.bind(this)),this.elem.className="filter";var t=document.createElement("div");t.className="settings-label filter-label",t.textContent="Category",this.elem.appendChild(t);var e=document.createElement("div");e.className="filter-options";for(var n=0;n<this.values.length;n++){var r=document.createElement("div");r.setAttribute("data-label",this.values[n]),r.addEventListener("click",this.onChange.bind(this)),r.className="filter-option no-highlight";var s=document.createElement("input"),t=document.createElement("div");s.setAttribute("type","checkbox"),t.textContent=this.values[n].replace(/__/g," "),r.appendChild(s),r.appendChild(t),e.appendChild(r)}this.elem.appendChild(e),document.querySelector("#filters").appendChild(this.elem),document.querySelector("#pixplot-canvas").addEventListener("click",this.hide.bind(this))}}Bs.prototype.showHide=function(i){this.elem.classList.toggle("open")};Bs.prototype.show=function(){this.elem.classList.add("open")};Bs.prototype.hide=function(){this.elem.classList.remove("open")};Bs.prototype.onChange=function(i){for(var t=i.target;!t.classList.contains("filter-option");)t=t.parentNode;if(t.classList.toggle("active"),t.classList.contains("active")){for(var e=this.elem.querySelectorAll(".filter-option"),n=0;n<e.length;n++)e[n].classList.remove("active"),e[n].querySelector("input").checked=!1;t.classList.add("active"),t.querySelector("input").checked=!0,this.selected=t.getAttribute("data-label"),this.elem.classList.add("has-selection")}else t.classList.remove("active"),t.querySelector("input").checked=!1,this.selected=null,this.elem.classList.remove("has-selection");if(!this.selected)this.imageSelected=function(o){return!0},jr.filterImages();else{var r=this.selected.replace(/\//g,"-").replace(/ /g,"__")+".json",s=Vn(nt.data.dir+"/metadata/options/"+r);Hn(s,(function(o){var a=o.reduce(function(l,c){return l[c]=!0,l},{});this.imageSelected=function(l){return rt.json.images_cropped?df(l)in a:l in a},jr.filterImages()}).bind(this))}};function ea(){this.elems={tray:document.querySelector("#header-controls-bottom"),icon:document.querySelector("#settings-icon")},this.state={open:!1}}ea.prototype.open=function(){this.state.open=!0,this.elems.tray.classList.add("open"),this.elems.icon.classList.add("no-tooltip"),this.elems.icon.classList.add("active")};ea.prototype.close=function(){this.state.open=!1,this.elems.tray.classList.remove("open"),this.elems.icon.classList.remove("no-tooltip"),this.elems.icon.classList.remove("active")};ea.prototype.toggleOpen=function(){this.state.open?this.close():this.open()};function pn(){this.json={},this.mesh=null,this.edited=!1,this.nUserClusters=0,this.elems={createHotspot:document.querySelector("#create-hotspot"),saveHotspots:document.querySelector("#save-hotspots"),navInner:document.querySelector("#nav-inner"),template:document.querySelector("#hotspot-template"),hotspots:document.querySelector("#hotspots"),nav:document.querySelector("nav"),clearTooltip:document.querySelector("#hotspots-tooltip-button")}}pn.prototype.initialize=function(){};pn.prototype.handleJson=function(i){i.length==0&&(this.elems.nav.style.display="none"),this.json=i,this.render()};pn.prototype.addEventListeners=function(){this.elems.createHotspot.addEventListener("click",(function(){for(var i=[],t=0;t<rt.cells.length;t++)lasso.selected[rt.json.images[t]]&&i.push(t);var e=[];this.json.push({convex_hull:e,label:rt.hotspots.getUserClusterName(),img:rt.json.images[aM(i)],images:i}),this.setCreateHotspotVisibility(!1),this.setEdited(!0),this.render(),setTimeout(this.scrollToBottom.bind(this),100)}).bind(this)),this.elems.saveHotspots.addEventListener("click",(function(){sM(this.json,"user_hotspots.json"),this.setEdited(!1)}).bind(this)),this.elems.navInner.addEventListener("dragover",function(i){i.preventDefault()}),this.elems.navInner.addEventListener("drop",(function(i){for(var t=i.pageY,e=document.querySelectorAll(".hotspot"),n=i.dataTransfer.getData("text"),r=document.getElementById(n),s=!1,o=0;o<e.length;o++){var a=e[o],l=a.getBoundingClientRect();if(!s&&t<=l.top+l.height/2){r.classList.remove("dragging"),a.parentNode.insertBefore(r,a),s=!0;break}}s||this.elems.hotspots.appendChild(r);var c=parseInt(n.split("-")[1]),h=o;this.json.splice(h,0,this.json.splice(c,1)[0]),this.render(),c!=h&&this.setEdited(!0)}).bind(this)),this.elems.nav.addEventListener("mouseenter",(function(i){localStorage.getItem("hotspots-tooltip-cleared")||(this.elems.tooltip.style.display="block")}).bind(this)),this.elems.clearTooltip.addEventListener("click",(function(i){localStorage.setItem("hotspots-tooltip-cleared",!0),this.elems.tooltip.style.display="none"}).bind(this))};pn.prototype.render=function(){this.mesh&&ot.scene.remove(this.mesh),this.elems.hotspots.innerHTML=_.template(this.elems.template.innerHTML)({hotspots:this.json,isLocalhost:nt.isLocalhost,edited:this.edited});for(var i=document.querySelectorAll(".hotspot"),t=0;t<i.length;t++){for(var e=this.json[t].convex_hull,n=0,r=0;r<rt.json.images.length;r++){var s=[rt.cells[r].x,rt.cells[r].y];Au(s,e)&&n++}i[t].querySelector(".hotspot-bar-inner").style.width=n*100/rt.cells.length+"%",i[t].querySelector(".hotspot-image").addEventListener("click",(function(a){ot.flyToCellImage(this.json[a].img)}).bind(this,t)),i[t].addEventListener("mouseenter",(function(a){var l=this.json[a].convex_hull;if(l){var c=new py;c.moveTo(l[0][0],l[0][1]);for(var h=1;h<l.length;
4100h++)c.lineTo(l[h][0],l[h][1]);var u=new(void 0)(c),f=new dc({color:16777215});f.transparent=!0,f.opacity=.25;var p=new zn(u,f);p.position.z=-.01,ot.scene.add(p),this.mesh=p}}).bind(this,t)),i[t].addEventListener("mouseleave",(function(a){this.setHotspotHoverBuffer([]),ot.scene.remove(this.mesh)}).bind(this));var o=i[t].querySelector(".remove-hotspot-x");o&&o.addEventListener("click",(function(a,l){l.preventDefault(),l.stopPropagation(),this.json.splice(a,1),this.setEdited(!0),this.render()}).bind(this,t));var o=i[t].querySelector(".refresh-hotspot");o&&o.addEventListener("click",(function(a,l){l.preventDefault(),l.stopPropagation();for(var c=this.json[a].convex_hull,h=[],u=0;u<rt.json.images.length;u++){var f=[rt.cells[u].x,rt.cells[u].y];Au(f,c)&&h.push(u)}var p=Math.floor(Math.random()*h.length);this.json[a].img=rt.json.images[h[p]],this.setEdited(!0),this.render()}).bind(this,t)),i[t].querySelector(".hotspot-label").addEventListener("keydown",(function(a,l){l.keyCode==13&&(l.stopPropagation(),l.preventDefault(),i[a].querySelector(".hotspot-label").blur())}).bind(this,t)),i[t].querySelector(".hotspot-label").addEventListener("input",(function(a,l){this.setEdited(!0),this.json[a].label=this.formatLabel(i[a].querySelector(".hotspot-label").textContent)}).bind(this,t)),i[t].addEventListener("dragstart",function(a){for(var l=l=a.target,c=l.id||null;!c;)l=l.parentNode,c=l.id;l.classList.add("dragging"),a.dataTransfer.setData("text",c)})}};pn.prototype.formatLabel=function(i){return i.replace(/[\u00A0-\u9999<>\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"})};pn.prototype.setEdited=function(i){this.edited=i,this.elems.saveHotspots.style.display=i?"inline-block":"none"};pn.prototype.showHide=function(){};pn.prototype.scrollToBottom=function(){this.elems.navInner.scrollTo({top:this.elems.navInner.scrollHeight,behavior:"smooth"})};pn.prototype.getUserClusterName=function(){for(var i=[],t=0;t<rt.hotspots.json.length;t++)i.push(rt.hotspots.json[t].label);var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ",n="Cluster "+e[this.nUserClusters++];for(this.nUserClusters.length>=e.length&&(this.nUserClusters=0);i.indexOf(n)>-1;){var n="Cluster "+e[this.nUserClusters++];this.nUserClusters.length>=e.length&&(this.nUserClusters=0)}return n};pn.prototype.setCreateHotspotVisibility=function(i){nt.isLocalhost};pn.prototype.setSaveHotspotsVisibility=function(i){this.elems.saveHotspots.style.display=i?"inline-block":"none"};pn.prototype.setHotspotHoverBuffer=function(e){for(var t=e.reduce(function(r,s){return r[s]=!0,r},{}),e=new Uint8Array(rt.cells.length),n=0;n<e.length;n++)e[n]=t[n]?1:0;ot.setBuffer("clusterSelected",e)};function Hc(){this.gl=this.getGl(),this.limits=this.getLimits()}Hc.prototype.getGl=function(){var i=Gc("canvas").getContext("webgl");if(!i)document.querySelector("#main-loader").classList.add("hidden");else return i};Hc.prototype.getLimits=function(){var i=this.gl.getSupportedExtensions().reduce(function(e,n){return e[n]=!0,e},{}),t=2**16-1;return["","MOZ_","WEBKIT_"].forEach(function(e){i[e+"OES_element_index_uint"]&&(t=2**32-1)}),{textureSize:Math.min(this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),2**13),textureCount:this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),vShaderTextures:this.gl.getParameter(this.gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),indexedElements:t}};function Vc(){this.pressed={},window.addEventListener("keydown",(function(i){this.pressed[i.keyCode]=!0}).bind(this)),window.addEventListener("keyup",(function(i){this.pressed[i.keyCode]=!1}).bind(this))}Vc.prototype.shiftPressed=function(){return this.pressed[16]};Vc.prototype.commandPressed=function(){return this.pressed[91]};function ks(){this.progressElem=document.querySelector("#progress"),this.loaderTextElem=document.querySelector("#loader-text"),this.loaderSceneElem=document.querySelector("#loader-scene")}ks.prototype.onButtonClick=function(i){i.target.className.indexOf("active")>-1&&requestAnimationFrame((function(){this.removeLoader((function(){this.startWorld()}).bind(this))}).bind(this))};ks.prototype.removeLoader=function(i){i(),document.querySelector("#loader-scene").classList.add("hidden"),setTimeout(function(){document.querySelector("#main-loader").classList.add("hidden")},2e3)};ks.prototype.updateProgress=function(){var i=hf(rt.textureProgress)/rt.textureCount;i=i.toString();var t=i.indexOf(".");t>-1&&(i=i.substring(0,t)),i==100&&rt.loadedTextures==rt.textureCount&&ot.heightmap&&(ot.ready=!0,requestAnimationFrame((function(){this.removeLoader((function(){this.startWorld()}).bind(this))}).bind(this)))};ks.prototype.startWorld=function(){requestAnimationFrame((function(){ot.init(
4100),Xc.init(),_i.init(),ff.init(),setTimeout(function(){requestAnimationFrame(function(){document.querySelector("#loader-scene").classList.add("hidden"),setTimeout(function(){document.querySelector("#main-loader").classList.add("hidden")},2e3)})},1500)}).bind(this))};function Hn(i,t,e){t=t||function(){},e=e||function(){};var n=new XMLHttpRequest;n.overrideMimeType("text/plain; charset=x-user-defined"),n.onreadystatechange=function(){if(n.readyState==XMLHttpRequest.DONE)if(n.status===200){var r=n.responseText;i.substring(i.length-3)==".gz"&&(r=rM(r),i=i.substring(0,i.length-3)),i.substring(i.length-5)==".json"?t(JSON.parse(r)):t(r)}else e(n)},n.open("GET",i,!0),n.send()}function rM(i){for(var t=[],e=0;e<i.length;e++)t.push(i.charCodeAt(e)&255);for(var n=new Zlib.Gunzip(t),r=n.decompress(),s="",e=0;e<r.length;e++)s+=String.fromCharCode(r[e]);return s}function sM(i,t){var e=t.split("."),n=e[e.length-1],r=n=="json"?new Blob([JSON.stringify(i)],{type:"octet/stream"}):new Blob([Papa.unparse(i)],{type:"text/plain"}),s=document.createElement("a");document.body.appendChild(s),s.download=t,s.href=window.URL.createObjectURL(r),s.click(),s.parentNode.removeChild(s)}function oM(){for(var i=Number.POSITIVE_INFINITY,t=0;t<rt.cells.length;t++)i=Math.min(rt.cells[t].z,i);return i}function Gc(i,e){var e=e||{},n=document.createElement(i);return Object.keys(e).forEach(function(r){n[r]=e[r]}),n}function aM(i){return i[Math.floor(Math.random()*i.length)]}function hf(i){return Object.keys(i).reduce(function(t,e){return t+=i[e],t},0)}function uf(i,t,e){var n=t.reduce(function(r,s){return r[s]?r[s]:{}},i);return n.length?n:e}function na(){var i=document.querySelector("#pixplot-canvas");return i?{w:i.clientWidth,h:i.clientHeight}:{w:window.innerWidth,h:window.innerHeight}}function Vn(i){var t=window.location.origin;return t+=window.location.pathname.replace("index.html",""),t+=i.replace("\\","/"),t}function df(i){var t=i.split(".")[i.split(".").length-1],e=i.split("-");return e.slice(0,e.length-1).join("-")+"."+t}function Au(i,t){for(var e=i[0],n=i[1],r=!1,s=0,o=t.length-1;s<t.length;o=s++){var a=t[s][0],l=t[s][1],c=t[o][0],h=t[o][1],u=l>n!=h>n&&e<(c-a)*(n-l)/(h-l)+a;u&&(r=!r)}return r}window.location.href="#";window.devicePixelRatio=Math.min(window.devicePixelRatio,2);var Wc=null,ia=null,nt=null,jr=null,Xc=null,Is=null,He=null,ot=null,_i=null,ff=null,he=null,Di=null,rt=null;function ra(){Wc=new ks,ia=new Hc,nt=new zc,jr=new kc,Xc=new Fi,Is=new Dn,new Vc,He=new bn,ot=new At,_i=new zi,ff=new ta,he=new zs,Di=new fn,new ea,rt=new es,this.layout=He,this.world=ot,this.config=nt}ra.prototype.getWorld=function(){return this.world};ra.prototype.getLayout=function(){return this.layout};ra.prototype.getConfig=function(){return this.config};const lM={MAIN:ra},cM=` 4101 precision mediump float; 4102 4103 uniform sampler2D texture; 4104 uniform float render; 4105 uniform float point; 4106 uniform float canvas; 4107 4108 varying vec2 vOffset; 4109 4110 void main() { 4111 vec2 uv = vec2(vOffset.x/point + gl_PointCoord.x, vOffset.y/point + gl_PointCoord.y); 4112 uv *= point/canvas; 4113 gl_FragColor = texture2D(texture, uv); 4114 if (gl_FragColor.r < 0.1 || render < 0.5) discard; 4115 } 4116 `,hM={props:["index"],data(){return{tsne:null,main:null,ready:!1,baseUrl:"/",currentLayout:"umap",zoomConfig:{default:1.1,umap:1.1,cluster:.45,grid_in:1,date:1.5},flyToImage:"2-186.jpg"}},created(){},unmounted(){this.tsne=null,this.main=null;const i=document.getElementById("text-fragment-shader");i&&i.remove()},mounted(){if(!document.getElementById("text-fragment-shader")){const e=document.createElement("script");e.type="x-shader/x-fragment",e.id="text-fragment-shader",e.text=cM,this.$el.prepend(e)}if(this.detectWebGl()){if(this.tsne=lM,this.main=new this.tsne.MAIN,this.setParameters(),this.index===3){var t=this;setTimeout(function(){t.main.layout.setCurrentTransition("null3"),t.main.layout.set("date",!0)},500)}}else this.$emit("vizWowAllowed",{value:!1})},methods:{setParameters(){this.main.config.setFlyToImage(this.flyToImage),this.main.config.setZoomConfig(this.zoomConfig),this.main.config.point_size={min:0,grid:.035,max:.035,scatter:.025,initial:.045,date:.017}},detectWebGl(){let i=document.createElement("canvas"),t=null;try{t=i.getContext("webgl")}catch{t=null}if(t==null)try{t=i.getContext("experimental-webgl")}catch{t=null}return i.remove(),!!t}},watch:{index:function(i,t){switch(console.log("new index",this.index),+this.index){case 0:+t==1&&this.main.layout.setCurrentTransition("10"),this.main.layout.setCurrentTransition("01"),this.main.layout.set("umap",!0);break;case 1:+t==2?(this.main.layout.setCurrentTransition("21"),this.main.layout.set("umap",!0)):this.main.world.flyToCellImage(this.flyToImage);break;case 2:+t==3?(this.main.layout.setCurrentTransition("32"),this.main.layout.set("grid",!0)):(this.main.layout.setCurrentTransition("12"),this.main.layout.set("grid",!0));break;case 3:this.main.layout.setCurrentTransition("23"),this.main.layout.set("date",!0);break}}},components:{Loader:wf}},uM={class:"viz-wow-container"},dM={id:"loader-scene"};function fM(i,t,e,n,r,s){const o=Xe("Loader");return zt(),ge("div",uM,[xt("div",dM,[ec(o)]),t[0]||(t[0]=xt("div",{id:"canvas-container"},[xt("div",{id:"canvas-target"},[xt("canvas",{id:"pixplot-canvas"})])],-1))])}const pM=Ui(hM,[["render",fM],["__scopeId","data-v-4da041c8"]]),mM={props:["content"],data(){return{baseUrl:"/"}},mounted(){this.$nextTick(()=>{this.setLottie()})},methods:{setLottie(){this.animation=xf.loadAnimation({container:this.$refs.video,renderer:"svg",loop:!1,autoplay:!0,path:`${this.baseUrl}videos/example_${this.$ml.current}.json`,rendererSettings:{className:"tva-bodymovin"}})}}},_M={class:"landing-video-comp"},gM={ref:"video",class:"landing-video"},vM={key:0,class:"LandingParagraph__button button--primary-text-square"},xM=["src"];function yM(i,t,e,n,r,s){const o=Xe("router-link");return zt(),ge("div",_M,[xt("div",gM,null,512),i.$tvaMq==="desktop"?(zt(),Pe(o,{key:0,class:"landing-call",to:{name:"viz"}},{default:gi(()=>[i.$tvaMq==="desktop"?(zt(),ge("div",vM,Ln(e.content),1)):be("",!0),xt("img",{src:`${r.baseUrl}images/svg/arrowbig-right-black.svg`},null,8,xM)]),_:1})):be("",!0)])}const SM=Ui(mM,[["render",yM]]),MM={props:{friction:{default:.5},decay:{default:.01},active:{default:!0}},data(){return{animation:null}},mounted(){this.$nextTick(()=>{this.active&&this.drag()})},unmounted(){cancelAnimationFrame(this.animation),this.animation=null},methods:{drag(){let i=this.$refs.component,t=!1,e=!0,n={x:0,y:0},r={x:0,y:0},s={x:0,y:0},o={x:0,y:0};const a=()=>{this.animation=requestAnimationFrame(a),t?(e?(s.x=0,s.y=0):(s.x=n.x-r.x,s.y=n.y-r.y),r.x=n.x,r.y=n.y,o.x=s.x,o.y=s.y,setTimeout(()=>{e=!1},100)):(e=!0,s.x+=o.x,s.y+=o.y,o.x*=this.friction,o.y*=this.friction),(o.x>.001||o.x<-.001)&&this.setScroll(s.x)};i.addEventListener("mousedown",function(){t=!0}),document.addEventListener("mouseup",function(){t=!1}),i.addEventListener("mousemove",function(l){n.x=l.x,n.y=l.y}),i.addEventListener("touchstart",function(){t=!0}),document.addEventListener("touchend",function(){t=!1}),i.addEventListener("touchmove",function(l){setTimeout(()=>{n.x=l.touches[0].clientX,n.y=l.touches[0].clientY})}),a()},setScroll(i){let t=document.querySelector("html"),e=t.scrollTop,n=window.innerHeight/window.innerWidth;t.scrollTop=e-i*n}}},EM={class:"tva-draggable",ref:"component"};function TM(i,t,e,n,r,s){return zt(),ge("div",EM,[Sf(i.$slots,"default",{},void 0)],512)}const bM=Ui(MM,[["render",TM],["__scopeId","data-v-a992c5ba"]]),wM={props:["content"],data(){return{}}},AM={id:"main-loader",class:"main-loader"},CM=["innerHTML"];function RM(i,t,e,n,r,s){return zt(),ge("div",AM,[t[0]||(t[0]=xt("div",{class:"pulsate"},[xt("svg",{width:"80",height:"82",viewBox:"0 0 80 82",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[xt("path",{d:"M75.8902 21.1412C75.2 19.7137 74.4157 18.3804 73.5686 17.1412C72.1098 14.9922 70.3686 13.1098 68.4392 11.4471C69.5529 10.0353 70.3216 8.40393 70.651 6.64707C68.4549 5.5804 65.9294 5.25099 63.4824 5.76864C63.749 4.01177 63.6078 2.20785 63.0588 0.529419C60.549 0.686282 58.149 1.73726 56.251 3.50981C56.9255 6.12942 56.6902 8.98432 55.2941 11.5412C54.4157 13.1726 53.1608 14.4431 51.7177 15.4C52.5961 15.7451 53.3961 16.1843 53.9608 16.8275C56.0471 19.3373 55.7961 19.3216 56.6275 21.1255C56.7686 21.4549 56.9412 21.7843 57.051 22.0667C57.5216 23.1804 57.6471 24.3882 57.4431 25.5804L56.9255 28.498C56.9255 28.498 60.3451 31.8079 61.051 33.2039C61.0824 33.2824 61.1294 33.3765 61.1608 33.4549C62.3686 36.1059 63.4824 42.4588 64.0471 46.1294C64.2667 47.5882 63.1843 48.9059 61.7098 48.9686L61.4902 48.9843L60.5333 49.0157C59.4039 49.0628 58.5569 50.0824 58.7451 51.2118L59.2471 54.2706C59.3412 54.898 59.2627 55.5412 59.0275 56.1216L58.4314 57.5177C58.0392 58.4275 58.0706 59.4628 58.4784 60.3726C58.5098 60.4353 58.5412 60.5294 58.5569 60.6079C59.0902 61.8784 59.6549 63.9647 59.4353 67.0079C59.0902 71.7765 54.4157 71.3843 47.6078 70.7098C47.3569 70.6784 47.0745 70.6628 46.8235 70.6628H40H29.1294V14.5529H38.651C38.7608 14.051 38.8706 13.5647 39.0431 13.0784C40.251 9.70589 42.949 7.33726 46.1176 6.31765C46.5412 6.99216 46.902 7.71373 47.1843 8.45099C47.3412 8.0902 47.4667 7.71373 47.6549 7.36863C48.3922 6.00393 49.4118 4.92158 50.5569 4.02746C48.9098 3.83922 47.2 3.74511 45.4118 3.74511H40H0V10.051L12.3608 13.1412L11.0588 72.3255C8.84706 72.7961 6.83922 73.3137 5.05098 73.8628C3.26275 74.4118 1.58431 75.0079 0 75.6353V81.4706H40H42.4314C50.1961 81.4706 56.8941 79.8235 62.5255 76.5451C67.0745 73.8784 70.7294 70.302 73.5686 65.8784C74.2431 64.8275 74.902 63.7922 75.4824 62.6471C78.4941 56.6706 80 49.549 80 41.3137C79.9843 33.4392 78.6196 26.7255 75.8902 21.1412Z",fill:"white"})])],-1)),xt("span",{innerHTML:e.content.loaderText},null,8,CM)])}const PM=Ui(wM,[["render",RM],["__scopeId","data-v-91df3643"]]),LM={data(){return{config:Cu,sections:[140,100,100,100,100,100],sectionsSum:0,mounted:!1,index:0,progress:0,offset:0,mouseDown:!1,vizWowAllowed:!0,baseUrl:"/",viewportKey:0}},components:{LandingParagraph:Pp,LandingIntro:Jf,VizWow:pM,VueFlyScroll:yf,
4116LandingIntroMobile:Sp,LandingVideo:SM,Menu:vf,TvaDraggableCanvas:bM,MainLoader:PM},mounted(){window.addEventListener("resize",()=>{this.viewportKey=this.viewportKey+1,this.setSections()}),window.addEventListener("orientationchange",()=>{this.viewportKey=this.viewportKey+1,this.setSections()}),this.$nextTick(()=>{this.setSections()})},created(){const i=Mf();switch(i&&i.name){case"safari":this.vizWowAllowed=!1;break;default:this.vizWowAllowed=!0;break}},computed:{containerTransform(){let i=this.index===0?-this.offset*this.sections[0]:-this.sections[0];return this.$tvaMq==="desktop"?`translate3d(${i}vw,0,0)`:(i=this.index<=4?i*.75:0,`translate3d(0,${i}vh,0)`)},sliderIndex(){return this.index>0?this.index-1:0},horizontalScroll(){return this.$tvaMq!=="mobile"&&!this.$touchDevice||this.$tvaMq==="desktop"&&!this.$touchDevice||this.$tvaMq==="tablet"},content(){return this.$ml.get("landing")}},methods:{setSections(){this.sectionsSum=this.sections.reduce((i,t)=>i+t),window.scrollTo(0,0),this.mounted=!0,setTimeout(()=>{let i=this.$tvaMq==="desktop"?this.$refs.landingIntro.offsetWidth:this.$refs.landingIntro.offsetHeight;this.sections[0]=i/window.innerWidth*100,this.sectionsSum=this.sections.reduce((t,e)=>t+e)},500)}}},IM={ref:"landingIntro"},DM=["src"],UM={key:1,class:"Landing__section__image-fallback"},NM=["src"],OM=["id"];function FM(i,t,e,n,r,s){const o=Xe("MainLoader"),a=Xe("Menu"),l=Xe("LandingIntro"),c=Xe("LandingIntroMobile"),h=Xe("VizWow"),u=Xe("LandingVideo"),f=Xe("router-link"),p=Xe("vue-fly-scroll"),x=Xe("TvaDraggableCanvas");return zt(),Pe(x,{active:i.$tvaMq!=="mobile",key:r.viewportKey},{default:gi(()=>[r.vizWowAllowed&&i.$tvaMq==="desktop"?(zt(),Pe(o,{key:0,content:s.content},null,8,["content"])):be("",!0),xt("div",{class:xi(["Landing",{scrollable:!s.horizontalScroll,mouseDown:r.mouseDown}]),ref:"landing",onMousedown:t[4]||(t[4]=v=>r.mouseDown=!0),onMouseup:t[5]||(t[5]=v=>r.mouseDown=!1)},[i.$tvaMq!=="desktop"?(zt(),Pe(a,{key:0})):be("",!0),r.mounted?(zt(),Pe(p,{key:1,top:.001,bottom:1,threshold:.001,active:i.$tvaMq!=="mobile",orientation:s.horizontalScroll?"vertical":"horizontal",element:s.horizontalScroll?null:i.$refs.landing,onIndex:t[1]||(t[1]=v=>r.index=v),onProgress:t[2]||(t[2]=v=>r.progress=v),onOffset:t[3]||(t[3]=v=>r.offset=v)},Ef({background:gi(()=>[xt("div",{class:xi(["Landing__container"]),style:fs({width:`${r.sectionsSum}vw`,transform:s.containerTransform})},[i.$tvaMq==="desktop"?(zt(),ge("div",{key:0,class:"Landing__container__bg",style:fs({width:`${r.sectionsSum}vw`,transform:`translate3d(${-r.progress*r.sectionsSum}vh,0,0)`})},null,4)):be("",!0),xt("div",IM,[i.$tvaMq==="desktop"?(zt(),Pe(l,{key:0,progress:r.index===0?r.offset:1},null,8,["progress"])):be("",!0),i.$tvaMq!=="desktop"?(zt(),Pe(c,{key:1})):be("",!0)],512),xt("div",{class:xi(["Landing__section",i.$tvaMq])},[i.$tvaMq==="desktop"?(zt(),Pe(a,{key:0,class:"Landing__section__menu",background:"transparent",active:r.index>0},null,8,["active"])):be("",!0),(zt(!0),ge(Dr,null,Ss(r.config.landing.steps,(v,m)=>(zt(),ge("div",{class:xi([`Landing__section__paragraph-container-${m}`]),key:"step"+m},[ec(Tf,{name:"fade"},{default:gi(()=>[i.$tvaMq==="mobile"||i.$tvaMq!=="mobile"&&m===s.sliderIndex?(zt(),Pe(bf(v.component),{key:0,class:"Landing__section__paragraph",content:s.content[v.content],config:v,componentIndex:m},null,8,["content","config","componentIndex"])):be("",!0)]),_:2},1024),i.$tvaMq==="mobile"&&m<4?(zt(),ge("img",{key:0,class:"Landing__section__image",src:`${r.baseUrl}images/landing/wow-mobile/${m}.png`},null,8,DM)):be("",!0)],2))),128)),i.$tvaMq!=="mobile"&&r.index<5?(zt(),ge(Dr,{key:1},[r.vizWowAllowed&&i.$tvaMq==="desktop"?(zt(),Pe(h,{key:0,class:"Landing__section__viz",index:s.sliderIndex,onVizWowAllowed:t[0]||(t[0]=v=>r.vizWowAllowed=v.value)},null,8,["index"])):(zt(),ge("div",UM,[xt("img",{src:`${r.baseUrl}images/landing/wow/${r.index===0?0:r.index-1}.png`},null,8,NM)]))],64)):be("",!0),r.index===5||i.$tvaMq==="mobile"?(zt(),Pe(u,{key:2,content:s.content.tutorial.button},null,8,["content"])):be("",!0),i.$tvaMq!=="desktop"?(zt(),Pe(f,{key:3,class:"Landing__ctaMobile",to:{name:"viz"}},{default:gi(()=>[Qa(Ln(s.content.tutorial.button),1)]),_:1})):be("",!0)],2)],4)]),_:2},[i.$tvaMq!=="mobile"?{name:"foreground",fn:gi(()=>[(zt(!0),ge(Dr,null,Ss(r.sections,(v,m)=>(zt(),ge("section",{class:"Landing__foreground-section",id:`Landing__foreground-section-${m}`,key:"section"+m,style:fs({height:v+"vh",width:v+"vw"})},null,12,OM))),128))]),key:"0"}:void 0]),1032,["active","orientation","element"])):be("",!0)],34)]),_:1},8,["active"])}const VM=Ui(LM,[["render",FM],["__scopeId","data-v-3158725b"]]);export{VM as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.